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

Added Lists box for unsubscribe links

This commit is contained in:
Andrew Van Tassel 2012-02-07 18:53:53 -07:00
parent 1b8c098ddc
commit 924c73046e
7 changed files with 33 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

View File

@ -169,8 +169,7 @@ var regexAllIp = /(1\d{0,2}|2(?:[0-4]\d{0,1}|[6789]|5[0-5]?)?|[3-9]\d?|0)\.(1\d{
//display auth //display auth
mailHops.displayResultAuth(headXMailer,headUserAgent,headXMimeOLE,headAuth,headReceivedSPF); mailHops.displayResultAuth(headXMailer,headUserAgent,headXMimeOLE,headAuth,headReceivedSPF);
//display unsubscribe link //display unsubscribe link
if(headListUnsubscribe) mailHops.displayResultLists(headListUnsubscribe);
mailHops.displayResultLists(headListUnsubscribe);
var received_ips; var received_ips;
var all_ips = new Array(); var all_ips = new Array();
@ -240,30 +239,40 @@ mailHops.testIP = function(ip,header){
return retval; return retval;
}; };
mailHops.displayResultLists = function( header_unsubscribe){ mailHops.displayResultLists = function( header_unsubscribe ){
while(mailHops.resultListDataPane.firstChild) { while(mailHops.resultListDataPane.firstChild) {
mailHops.resultListDataPane.removeChild(mailHops.resultListDataPane.firstChild); mailHops.resultListDataPane.removeChild(mailHops.resultListDataPane.firstChild);
} }
var listArr=header_unsubscribe.split(','); if(header_unsubscribe){
var href=''; var listArr=header_unsubscribe.split(',');
for(var h=0;h<listArr.length;h++){ var href='';
href = listArr[h].replace('<','').replace('>',''); if(listArr.length!=0){
var link = document.createElement('a'); for(var h=0;h<listArr.length;h++){
link.setAttribute('href',href); href = listArr[h].replace('<','').replace('>','');
if(href.indexOf('mailto:')!=-1) var label = document.createElement('label');
link.innerHTML='Unsubscribe via Email';
else
link.innerHTML='Unsubscribe';
mailHops.resultListDataPane.appendChild(link);
}
if(!href)
mailHops.mailhopsListContainer.style.display='none';
else{
mailHops.mailhopsListContainer.style.display='block';
}
label.setAttribute('class','text-link dataPaneURLitem');
if(href.indexOf('mailto:')!=-1){
label.setAttribute('value','Unsubscribe via Email');
if(href.toLowerCase().indexOf('subject=')==-1){
if(href.indexOf('?')==-1)
href+='?subject=Unsubscribe';
else
href+='&subject=Unsubscribe';
}
}
else{
label.setAttribute('value','Unsubscribe');
}
label.setAttribute('href',href);
mailHops.resultListDataPane.appendChild(label);
}
}
}
}; };
mailHops.displayResultAuth = function( header_xmailer, header_useragent, header_xmimeole, header_auth, header_spf ){ mailHops.displayResultAuth = function( header_xmailer, header_useragent, header_xmimeole, header_auth, header_spf ){

View File

@ -48,14 +48,12 @@
<vbox id="dataPaneMailHopsListContainer" class="dataPaneBox"> <vbox id="dataPaneMailHopsListContainer" class="dataPaneBox">
<hbox flex="1" pack="start" align="center"> <hbox flex="1" pack="start" align="center">
<label class="dataPaneHeader" crop="right" value="List Info"></label> <label class="dataPaneHeader" crop="right" value="Lists"></label>
<separator class="dataPaneBoxSeparator" flex="1"></separator> <separator class="dataPaneBoxSeparator" flex="1"></separator>
</hbox> </hbox>
<vbox id="mailhopsListDataPane" flex="1"> <vbox id="mailhopsListDataPane" flex="1">
</vbox> </vbox>
</vbox> </vbox>
</vbox> </vbox>

View File

@ -56,7 +56,3 @@
.auth-item{ .auth-item{
display: none; display: none;
} }
#dataPaneMailHopsListContainer{
display: none;
}

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.4</em:version> <em:version>0.6.5</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.4-pb.xpi Normal file

Binary file not shown.

BIN
mailhops-0.6.5-pb.xpi Normal file

Binary file not shown.