diff --git a/chrome.manifest b/chrome.manifest index 050468c..c29d2eb 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -10,9 +10,7 @@ locale mailhops ru jar:chrome/mailhops.jar!/locale/ru/ locale mailhops zh-CN jar:chrome/mailhops.jar!/locale/zh-CN/ # Postbox -# overlay chrome://messenger/content/msgHdrViewOverlay.xul chrome://mailhops/content/pb-overlay.xul application=postbox@postbox-inc.com overlay chrome://messenger/content/mailWindowOverlay.xul chrome://mailhops/content/msgNotificationBar.xul application=postbox@postbox-inc.com # Thunberbird -# overlay chrome://messenger/content/msgHdrViewOverlay.xul chrome://mailhops/content/tb-overlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} overlay chrome://messenger/content/mailWindowOverlay.xul chrome://mailhops/content/msgNotificationBar.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} diff --git a/chrome/content/images/btn-add-to-slack-122x35.png b/chrome/content/images/btn-add-to-slack-122x35.png deleted file mode 100644 index f2661ae..0000000 Binary files a/chrome/content/images/btn-add-to-slack-122x35.png and /dev/null differ diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index 22b04e8..c0399b8 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 2.0.0', + 'version':'MailHops Plugin 3.0.0', 'lan':'en', 'unit':'mi', 'api_http':'https://', diff --git a/chrome/content/msgNotificationBar.js b/chrome/content/msgNotificationBar.js index c59f3e5..997297b 100644 --- a/chrome/content/msgNotificationBar.js +++ b/chrome/content/msgNotificationBar.js @@ -10,12 +10,14 @@ var mailHopsDisplay = mailhopsDataPaneDNSBL: null, mailhopsResultWeather: null, mailhopsUnsubscribe: null, + mailhopsNoficationBox: null, options: null, init: function(options){ this.options = options; + this.mailhopsNoficationBox = document.getElementById("mailhopsNoficationBox"); this.container = document.getElementById("mailhopsBox"); this.resultBox = document.getElementById("mailhopsResult"); this.resultText = document.getElementById("mailhopsResultText"); @@ -184,10 +186,13 @@ var mailHopsDisplay = this.resultDetails.removeChild(this.resultDetails.firstChild); } - if(no_ips) + if(no_ips){ + this.resultText.style.backgroundImage = "url('chrome://mailhops/content/images/local.png')"; this.resultText.value = ' Looks like a local message'; - else + } else { + this.resultText.style.backgroundImage = "url('chrome://mailhops/content/images/refresh.png')"; this.resultText.value = ' Looking Up Route...'; + } }, route: function ( header_route, message, response, meta, lookup_url ){ @@ -296,7 +301,7 @@ var mailHopsDisplay = //set weather of sender if(weatherRoute){ this.mailhopsResultWeather.style.display = 'block'; - this.mailhopsResultWeather.setAttribute('tooltiptext','Weather'); + this.mailhopsResultWeather.setAttribute('tooltiptext','Weather in '+weatherRoute.city+' '+weatherRoute.state); this.mailhopsResultWeather.value = weatherRoute.weather.summary+' '+Math.round(weatherRoute.weather.temp)+'\u00B0'; this.mailhopsResultWeather.style.backgroundImage = 'url('+mailHopsUtils.getWeatherIcon(weatherRoute.weather.icon)+')'; if(weatherRoute.coords) diff --git a/chrome/content/msgNotificationBar.xul b/chrome/content/msgNotificationBar.xul index a5f8bb8..19885b0 100644 --- a/chrome/content/msgNotificationBar.xul +++ b/chrome/content/msgNotificationBar.xul @@ -1,7 +1,7 @@ - + ',''); - var label = document.createElement('label'); - - label.setAttribute('class','text-link dataPaneURLitem'); - - if(href.indexOf('mailto:')!=-1){ - label.setAttribute('value','Unsubscribe via Email'); - if(href.toLowerCase().indexOf('subject=')==-1){ - if(href.indexOf('?')==-1) - href+='?subject=Unsubscribe'; - else - href+='&subject=Unsubscribe'; - } - } - else{ - label.setAttribute('value','Unsubscribe via Web'); - } - label.setAttribute('tooltiptext',href); - label.setAttribute('href',href); - this.resultListDataPane.appendChild(label); - } - } - } - }, - - auth: function( header_xmailer, header_useragent, header_xmimeole, header_auth, header_spf ){ - this.mailhopsAuthContainer.style.display=''; - //SPF - if(header_spf){ - header_spf=header_spf.replace(/^\s+/,""); - var headerSPFArr=header_spf.split(' '); - this.mailhopsDataPaneSPF.setAttribute('value','SPF: '+headerSPFArr[0]); - this.mailhopsDataPaneSPF.style.backgroundImage = 'url(chrome://mailhops/content/images/auth/'+headerSPFArr[0]+'.png)'; - this.mailhopsDataPaneSPF.setAttribute('tooltiptext',header_spf+'\n'+mailHopsUtils.spf(headerSPFArr[0])); - this.mailhopsDataPaneSPF.style.display='block'; - } else { - this.mailhopsDataPaneSPF.style.display='none'; - } - //Authentication-Results - //http://tools.ietf.org/html/rfc5451 - if(header_auth){ - var headerAuthArr=header_auth.split(';'); - var dkim_result; - var spf_result; - for(var h=0;h 0) - distanceText = mailHopsUtils.addCommas(Math.round(response.distance.kilometers))+' km traveled'; - else if(response.distance.miles > 0) - distanceText = mailHopsUtils.addCommas(Math.round(response.distance.miles))+' mi traveled'; - } - else if(displayText=='') - displayText = ' Local message.'; - } - - if(message.time != null){ - message.time = message.time/1000; - if(message.time < 60) - distanceText += ' in '+message.time+' sec.'; - else if(message.time < 3600) //something is wrong if it takes this long - distanceText += ' in '+Math.round(message.time/60)+' min.'; - else //something is wrong if it takes this long - distanceText += ' in '+Math.round(message.time/60/60)+' hrs.'; - } - - if(header_route){ - this.resultMapLink.setAttribute("data-route", header_route); - this.resultSlackLink.setAttribute("data-api_url", lookup_url.replace('lookup','map')); - } else { - this.resultMapLink.removeAttribute("data-route"); - this.resultSlackLink.removeAttribute("data-api_url"); - } - - this.resultTextDataPane.style.backgroundImage = 'url('+image+')'; - this.resultTextDataPane.value = displayText; - - if(distanceText){ - this.resultTextDataPane2.style.display = 'block'; - this.resultTextDataPane2.value = ' ( '+distanceText+' )'; - } else { - this.resultTextDataPane2.style.display = 'none'; - } - - //set weather of sender - if(weather){ - this.resultTextDataPane3.style.display = 'block'; - this.resultTextDataPane3.setAttribute('tooltiptext',new Date(weather.time*1000)); - this.resultTextDataPane3.value = weather.summary+' '+Math.round(weather.temp)+'\u00B0'; - this.resultTextDataPane3.style.backgroundImage = 'url('+mailHopsUtils.getWeatherIcon(weather.icon)+')'; - } - - //show the detail link - this.resultMapLink.style.display = 'block'; - this.resultContainerDetails.style.display = 'block'; - - } //end route -}; diff --git a/chrome/content/pb-overlay.xul b/chrome/content/pb-overlay.xul deleted file mode 100644 index d2880d1..0000000 --- a/chrome/content/pb-overlay.xul +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - -