diff options
author | Sukhbir Singh <sukhbir@torproject.org> | 2017-12-17 12:05:35 -0500 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-12-20 18:09:55 +0200 |
commit | 72468d21084a80420b299d94a6afdd66c2d141e6 (patch) | |
tree | 19f1afd576b6738c665132b9da9a9ecb23996a70 /chrome/content | |
parent | de0dc0bb86f79234159d32684003bb205240e07c (diff) |
[feat] Add icons to bitmask status bar
Display the status of bitmaskd in Thunderbird's status bar by connecting
to it using bitmask.js
Diffstat (limited to 'chrome/content')
-rw-r--r-- | chrome/content/accountWizard/bitmaskMessengerOverlay.js | 7 | ||||
-rw-r--r-- | chrome/content/accountWizard/bitmaskMessengerOverlay.xul | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/content/accountWizard/bitmaskMessengerOverlay.js b/chrome/content/accountWizard/bitmaskMessengerOverlay.js index aa6bff8..148290c 100644 --- a/chrome/content/accountWizard/bitmaskMessengerOverlay.js +++ b/chrome/content/accountWizard/bitmaskMessengerOverlay.js @@ -8,16 +8,19 @@ window.setInterval(function() { function overlayStartup() { let myPanel = document.getElementById("bitmaskStatusBarPanel"); + let strBundle = document.getElementById("bitmaskMessengerStrings"); // We just need to check if bitmaskd is running and if we were able to // authorize with it using the token from bitmask.js let promise = bitmask.core.status(); promise.then(function(data) { - myPanel.label = "bitmask is " + data["mail"]; + myPanel.label = strBundle.getFormattedString("bitmaskStatusOn", [ data["mail"] ]); myPanel.style.color = "green"; + myPanel.src = "chrome://bitmask/skin/on.png"; }, function(error) { - myPanel.label = "bitmask is not running"; + myPanel.label = strBundle.getString("bitmaskStatusOff"); myPanel.style.color = "red"; + myPanel.src = "chrome://bitmask/skin/off.png"; console.log(error); }); } diff --git a/chrome/content/accountWizard/bitmaskMessengerOverlay.xul b/chrome/content/accountWizard/bitmaskMessengerOverlay.xul index e6406d1..da906f6 100644 --- a/chrome/content/accountWizard/bitmaskMessengerOverlay.xul +++ b/chrome/content/accountWizard/bitmaskMessengerOverlay.xul @@ -9,8 +9,12 @@ <script type="application/javascript" src="chrome://bitmask/content/accountWizard/bitmaskMessengerOverlay.js"/> + <stringbundleset id="stringbundleset"> + <stringbundle id="bitmaskMessengerStrings" src="chrome://bitmask/locale/bitmaskMessengerOverlay.properties"/> + </stringbundleset> + <statusbar id="status-bar"> - <statusbarpanel id="bitmaskStatusBarPanel" /> + <statusbarpanel id="bitmaskStatusBarPanel" class="statusbarpanel-iconic-text" /> </statusbar> <menupopup id="menu_NewPopup"> |