Skip to content

Commit

Permalink
Folder view for the new yahoo interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen1956 authored Nov 27, 2017
1 parent 710a525 commit 795bb77
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/scripts/yahoo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***********************************************************
Yahoo XN 4.1.3 to vs 3 (re-implement cookieManager)
Yahoo
***********************************************************/
var supportInboxOnly=true;
var supportShowFolders=true;
Expand Down Expand Up @@ -32,6 +32,11 @@ function init(){
function checkLogin(aData){
switch(this.stage){
case ST_CHECK:
if(this.cookies){
this.stage=ST_DATA;
this.setCookies();
return true;
}
this.getHtml(this.viewURL);
return false;
case ST_CHECK+1:
Expand Down Expand Up @@ -219,9 +224,9 @@ function getData(aData){
if(fid=="Trash")continue;
var n=o.unread;
if(fid=="%40B%40Bulk"){
if(this.includeSpam==2)num+=n;
if(this.includeSpam==2)num+=n;
}else if(this.inboxOnly){
if(fid=="Inbox")num+=n;
if(fid=="Inbox")num+=n;
}else num+=n;
if(n>0&&fid!="Inbox"){
var fn=fid=="%40B%40Bulk"?this.spamName:unescape(o.folderInfo.name.replace(/\\u/g,"%u"));
Expand All @@ -237,7 +242,7 @@ function getData(aData){
}else if(this.mode==1||this.mode==0){
fnd=fnd[1];
if(this.mode==1&&(!this.inboxOnly||this.showFolders)){
var fnd2=aData.match(/<div\s+id="customfolders">([\s\S]+?)<\/ol>/);
var fnd2=aData.match(/<div\s+id="customfolders">([\s\S]+?)<\/ol>/);
if(fnd2){
fnd+=fnd2[1];
}
Expand Down Expand Up @@ -276,6 +281,10 @@ function getData(aData){
return obj;
}
function getViewURL(aFolder){
if((this.mode==3)&&aFolder&&this.dataURLCopy){
var url=this.dataURLCopy+"/folders/"+encodeURIComponent(aFolder);
return url;
}
if((this.mode==2||this.mode==0)&&aFolder&&this.dataURLCopy){
var url=this.dataURLCopy+"&fid="+encodeURIComponent(aFolder);
return url;
Expand Down

0 comments on commit 795bb77

Please sign in to comment.