From b7362963c5e61685371862a1a6a788804a97e8a7 Mon Sep 17 00:00:00 2001 From: Andrew Van Tassel Date: Mon, 4 Jul 2011 14:40:26 -0600 Subject: [PATCH] Finished Auth section --- chrome/content/images/error.png | Bin 666 -> 0 bytes chrome/content/mailhops.js | 171 ++++++++++++++++++--------- chrome/content/msgHdrViewOverlay.xul | 9 +- chrome/content/preferences.js | 8 +- chrome/content/preferences.xul | 1 - chrome/skin/classic/mailhops.css | 8 +- install.rdf | 2 +- 7 files changed, 129 insertions(+), 70 deletions(-) delete mode 100644 chrome/content/images/error.png diff --git a/chrome/content/images/error.png b/chrome/content/images/error.png deleted file mode 100644 index 628cf2dae3d419ae220c8928ac71393b480745a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 666 zcmV;L0%iS)P)eOSYYtbpBV}~vsBnU!_?2tr-P=|^T zED%wc9ezHgW@NMb!^uT_|SvCpFLJylbx zY%bpaTGI8IYXMN$9w<3j9VkA~NYOKEQXsj?6a9_hcwfU$acAhJhB)zb_w@MVUEy@S zX&I>K-R!bhu3?(6bHWIg$HEl7{9g>>&l_qdd+UYb(1~BCo9LptNq&8>!yoJ3Ui(i5 zRJ|XnYBklL!{@$-7=3mJ>P@1c=7Oc79e-V7yf+%lD2!I;Y&nXBZ>=B!5?CB>LvEx6 znI%n)qqi$#X#wKB(U7XP2P=+4{b@j#r%9-K(8UqtSDk>0UKzf*HM9yqMZ1D!$2MdZ zR=`U>0zhOH1XqN?nY@AQqB7)Fp4{v&dKXvb43hZKvnN8;Po;+jY*}~*Z|W9Q0W%{D z^T}Cc<|r(Su=1K=P5>Z4 zg`et&Va}tdzBS-G-ZcO)zCWpJvGQwrHZ`@wpM420ac@bI5~KkTFfGEM3sPWO8co4^fI6lPnA)Y{ef%@{+SnoUk0+dW+*{8WvF8}}l07*qoM6N<$g7cXs A&j0`b diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index 4e19502..316d273 100644 --- a/chrome/content/mailhops.js +++ b/chrome/content/mailhops.js @@ -16,14 +16,13 @@ var mailHops = mailhopsDataPaneSPF: null, mailhopsDataPaneDKIM: null, mailhopsDataPaneMailer: null, - mailhopsAuthContainer: null, + mailhopsDataPaneDNSBL: null, isLoaded: false, showDetails: false, showWeather: false, - showAuth: true, map: 'goog', unit: 'mi', - appVersion: 'MailHops Postbox 0.5' + appVersion: 'MailHops Postbox 0.6' } mailHops.init = function() @@ -43,10 +42,10 @@ mailHops.init = function() mailHops.resultMapLink = document.getElementById ( "mailhopsDataPaneMapLink"); - mailHops.mailhopsAuthContainer = document.getElementById ( "dataPaneMailHopsAuthContainer"); mailHops.mailhopsDataPaneSPF = document.getElementById ( "mailhopsDataPaneSPF"); mailHops.mailhopsDataPaneDKIM = document.getElementById ( "mailhopsDataPaneDKIM"); mailHops.mailhopsDataPaneMailer = document.getElementById ( "mailhopsDataPaneMailer"); + mailHops.mailhopsDataPaneDNSBL = document.getElementById ( "mailhopsDataPaneDNSBL"); //event listner for route click to launch map mailHops.resultMapLink.addEventListener("click", function () { @@ -76,10 +75,6 @@ mailHops.loadPref = function() mailHops.unit = mailHops.getCharPref('mail.mailHops.unit','mi'); mailHops.showDetails = mailHops.getCharPref('mail.mailHops.show_details','false')=='true'?true:false; mailHops.showWeather = mailHops.getCharPref('mail.mailHops.show_weather','false')=='true'?true:false; - mailHops.showAuth = mailHops.getCharPref('mail.mailHops.show_auth','true')=='true'?true:false; - - if(!mailHops.showAuth) - mailHops.mailhopsAuthContainer.style.display = 'none'; }; mailHops.StreamListener = @@ -157,10 +152,8 @@ var regexAllIp = /(1\d{0,2}|2(?:[0-4]\d{0,1}|[6789]|5[0-5]?)?|[3-9]\d?|0)\.(1\d{ var headReceivedSPF = mailHops.headers.extractHeader ( "Received-SPF" , false ) ; var headAuth = mailHops.headers.extractHeader ( "Authentication-Results" , false ) ; - //display auth - if(mailHops.showAuth) - mailHops.displayResultAuth(headXMailer,headUserAgent,headAuth,headReceivedSPF); + mailHops.displayResultAuth(headXMailer,headUserAgent,headAuth,headReceivedSPF); var received_ips; var all_ips = new Array(); @@ -238,21 +231,28 @@ mailHops.displayResultAuth = function( header_xmailer, header_useragent, header_ var headerSPFArr=header_spf.split(' '); mailHops.mailhopsDataPaneSPF.setAttribute('value','SPF: '+headerSPFArr[0]); mailHops.mailhopsDataPaneSPF.style.backgroundImage = 'url(chrome://mailhops/content/images/auth/'+headerSPFArr[0]+'.png)'; - mailHops.mailhopsDataPaneSPF.setAttribute('tooltiptext',header_spf); + mailHops.mailhopsDataPaneSPF.setAttribute('tooltiptext',header_spf+'\n'+mailHops.authExplainSPF(headerSPFArr[0])); + mailHops.mailhopsDataPaneSPF.style.display='block'; } else{ - mailHops.mailhopsDataPaneSPF.setAttribute('value','SPF: Missing'); - mailHops.mailhopsDataPaneSPF.style.backgroundImage = 'url(chrome://mailhops/content/images/auth/none.png)'; + mailHops.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 - @@ -39,9 +39,10 @@ - - - + + + + diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js index 342a1d3..d395767 100644 --- a/chrome/content/preferences.js +++ b/chrome/content/preferences.js @@ -25,12 +25,7 @@ var mailHopPreferences = if(pref.getCharPref("mail.mailHops.show_weather",'false')=='true') document.getElementById("mailhop.show_weather").checked = true; else - document.getElementById("mailhop.show_weather").checked = false; - - if(pref.getCharPref("mail.mailHops.show_auth",'true')=='true') - document.getElementById("mailhop.show_auth").checked = true; - else - document.getElementById("mailhop.show_auth").checked = false; + document.getElementById("mailhop.show_weather").checked = false; } , savePreferences: function() @@ -39,6 +34,5 @@ var mailHopPreferences = pref.setCharPref("mail.mailHops.unit", document.getElementById("mailhop.unit").selectedItem.value) ; pref.setCharPref("mail.mailHops.show_details", String(document.getElementById("mailhop.show_details").checked)) ; pref.setCharPref("mail.mailHops.show_weather", String(document.getElementById("mailhop.show_weather").checked)) ; - pref.setCharPref("mail.mailHops.show_auth", String(document.getElementById("mailhop.show_auth").checked)) ; } } diff --git a/chrome/content/preferences.xul b/chrome/content/preferences.xul index 0f45d3a..3af6321 100644 --- a/chrome/content/preferences.xul +++ b/chrome/content/preferences.xul @@ -34,7 +34,6 @@ - diff --git a/chrome/skin/classic/mailhops.css b/chrome/skin/classic/mailhops.css index b28c796..07d3353 100644 --- a/chrome/skin/classic/mailhops.css +++ b/chrome/skin/classic/mailhops.css @@ -24,10 +24,6 @@ padding-right: 14px; } -#dataPaneMailHopsAuthContainer{ - display: none; -} - #mailhopsDataPane{ padding-bottom: 4px; } @@ -55,4 +51,8 @@ .mailhopsWeather{ margin-left: 30px; padding-bottom: 2px; +} + +.auth-item{ + display: none; } \ No newline at end of file diff --git a/install.rdf b/install.rdf index 14ed8a8..39d36fa 100644 --- a/install.rdf +++ b/install.rdf @@ -7,7 +7,7 @@ postbox@mailhops.com 2 MailHops - 0.5 + 0.6 MailHops maps the route an email traveled to get to you. Using GeoIP it also displays distance traveled along with the location (city, state and country) of the sender. chrome://mailhops/content/images/mailhops32.png http://mailhops.com