[Pkg-mozext-commits] [firebug] 42/56: Issue 7685 - support for manual upgrade
David Prévot
taffit at moszumanska.debian.org
Wed Nov 19 21:01:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firebug.
commit 6501674a208d45c3a8aa04b955ec42f69ecceaf9
Author: Jan Odvarko <odvarko at gmail.com>
Date: Thu Oct 30 12:05:20 2014 +0100
Issue 7685 - support for manual upgrade
---
.../content/firebug/firefox/browserCommands.js | 1 +
extension/content/firebug/firefox/browserMenu.js | 137 ++++++++++++---------
.../content/firebug/firefox/browserOverlay.css | 12 ++
.../content/firebug/firefox/browserOverlay.js | 71 ++++++++---
.../firebug/firefox/upgradeFirebugPanel.xml | 112 +++++++++++++++++
.../en-US/multiprocess-notification.properties | 10 ++
6 files changed, 269 insertions(+), 74 deletions(-)
diff --git a/extension/content/firebug/firefox/browserCommands.js b/extension/content/firebug/firefox/browserCommands.js
index bb6bed4..b12fa3c 100644
--- a/extension/content/firebug/firefox/browserCommands.js
+++ b/extension/content/firebug/firefox/browserCommands.js
@@ -65,6 +65,7 @@ var BrowserCommands =
$command(doc, "cmd_firebug_resetAllOptions", "Firebug.resetAllOptions(true);");
$command(doc, "cmd_firebug_toggleProfiling", ""); //todo
$command(doc, "cmd_firebug_openInEditor", "Firebug.ExternalEditors.onContextMenuCommand(event)");
+ $command(doc, "cmd_firebug_upgradeFirebug", "Firebug.browserOverlay.upgradeFirebug(event)");
},
overlayShortcuts: function(doc)
diff --git a/extension/content/firebug/firefox/browserMenu.js b/extension/content/firebug/firefox/browserMenu.js
index 05e1ba8..23b597d 100644
--- a/extension/content/firebug/firefox/browserMenu.js
+++ b/extension/content/firebug/firefox/browserMenu.js
@@ -26,8 +26,11 @@ var TraceError = FBTrace.toError();
var BrowserMenu =
{
- overlay: function(doc)
+ overlay: function(overlay)
{
+ this.browserOverlay = overlay;
+
+ var doc = overlay.doc;
this.overlayStartButtonMenu(doc);
this.overlayFirebugMenu(doc);
this.overlayFirefoxMenu(doc);
@@ -39,68 +42,86 @@ var BrowserMenu =
overlayStartButtonMenu: function(doc)
{
- $menupopupOverlay(doc, $(doc, "mainPopupSet"), [
+ var menuItems =
+ [
+ $menu(doc,
+ {
+ id: "menu_firebug_menuLocation",
+ label: "firebug.uiLocation",
+ tooltiptext: "firebug.menu.tip.UI_Location"
+ },
+ [
+ $menupopup(doc, {
+ onpopupshowing: "Firebug.browserOverlay.onPositionPopupShowing(this)"
+ })
+ ]),
+ $menuseparator(doc),
+ $menuitem(doc, {
+ id: "menu_firebug_ClearConsole",
+ label: "firebug.ClearConsole",
+ tooltiptext: "firebug.ClearTooltip",
+ command: "cmd_firebug_clearConsole",
+ key: "key_firebug_clearConsole"
+ }),
+ $menuitem(doc, {
+ id: "menu_firebug_showErrorCount",
+ type: "checkbox",
+ label: "firebug.Show_Error_Count",
+ tooltiptext: "firebug.menu.tip.Show_Error_Count",
+ oncommand: "Firebug.browserOverlay.onToggleOption(this)",
+ option: "showErrorCount"
+ }),
+ $menuseparator(doc),
+ $menuitem(doc, {
+ id: "menu_firebug_enablePanels",
+ label: "firebug.menu.Enable_All_Panels",
+ tooltiptext: "firebug.menu.tip.Enable_All_Panels",
+ command: "cmd_firebug_enablePanels"
+ }),
+ $menuitem(doc, {
+ id: "menu_firebug_disablePanels",
+ label: "firebug.menu.Disable_All_Panels",
+ tooltiptext: "firebug.menu.tip.Disable_All_Panels",
+ command: "cmd_firebug_disablePanels"
+ }),
+ $menuseparator(doc),
+ $menuitem(doc, {
+ id: "menu_firebug_AllOn",
+ type: "checkbox",
+ label: "On_for_all_web_pages",
+ tooltiptext: "firebug.menu.tip.On_for_all_Web_Sites",
+ command: "cmd_firebug_allOn",
+ option: "allPagesActivation"
+ }),
+ $menuitem(doc, {
+ id: "menu_firebug_clearActivationList",
+ label: "firebug.menu.Clear_Activation_List",
+ tooltiptext: "firebug.menu.tip.Clear_Activation_List",
+ command: "cmd_firebug_clearActivationList"
+ })
+ ];
+
+ if (this.browserOverlay.isMultiprocessEnabled() || this.browserOverlay.auroraChannel)
+ {
+ var upgradeItem = $menuitem(doc, {
+ id: "menu_firebug_upgradeFirebug",
+ label: "upgrade.upgradeFirebug",
+ tooltiptext: "upgrade.tip.upgradeFirebug",
+ command: "cmd_firebug_upgradeFirebug",
+ });
+
+ menuItems.unshift($menuseparator(doc));
+ menuItems.unshift(upgradeItem);
+ }
+
+ var parentNode = $(doc, "mainPopupSet");
+ $menupopupOverlay(doc, parentNode, [
$menupopup(doc,
{
id: "fbStatusContextMenu",
onpopupshowing: "Firebug.browserOverlay.onOptionsShowing(this)"
},
- [
- $menu(doc,
- {
- label: "firebug.uiLocation",
- tooltiptext: "firebug.menu.tip.UI_Location"
- },
- [
- $menupopup(doc, {
- onpopupshowing: "Firebug.browserOverlay.onPositionPopupShowing(this)"
- })
- ]),
- $menuseparator(doc),
- $menuitem(doc, {
- id: "menu_firebug_ClearConsole",
- label: "firebug.ClearConsole",
- tooltiptext: "firebug.ClearTooltip",
- command: "cmd_firebug_clearConsole",
- key: "key_firebug_clearConsole"
- }),
- $menuitem(doc, {
- id: "menu_firebug_showErrorCount",
- type: "checkbox",
- label: "firebug.Show_Error_Count",
- tooltiptext: "firebug.menu.tip.Show_Error_Count",
- oncommand: "Firebug.browserOverlay.onToggleOption(this)",
- option: "showErrorCount"
- }),
- $menuseparator(doc),
- $menuitem(doc, {
- id: "menu_firebug_enablePanels",
- label: "firebug.menu.Enable_All_Panels",
- tooltiptext: "firebug.menu.tip.Enable_All_Panels",
- command: "cmd_firebug_enablePanels"
- }),
- $menuitem(doc, {
- id: "menu_firebug_disablePanels",
- label: "firebug.menu.Disable_All_Panels",
- tooltiptext: "firebug.menu.tip.Disable_All_Panels",
- command: "cmd_firebug_disablePanels"
- }),
- $menuseparator(doc),
- $menuitem(doc, {
- id: "menu_firebug_AllOn",
- type: "checkbox",
- label: "On_for_all_web_pages",
- tooltiptext: "firebug.menu.tip.On_for_all_Web_Sites",
- command: "cmd_firebug_allOn",
- option: "allPagesActivation"
- }),
- $menuitem(doc, {
- id: "menu_firebug_clearActivationList",
- label: "firebug.menu.Clear_Activation_List",
- tooltiptext: "firebug.menu.tip.Clear_Activation_List",
- command: "cmd_firebug_clearActivationList"
- })
- ])
+ menuItems)
]);
},
diff --git a/extension/content/firebug/firefox/browserOverlay.css b/extension/content/firebug/firefox/browserOverlay.css
index 07b1fd8..89904ac 100644
--- a/extension/content/firebug/firefox/browserOverlay.css
+++ b/extension/content/firebug/firefox/browserOverlay.css
@@ -204,16 +204,27 @@ fbAuroraNotificationPanel {
-moz-binding: url("chrome://firebug/content/firefox/auroraNotificationPanel.xml#panel");
}
+fbUpgradeNotificationPanel {
+ -moz-binding: url("chrome://firebug/content/firefox/upgradeFirebugPanel.xml#panel");
+}
+
+fbUpgradeNotificationPanel .iconbox,
fbAuroraNotificationPanel .iconbox,
fbMultiprocessNotificationPanel .iconbox {
padding-right: 10px;
}
+fbUpgradeNotificationPanel .desc,
fbAuroraNotificationPanel .desc,
fbMultiprocessNotificationPanel .desc {
max-width: 300px;
}
+fbUpgradeNotificationPanel .title {
+ font-weight: bold;
+ font-size: 16px;
+}
+
fbMultiprocessNotificationPanel .warn {
max-width: 275px;
}
@@ -230,6 +241,7 @@ fbMultiprocessNotificationPanel .warningicon {
margin-right: 4px;
}
+fbUpgradeNotificationPanel .progress,
fbAuroraNotificationPanel .progress,
fbMultiprocessNotificationPanel .progress {
margin: 8px;
diff --git a/extension/content/firebug/firefox/browserOverlay.js b/extension/content/firebug/firefox/browserOverlay.js
index 4d56d3e..06b9196 100644
--- a/extension/content/firebug/firefox/browserOverlay.js
+++ b/extension/content/firebug/firefox/browserOverlay.js
@@ -24,7 +24,7 @@ var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
-var {$, $el, $stylesheet, $menuitem} = BrowserOverlayLib;
+var {$, $el, $stylesheet, $menuitem, $menuseparator} = BrowserOverlayLib;
Locale.registerStringBundle("chrome://firebug/locale/firebug.properties");
Locale.registerStringBundle("chrome://firebug/locale/cookies.properties");
@@ -43,6 +43,8 @@ Cu.import("resource://gre/modules/Services.jsm", servicesScope);
const firstRunPage = "https://getfirebug.com/firstrun#Firebug ";
+const auroraChannel = servicesScope.Services.prefs.getCharPref("app.update.channel") == "aurora";
+
// ********************************************************************************************* //
// BrowserOverlay Implementation
@@ -58,6 +60,8 @@ BrowserOverlay.prototype =
// chrome UI (XUL).
nodesToRemove: [],
+ auroraChannel: auroraChannel,
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Initialization
@@ -85,7 +89,7 @@ BrowserOverlay.prototype =
var version = this.getVersion();
BrowserCommands.overlay(this.doc);
- BrowserMenu.overlay(this.doc);
+ BrowserMenu.overlay(this);
BrowserToolbar.overlay(this.doc, version);
this.internationalize();
@@ -134,12 +138,12 @@ BrowserOverlay.prototype =
{
// Special case for e10s enabled browser.
if (this.isMultiprocessEnabled()) {
- this.showMultiprocessNotification();
- return;
+ this.showMultiprocessNotification();
+ return;
}
else if (this.isAuroraChannel()) {
- this.showAuroraNotification();
- return;
+ this.showAuroraNotification();
+ return;
}
if (this.win.Firebug.waitingForFirstLoad)
@@ -598,6 +602,16 @@ BrowserOverlay.prototype =
},
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Upgrade Firebug
+
+ upgradeFirebug: function(event)
+ {
+ Events.cancelEvent(event);
+
+ this.showUpgradeNotification();
+ },
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Remote Browser (aka e10s enabled browser)
isMultiprocessEnabled: function()
@@ -622,9 +636,12 @@ BrowserOverlay.prototype =
if (Options.get("noThanksFirebugNext"))
return false;
- return (servicesScope.Services.prefs.getCharPref("app.update.channel") == "aurora");
+ return auroraChannel;
},
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Aurora notification
+
showAuroraNotification: function()
{
var popupSet = $(this.doc, "mainPopupSet");
@@ -632,10 +649,10 @@ BrowserOverlay.prototype =
if (!panel)
{
panel = this.doc.createElement("fbAuroraNotificationPanel");
- panel.setAttribute("upgradecommand", "Firebug.browserOverlay.onUpgradeFirebug(event)");
+ panel.setAttribute("upgradecommand", "Firebug.browserOverlay.onUpgradeFirebug(event, 'fbAuroraNotificationPanel')");
panel.setAttribute("notnowcommand", "Firebug.browserOverlay.onNotNow(event)");
panel.setAttribute("nothankscommand", "Firebug.browserOverlay.onNoThanks(event)");
- panel.setAttribute("cancelcommand", "Firebug.browserOverlay.onCancelUpgrade(event)");
+ panel.setAttribute("cancelcommand", "Firebug.browserOverlay.onCancelUpgrade(event, 'fbAuroraNotificationPanel')");
popupSet.appendChild(panel);
}
@@ -676,6 +693,28 @@ BrowserOverlay.prototype =
});
},
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Manual upgrade panel
+
+ showUpgradeNotification: function()
+ {
+ var popupSet = $(this.doc, "mainPopupSet");
+ var panel = this.doc.querySelector("fbUpgradeNotificationPanel");
+ if (!panel)
+ {
+ panel = this.doc.createElement("fbUpgradeNotificationPanel");
+ panel.setAttribute("upgradecommand", "Firebug.browserOverlay.onUpgradeFirebug(event, 'fbUpgradeNotificationPanel')");
+ panel.setAttribute("cancelcommand", "Firebug.browserOverlay.onCancelUpgrade(event, 'fbUpgradeNotificationPanel')");
+ popupSet.appendChild(panel);
+ }
+
+ panel.internationalize(Locale);
+ panel.open();
+ },
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // e10s enabled browser Notification
+
showMultiprocessNotification: function()
{
var popupSet = $(this.doc, "mainPopupSet");
@@ -683,9 +722,9 @@ BrowserOverlay.prototype =
if (!panel)
{
panel = this.doc.createElement("fbMultiprocessNotificationPanel");
- panel.setAttribute("upgradecommand", "Firebug.browserOverlay.onUpgradeFirebug(event)");
+ panel.setAttribute("upgradecommand", "Firebug.browserOverlay.onUpgradeFirebug(event, 'fbMultiprocessNotificationPanel')");
panel.setAttribute("disablecommand", "Firebug.browserOverlay.onDisableE10s(event)");
- panel.setAttribute("cancelcommand", "Firebug.browserOverlay.onCancelUpgrade(event)");
+ panel.setAttribute("cancelcommand", "Firebug.browserOverlay.onCancelUpgrade(event, 'fbMultiprocessNotificationPanel')");
popupSet.appendChild(panel);
}
@@ -702,12 +741,12 @@ BrowserOverlay.prototype =
restartFirefox();
},
- onUpgradeFirebug: function(event)
+ onUpgradeFirebug: function(event, panelId)
{
Events.cancelEvent(event);
var self = this;
- var panel = this.doc.querySelector("fbMultiprocessNotificationPanel");
+ var panel = this.doc.querySelector(panelId);
// Listen for installation end
var listener =
@@ -763,7 +802,7 @@ BrowserOverlay.prototype =
// TODO: Setup a page for "Learn more..." link in the notification
},
- onCancelUpgrade: function(event)
+ onCancelUpgrade: function(event, panelId)
{
Events.cancelEvent(event);
@@ -773,12 +812,12 @@ BrowserOverlay.prototype =
this.install.cancel();
this.install = null;
- var panel = this.doc.querySelector("fbMultiprocessNotificationPanel");
+ var panel = this.doc.querySelector(panelId);
panel.upgradeButton.removeAttribute("collapsed");
panel.progress.setAttribute("value", "0");
panel.progress.setAttribute("collapsed", "true");
panel.cancelButton.setAttribute("collapsed", "true");
- }
+ },
};
function findFirebugUpdate(callback)
diff --git a/extension/content/firebug/firefox/upgradeFirebugPanel.xml b/extension/content/firebug/firefox/upgradeFirebugPanel.xml
new file mode 100644
index 0000000..12f9095
--- /dev/null
+++ b/extension/content/firebug/firefox/upgradeFirebugPanel.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<!-- See license.txt for terms of usage -->
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+
+<binding id="panel">
+ <resources>
+ <stylesheet src="chrome://global/skin/notification.css"/>
+ </resources>
+ <content>
+ <xul:panel anonid="panel" norestorefocus="true" noautofocus="true"
+ ignorekeys="true" role="presentation" type="arrow" class="panel">
+ <xul:hbox>
+ <xul:vbox class="iconbox">
+ <xul:image src="chrome://firebug/skin/firebug64.png"/>
+ </xul:vbox>
+ <xul:vbox>
+ <xul:description anonid="desc" class="desc title" />
+ <xul:description anonid="desc2" class="desc" />
+ <xul:label anonid="learnMore"
+ class="text-link popup-notification-learnmore-link learnMore"
+ href="https://getfirebug.com/"/>
+ <xul:hbox align="right">
+ <xul:progressmeter anonid="progress" class="progress"
+ mode="determined" value="0" collapsed="true"/>
+ <xul:spacer width="20px" />
+ <xul:button anonid="upgrade" type="button"
+ xbl:inherits="oncommand=upgradecommand"
+ class="popup-notification-menubutton">
+ </xul:button>
+ <xul:button anonid="cancel" type="button" collapsed="true"
+ xbl:inherits="oncommand=cancelcommand">
+ </xul:button>
+ </xul:hbox>
+ </xul:vbox>
+ </xul:hbox>
+ </xul:panel>
+ </content>
+
+ <implementation>
+ <constructor><![CDATA[
+ ]]></constructor>
+
+ <method name="internationalize">
+ <parameter name="Locale" />
+ <body><![CDATA[
+ var desc = document.getAnonymousElementByAttribute(this, "anonid", "desc");
+ desc.textContent = Locale.$STR("upgrade.description");
+
+ var desc2 = document.getAnonymousElementByAttribute(this, "anonid", "desc2");
+ desc2.textContent = Locale.$STR("upgrade.description2");
+
+ var learnMore = document.getAnonymousElementByAttribute(this, "anonid", "learnMore");
+ learnMore.textContent = Locale.$STR("multiprocess.learnMore");
+
+ var upgradeButton = document.getAnonymousElementByAttribute(this, "anonid", "upgrade");
+ upgradeButton.label = Locale.$STR("multiprocess.upgrade");
+
+ var cancelButton = document.getAnonymousElementByAttribute(this, "anonid", "cancel");
+ cancelButton.label = Locale.$STR("multiprocess.cancel");
+ ]]></body>
+ </method>
+
+ <method name="open">
+ <body><![CDATA[
+ var offsetY = 0;
+ var offsetX = 0;
+ var target = document.getElementById("nav-bar-customization-target");
+
+ var startButton = document.getElementById("firebug-button");
+ if (startButton) {
+ var style = document.defaultView.getComputedStyle(startButton.button);
+ offsetY = parseInt(style["padding-bottom"]);
+ offsetX = parseInt(style["width"])/2;
+ target = startButton.button;
+ }
+
+ this.panel = document.getAnonymousElementByAttribute(this, "anonid", "panel");
+ this.panel.openPopup(target, "after_end", -offsetX, -offsetY, false, false);
+ ]]></body>
+ </method>
+
+ <method name="close">
+ <body><![CDATA[
+ this.panel.hidePopup();
+ this.panel = null;
+ ]]></body>
+ </method>
+
+ <property name="progress">
+ <getter><![CDATA[
+ return document.getAnonymousElementByAttribute(this, "anonid", "progress");
+ ]]></getter>
+ </property>
+
+ <property name="upgradeButton">
+ <getter><![CDATA[
+ return document.getAnonymousElementByAttribute(this, "anonid", "upgrade");
+ ]]></getter>
+ </property>
+
+ <property name="cancelButton">
+ <getter><![CDATA[
+ return document.getAnonymousElementByAttribute(this, "anonid", "cancel");
+ ]]></getter>
+ </property>
+ </implementation>
+</binding>
+</bindings>
diff --git a/extension/locale/en-US/multiprocess-notification.properties b/extension/locale/en-US/multiprocess-notification.properties
index 6018336..3f9a6ed 100644
--- a/extension/locale/en-US/multiprocess-notification.properties
+++ b/extension/locale/en-US/multiprocess-notification.properties
@@ -16,3 +16,13 @@ aurora.description=Did you know that Firebug 3 (for testers) is available? This
aurora.description2=Do you want to try it out?
aurora.notnow=Not Now
aurora.nothanks=No Thanks
+
+# LOCALIZATION NOTE (firebug.upgradeFirebug, upgrade.tip.upgradeFirebug): A label used within
+# the Start button menu. The action is used to upgrade Firebug to Firebug 3
+upgrade.upgradeFirebug=Upgrade Firebug...
+upgrade.tip.upgradeFirebug=Upgrade to Firebug 3 (for testers)
+
+# LOCALIZATION NOTE (upgrade.description, upgrade.description2):
+# Label used in a notification panel that is displayed when the user wants to explicitly upgrade Firebug.
+upgrade.description=Download & Install Firebug 3
+upgrade.description2=Firebug 3 (available for testers now) is built on top of Firefox native developer tools and offers significant performance, stability, and security advantages.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list