From 437f561dd9ecf89ca248ea6ccb992d35b3b6e33a Mon Sep 17 00:00:00 2001 From: Andrew Van Tassel Date: Fri, 4 May 2012 22:25:22 -0600 Subject: [PATCH] Updated prefs and added map xul --- chrome/content/images/auth/hardfail.png | Bin 0 -> 287 bytes chrome/content/mailhops.js | 34 +++++++++++++----------- chrome/content/mailhopsMap.xul | 22 +++++++++++++++ chrome/content/preferences.xul | 10 +++---- install.rdf | 2 +- mailhops-0.6.9.1-pb.xpi | Bin 0 -> 138728 bytes mailhops-0.6.9.2-pb.xpi | Bin 0 -> 138815 bytes mailhops-0.6.9.3-pb.xpi | Bin 0 -> 139144 bytes mailhops-0.7.xpi | Bin 0 -> 140818 bytes 9 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 chrome/content/images/auth/hardfail.png create mode 100644 chrome/content/mailhopsMap.xul create mode 100644 mailhops-0.6.9.1-pb.xpi create mode 100644 mailhops-0.6.9.2-pb.xpi create mode 100644 mailhops-0.6.9.3-pb.xpi create mode 100644 mailhops-0.7.xpi diff --git a/chrome/content/images/auth/hardfail.png b/chrome/content/images/auth/hardfail.png new file mode 100644 index 0000000000000000000000000000000000000000..0cd803115831933aa171497cfe9c1af983035f86 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=8^mK6yu{izqk}mh50EX6wkMFui zZg|fh<-*g%H9O|;u|DY#DW^u;K&o-|vHe`x?xbw1zYx$2><(A#;6QU!sSfhO( ioL~suuJh6Vfb_?jd)=>7iZy|bXYh3Ob6Mw<&;$Tq>~Ep~ literal 0 HcmV?d00001 diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index 52c1dd8..c019ab3 100644 --- a/chrome/content/mailhops.js +++ b/chrome/content/mailhops.js @@ -22,7 +22,7 @@ var mailHops = resultListDataPane: null, isLoaded: false, options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com'}, - appVersion: 'MailHops Postbox 0.6.9.3' + appVersion: 'MailHops Postbox 0.7' } mailHops.init = function() @@ -54,9 +54,8 @@ mailHops.init = function() //event listner for route click to launch map mailHops.resultMapLink.addEventListener("click", function () { - var route = this.getAttribute("route"); - if(route) - mailHops.launchMap(String(route)); + if(this.hasAttribute("data-route")) + mailHops.launchMap(String(this.getAttribute("data-route"))); } , false); mailHops.resultDetailsLink.addEventListener("click", function () { @@ -72,8 +71,8 @@ mailHops.init = function() , false); mailHops.mailhopsDataPaneDNSBL.addEventListener("click", function () { - var ip = this.getAttribute('data-ip'); - mailHops.launchSpamHausURL(ip); + if(this.hasAttribute('data-ip')) + mailHops.launchSpamHausURL(this.getAttribute('data-ip')); } , false); @@ -641,9 +640,9 @@ mailHops.displayResult = function ( header_route, response ){ } if(header_route) - mailHops.resultMapLink.setAttribute("route", header_route); + mailHops.resultMapLink.setAttribute("data-route", header_route); else - mailHops.resultMapLink.removeAttribute("route"); + mailHops.resultMapLink.removeAttribute("data-route"); mailHops.resultTextDataPane.style.backgroundImage = 'url('+image+')'; mailHops.resultTextDataPane.value = displayText; @@ -836,20 +835,23 @@ mailHops.addCommas = function(nStr){ mailHops.launchWhoIs = function(ip){ var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); - messenger.launchExternalURL(encodeURIComponent('http://www.mailhops.com/whois/'+ip)); + messenger.launchExternalURL('http://www.mailhops.com/whois/'+ip); }; mailHops.launchSpamHausURL = function(ip){ var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); - messenger.launchExternalURL(encodeURIComponent('http://www.spamhaus.org/query/bl?ip='+ip)); + messenger.launchExternalURL('http://www.spamhaus.org/query/bl?ip='+ip); }; + mailHops.launchMap = function(route){ - //launch mailhops api map - var lookupURL=mailHops.options.api_url+'/v1/map/?pb&app='+mailHops.appVersion+'&m='+mailHops.options.map+'&u='+mailHops.options.unit+'&r='+String(route); - if(mailHops.options.show_weather) - lookupURL+='&w=1'; - var openwin = window.openDialog(encodeURIComponent(lookupURL),"MailHops",'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,close=yes,width=732,height=332'); - openwin.focus(); + + if(route != '') { + var lookupURL=mailHops.options.api_url+'/v1/map/?pb&app='+mailHops.appVersion+'&m='+mailHops.options.map+'&u='+mailHops.options.unit+'&r='+String(route); + if(mailHops.options.show_weather) + lookupURL+='&w=1'; + + window.openDialog("chrome://mailhops/content/mailhopsMap.xul","MailHops",'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,close=yes,width=742,height=385', {src: lookupURL}); + } }; addEventListener ( "messagepane-loaded" , mailHops.setupEventListener , true ) ; diff --git a/chrome/content/mailhopsMap.xul b/chrome/content/mailhopsMap.xul new file mode 100644 index 0000000..dcd8b64 --- /dev/null +++ b/chrome/content/mailhopsMap.xul @@ -0,0 +1,22 @@ + + + + + + + +