mirror of
https://github.com/MailHops/mailhops-plugin.git
synced 2025-05-17 14:50:08 -07:00
Added Lists box for unsubscribe links
This commit is contained in:
parent
1b8c098ddc
commit
924c73046e
BIN
chrome/content/images/info.png
Normal file
BIN
chrome/content/images/info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 778 B |
@ -169,7 +169,6 @@ var regexAllIp = /(1\d{0,2}|2(?:[0-4]\d{0,1}|[6789]|5[0-5]?)?|[3-9]\d?|0)\.(1\d{
|
||||
//display auth
|
||||
mailHops.displayResultAuth(headXMailer,headUserAgent,headXMimeOLE,headAuth,headReceivedSPF);
|
||||
//display unsubscribe link
|
||||
if(headListUnsubscribe)
|
||||
mailHops.displayResultLists(headListUnsubscribe);
|
||||
|
||||
var received_ips;
|
||||
@ -246,24 +245,34 @@ mailHops.displayResultLists = function( header_unsubscribe){
|
||||
mailHops.resultListDataPane.removeChild(mailHops.resultListDataPane.firstChild);
|
||||
}
|
||||
|
||||
if(header_unsubscribe){
|
||||
var listArr=header_unsubscribe.split(',');
|
||||
var href='';
|
||||
if(listArr.length!=0){
|
||||
for(var h=0;h<listArr.length;h++){
|
||||
href = listArr[h].replace('<','').replace('>','');
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('href',href);
|
||||
if(href.indexOf('mailto:')!=-1)
|
||||
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';
|
||||
}
|
||||
var label = document.createElement('label');
|
||||
|
||||
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 ){
|
||||
|
@ -48,14 +48,12 @@
|
||||
|
||||
<vbox id="dataPaneMailHopsListContainer" class="dataPaneBox">
|
||||
<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>
|
||||
</hbox>
|
||||
|
||||
<vbox id="mailhopsListDataPane" flex="1">
|
||||
|
||||
</vbox>
|
||||
|
||||
</vbox>
|
||||
|
||||
</vbox>
|
||||
|
@ -56,7 +56,3 @@
|
||||
.auth-item{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#dataPaneMailHopsListContainer{
|
||||
display: none;
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<em:id>postbox@mailhops.com</em:id>
|
||||
<em:type>2</em:type>
|
||||
<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:iconURL>chrome://mailhops/content/images/mailhops32.png</em:iconURL>
|
||||
<em:homepageURL>http://mailhops.com</em:homepageURL>
|
||||
|
BIN
mailhops-0.6.4-pb.xpi
Normal file
BIN
mailhops-0.6.4-pb.xpi
Normal file
Binary file not shown.
BIN
mailhops-0.6.5-pb.xpi
Normal file
BIN
mailhops-0.6.5-pb.xpi
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user