From 3c8edf0c22ca0a917367a59cfa9959820c52527c Mon Sep 17 00:00:00 2001 From: Andrew Van Tassel Date: Sat, 15 Jul 2017 15:05:36 -0600 Subject: [PATCH] Language Pull Requests, Account Messages, Fixed Missing blacklisted icon --- CHANGELOG.md | 9 +++++ PRIVACY.md | 3 ++ chrome/content/mailhops.js | 2 +- chrome/content/msgNotificationBar.js | 20 +++++++++ chrome/content/msgNotificationBar.xul | 3 ++ chrome/content/preferences.js | 6 +-- chrome/content/preferences.xul | 8 ++-- chrome/skin/classic/msgNotificationBar.css | 47 ++++++++++++++-------- install.rdf | 2 +- 9 files changed, 75 insertions(+), 25 deletions(-) create mode 100644 PRIVACY.md diff --git a/CHANGELOG.md b/CHANGELOG.md index eef8444..123bb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 3.1.1 - 2017-07-15 + +### Added +- Language Pull Requests +- Account Messages + +### Fixed +- Missing blacklisted icon in MailHops bar + ## 3.1.0 - 2017-02-21 ### Fixed diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..ebae61b --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,3 @@ +# MailHops Privacy Policy + +MailHops parses IP addresses from the Received headers to send to the MailHops service. Please see the MailHops privacy policy for more details. [https://www.mailhops.com/privacy/](https://www.mailhops.com/privacy) diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index 9ec78c5..5a62129 100644 --- a/chrome/content/mailhops.js +++ b/chrome/content/mailhops.js @@ -9,7 +9,7 @@ var mailHops = msgURI: null, isLoaded: false, options: { - 'version':'MailHops Plugin 3.1.0', + 'version':'MailHops Plugin 3.1.1', 'lan':'en', 'unit':'mi', 'api_http':'https://', diff --git a/chrome/content/msgNotificationBar.js b/chrome/content/msgNotificationBar.js index a72393b..5d96c87 100644 --- a/chrome/content/msgNotificationBar.js +++ b/chrome/content/msgNotificationBar.js @@ -9,6 +9,8 @@ var mailHopsDisplay = mailhopsDataPaneDNSBL: null, mailhopsResultWeather: null, mailhopsUnsubscribe: null, + mailHopsMessage: null, + mailHopsMessageText: null, mhBox: null, options: null, @@ -21,6 +23,9 @@ var mailHopsDisplay = this.mailhopsResultWeather = document.getElementById("mailhopsResultWeather"); this.mailhopsUnsubscribe = document.getElementById("mailhopsUnsubscribe"); this.resultDetails = document.getElementById("mailhopsDataPaneDetails"); + this.mailHopsMessage = document.getElementById("mailHopsMessage"); + this.mailHopsMessageText = document.getElementById("mailHopsMessageText"); + //auth this.mailhopsDataPaneSPF = document.getElementById("mailhopsDataPaneSPF"); this.mailhopsDataPaneDKIM = document.getElementById("mailhopsDataPaneDKIM"); @@ -47,6 +52,10 @@ var mailHopsDisplay = mailHopsUtils.launchExternalURL(this.getAttribute('href')); }); + this.mailHopsMessageText.addEventListener("click", function () { + mailHopsUtils.launchExternalURL(this.getAttribute('href')); + }); + this.mailhopsUnsubscribe.addEventListener("click", function () { if(this.getAttribute('href')) mailHopsUtils.launchExternalURL(this.getAttribute('href')); @@ -189,6 +198,7 @@ var mailHopsDisplay = }, error: function(status,data){ + this.resultText.style.backgroundImage = "url('chrome://mailhops/content/images/auth/error.png')"; if(data && data.error){ this.resultText.setAttribute('value', status+': '+data.error.message); this.resultText.setAttribute('tooltiptext',data.error.message); @@ -375,6 +385,16 @@ var mailHopsDisplay = this.resultText.setAttribute('value', displayText+' ( '+distanceText+' )'); this.resultText.style.backgroundImage = 'url('+image+')'; + + if(meta && meta.message){ + this.mailHopsMessage.style.display = 'inline'; + if(meta.message.text) + this.mailHopsMessageText.value = meta.message.text; + if(meta.message.url) + this.mailHopsMessageText.setAttribute('href', meta.message.url); + } else { + this.mailHopsMessage.style.display = 'none'; + } }, //end route toggleMailHopsBar: function(show){ diff --git a/chrome/content/msgNotificationBar.xul b/chrome/content/msgNotificationBar.xul index 757f5fd..273a613 100644 --- a/chrome/content/msgNotificationBar.xul +++ b/chrome/content/msgNotificationBar.xul @@ -14,6 +14,9 @@ +
+ +
diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js index dde5d8a..89e4d6c 100644 --- a/chrome/content/preferences.js +++ b/chrome/content/preferences.js @@ -34,8 +34,8 @@ var mailHopPreferences = { document.getElementById("mailhop.unit").selectedIndex = 1; //Display Box styles - document.getElementById("mailhop.bar_color").value = pref.getCharPref("mail.mailHops.bar_color",'#5E7A9B'); - document.getElementById("mailhop.font_color").value = pref.getCharPref("mail.mailHops.font_color",'#ffffff'); + document.getElementById("mailhop.bar_color").value = pref.getCharPref("mail.mailHops.bar_color",'#FFF'); + document.getElementById("mailhop.font_color").value = pref.getCharPref("mail.mailHops.font_color",'#777'); document.getElementById("mailhop.font_size").value = pref.getCharPref("mail.mailHops.font_size",'14px'); //Update styles @@ -177,7 +177,7 @@ var mailHopPreferences = { self.valid_api_key=true; document.getElementById("plan-error").style.display = 'none'; // set plan info - document.getElementById("plan").value = "Plan: "+data.account.subscriptions.data[0].plan.id; + document.getElementById("plan").value = "Plan: "+data.account.subscriptions.data[0].plan.name; document.getElementById("status").value = "Status: "+data.account.subscriptions.data[0].status; document.getElementById("rate-limit").value = "Limit: "+data.account.rate.limit; document.getElementById("rate-remaining").value = "Remaining: "+data.account.rate.remaining; diff --git a/chrome/content/preferences.xul b/chrome/content/preferences.xul index 2d80ae4..1db2e41 100644 --- a/chrome/content/preferences.xul +++ b/chrome/content/preferences.xul @@ -489,7 +489,7 @@ Use any