diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browserOverlay.xul | 25 | ||||
-rw-r--r-- | chrome/js/browserOverlay.js | 8 |
2 files changed, 24 insertions, 9 deletions
diff --git a/chrome/browserOverlay.xul b/chrome/browserOverlay.xul index 5859a93..8a97546 100644 --- a/chrome/browserOverlay.xul +++ b/chrome/browserOverlay.xul @@ -3,31 +3,40 @@ <!DOCTYPE overlay SYSTEM "chrome://redirector/locale/browserOverlay.dtd"> <overlay id="redirector-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <script src="chrome://redirector/content/js/browserOverlay.js"/> + <script src="chrome://redirector/content/js/browserOverlay.js" /> <stringbundleset id="stringbundleset"> - <stringbundle id="redirector-strings" src="chrome://redirector/locale/redirector.properties"/> + <stringbundle id="redirector-strings" + src="chrome://redirector/locale/redirector.properties" /> </stringbundleset> <commandset> <command id="redirector-toggle" - label="Toggle" - oncommand="RedirectorOverlay.toggleEnabled();"/> + oncommand="RedirectorOverlay.toggleEnabled();" /> </commandset> + <popupset> + <tooltip id="redirector-tooltip" + onpopupshowing="RedirectorOverlay.updateTooltip(event);"> + <label class="redirector-tooltip-version" /> + </tooltip> + </popupset> + <toolbarpalette id="BrowserToolbarPalette"> <toolbarbutton id="redirector-button" - label="URL Rewriter" command="redirector-toggle" class="toolbarbutton-1" - type="menu-button"> + type="menu-button" + label="URL Rewriter" + tooltip="redirector-tooltip"> <menupopup> <menuitem id="redirector-enabled-item" type="checkbox" - command="redirector-toggle"/> + command="redirector-toggle" + label="Enable" /> <menuitem id="redirector-settings-item" label="Settings" - oncommand="RedirectorOverlay.openSettings();"/> + oncommand="RedirectorOverlay.openSettings();" /> </menupopup> </toolbarbutton> </toolbarpalette> diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js index 2767d7b..d833ccf 100644 --- a/chrome/js/browserOverlay.js +++ b/chrome/js/browserOverlay.js @@ -93,8 +93,14 @@ var RedirectorOverlay = { } else if (event.button == RIGHT) { this.openSettings(); } - } + }, + updateTooltip: function(event) { + AddonManager.getAddonByID("url-rewriter@papush", (addon) => { + let label = event.target.getElementsByClassName("redirector-tooltip-version")[0]; + label.setAttribute("value", "URL Rewriter " + addon.version); + }); + } }; window.addEventListener("load", function(event) { RedirectorOverlay.onLoad(event); }, false); window.addEventListener("unload", function(event) { RedirectorOverlay.onUnload(event); }, false); |