From 72468d21084a80420b299d94a6afdd66c2d141e6 Mon Sep 17 00:00:00 2001 From: Sukhbir Singh Date: Sun, 17 Dec 2017 12:05:35 -0500 Subject: [feat] Add icons to bitmask status bar Display the status of bitmaskd in Thunderbird's status bar by connecting to it using bitmask.js --- chrome/content/accountWizard/bitmaskMessengerOverlay.js | 7 +++++-- chrome/content/accountWizard/bitmaskMessengerOverlay.xul | 6 +++++- chrome/locale/en-US/bitmaskMessengerOverlay.properties | 2 ++ chrome/skin/off.png | Bin 0 -> 685 bytes chrome/skin/on.png | Bin 0 -> 670 bytes 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 chrome/locale/en-US/bitmaskMessengerOverlay.properties create mode 100644 chrome/skin/off.png create mode 100644 chrome/skin/on.png 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 @@