1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-17 06:40:08 -07:00

Added Display option to hide the MailHops bar when CompactHeaders

This commit is contained in:
Andrew Van Tassel 2017-01-12 22:55:43 -07:00
parent b55542877b
commit 2b071c7617
3 changed files with 22 additions and 13 deletions

View File

@ -15,6 +15,7 @@ var mailHops =
'api_http':'https://',
'api_host':'api.mailhops.com',
'debug':false,
'hide_compact':false,
'bar_color': '#5E7A9B',
'font_color': '#FFF',
'font_size': '14px',
@ -71,6 +72,8 @@ mailHops.loadPref = function(reload)
mailHops.options.debug = mailHops.getCharPref('mail.mailHops.debug','false')=='true'?true:false;
mailHops.options.hide_compact = mailHops.getCharPref('mail.mailHops.hide_compact','false')=='true'?true:false;
mailHops.options.api_host = mailHops.getCharPref('mail.mailHops.api_host','api.mailhops.com');
mailHops.options.api_http = mailHops.getCharPref('mail.mailHops.api_http','https://');
@ -135,6 +138,7 @@ mailHops.StreamListener =
*/
mailHops.loadHeaderData = function() {
if(!!mailHops.options.hide_compact){
// CompactHeader toggle header logic
var compactHeadersView = document.getElementById('CompactHeader_collapsedHeaderView');
if(!!compactHeadersView){
@ -145,6 +149,7 @@ mailHops.loadHeaderData = function() {
return;
}
}
}
var msgURI = null ;

View File

@ -82,6 +82,11 @@ var mailHopPreferences = {
else
document.getElementById("mailhop.travel_time_junk").checked = true;
if(pref.getCharPref("mail.mailHops.hide_compact",'false')=='false')
document.getElementById("mailhop.hide_compact").checked = false;
else
document.getElementById("mailhop.hide_compact").checked = true;
document.getElementById("mailhops-membership-link").addEventListener("click", function () {
mailHopsUtils.launchExternalURL(this.getAttribute('data-account-url'));
});
@ -99,10 +104,6 @@ var mailHopPreferences = {
document.getElementById("mailhop.font_size").addEventListener("input", function () {
self.previewBar.style.fontSize = this.value;
});
document.getElementById("randomColorHue").addEventListener("change", function () {
self.RandomColor(this.value);
});
},
savePreferences: function() {
pref.setCharPref("mail.mailHops.lang", document.getElementById("mailhop.lang").selectedItem.value);
@ -112,6 +113,7 @@ var mailHopPreferences = {
pref.setCharPref("mail.mailHops.font_color", String(document.getElementById("mailhop.font_color").value));
pref.setCharPref("mail.mailHops.font_size", String(document.getElementById("mailhop.font_size").value));
pref.setCharPref("mail.mailHops.debug", String(document.getElementById("mailhop.debug").checked));
pref.setCharPref("mail.mailHops.hide_compact", String(document.getElementById("mailhop.hide_compact").checked));
//API vars
if(!this.valid_api_key)

View File

@ -560,6 +560,8 @@
</rows>
</grid>
<checkbox id="mailhop.hide_compact" label="Hide MailHops Bar when CompactHeaders" checked="false"/>
</groupbox>
</tabpanel>