diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index 2310a44..3df3204 100644 --- a/chrome/content/mailhops.js +++ b/chrome/content/mailhops.js @@ -8,7 +8,7 @@ var mailHops = { msgURI: null , isLoaded: false - , options: {'version':'MailHops Plugin 1.0.9','lan':'en','unit':'mi','api_url':'https://api.mailhops.com','debug':false} + , options: {'version':'MailHops Plugin 1.0.12','lan':'en','unit':'mi','api_url':'https://api.mailhops.com','debug':false} , message: { secure:[] } , client_location: null }; diff --git a/chrome/content/pb-overlay.js b/chrome/content/pb-overlay.js index 904f835..fd4f1ef 100644 --- a/chrome/content/pb-overlay.js +++ b/chrome/content/pb-overlay.js @@ -310,6 +310,8 @@ var mailHopsDisplay = } var label = document.createElement('label'); + label.setAttribute('data-ip',response.route[i].ip); + if(response.route[i].countryCode) label.style.backgroundImage = 'url(chrome://mailhops/content/images/flags/'+response.route[i].countryCode.toLowerCase()+'.png)'; else @@ -318,15 +320,21 @@ var mailHopsDisplay = if(response.route[i].city && response.route[i].state){ label.setAttribute('value','Hop #'+(i+1)+' '+response.route[i].city+', '+response.route[i].state); - label.setAttribute('onclick','mailHopsUtils.launchWhoIs("'+response.route[i].ip+'");'); + label.addEventListener("click", function (e) { + mailHopsUtils.launchWhoIs(this.getAttribute('data-ip')); + }, false); } else if(response.route[i].city){ label.setAttribute('value','Hop #'+(i+1)+' '+response.route[i].city+', '+response.route[i].countryCode); - label.setAttribute('onclick','mailHopsUtils.launchWhoIs("'+response.route[i].ip+'");'); + label.addEventListener("click", function () { + mailHopsUtils.launchWhoIs(this.getAttribute('data-ip')); + }, false); } else if(response.route[i].countryName){ label.setAttribute('value','Hop #'+(i+1)+' '+response.route[i].countryName); - label.setAttribute('onclick','mailHopsUtils.launchWhoIs("'+response.route[i].ip+'");'); + label.addEventListener("click", function () { + mailHopsUtils.launchWhoIs(this.getAttribute('data-ip')); + }, false); } else label.setAttribute('value','Hop #'+(i+1)+' Private'); @@ -397,9 +405,12 @@ var mailHopsDisplay = if(response.route[i].w3w){ var w3w = document.createElement('label'); + w3w.setAttribute('data-w3w',response.route[i].w3w.url); w3w.setAttribute('class','dataPaneAddressitem mailhopsW3w'); w3w.setAttribute('value',response.route[i].w3w.words.join('.')); - w3w.setAttribute('onclick','mailHopsUtils.launchExternalURL("'+response.route[i].w3w.url+'");'); + w3w.addEventListener("click", function () { + mailHopsUtils.launchExternalURL(this.getAttribute('data-w3w')); + }); this.resultDetails.appendChild(w3w); } } diff --git a/chrome/content/utils.js b/chrome/content/utils.js index e92030e..1a9ea93 100644 --- a/chrome/content/utils.js +++ b/chrome/content/utils.js @@ -127,7 +127,7 @@ launchExternalURL: function(url){ messenger.launchExternalURL(url); }, -launchWhoIs: function(ip){ +launchWhoIs: function(ip){ this.launchExternalURL('https://www.mailhops.com/whois/' + ip); }, diff --git a/chrome/skin/classic/pb-styles.css b/chrome/skin/classic/pb-styles.css index 3b475ad..f2217a1 100644 --- a/chrome/skin/classic/pb-styles.css +++ b/chrome/skin/classic/pb-styles.css @@ -101,13 +101,13 @@ button { font-size: 14px; } -textbox { +#mailHopsPreferences textbox { font-size: 14px; padding: 5px; color: #777; } -tab { +#mailHopsPreferences tab { font-size: 14px; padding: 5px; color: #333; @@ -123,12 +123,14 @@ tab { color: rgba(255,0,0,1); } -button { +.mailHopsLinkContainer button, #mailHopsPreferences button{ height: 35px; + color: #333; } -button.navButton { +.mailHopsLinkContainer button.navButton, button.navButton { height: 25px; width: 10px; text-align: center; + color: #333; } diff --git a/chrome/skin/classic/tb-styles.css b/chrome/skin/classic/tb-styles.css index f77b80a..624543f 100644 --- a/chrome/skin/classic/tb-styles.css +++ b/chrome/skin/classic/tb-styles.css @@ -15,18 +15,18 @@ font-size: 14px; } -textbox { +#mailHopsPreferences textbox { font-size: 14px; padding: 5px; color: #777; } -tab { +#mailHopsPreferences tab { font-size: 14px; padding: 5px; color: #333; } #mailhopsResult label { - margin-top: 8px; + margin-top: 8px; } diff --git a/install.rdf b/install.rdf index 5d35bc7..900734c 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ 2 thunderbird@mailhops.com - 1.0.9 + 1.0.12 MailHops MailHops maps the route an email took to get to you. Displaying the senders location, weather, user-agent and authentication used.