mirror of
https://github.com/MailHops/mailhops-plugin.git
synced 2025-05-17 23:00:10 -07:00
Added new prefs for hosting option
Reformatted prefs into tabs
This commit is contained in:
parent
d2858eb09c
commit
7f26e8b121
@ -18,14 +18,11 @@ var mailHops =
|
|||||||
mailhopsDataPaneMailer: null,
|
mailhopsDataPaneMailer: null,
|
||||||
mailhopsDataPaneDNSBL: null,
|
mailhopsDataPaneDNSBL: null,
|
||||||
mailhopsListContainer: null,
|
mailhopsListContainer: null,
|
||||||
|
mailhopsAuthContainer: null,
|
||||||
resultListDataPane: null,
|
resultListDataPane: null,
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
showDetails: false,
|
options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com'},
|
||||||
showWeather: false,
|
appVersion: 'MailHops Postbox 0.6.9.3'
|
||||||
showHost: false,
|
|
||||||
map: 'goog',
|
|
||||||
unit: 'mi',
|
|
||||||
appVersion: 'MailHops Postbox 0.6.9.2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mailHops.init = function()
|
mailHops.init = function()
|
||||||
@ -45,12 +42,14 @@ mailHops.init = function()
|
|||||||
|
|
||||||
mailHops.resultMapLink = document.getElementById ( "mailhopsDataPaneMapLink");
|
mailHops.resultMapLink = document.getElementById ( "mailhopsDataPaneMapLink");
|
||||||
//auth
|
//auth
|
||||||
|
mailHops.mailhopsAuthContainer = document.getElementById ( "dataPaneMailHopsAuthContainer");
|
||||||
mailHops.mailhopsDataPaneSPF = document.getElementById ( "mailhopsDataPaneSPF");
|
mailHops.mailhopsDataPaneSPF = document.getElementById ( "mailhopsDataPaneSPF");
|
||||||
mailHops.mailhopsDataPaneDKIM = document.getElementById ( "mailhopsDataPaneDKIM");
|
mailHops.mailhopsDataPaneDKIM = document.getElementById ( "mailhopsDataPaneDKIM");
|
||||||
mailHops.mailhopsDataPaneMailer = document.getElementById ( "mailhopsDataPaneMailer");
|
mailHops.mailhopsDataPaneMailer = document.getElementById ( "mailhopsDataPaneMailer");
|
||||||
mailHops.mailhopsDataPaneDNSBL = document.getElementById ( "mailhopsDataPaneDNSBL");
|
mailHops.mailhopsDataPaneDNSBL = document.getElementById ( "mailhopsDataPaneDNSBL");
|
||||||
//list
|
//list
|
||||||
mailHops.mailhopsListContainer = document.getElementById ( "dataPaneMailHopsListContainer");
|
mailHops.mailhopsListContainer = document.getElementById ( "dataPaneMailHopsListContainer");
|
||||||
|
|
||||||
mailHops.resultListDataPane = document.getElementById ( "mailhopsListDataPane");
|
mailHops.resultListDataPane = document.getElementById ( "mailhopsListDataPane");
|
||||||
|
|
||||||
//event listner for route click to launch map
|
//event listner for route click to launch map
|
||||||
@ -83,11 +82,33 @@ mailHops.init = function()
|
|||||||
mailHops.loadPref = function()
|
mailHops.loadPref = function()
|
||||||
{
|
{
|
||||||
//get preferences
|
//get preferences
|
||||||
mailHops.map = mailHops.getCharPref('mail.mailHops.map','goog');
|
mailHops.options.map = mailHops.getCharPref('mail.mailHops.map','goog');
|
||||||
mailHops.unit = mailHops.getCharPref('mail.mailHops.unit','mi');
|
mailHops.options.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;
|
//Display Boxes
|
||||||
mailHops.showHost = mailHops.getCharPref('mail.mailHops.show_host','false')=='true'?true:false;
|
mailHops.options.show_details = mailHops.getCharPref('mail.mailHops.show_details','false')=='true'?true:false;
|
||||||
|
mailHops.options.show_auth = mailHops.getCharPref('mail.mailHops.show_auth','true')=='true'?true:false;
|
||||||
|
mailHops.options.show_lists = mailHops.getCharPref('mail.mailHops.show_lists','true')=='true'?true:false;
|
||||||
|
|
||||||
|
//Details options
|
||||||
|
mailHops.options.show_host = mailHops.getCharPref('mail.mailHops.show_host','false')=='true'?true:false;
|
||||||
|
mailHops.options.show_weather = mailHops.getCharPref('mail.mailHops.show_weather','false')=='true'?true:false;
|
||||||
|
|
||||||
|
//Auth options
|
||||||
|
mailHops.options.show_dkim = mailHops.getCharPref('mail.mailHops.show_dkim','true')=='true'?true:false;
|
||||||
|
mailHops.options.show_spf = mailHops.getCharPref('mail.mailHops.show_spf','true')=='true'?true:false;
|
||||||
|
mailHops.options.show_mailer = mailHops.getCharPref('mail.mailHops.show_mailer','true')=='true'?true:false;
|
||||||
|
mailHops.options.show_dnsbl = mailHops.getCharPref('mail.mailHops.show_dnsbl','true')=='true'?true:false;
|
||||||
|
|
||||||
|
//Hosting
|
||||||
|
mailHops.options.use_private = mailHops.getCharPref('mail.mailHops.use_private','false')=='true'?true:false;
|
||||||
|
mailHops.options.hosting = mailHops.getCharPref('mail.mailHops.hosting','personal');
|
||||||
|
|
||||||
|
if(mailHops.options.use_private)
|
||||||
|
mailHops.options.api_url = mailHops.getCharPref('mail.mailHops.api_url','http://api.mailhops.com');
|
||||||
|
else
|
||||||
|
mailHops.options.api_url='http://api.mailhops.com';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mailHops.StreamListener =
|
mailHops.StreamListener =
|
||||||
@ -159,19 +180,26 @@ var regexAllIp = /(1\d{0,2}|2(?:[0-4]\d{0,1}|[6789]|5[0-5]?)?|[3-9]\d?|0)\.(1\d{
|
|||||||
|
|
||||||
var headReceived = mailHops.headers.extractHeader ( "Received" , true ) ;
|
var headReceived = mailHops.headers.extractHeader ( "Received" , true ) ;
|
||||||
var headXOrigIP = mailHops.headers.extractHeader ( "X-Originating-IP" , false ) ;
|
var headXOrigIP = mailHops.headers.extractHeader ( "X-Originating-IP" , false ) ;
|
||||||
|
//auth box
|
||||||
var headXMailer = mailHops.headers.extractHeader ( "X-Mailer" , false ) ;
|
var headXMailer = (mailHops.options.show_auth && mailHops.options.show_mailer) ? mailHops.headers.extractHeader ( "X-Mailer" , false ) : null;
|
||||||
var headUserAgent = mailHops.headers.extractHeader ( "User-Agent" , false ) ;
|
var headUserAgent = (mailHops.options.show_auth && mailHops.options.show_mailer) ? mailHops.headers.extractHeader ( "User-Agent" , false ) : null;
|
||||||
var headXMimeOLE = mailHops.headers.extractHeader ( "X-MimeOLE" , false ) ;
|
var headXMimeOLE = (mailHops.options.show_auth && mailHops.options.show_mailer) ? mailHops.headers.extractHeader ( "X-MimeOLE" , false ) : null;
|
||||||
var headReceivedSPF = mailHops.headers.extractHeader ( "Received-SPF" , false ) ;
|
var headReceivedSPF = (mailHops.options.show_auth && mailHops.options.show_spf) ? mailHops.headers.extractHeader ( "Received-SPF" , false ) : null;
|
||||||
var headAuth = mailHops.headers.extractHeader ( "Authentication-Results" , false ) ;
|
var headAuth = mailHops.options.show_auth ? mailHops.headers.extractHeader ( "Authentication-Results" , false ) : null;
|
||||||
|
//lists box
|
||||||
var headListUnsubscribe = mailHops.headers.extractHeader ( "List-Unsubscribe" , false ) ;
|
var headListUnsubscribe = mailHops.options.show_lists ? mailHops.headers.extractHeader ( "List-Unsubscribe" , false ) : null;
|
||||||
|
|
||||||
//display auth
|
//display auth
|
||||||
|
if(mailHops.options.show_auth)
|
||||||
mailHops.displayResultAuth(headXMailer,headUserAgent,headXMimeOLE,headAuth,headReceivedSPF);
|
mailHops.displayResultAuth(headXMailer,headUserAgent,headXMimeOLE,headAuth,headReceivedSPF);
|
||||||
|
else
|
||||||
|
mailHops.mailhopsAuthContainer.style.display='none';
|
||||||
|
|
||||||
//display unsubscribe link
|
//display unsubscribe link
|
||||||
|
if(mailHops.options.show_lists)
|
||||||
mailHops.displayResultLists(headListUnsubscribe);
|
mailHops.displayResultLists(headListUnsubscribe);
|
||||||
|
else
|
||||||
|
mailHops.mailhopsListContainer.style.display='none';
|
||||||
|
|
||||||
var received_ips;
|
var received_ips;
|
||||||
var all_ips = new Array();
|
var all_ips = new Array();
|
||||||
@ -309,7 +337,7 @@ mailHops.displayResultAuth = function( header_xmailer, header_useragent, header_
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dkim_result){
|
if(mailHops.options.show_dkim && dkim_result){
|
||||||
dkim_result=dkim_result.replace(/^\s+/,"");
|
dkim_result=dkim_result.replace(/^\s+/,"");
|
||||||
var dkimArr=dkim_result.split(' ');
|
var dkimArr=dkim_result.split(' ');
|
||||||
mailHops.mailhopsDataPaneDKIM.setAttribute('value','DKIM: '+dkimArr[0].replace('dkim=',''));
|
mailHops.mailhopsDataPaneDKIM.setAttribute('value','DKIM: '+dkimArr[0].replace('dkim=',''));
|
||||||
@ -320,7 +348,7 @@ mailHops.displayResultAuth = function( header_xmailer, header_useragent, header_
|
|||||||
else{
|
else{
|
||||||
mailHops.mailhopsDataPaneDKIM.style.display='none';
|
mailHops.mailhopsDataPaneDKIM.style.display='none';
|
||||||
}
|
}
|
||||||
if(spf_result){
|
if(mailHops.options.show_spf && spf_result){
|
||||||
spf_result=spf_result.replace(/^\s+/,"");
|
spf_result=spf_result.replace(/^\s+/,"");
|
||||||
var spfArr=spf_result.split(' ');
|
var spfArr=spf_result.split(' ');
|
||||||
mailHops.mailhopsDataPaneSPF.setAttribute('value','SPF: '+spfArr[0].replace('spf=',''));
|
mailHops.mailhopsDataPaneSPF.setAttribute('value','SPF: '+spfArr[0].replace('spf=',''));
|
||||||
@ -387,6 +415,7 @@ switch(result){
|
|||||||
return 'The message was signed, the signature or signatures were acceptable to the verifier, and the signature(s) passed verification tests.';
|
return 'The message was signed, the signature or signatures were acceptable to the verifier, and the signature(s) passed verification tests.';
|
||||||
|
|
||||||
case 'fail':
|
case 'fail':
|
||||||
|
case 'hardfail':
|
||||||
return 'The message was signed and the signature or signatures were acceptable to the verifier, but they failed the verification test(s).';
|
return 'The message was signed and the signature or signatures were acceptable to the verifier, but they failed the verification test(s).';
|
||||||
|
|
||||||
case 'policy':
|
case 'policy':
|
||||||
@ -538,7 +567,7 @@ mailHops.displayResult = function ( header_route, response ){
|
|||||||
//build tooltip
|
//build tooltip
|
||||||
var tiptext = response.route[i].ip;
|
var tiptext = response.route[i].ip;
|
||||||
|
|
||||||
if(!mailHops.showHost){
|
if(!mailHops.options.show_host){
|
||||||
if(response.route[i].host)
|
if(response.route[i].host)
|
||||||
tiptext+=' '+response.route[i].host;
|
tiptext+=' '+response.route[i].host;
|
||||||
if(response.route[i].whois && response.route[i].whois.descr)
|
if(response.route[i].whois && response.route[i].whois.descr)
|
||||||
@ -553,14 +582,14 @@ mailHops.displayResult = function ( header_route, response ){
|
|||||||
mailHops.resultDetails.appendChild(label);
|
mailHops.resultDetails.appendChild(label);
|
||||||
|
|
||||||
//append host
|
//append host
|
||||||
if(mailHops.showHost && response.route[i].host){
|
if(mailHops.options.show_host && response.route[i].host){
|
||||||
var host = document.createElement('label');
|
var host = document.createElement('label');
|
||||||
host.setAttribute('value',response.route[i].host);
|
host.setAttribute('value',response.route[i].host);
|
||||||
mailHops.resultDetails.appendChild(host);
|
mailHops.resultDetails.appendChild(host);
|
||||||
}
|
}
|
||||||
|
|
||||||
//append weather
|
//append weather
|
||||||
if(mailHops.showWeather && response.route[i].weather){
|
if(mailHops.options.show_weather && response.route[i].weather){
|
||||||
var weather = document.createElement('label');
|
var weather = document.createElement('label');
|
||||||
if(response.route[i].weather.image){
|
if(response.route[i].weather.image){
|
||||||
var wimage = response.route[i].weather.image.split('/');
|
var wimage = response.route[i].weather.image.split('/');
|
||||||
@ -570,7 +599,7 @@ mailHops.displayResult = function ( header_route, response ){
|
|||||||
wimage[5] = 'cloudy_night.png';
|
wimage[5] = 'cloudy_night.png';
|
||||||
weather.style.backgroundImage = 'url(chrome://mailhops/content/images/weather/'+wimage[5]+')';
|
weather.style.backgroundImage = 'url(chrome://mailhops/content/images/weather/'+wimage[5]+')';
|
||||||
}
|
}
|
||||||
if(mailHops.unit=='mi')
|
if(mailHops.options.unit=='mi')
|
||||||
weather.setAttribute('value',response.route[i].weather.cond+' '+response.route[i].weather.temp.F+'\u00B0F');
|
weather.setAttribute('value',response.route[i].weather.cond+' '+response.route[i].weather.temp.F+'\u00B0F');
|
||||||
else
|
else
|
||||||
weather.setAttribute('value',response.route[i].weather.cond+' '+response.route[i].weather.temp.C+'\u00B0C');
|
weather.setAttribute('value',response.route[i].weather.cond+' '+response.route[i].weather.temp.C+'\u00B0C');
|
||||||
@ -602,7 +631,7 @@ mailHops.displayResult = function ( header_route, response ){
|
|||||||
else if(countryName)
|
else if(countryName)
|
||||||
displayText = countryName;
|
displayText = countryName;
|
||||||
if(response.distance && response.distance.miles > 0){
|
if(response.distance && response.distance.miles > 0){
|
||||||
if(mailHops.unit=='mi')
|
if(mailHops.options.unit=='mi')
|
||||||
distanceText =' ( '+mailHops.addCommas(Math.round(response.distance.miles))+' mi traveled )';
|
distanceText =' ( '+mailHops.addCommas(Math.round(response.distance.miles))+' mi traveled )';
|
||||||
else
|
else
|
||||||
distanceText =' ( '+mailHops.addCommas(Math.round(response.distance.kilometers))+' km traveled )';
|
distanceText =' ( '+mailHops.addCommas(Math.round(response.distance.kilometers))+' km traveled )';
|
||||||
@ -631,7 +660,7 @@ mailHops.displayResult = function ( header_route, response ){
|
|||||||
mailHops.resultDetailsLink.style.display = 'block';
|
mailHops.resultDetailsLink.style.display = 'block';
|
||||||
mailHops.resultMapLink.style.display = 'block';
|
mailHops.resultMapLink.style.display = 'block';
|
||||||
//show details by default
|
//show details by default
|
||||||
if(mailHops.showDetails){
|
if(mailHops.options.show_details){
|
||||||
mailHops.resultContainerDetails.style.display = 'block';
|
mailHops.resultContainerDetails.style.display = 'block';
|
||||||
mailHops.resultDetailsLink.setAttribute('class','text-link dataPaneMoreLink active');
|
mailHops.resultDetailsLink.setAttribute('class','text-link dataPaneMoreLink active');
|
||||||
}
|
}
|
||||||
@ -736,11 +765,7 @@ mailHops.unregisterObserver = function(){
|
|||||||
|
|
||||||
mailHops.observe = function ( aSubject , aTopic , aData )
|
mailHops.observe = function ( aSubject , aTopic , aData )
|
||||||
{
|
{
|
||||||
if ( aTopic != "nsPref:changed" ){
|
if ( aTopic == "nsPref:changed" )
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//load preferences
|
|
||||||
mailHops.loadPref();
|
mailHops.loadPref();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -771,9 +796,9 @@ mailHops.lookup = function(header_route){
|
|||||||
//call mailhops api for lookup
|
//call mailhops api for lookup
|
||||||
var xmlhttp = new XMLHttpRequest();
|
var xmlhttp = new XMLHttpRequest();
|
||||||
|
|
||||||
var lookupURL='http://api.mailhops.com/v1/lookup/?pb&app='+mailHops.appVersion+'&r='+String(header_route);
|
var lookupURL=mailHops.options.api_url+'/v1/lookup/?pb&app='+mailHops.appVersion+'&r='+String(header_route);
|
||||||
|
|
||||||
if(mailHops.showWeather)
|
if(mailHops.options.show_weather)
|
||||||
lookupURL+='&w=1';
|
lookupURL+='&w=1';
|
||||||
|
|
||||||
xmlhttp.open("GET", lookupURL ,true);
|
xmlhttp.open("GET", lookupURL ,true);
|
||||||
@ -811,19 +836,19 @@ 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('http://www.mailhops.com/whois/'+ip);
|
messenger.launchExternalURL(encodeURIComponent('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('http://www.spamhaus.org/query/bl?ip='+ip);
|
messenger.launchExternalURL(encodeURIComponent('http://www.spamhaus.org/query/bl?ip='+ip));
|
||||||
};
|
};
|
||||||
mailHops.launchMap = function(route){
|
mailHops.launchMap = function(route){
|
||||||
//launch mailhops api map
|
//launch mailhops api map
|
||||||
var lookupURL='http://api.mailhops.com/v1/map/?pb&app='+mailHops.appVersion+'&m='+mailHops.map+'&u='+mailHops.unit+'&r='+String(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.showWeather)
|
if(mailHops.options.show_weather)
|
||||||
lookupURL+='&w=1';
|
lookupURL+='&w=1';
|
||||||
var openwin = window.openDialog(lookupURL,"MailHops",'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,close=yes,width=732,height=332');
|
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();
|
openwin.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,8 +5,20 @@ if (!pref)
|
|||||||
|
|
||||||
var mailHopPreferences =
|
var mailHopPreferences =
|
||||||
{
|
{
|
||||||
|
use_private: null,
|
||||||
|
|
||||||
|
api_url: null,
|
||||||
|
|
||||||
|
hosting: null,
|
||||||
|
|
||||||
loadPreferences: function()
|
loadPreferences: function()
|
||||||
{
|
{
|
||||||
|
this.use_private = document.getElementById("mailhop.use_private");
|
||||||
|
|
||||||
|
this.api_url = document.getElementById("mailhop.api_url");
|
||||||
|
|
||||||
|
this.hosting = document.getElementById("mailhop.hosting");
|
||||||
|
|
||||||
if(pref.getCharPref("mail.mailHops.map",'goog')=='goog')
|
if(pref.getCharPref("mail.mailHops.map",'goog')=='goog')
|
||||||
document.getElementById("mailhop.map").selectedIndex = 0;
|
document.getElementById("mailhop.map").selectedIndex = 0;
|
||||||
else
|
else
|
||||||
@ -17,11 +29,23 @@ var mailHopPreferences =
|
|||||||
else
|
else
|
||||||
document.getElementById("mailhop.unit").selectedIndex = 1;
|
document.getElementById("mailhop.unit").selectedIndex = 1;
|
||||||
|
|
||||||
|
//Display Box Options
|
||||||
if(pref.getCharPref("mail.mailHops.show_details",'true')=='true')
|
if(pref.getCharPref("mail.mailHops.show_details",'true')=='true')
|
||||||
document.getElementById("mailhop.show_details").checked = true;
|
document.getElementById("mailhop.show_details").checked = true;
|
||||||
else
|
else
|
||||||
document.getElementById("mailhop.show_details").checked = false;
|
document.getElementById("mailhop.show_details").checked = false;
|
||||||
|
|
||||||
|
if(pref.getCharPref("mail.mailHops.show_lists",'true')=='true')
|
||||||
|
document.getElementById("mailhop.show_lists").checked = true;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.show_lists").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;
|
||||||
|
|
||||||
|
//Details Options
|
||||||
if(pref.getCharPref("mail.mailHops.show_weather",'false')=='true')
|
if(pref.getCharPref("mail.mailHops.show_weather",'false')=='true')
|
||||||
document.getElementById("mailhop.show_weather").checked = true;
|
document.getElementById("mailhop.show_weather").checked = true;
|
||||||
else
|
else
|
||||||
@ -32,6 +56,44 @@ var mailHopPreferences =
|
|||||||
else
|
else
|
||||||
document.getElementById("mailhop.show_host").checked = false;
|
document.getElementById("mailhop.show_host").checked = false;
|
||||||
|
|
||||||
|
//Auth Options
|
||||||
|
if(pref.getCharPref("mail.mailHops.show_spf",'true')=='true')
|
||||||
|
document.getElementById("mailhop.show_spf").checked = true;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.show_spf").checked = false;
|
||||||
|
|
||||||
|
if(pref.getCharPref("mail.mailHops.show_dkim",'true')=='true')
|
||||||
|
document.getElementById("mailhop.show_dkim").checked = true;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.show_dkim").checked = false;
|
||||||
|
|
||||||
|
if(pref.getCharPref("mail.mailHops.show_mailer",'true')=='true')
|
||||||
|
document.getElementById("mailhop.show_mailer").checked = true;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.show_mailer").checked = false;
|
||||||
|
|
||||||
|
if(pref.getCharPref("mail.mailHops.show_dnsbl",'true')=='true')
|
||||||
|
document.getElementById("mailhop.show_dnsbl").checked = true;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.show_dnsbl").checked = false;
|
||||||
|
|
||||||
|
//Hosting Options
|
||||||
|
if(pref.getCharPref("mail.mailHops.hosting",'personal')=='personal')
|
||||||
|
document.getElementById("mailhop.hosting").selectedIndex = 0;
|
||||||
|
else if(pref.getCharPref("mail.mailHops.hosting",'personal')=='edu')
|
||||||
|
document.getElementById("mailhop.hosting").selectedIndex = 1;
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.hosting").selectedIndex = 2;
|
||||||
|
|
||||||
|
if(pref.getCharPref("mail.mailHops.use_private",'false')=='true'){
|
||||||
|
document.getElementById("mailhop.use_private").checked = true;
|
||||||
|
this.api_url.removeAttribute("disabled");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
document.getElementById("mailhop.use_private").checked = false;
|
||||||
|
|
||||||
|
this.api_url.value = pref.getCharPref("mail.mailHops.api_url",'http://api.mailhops.com');
|
||||||
|
|
||||||
} ,
|
} ,
|
||||||
savePreferences: function()
|
savePreferences: function()
|
||||||
{
|
{
|
||||||
@ -40,5 +102,53 @@ var mailHopPreferences =
|
|||||||
pref.setCharPref("mail.mailHops.show_details", String(document.getElementById("mailhop.show_details").checked)) ;
|
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_weather", String(document.getElementById("mailhop.show_weather").checked)) ;
|
||||||
pref.setCharPref("mail.mailHops.show_host", String(document.getElementById("mailhop.show_host").checked)) ;
|
pref.setCharPref("mail.mailHops.show_host", String(document.getElementById("mailhop.show_host").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_spf", String(document.getElementById("mailhop.show_spf").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_dkim", String(document.getElementById("mailhop.show_dkim").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_mailer", String(document.getElementById("mailhop.show_mailer").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_dnsbl", String(document.getElementById("mailhop.show_dnsbl").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_lists", String(document.getElementById("mailhop.show_lists").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.show_auth", String(document.getElementById("mailhop.show_auth").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.use_private", String(document.getElementById("mailhop.use_private").checked)) ;
|
||||||
|
pref.setCharPref("mail.mailHops.hosting", document.getElementById("mailhop.hosting").selectedItem.value) ;
|
||||||
|
pref.setCharPref("mail.mailHops.api_url", String(document.getElementById("mailhop.api_url").value)) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ChangePrivate(item){
|
||||||
|
if(item.checked){
|
||||||
|
mailHopPreferences.api_url.removeAttribute("disabled");
|
||||||
|
mailHopPreferences.api_url.focus();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
mailHopPreferences.api_url.setAttribute("disabled","true");
|
||||||
|
mailHopPreferences.api_url.value='http://api.mailhops.com';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function TestConnection(){
|
||||||
|
var xmlhttp = new XMLHttpRequest();
|
||||||
|
var nativeJSON = Components.classes["@mozilla.org/dom/json;1"].createInstance(Components.interfaces.nsIJSON);
|
||||||
|
var lookupURL=mailHopPreferences.api_url.value+'/v1/lookup/?pb&app='+mailHops.appVersion+'&watchmouse';
|
||||||
|
xmlhttp.open("GET", lookupURL ,true);
|
||||||
|
xmlhttp.onreadystatechange=function() {
|
||||||
|
if (xmlhttp.readyState==4) {
|
||||||
|
try{
|
||||||
|
var data = JSON.parse(xmlhttp.responseText);
|
||||||
|
if(data && data.meta.code==200){
|
||||||
|
alert('Connection Succeeded to '+mailHopPreferences.api_url.value+'!');
|
||||||
|
} else {
|
||||||
|
//display the error
|
||||||
|
alert('Connection Failed to '+mailHopPreferences.api_url.value+'!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex){
|
||||||
|
alert('Connection Failed to '+mailHopPreferences.api_url.value+'!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ResetConnection(){
|
||||||
|
mailHopPreferences.api_url.value='http://api.mailhops.com';
|
||||||
|
}
|
@ -13,7 +13,16 @@
|
|||||||
<script type="application/x-javascript" src="chrome://mailhops/content/mailhops.js"/>
|
<script type="application/x-javascript" src="chrome://mailhops/content/mailhops.js"/>
|
||||||
<script type="application/x-javascript" src="chrome://mailhops/content/preferences.js"/>
|
<script type="application/x-javascript" src="chrome://mailhops/content/preferences.js"/>
|
||||||
|
|
||||||
<vbox width="200px">
|
<vbox width="400px">
|
||||||
|
<tabbox id="mhTabs" selectedIndex="0">
|
||||||
|
<tabs>
|
||||||
|
<tab label="Defaults"/>
|
||||||
|
<tab label="Display"/>
|
||||||
|
<tab label="Authentication"/>
|
||||||
|
<tab label="Hosting"/>
|
||||||
|
</tabs>
|
||||||
|
<tabpanels>
|
||||||
|
<tabpanel>
|
||||||
<groupbox>
|
<groupbox>
|
||||||
<caption label="Default Map"/>
|
<caption label="Default Map"/>
|
||||||
<radiogroup id="mailhop.map">
|
<radiogroup id="mailhop.map">
|
||||||
@ -29,13 +38,48 @@
|
|||||||
<radio value="km" label="Kilometers"/>
|
<radio value="km" label="Kilometers"/>
|
||||||
</radiogroup>
|
</radiogroup>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
|
</tabpanel>
|
||||||
|
<tabpanel>
|
||||||
<groupbox>
|
<groupbox>
|
||||||
<caption label="Display Options"/>
|
<caption label="Display Boxes"/>
|
||||||
<checkbox id="mailhop.show_details" label="Show Details" checked="false"/>
|
<checkbox id="mailhop.show_details" label="Show Details" checked="false"/>
|
||||||
<checkbox id="mailhop.show_weather" label="Show Weather" checked="false"/>
|
<checkbox id="mailhop.show_auth" label="Show Auth" checked="true"/>
|
||||||
<checkbox id="mailhop.show_host" label="Show Host" checked="false"/>
|
<checkbox id="mailhop.show_lists" label="Show Unsubscribe Links" checked="true"/>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
|
<groupbox>
|
||||||
|
<caption label="Details Options"/>
|
||||||
|
<checkbox id="mailhop.show_host" label="Show Host" checked="false"/>
|
||||||
|
<checkbox id="mailhop.show_weather" label="Show Weather" checked="false"/>
|
||||||
|
</groupbox>
|
||||||
|
</tabpanel>
|
||||||
|
<tabpanel>
|
||||||
|
<groupbox>
|
||||||
|
<caption label="Authentication Options"/>
|
||||||
|
<checkbox id="mailhop.show_mailer" label="Show Mailer" checked="true"/>
|
||||||
|
<checkbox id="mailhop.show_spf" label="Show SPF" checked="true"/>
|
||||||
|
<checkbox id="mailhop.show_dkim" label="Show DKIM" checked="true"/>
|
||||||
|
<checkbox id="mailhop.show_dnsbl" label="Show DNS Blacklist" checked="true"/>
|
||||||
|
</groupbox>
|
||||||
|
</tabpanel>
|
||||||
|
<tabpanel>
|
||||||
|
<groupbox>
|
||||||
|
<caption label="MailHops API Hosting"/>
|
||||||
|
<description>
|
||||||
|
MailHops API is also available for download if you would like to host your own.
|
||||||
|
</description>
|
||||||
|
<radiogroup id="mailhop.hosting">
|
||||||
|
<radio value="personal" label="Personal (Free)" selected="true"/>
|
||||||
|
<radio value="edu" label="Educational (Free)"/>
|
||||||
|
<radio value="business" label="Business (Not-Free)"/>
|
||||||
|
</radiogroup>
|
||||||
|
<checkbox id="mailhop.use_private" label="Yes, I Agree to MailHops terms for the use of private hosting." checked="false" oncommand="ChangePrivate(this);"/>
|
||||||
|
<label class="text-link" value="MailHops Terms and Conditions" href="http://www.mailhops.com/terms"/>
|
||||||
|
<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" />
|
||||||
|
</groupbox>
|
||||||
|
</tabpanel>
|
||||||
|
</tabpanels>
|
||||||
|
</tabbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
</dialog>
|
</dialog>
|
||||||
|
@ -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.2</em:version>
|
<em:version>0.6.9.3</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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user