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

Updated prefs and added map xul

This commit is contained in:
Andrew Van Tassel 2012-05-04 22:25:22 -06:00
parent 7f26e8b121
commit 437f561dd9
9 changed files with 45 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

View File

@ -22,7 +22,7 @@ var mailHops =
resultListDataPane: null, resultListDataPane: null,
isLoaded: false, isLoaded: false,
options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com'}, 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() mailHops.init = function()
@ -54,9 +54,8 @@ mailHops.init = function()
//event listner for route click to launch map //event listner for route click to launch map
mailHops.resultMapLink.addEventListener("click", function () { mailHops.resultMapLink.addEventListener("click", function () {
var route = this.getAttribute("route"); if(this.hasAttribute("data-route"))
if(route) mailHops.launchMap(String(this.getAttribute("data-route")));
mailHops.launchMap(String(route));
} }
, false); , false);
mailHops.resultDetailsLink.addEventListener("click", function () { mailHops.resultDetailsLink.addEventListener("click", function () {
@ -72,8 +71,8 @@ mailHops.init = function()
, false); , false);
mailHops.mailhopsDataPaneDNSBL.addEventListener("click", function () { mailHops.mailhopsDataPaneDNSBL.addEventListener("click", function () {
var ip = this.getAttribute('data-ip'); if(this.hasAttribute('data-ip'))
mailHops.launchSpamHausURL(ip); mailHops.launchSpamHausURL(this.getAttribute('data-ip'));
} }
, false); , false);
@ -641,9 +640,9 @@ mailHops.displayResult = function ( header_route, response ){
} }
if(header_route) if(header_route)
mailHops.resultMapLink.setAttribute("route", header_route); mailHops.resultMapLink.setAttribute("data-route", header_route);
else else
mailHops.resultMapLink.removeAttribute("route"); mailHops.resultMapLink.removeAttribute("data-route");
mailHops.resultTextDataPane.style.backgroundImage = 'url('+image+')'; mailHops.resultTextDataPane.style.backgroundImage = 'url('+image+')';
mailHops.resultTextDataPane.value = displayText; mailHops.resultTextDataPane.value = displayText;
@ -836,20 +835,23 @@ mailHops.addCommas = function(nStr){
mailHops.launchWhoIs = function(ip){ mailHops.launchWhoIs = function(ip){
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); 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){ mailHops.launchSpamHausURL = function(ip){
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); 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){ 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(route != '') {
if(mailHops.options.show_weather) var lookupURL=mailHops.options.api_url+'/v1/map/?pb&app='+mailHops.appVersion+'&m='+mailHops.options.map+'&u='+mailHops.options.unit+'&r='+String(route);
lookupURL+='&w=1'; if(mailHops.options.show_weather)
var openwin = window.openDialog(encodeURIComponent(lookupURL),"MailHops",'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,close=yes,width=732,height=332'); lookupURL+='&w=1';
openwin.focus();
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 ) ; addEventListener ( "messagepane-loaded" , mailHops.setupEventListener , true ) ;

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://mailhops/skin/mailhops.css" type="text/css"?>
<dialog id="mailHopsMap"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="cancel"
onload="loadMap();"
title="MailHops Map"
buttonlabelcancel="Close">
<iframe id="mailhops_iframe" flex="1" width="732" height="332" style="overflow:hidden;"/>
<script>
function loadMap(){
var args = window.arguments[0];
document.getElementById('mailhops_iframe').setAttribute('src',args.src);
}
</script>
</dialog>

View File

@ -18,7 +18,6 @@
<tabs> <tabs>
<tab label="Defaults"/> <tab label="Defaults"/>
<tab label="Display"/> <tab label="Display"/>
<tab label="Authentication"/>
<tab label="Hosting"/> <tab label="Hosting"/>
</tabs> </tabs>
<tabpanels> <tabpanels>
@ -51,9 +50,7 @@
<checkbox id="mailhop.show_host" label="Show Host" checked="false"/> <checkbox id="mailhop.show_host" label="Show Host" checked="false"/>
<checkbox id="mailhop.show_weather" label="Show Weather" checked="false"/> <checkbox id="mailhop.show_weather" label="Show Weather" checked="false"/>
</groupbox> </groupbox>
</tabpanel> <groupbox>
<tabpanel>
<groupbox>
<caption label="Authentication Options"/> <caption label="Authentication Options"/>
<checkbox id="mailhop.show_mailer" label="Show Mailer" checked="true"/> <checkbox id="mailhop.show_mailer" label="Show Mailer" checked="true"/>
<checkbox id="mailhop.show_spf" label="Show SPF" checked="true"/> <checkbox id="mailhop.show_spf" label="Show SPF" checked="true"/>
@ -61,6 +58,7 @@
<checkbox id="mailhop.show_dnsbl" label="Show DNS Blacklist" checked="true"/> <checkbox id="mailhop.show_dnsbl" label="Show DNS Blacklist" checked="true"/>
</groupbox> </groupbox>
</tabpanel> </tabpanel>
<tabpanel> <tabpanel>
<groupbox> <groupbox>
<caption label="MailHops API Hosting"/> <caption label="MailHops API Hosting"/>
@ -72,8 +70,8 @@
<radio value="edu" label="Educational (Free)"/> <radio value="edu" label="Educational (Free)"/>
<radio value="business" label="Business (Not-Free)"/> <radio value="business" label="Business (Not-Free)"/>
</radiogroup> </radiogroup>
<checkbox id="mailhop.use_private" label="Yes, I Agree to MailHops terms for the use of private hosting." checked="false" oncommand="ChangePrivate(this);"/> <checkbox id="mailhop.use_private" label="Yes, I Agree to MailHops terms of use for hosting my own MailHops API." checked="false" oncommand="ChangePrivate(this);"/>
<label class="text-link" value="MailHops Terms and Conditions" href="http://www.mailhops.com/terms"/> <label class="text-link" value="MailHops Terms of Use" href="http://www.mailhops.com/terms"/>
<textbox id="mailhop.api_url" value="http://api.mailhops.com" disabled="true"/> <textbox id="mailhop.api_url" value="http://api.mailhops.com" disabled="true"/>
<label class="text-link" onclick="TestConnection();" value="Test Connection" /> <label class="text-link" onclick="ResetConnection();" value="Reset Connection" /> <label class="text-link" onclick="TestConnection();" value="Test Connection" /> <label class="text-link" onclick="ResetConnection();" value="Reset Connection" />
</groupbox> </groupbox>

View File

@ -7,7 +7,7 @@
<em:id>postbox@mailhops.com</em:id> <em:id>postbox@mailhops.com</em:id>
<em:type>2</em:type> <em:type>2</em:type>
<em:name>MailHops</em:name> <em:name>MailHops</em:name>
<em:version>0.6.9.3</em:version> <em:version>0.7</em:version>
<em:description>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.</em:description> <em:description>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.</em:description>
<em:iconURL>chrome://mailhops/content/images/mailhops32.png</em:iconURL> <em:iconURL>chrome://mailhops/content/images/mailhops32.png</em:iconURL>
<em:homepageURL>http://mailhops.com</em:homepageURL> <em:homepageURL>http://mailhops.com</em:homepageURL>

BIN
mailhops-0.6.9.1-pb.xpi Normal file

Binary file not shown.

BIN
mailhops-0.6.9.2-pb.xpi Normal file

Binary file not shown.

BIN
mailhops-0.6.9.3-pb.xpi Normal file

Binary file not shown.

BIN
mailhops-0.7.xpi Normal file

Binary file not shown.