/* Alesti (C) 2006 by Oliver Maruhn */ version=0.799907;language="English";auto_detect_language=1; var JSON={copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(v){var a=[];function e(s){a[a.length]=s;} function g(x){var c,i,l,v;switch(typeof x){case"object":if(x){if(x instanceof Array){e("[");l=a.length;for(i=0;i=" "){if(c=="\\"||c=="\""){e("\\");} e(c);}else{switch(c){case"\b":e("\\b");break;case"\f":e("\\f");break;case"\n":e("\\n");break;case"\r":e("\\r");break;case"\t":e("\\t");break;default:c=c.charCodeAt();e("\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16));}}} e("\"");return;case"boolean":e(String(x));return;default:e("null");return;}} g(v);return a.join("");},parse:function(_6){return(/^(\s+|[,:{}\[\]]|"(\\["\\\/bfnrtu]|[^\x00-\x1f"\\]+)*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)+$/.test(_6))&&eval("("+_6+")");}}; var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf("opera");if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else{if(navigator.vendor!="KDE"&&document.all&&xUA.indexOf("msie")!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf("msie 4")!=-1;xIE5=xUA.indexOf("msie 5")!=-1;}else{if(document.layers){xNN4=true;}}} xMac=xUA.indexOf("mac")!=-1;function xBackground(e,c,i){if(!(e=xGetElementById(e))){return"";} var bg="";if(e.style){if(xStr(c)){if(!xOp6Dn){e.style.backgroundColor=c;}else{e.style.background=c;}} if(xStr(i)){e.style.backgroundImage=(i!="")?"url("+i+")":null;} if(!xOp6Dn){bg=e.style.backgroundColor;}else{bg=e.style.background;}} return bg;} function xClientHeight(){var h=0;if(xOp6Dn){h=window.innerHeight;}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight;}else{if(document.body&&document.body.clientHeight){h=document.body.clientHeight;}else{if(xDef(window.innerWidth,window.innerHeight,document.width)){h=window.innerHeight;if(document.width>window.innerWidth){h-=16;}}}}} return h;} function xClientWidth(){var w=0;if(xOp6Dn){w=window.innerWidth;}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientWidth){w=document.documentElement.clientWidth;}else{if(document.body&&document.body.clientWidth){w=document.body.clientWidth;}else{if(xDef(window.innerWidth,window.innerHeight,document.height)){w=window.innerWidth;if(document.height>window.innerHeight){w-=16;}}}}} return w;} function xClip(e,t,r,b,l){if(!(e=xGetElementById(e))){return;} if(e.style){if(xNum(l)){e.style.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";}else{e.style.clip="rect(0 "+parseInt(e.style.width)+"px "+parseInt(e.style.height)+"px 0)";}}} function xColor(e,s){if(!(e=xGetElementById(e))){return"";} var c="";if(e.style&&xDef(e.style.color)){if(xStr(s)){e.style.color=s;} c=e.style.color;} return c;} function xDef(){for(var i=0;i=eX+l&&x<=eX+xWidth(e)-r&&y>=eY+t&&y<=eY+xHeight(e)-b);} function xHeight(e,h){if(!(e=xGetElementById(e))){return 0;} if(xNum(h)){if(h<0){h=0;}else{h=Math.round(h);}}else{h=-1;} var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=="html"||e.tagName.toLowerCase()=="body"){h=xClientHeight();}else{if(css&&xDef(e.offsetHeight)&&xStr(e.style.height)){if(h>=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=="CSS1Compat"){var gcs=xGetComputedStyle;pt=gcs(e,"padding-top",1);if(pt!==null){pb=gcs(e,"padding-bottom",1);bt=gcs(e,"border-top-width",1);bb=gcs(e,"border-bottom-width",1);}else{if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+"px";pt=e.offsetHeight-h;}}} h-=(pt+pb+bt+bb);if(isNaN(h)||h<0){return;}else{e.style.height=h+"px";}} h=e.offsetHeight;}else{if(css&&xDef(e.style.pixelHeight)){if(h>=0){e.style.pixelHeight=h;} h=e.style.pixelHeight;}}} return h;} function xHide(e){return xVisibility(e,0);} function xLeft(e,iX){if(!(e=xGetElementById(e))){return 0;} var css=xDef(e.style);if(css&&xStr(e.style.left)){if(xNum(iX)){e.style.left=iX+"px";}else{iX=parseInt(e.style.left);if(isNaN(iX)){iX=0;}}}else{if(css&&xDef(e.style.pixelLeft)){if(xNum(iX)){e.style.pixelLeft=iX;}else{iX=e.style.pixelLeft;}}} return iX;} function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y);} function xNum(){for(var i=0;i=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=="CSS1Compat"){var gcs=xGetComputedStyle;pl=gcs(e,"padding-left",1);if(pl!==null){pr=gcs(e,"padding-right",1);bl=gcs(e,"border-left-width",1);br=gcs(e,"border-right-width",1);}else{if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+"px";pl=e.offsetWidth-w;}}} w-=(pl+pr+bl+br);if(isNaN(w)||w<0){return;}else{e.style.width=w+"px";}} w=e.offsetWidth;}else{if(css&&xDef(e.style.pixelWidth)){if(w>=0){e.style.pixelWidth=w;} w=e.style.pixelWidth;}}} return w;} function xZIndex(e,uZ){if(!(e=xGetElementById(e))){return 0;} if(e.style&&xDef(e.style.zIndex)){if(xNum(uZ)){e.style.zIndex=uZ;} uZ=parseInt(e.style.zIndex);} return uZ;} function xDisableDrag(id,_2){if(!window._xDrgMgr){return;} var _3=xGetElementById(id);_3.xDraggable=false;_3.xODS=null;_3.xOD=null;_3.xODE=null;xRemoveEventListener(_3,"mousedown",_xOMD,false);if(_xDrgMgr.mm&&_2){_xDrgMgr.mm=false;xRemoveEventListener(document,"mousemove",_xOMM,false);}} var _xDrgMgr={ele:null,mm:false};function xEnableDrag(id,fS,fD,fE){var _8=xGetElementById(id);_8.xDraggable=true;_8.xODS=fS;_8.xOD=fD;_8.xODE=fE;xAddEventListener(_8,"mousedown",_xOMD,false);if(!_xDrgMgr.mm){_xDrgMgr.mm=true;xAddEventListener(document,"mousemove",_xOMM,false);}} function _xOMD(e){var _a=new xEvent(e);var _b=_a.target;while(_b&&!_b.xDraggable){_b=xParent(_b);} if(_b){xPreventDefault(e);_b.xDPX=_a.pageX;_b.xDPY=_a.pageY;_xDrgMgr.ele=_b;xAddEventListener(document,"mouseup",_xOMU,false);if(_b.xODS){_b.xODS(_b,_a.pageX,_a.pageY);}}} function _xOMM(e){var _d=new xEvent(e);if(_xDrgMgr.ele){xPreventDefault(e);var _e=_xDrgMgr.ele;var dx=_d.pageX-_e.xDPX;var dy=_d.pageY-_e.xDPY;_e.xDPX=_d.pageX;_e.xDPY=_d.pageY;if(_e.xOD){_e.xOD(_e,dx,dy);}else{xMoveTo(_e,xLeft(_e)+dx,xTop(_e)+dy);}}} function _xOMU(e){if(_xDrgMgr.ele){xPreventDefault(e);xRemoveEventListener(document,"mouseup",_xOMU,false);if(_xDrgMgr.ele.xODE){var evt=new xEvent(e);_xDrgMgr.ele.xODE(_xDrgMgr.ele,evt.pageX,evt.pageY);} _xDrgMgr.ele=null;}} function xDeleteCookie(_1,_2){if(xGetCookie(_1)){document.cookie=_1+"="+"; path="+((!_2)?"/":_2)+"; expires="+new Date(0).toGMTString();}} function xGetCookie(_3){var _4=null,search=_3+"=";if(document.cookie.length>0){var _5=document.cookie.indexOf(search);if(_5!=-1){_5+=search.length;var _6=document.cookie.indexOf(";",_5);if(_6==-1){_6=document.cookie.length;} _4=unescape(document.cookie.substring(_5,_6));}} return _4;} function xSetCookie(_7,_8,_9,_a){document.cookie=_7+"="+escape(_8)+((!_9)?"":("; expires="+_9.toGMTString()))+"; path="+((!_a)?"/":_a);} function xAddEventListener(e,eT,eL,_4){if(!(e=xGetElementById(e))){return;} eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=="resize"){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=eL;xResizeEvent();return;} if(eT=="scroll"){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=eL;xScrollEvent();return;}} var eh="e.on"+eT+"=eL";if(e.addEventListener){e.addEventListener(eT,eL,_4);}else{if(e.attachEvent){e.attachEvent("on"+eT,eL);}else{eval(eh);}}} function xResizeEvent(){if(window.xREL){setTimeout("xResizeEvent()",250);} var cw=xClientWidth(),ch=xClientHeight();if(window.xPCW!=cw||window.xPCH!=ch){window.xPCW=cw;window.xPCH=ch;if(window.xREL){window.xREL();}}} function xScrollEvent(){if(window.xSEL){setTimeout("xScrollEvent()",250);} var sl=xScrollLeft(),st=xScrollTop();if(window.xPSL!=sl||window.xPST!=st){window.xPSL=sl;window.xPST=st;if(window.xSEL){window.xSEL();}}} function xEvent(_8){var e=_8||window.event;if(!e){return;} if(e.type){this.type=e.type;} if(e.target){this.target=e.target;}else{if(e.srcElement){this.target=e.srcElement;}} if(e.relatedTarget){this.relatedTarget=e.relatedTarget;}else{if(e.type=="mouseover"&&e.fromElement){this.relatedTarget=e.fromElement;}else{if(e.type=="mouseout"){this.relatedTarget=e.toElement;}}} if(xOp6Dn){this.pageX=e.clientX;this.pageY=e.clientY;}else{if(xDef(e.pageX,e.pageY)){this.pageX=e.pageX;this.pageY=e.pageY;}else{if(xDef(e.clientX,e.clientY)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop();}}} if(xDef(e.offsetX,e.offsetY)){this.offsetX=e.offsetX;this.offsetY=e.offsetY;}else{if(xDef(e.layerX,e.layerY)){this.offsetX=e.layerX;this.offsetY=e.layerY;}else{this.offsetX=this.pageX-xPageX(this.target);this.offsetY=this.pageY-xPageY(this.target);}} if(e.keyCode){this.keyCode=e.keyCode;}else{if(xDef(e.which)&&e.type.indexOf("key")!=-1){this.keyCode=e.which;}} this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey;this.altKey=e.altKey;} function xPreventDefault(e){if(e&&e.preventDefault){e.preventDefault();}else{if(window.event){window.event.returnValue=false;}}} function xRemoveEventListener(e,eT,eL,_e){if(!(e=xGetElementById(e))){return;} eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=="resize"){window.xREL=null;return;} if(eT=="scroll"){window.xSEL=null;return;}} var eh="e.on"+eT+"=null";if(e.removeEventListener){e.removeEventListener(eT,eL,_e);}else{if(e.detachEvent){e.detachEvent("on"+eT,eL);}else{eval(eh);}}} function xStopPropagation(evt){if(evt&&evt.stopPropagation){evt.stopPropagation();}else{if(window.event){window.event.cancelBubble=true;}}} function purge(d){if(!d){return;} var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i0?str+ps:ps+str;};var _21=function(_22,_23,rs,arg){var pn=function(_27,arg,rs){if(arg>=0){if(_27.indexOf(" ")>=0){rs=" "+rs;}else{if(_27.indexOf("+")>=0){rs="+"+rs;}}}else{rs="-"+rs;} return rs;};var _2a=parseInt(_23,10);if(_23.charAt(0)=="0"){var ec=0;if(_22.indexOf(" ")>=0||_22.indexOf("+")>=0){ec++;} if(rs.length<(_2a-ec)){rs=pad(rs,"0",rs.length-(_2a-ec));} return pn(_22,arg,rs);} rs=pn(_22,arg,rs);if(rs.length<_2a){if(_22.indexOf("-")<0){rs=pad(rs," ",rs.length-_2a);}else{rs=pad(rs," ",_2a-rs.length);}} return rs;};var _2c=[];_2c.c=function(_2d,_2e,_2f,arg){if(typeof(arg)=="number"){return String.fromCharCode(arg);}else{if(typeof(arg)=="string"){return arg.charAt(0);}else{return"";}}};_2c.d=function(_31,_32,_33,arg){return _2c.i(_31,_32,_33,arg);};_2c.u=function(_35,_36,_37,arg){return _2c.i(_35,_36,_37,Math.abs(arg));};_2c.i=function(_39,_3a,_3b,arg){var _3d=parseInt(_3b,10);var rs=((Math.abs(arg)).toString().split("."))[0];if(rs.length<_3d){rs=pad(rs," ",_3d-rs.length);} return _21(_39,_3a,rs,arg);};_2c.E=function(_3f,_40,_41,arg){return(_2c.e(_3f,_40,_41,arg)).toUpperCase();};_2c.e=function(_43,_44,_45,arg){iPrecision=parseInt(_45,10);if(isNaN(iPrecision)){iPrecision=6;} rs=(Math.abs(arg)).toExponential(iPrecision);if(rs.indexOf(".")<0&&_43.indexOf("#")>=0){rs=rs.replace(/^(.*)(e.*)$/,"$1.$2");} return _21(_43,_44,rs,arg);};_2c.f=function(_47,_48,_49,arg){iPrecision=parseInt(_49,10);if(isNaN(iPrecision)){iPrecision=6;} rs=(Math.abs(arg)).toFixed(iPrecision);if(rs.indexOf(".")<0&&_47.indexOf("#")>=0){rs=rs+".";} return _21(_47,_48,rs,arg);};_2c.G=function(_4b,_4c,_4d,arg){return(_2c.g(_4b,_4c,_4d,arg)).toUpperCase();};_2c.g=function(_4f,_50,_51,arg){iPrecision=parseInt(_51,10);absArg=Math.abs(arg);rse=absArg.toExponential();rsf=absArg.toFixed(6);if(!isNaN(iPrecision)){rsep=absArg.toExponential(iPrecision);rse=rsep.length=0){rse=rse.replace(/^(.*)(e.*)$/,"$1.$2");} if(rsf.indexOf(".")<0&&_4f.indexOf("#")>=0){rsf=rsf+".";} rs=rse.length=0){rs="0"+rs;} return _21(_53,_54,rs,arg);};_2c.X=function(_59,_5a,_5b,arg){return(_2c.x(_59,_5a,_5b,arg)).toUpperCase();};_2c.x=function(_5d,_5e,_5f,arg){var _61=parseInt(_5f,10);arg=Math.abs(arg);var rs=Math.round(arg).toString(16);if(rs.length<_61){rs=pad(rs," ",_61-rs.length);} if(_5d.indexOf("#")>=0){rs="0x"+rs;} return _21(_5d,_5e,rs,arg);};_2c.s=function(_63,_64,_65,arg){var _67=parseInt(_65,10);var rs=arg;if(rs.length>_67){rs=rs.substring(0,_67);} return _21(_63,_64,rs,0);};farr=_1a.split("%");retstr=farr[0];fpRE=/^([-+ #]*)(?:(\d*)\$|)(\d*)\.?(\d*)([cdieEfFgGosuxX])(.*)$/;for(var i=1;i

←"+"Public subscriptions of %s".sprintf(xGetCookie("public"))+"

"+"This is a read-only view. You can browse this collection of subscriptions or download it as OPML."+"
";}else{help.draw();} setTimeout(data.init5,100);};data.init5=function data_init5(){io.post("c=publisher_data"+"&publisher_id="+state.order_publisher_ids.join(","),function data_init_io_callback2(_4){eval(_4);setTimeout(data.init6,100);});};data.init6=function data_init6(){publishers_list.refresh({"show_loading":0,"fetch":0,"refresh_all":0});data.auto_update();};data.update=function data_init(){io.fetch("?"+"c=articles_update"+"×tamp="+data.timestamp+"&uid="+(xGetCookie("uid")||0)+"&sid="+Math.random(),function data_update_io_callback(_5){eval(_5);publishers_list.refresh();articles_list.refresh();});};data.auto_update=function data_auto_update(){setInterval(data.auto_update_real,30*1000);};data.last_auto_update=(new Date()).getTime();data.auto_update_real=function data_auto_update_real(){if(!data.timestamp&&!data.articles_list_included){return;} if((new Date()).getTime()-data.last_auto_update>=2*60*1000){data.last_auto_update=(new Date()).getTime();data.update();}};data.include_publishers=function data_include_publishers(_6){var _7=_6.length;var i=0;data.timestamp=_6[i];++i;state.order_publisher_ids=[];while(i<_7){var id=_6[i];++i;data.publishers[id]={};data.publishers[id].article_ids=[];data.publishers[id].name=_6[i];++i;data.publishers[id].num_unread_articles=_6[i];++i;data.publishers[id].tags=_6[i].slice();++i;state.order_publisher_ids.push(id);}};data.include_publisher_data=function data_include_publisher_data(_a){var _b=_a.length;var i=0;while(i<_b){var id=_a[i];++i;if(!data.publishers[id]){data.publishers[id]={};data.publishers[publisher_ref].article_ids=[];data.publishers[publisher_ref].num_unread_articles=0;} data.publishers[id].url=_a[i];++i;data.publishers[id].feed_url=_a[i];++i;data.publishers[id].original_name=_a[i];++i;data.publishers[id].is_public=_a[i];++i;data.publishers[id].show_body=_a[i];++i;data.publishers[id].show_original=_a[i];++i;data.publishers[id].show_author=_a[i];++i;data.publishers[id].http_status=_a[i];++i;}};data.include_articles=function data_include_articles(_e){var _f=_e.length;var i=0;for(var id in data.publishers){data.publishers[id].num_unread_articles=0;} var _12=-1;while(i<_f){if(_e[i]==0){++i;_12=_e[i];++i;if(data.publishers[_12]){data.publishers[_12].num_unread_articles=0;data.publishers[_12].headlines_loaded=1;} continue;} if(data.publishers[_12]){var id=_e[i];++i;data.articles[id]={};data.articles[id].date=_e[i];++i;data.articles[id].title=_e[i];++i;data.articles[id].publisher_ref=_12;data.articles[id].is_unread=1;data.publishers[_12].article_ids.push(id);if(_12>100){++data.publishers[_12].num_unread_articles;}}else{i+=3;}} data.articles_list_included=1;};data.include_article_data=function data_include_article_data(_13){var _14=_13.length;var i=0;while(i<_14){var id=_13[i];++i;if(!data.articles[id]){data.articles[id]={};} data.articles[id].url=_13[i];++i;data.articles[id].author=_13[i];++i;data.articles[id].is_bookmarked=_13[i];++i;}};data.include_article_bodies=function data_include_article_bodies(_17){var _18=_17.length;var i=0;while(i<_18){var id=_17[i];++i;if(!data.articles[id]){data.articles[id]={};} data.articles[id].body=_17[i];++i;}};data.add_articles=function data_add_articles(_1b,_1c){var _1d=(_1c===undefined)?{}:_1c;var _1e=_1b.length;var i=0;data.timestamp=_1b[i];++i;if(_1e==1){return;} var _20=1;if(_1d["is_unread"]!==undefined){if(_1d["is_unread"]==0){_20=0;}} var _21=-1;while(i<_1e){if(_1b[i]==0){++i;_21=_1b[i];++i;if(!data.publishers[_21]){alert("Error in data.add_articles: data.publishers["+_21+"] === undefined");} data.publishers[_21].headlines_loaded=1;} var id=_1b[i];++i;if(data.articles[id]){i+=4;continue;} data.articles[id]={};data.articles[id].date=_1b[i];++i;data.articles[id].title=_1b[i];++i;data.articles[id].publisher_ref=_21;data.articles[id].is_unread=_20;data.articles[id].url=_1b[i];++i;data.articles[id].author=_1b[i];++i;data.publishers[_21].article_ids.unshift(id);if(_20==1){++data.publishers[_21].num_unread_articles;}}}; var storage={};storage.save_object=function storage_save_object(_1,_2){console("saving object '"+_1+"'");storage.save_string(_1,JSON.stringify(_2));};storage.save_string=function storage_save_string(_3,_4){console("saving string '"+_3+"'");var el=document.getElementById(_3);el.value=_4;};storage.load_object=function storage_load_object(_6){console("loading object'"+_6+"'");var el=document.getElementById(_6);var _8;if(el&&el.value){console("loading object'"+_6+"' found");_8=eval("("+el.value+")");}else{console("loading object'"+_6+"' NOT found");_8=null;} return _8;};storage.exists=function storage_exists(_9){return document.getElementById(_9);};storage.send_state=function storage_send_state(_a){var _b={};_b.plist_show_read=state.plist_show_read;_b.sep_v_precent=state.sep_v_precent;_b.sep_h_precent=state.sep_h_precent;_b.show_feed_icons=state.show_feed_icons;_b.menu_icons=state.menu_icons;io.post("c=save_state"+"&state="+encodeURIComponent(JSON.stringify(_b)),function storage_send_state_onreadystatechange_and_callback(){if(_a){_a();}});};storage.fetch_state=function storage_fetch_state(_c){io.post("c=state",function storage_fetch_state_onreadystatechange_and_callback(_d){if(_d.length>0){state=eval("("+_d+")");}else{state={};} if(state.plist_show_read===undefined){state.plist_show_read=0;} if(state.alist_show_read===undefined){state.alist_show_read=0;} if(state.sep_v_precent===undefined){state.sep_v_precent=25;} if(state.sep_h_precent===undefined){state.sep_h_precent=25;} if(state.alist_show_preview===undefined){state.alist_show_preview=0;} if(state.show_original_article===undefined){state.show_original_article=0;} if(state.show_feed_icons===undefined){state.show_feed_icons=0;} if(state.tag===undefined){state.tag="";} if(state.tag_selected===undefined){state.tag_selected=0;} if(state.order_publisher_ids===undefined){state.order_publisher_ids=[];} if(state.order_article_ids===undefined){state.order_article_ids=[];} if(state.selected_publisher_ids===undefined){state.selected_publisher_ids={};} if(state.current_publisher_ids===undefined){state.current_publisher_ids={};} if(state.history_publisher_ids===undefined){state.history_publisher_ids={};} if(state.selected_article_ids===undefined){state.selected_article_ids={};} if(state.current_article_ids===undefined){state.current_article_ids={};} if(state.history_article_ids===undefined){state.history_article_ids={};} if(state.menu_icons===undefined){state.menu_icons="colored";} if(state.fontsize_ui===undefined){state.fontsize_ui=12;} if(state.fontsize_item===undefined){state.fontsize_item=12;} if(state.fontsize_article===undefined){state.fontsize_article=12;} state.public_view=xGetCookie("public")?true:false;if(_c){_c();}});}; var io={};io.is_transferring=0;io.div_io_status=undefined;io.display_status=function io_display_status(){if(!io.div_io_status){io.div_io_status=xGetElementById("io_status");if(!io.div_io_status){return;}} if(io.is_transferring){io.div_io_status.style.visibility="visible";}else{io.div_io_status.style.visibility="hidden";}};io.get=function io_get(_1,_2){var _3=io.new_XMLHttpRequest();_3.open("GET","/data?"+_1,true);_3.onreadystatechange=function io_fetch_onreadystatechange_and_callback(){if(_3.readyState==4){--io.is_transferring;io.display_status();if(_2){_2(_3.responseText);}}};++io.is_transferring;io.display_status();_3.send(null);};io.fetch=function io_fetch(_4,_5){var _6=io.new_XMLHttpRequest();_6.open("GET","/data"+_4,true);_6.onreadystatechange=function io_fetch_onreadystatechange_and_callback(){if(_6.readyState==4){--io.is_transferring;io.display_status();if(_5){_5(_6.responseText);}}};++io.is_transferring;io.display_status();_6.send(null);};io.send=function io_send(_7){io.fetch(_7);};io.post=function io_post(_8,_9){var _a=io.new_XMLHttpRequest();_a.open("POST","/data"+"/uid/"+(xGetCookie("uid")||0)+"/sid/"+Math.random()+".txt",true);_a.onreadystatechange=function io_fetch_onreadystatechange_and_callback(){if(_a.readyState==4){--io.is_transferring;io.display_status();if(_9){_9(_a.responseText);}}};++io.is_transferring;io.display_status();_a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_a.send(_8);};io.post_sync=function io_post_sync(_b){var _c=io.new_XMLHttpRequest();_c.open("POST","/data"+"/uid/"+(xGetCookie("uid")||0)+"/sid/"+Math.random()+".txt",false);++io.is_transferring;io.display_status();_c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_c.send(_b);--io.is_transferring;io.display_status();return _c.responseText;};io.shutdown=function io_shutdown(){if(io.is_transferring){message.show_hint(document.createTextNode("Alesti is currently transferring data. Please wait a few seconds before closing this window again."));return "Alesti is currently transferring data. Please press \"Cancel\" and try exiting in a few seconds again. If you press \"OK\" you risk to loose data.";}else{message.show_hint(document.createTextNode("Bye!"));}};io.new_XMLHttpRequest=function io_new_XMLHttpRequest(){try{return new ActiveXObject("Msxml2.XMLHTTP");} catch(e){} try{return new ActiveXObject("Microsoft.XMLHTTP");} catch(e){} try{return new XMLHttpRequest();} catch(e){} alert("XMLHttpRequest not supported");return null;}; var layout={};layout.init=function layout_init(){var _1;document.body.style.color=gui.color.fg;document.body.style.background=gui.color.bg;layout.div_header_border=document.createElement("div");layout.div_header_border.id="div_header_border";layout.div_header_border.style.position="absolute";layout.div_header_border.style.borderBottom="1px solid "+gui.color.border_l;document.body.appendChild(layout.div_header_border);layout.div_header=document.createElement("div");layout.div_header.id="div_header";layout.div_header.style.borderBottom="1px solid "+gui.color.border_d;layout.div_header.style.padding="2px "+3*gui.space+"px "+"3px "+3*gui.space+"px";layout.div_header.style.fontSize=state.fontsize_ui+"px";layout.div_header_border.appendChild(layout.div_header);layout.div_dialog=document.createElement("div");layout.div_dialog.id="div_dialog";layout.div_dialog.style.position="absolute";layout.div_dialog.display="none";document.body.appendChild(layout.div_dialog);layout.div_message=document.createElement("div");layout.div_message.id="div_message";layout.div_message.style.position="absolute";document.body.appendChild(layout.div_message);layout.div_footer=document.createElement("div");layout.div_footer.id="div_footer";layout.div_footer.style.position="absolute";layout.div_footer.innerHTML="";document.body.appendChild(layout.div_footer);layout.div_plist=document.createElement("div");layout.div_plist.id="div_plist";layout.div_plist.style.position="absolute";document.body.appendChild(layout.div_plist);layout.div_alist=document.createElement("div");layout.div_alist.id="div_alist";layout.div_alist.style.position="absolute";document.body.appendChild(layout.div_alist);layout.div_aview=document.createElement("div");layout.div_aview.id="div_aview";layout.div_aview.style.position="absolute";document.body.appendChild(layout.div_aview);};layout.resize=function layout_resize(){layout.resize_h();layout.resize_v();gui.currently_resizing=false;};layout.previous_screen_width=-1;layout.previous_sep_v=-1;layout.resize_h=function layout_resize_h(){var _2=xClientWidth();if(_2!=layout.previous_screen_width){xLeft(layout.div_header_border,0);xWidth(layout.div_header_border,_2);xLeft(layout.div_dialog,0);xWidth(layout.div_dialog,_2);xLeft(layout.div_message,0);xWidth(layout.div_message,_2);xLeft(layout.div_footer,gui.space);xWidth(layout.div_footer,_2-2*gui.space);layout.div_body_left=gui.space;layout.div_body_width=_2-2*gui.space;layout.previous_screen_width=_2;} separator.resize("plsep",layout.div_body_left,layout.div_body_top,layout.div_body_width,layout.div_body_height,state.sep_v_precent,0,100);var _3=layout.div_body_left+xGetElementById("plsep").left_in_frame;if(_3!=layout.previous_sep_v){xLeft(layout.div_plist,gui.space);xWidth(layout.div_plist,_3-gui.space);xLeft(layout.div_alist,_3+gui.space);xWidth(layout.div_alist,_2-_3-2*gui.space);xLeft(layout.div_aview,_3+gui.space);xWidth(layout.div_aview,_2-_3-2*gui.space);layout.previous_sep_v=_3;}};layout.resize_v=function layout_resize_v(){var _4=xClientHeight();var _5=xHeight(layout.div_header_border);var _6=xHeight(layout.div_dialog);var _7=xHeight(layout.div_message);var _8=xHeight(layout.div_footer);xTop(layout.div_header_border,0);xTop(layout.div_dialog,_5);xTop(layout.div_message,_5+_6);xTop(layout.div_footer,_4-_8);layout.div_body_top=_5+_6+_7+gui.space;layout.div_body_height=_4-_5-_6-_7-_8-2*gui.space;separator.resize("alsep",layout.div_body_left,layout.div_body_top,layout.div_body_width,layout.div_body_height,state.sep_v_precent,state.sep_h_precent,100-state.sep_v_precent);separator.resize("plsep",layout.div_body_left,layout.div_body_top,layout.div_body_width,layout.div_body_height,state.sep_v_precent,0,100);var _9=layout.div_body_top+xGetElementById("alsep").top_in_frame;xTop(layout.div_plist,_5+_6+_7+gui.space);xHeight(layout.div_plist,_4-_5-_6-_7-_8-2*gui.space);xTop(layout.div_alist,_5+_6+_7+gui.space);xHeight(layout.div_alist,_9-_5-_6-_7-gui.space);xTop(layout.div_aview,_9+gui.space);xHeight(layout.div_aview,_4-_9-_8-2*gui.space);}; var gui=new Object();gui.no_auto_resize=0;gui.space=5;gui.color={};gui.color.fg="#000";gui.color.bg="#ece9d8";gui.color.border_l="#fafafa";gui.color.border_d="#aca988";gui.color.area_header_bg="#cdf";gui.color.read_item="#88a";gui.color.mouseover_item_bg="#feffcc";gui.color.current_item_bg="#ccffd0";gui.color.focused_item_fg="#000";gui.color.focused_item_bg="#feffcc";gui.color.selected_item_fg="#fff";gui.color.selected_item_bg="#06c";gui.color.disabled_cmd_fg="#bbb";function console(_1){if(0){document.getElementById("console").innerHTML="
"+_1+document.getElementById("console").innerHTML;}} gui.init=function gui_init(){gui.div_Clear(document.body);layout.init();dialog.init();message.init();area.create("pld",layout.div_plist);area.create("ald",layout.div_alist);area.create("avd",layout.div_aview);var _2=xGetElementById("avd");_2.style.background="#fff";_2.style.fontSize=state.fontsize_article+"px";separator.create("plsep","v");xEnableDrag(xGetElementById("plsep"),separator.move_start,separator.on_move,separator.move_end);separator.create("alsep","h");xEnableDrag(xGetElementById("alsep"),separator.move_start,separator.on_move,separator.move_end);gui.resize();gui.auto_resize();key.init();window.onresize=gui.resize;window.onbeforeunload=io.shutdown;};gui.refresh=function gui_refresh(){setTimeout(gui.refresh_real,50);};gui.refresh_real=function gui_refresh_real(){header.draw();publishers_list.refresh({"show_loading":0,"fetch":1,"refresh_all":1});};gui.resize=function gui_resize(){setTimeout(gui.resize_real,20);};gui.resize_real=function gui_resize_real(){if(gui.currently_resizing){return;} if(!gui.no_auto_resize){gui.currently_resizing=true;layout.resize();article_view.resize();area.resize("pld");area.resize("ald");area.resize("avd");}};gui.date2=new Date();gui.last_auto_resize=gui.date2.getTime();gui.auto_resize=function gui_auto_resize(){gui.resize();setInterval("gui.auto_resize_real()",15*1000);};gui.auto_resize_real=function gui_auto_resize_real(){gui.date2=new Date();if(gui.date2.getTime()-gui.last_auto_resize>=10*1000){gui.last_auto_resize=gui.date2.getTime();gui.resize_real();}};gui.div_top=function gui_div_top(id){var el;if(typeof id=="string"){el=xGetElementById(id);}else{el=id;} el.scrollLeft=0;el.scrollTop=0;};gui.div_scroll_to_bottom=function gui_div_scroll_to_bottom(id){var _6=xGetElementById(id);_6.scrollLeft=0;_6.scrollTop=_6.scrollHeight;};gui.div_clear=function gui_div_clear(id){var el;if(typeof id=="string"){el=xGetElementById(id);}else{el=id;} if(!el){return;} purge(el);el.innerHTML=" ";gui.div_top(el);};gui.div_Clear=function gui_div_Clear(id){var el;if(typeof id=="string"){el=xGetElementById(id);}else{el=id;} if(!el){return;} purge(el);el.innerHTML="";gui.div_top(el);};gui.div_show=function gui_div_show(id){var el=xGetElementById(id);el.style.display="block";};gui.div_hide=function gui_div_hide(id){var el=xGetElementById(id);el.style.display="none";};gui.div_loading=function gui_div_loading(id){var div;if(typeof id=="string"){div=xGetElementById(id);}else{div=id;} purge(div);div.innerHTML=" "+"loading"+".";};gui.div_processing=function gui_div_processing(id){var div=xGetElementById(id);purge(div);div.innerHTML=" "+"processing"+".";};gui.adjust_iframe_size=function gui_adjust_iframe_size(_13){if(_13.document.height){var _14=document.getElementById(_13.name);_14.style.height=_13.document.height+"px";_14.style.width=_13.document.width+"px";}else{if(document.all){var _14=document.all[_13.name];if(_13.document.compatMode&&_13.document.compatMode!="BackCompat"){_14.style.height=_13.document.documentElement.scrollHeight+5+"px";_14.style.width=_13.document.documentElement.scrollWidth+5+"px";}else{_14.style.height=_13.document.body.scrollHeight+5+"px";_14.style.width=_13.document.body.scrollWidth+5+"px";}}} gui.resize();}; key={};key.shift_mode=0;key.ctrl_mode=false;key.alt_mode=0;key.focused_list="pld";key.disable_keys=false;key.init=function key_init(){};key.onkeydown=function key_onkeydown(_1){var e=_1||window.event;switch(e.keyCode){case 16:++key.shift_mode;break;case 17:++key.ctrl_mode;key.ctrl_mode=true;break;case 18:++key.alt_mode;break;} return true;};key.onkeyup=function key_onkeyup(_3){var e=_3||window.event;switch(e.keyCode){case 16:--key.shift_mode;break;case 17:--key.ctrl_mode;key.ctrl_mode=false;break;case 18:--key.alt_mode;break;} return true;};key.onkeypress=function key_onkeypress(ev){if(key.disable_keys){return true;} var e=new xEvent(ev);switch(e.keyCode){case 106:if(key.focused_list=="pld"){publishers_list.key_go(-1);}else{articles_list.key_go(-1);} break;case 107:if(key.focused_list=="pld"){publishers_list.key_go(+1);}else{articles_list.key_go(+1);} break;case 104:if(key.focused_list=="pld"){publishers_list.key_select();}else{articles_list.key_select();} break;case 108:if(key.focused_list=="pld"){key.focused_list="ald";}else{key.focused_list="pld";} publishers_list.key_switch_focused_list();articles_list.key_switch_focused_list();} return false;}; var header={};header.draw=function(){var _1;var _2=xGetElementById("div_header");var _3;var _4;var _5;purge(layout.div_header);layout.div_header.innerHTML="";var _4=document.createElement("span");_4.style.cssFloat=_4.style.styleFloat="right";_4.style.backgroundColor="#cc4444";_4.style.color=gui.color.bg;_4.style.padding="0 0.5em 0 0.5em";_4.style.fontSize="10px";_4.style.cssFloat=_4.style.styleFloat="right";_4.id="io_status";_4.innerHTML=""+"loading"+".";_2.appendChild(_4);var _6=document.createElement("span");_6.style.color="#c60";_6.appendChild(document.createTextNode("alesti"));if(xGetCookie("un")!=null){_3=document.createElement("span");_3.style.padding="0";_3.appendChild(document.createTextNode(" | "+xGetCookie("un")));_4=document.createElement("span");_4.appendChild(_6);_4.appendChild(_3);_2.appendChild(cmd.area_heading(_4));}else{_3=document.createElement("span");_3.style.padding="0";_3.appendChild(document.createTextNode(" | "+"not logged in"));_4=document.createElement("span");_4.appendChild(_6);_4.appendChild(_3);_2.appendChild(cmd.area_heading(_4));} _2.appendChild(cmd.area_heading(document.createTextNode(" \xa0 \xa0 ")));_2.appendChild(cmd.space());if(xGetCookie("un")!=null){_2.appendChild(cmd.menu({"icon":"logout","text":"logout","hint":"Logout from this computer. You can login later whenever you want.","onclick":function(){xDeleteCookie("uid");xDeleteCookie("un");xDeleteCookie("pw");location.href="/?restart=1";}}));}else{_2.appendChild(cmd.menu({"icon":"login","text":"login","bold":1,"hint":"Login from this computer. If you don\'t logout you don\'t need to login each time.","onclick":function(){code.load("login");login.draw();}}));_2.appendChild(cmd.space());_2.appendChild(cmd.menu({"icon":"register","text":"register","hint":"Create your personal account. It\'s free and just takes a few seconds.","onclick":function(){code.load("register");register.draw();}}));} _2.appendChild(cmd.menu({"icon":"preferences","text":"preferences","hint":"Change your personal configuration.","onclick":function(){if(xGetCookie("un")!=null){code.load("preferences");preferences.draw();}else{message.show_hint(document.createTextNode("To change your preferences you have to login first."));}}}));_2.appendChild(cmd.space());_2.appendChild(cmd.menu({"icon":"send_us_feedback","text":"send us feedback","hint":"Your suggestions and bug reports are welcome!","onclick":function(){code.load("feedback");feedback.draw();}}));_2.appendChild(cmd.space());_2.appendChild(cmd.menu({"icon":"help","text":"help","hint":"Read the short manual.","onclick":function(){help.draw();}}));_2.appendChild(cmd.space());var _7;_7=cmd.menu({"icon":"switch_language","icon-width":"66","text":"language","hint":"Switch language","onclick":function(){dialog.set_header(document.createTextNode("Switch Language"));if(1){var _8={"English":"English","Spanish":"Español","Portuguese":"Português","German":"Deutsch","Basque":"Euskara"};}else{var _8={"English":"English","Spanish":"Español","Portuguese":"Português","Russian":"Pусский","Ukrainian":"Ukrainian","German":"Deutsch","Basque":"Euskara","Catalan":"Català"};} var _9=document.createElement("div");_7=cmd.menu({"pressed":(auto_detect_language?1:0),"text":"Auto detect","hint":"Switch to default language of web browser","onclick":function(){xDeleteCookie("lang");xDeleteCookie("detected-lang");location.href="/?restart=1";}});_9.appendChild(_7);var _a=document.createElement("span");_a.innerHTML=" ";_9.appendChild(cmd.area_heading(_a));for(var _b in _8){_7=cmd.menu({"pressed":((!auto_detect_language&&language)==_b?1:0),"text":_8[_b],"hint":"Switch language to %s.".sprintf(_8[_b]),"onclick":function(){location.href="/?language="+this.lang;}});_7.lang=_b;_9.appendChild(_7);_a=document.createElement("span");_a.innerHTML=" ";_9.appendChild(cmd.area_heading(_a));} _9.appendChild(document.createElement("br"));_9.appendChild(document.createElement("br"));_9.appendChild(cmd.button(document.createTextNode("cancel"),function(){dialog.hide();}));dialog.set_content(_9);dialog.show();}});_2.appendChild(_7);if(xGetCookie("public")!=null){var _c=document.createElement("center");_c.style.margin="4px 0px 3px 0px";_2.appendChild(_c);_4=document.createElement("center");_4.style.border="1px solid #000";_4.style.padding="1px 16px 1px 24px";_4.style.backgroundColor="#fd8";_4.appendChild(cmd.area_heading(document.createTextNode("public subscriptions of %s (read-only view)".sprintf(xGetCookie("public")))));_2.appendChild(cmd.space());_4.appendChild(cmd.menu({"icon":"download_opml","bold":1,"text":"download OPML","onclick":function(){var _d=document.createElement("span");_d.innerHTML="Download these subscriptions as OPML.";message.show_hint(_d);}}));_2.appendChild(cmd.space());_4.appendChild(cmd.menu({"icon":"exit","bold":1,"text":"exit","onclick":function(){xDeleteCookie("public");storage.fetch_state(function(){gui.refresh();article_view.refresh({"show_loading":0,"fetch":0});});}}));_2.appendChild(_4);} gui.resize();}; var dialog={};dialog.init=function(){dialog.div_border_outer=document.createElement("div");dialog.div_border_outer.id="div_dialog_border_outer";dialog.div_border_outer.style.zIndex=100;dialog.div_border_outer.style.borderBottom="1px solid "+gui.color.border_l;layout.div_dialog.appendChild(dialog.div_border_outer);dialog.div_border=document.createElement("div");dialog.div_border.id="div_dialog_border";dialog.div_border.style.borderBottom="1px solid "+gui.color.border_d;dialog.div_border_outer.appendChild(dialog.div_border);dialog.div_header=document.createElement("div");dialog.div_header.id="div_dialog_header";dialog.div_header.style.padding="1px "+gui.space+"px "+"1px "+gui.space+"px ";dialog.div_header.style.margin=gui.space+"px "+gui.space+"px "+gui.space+"px "+gui.space+"px ";dialog.div_header.style.fontWeight="bold";dialog.div_header.style.color="#fff";dialog.div_header.style.background="#06c";dialog.div_header.style.borderLeft="1px solid "+gui.color.border_d;dialog.div_header.style.borderTop="1px solid "+gui.color.border_d;dialog.div_header.style.borderRight="1px solid "+gui.color.border_l;dialog.div_header.style.borderBottom="1px solid "+gui.color.border_l;dialog.div_header.style.fontSize=state.fontsize_ui+"px";dialog.div_header.innerHTML="The Header";dialog.div_border.appendChild(dialog.div_header);dialog.div_content=document.createElement("div");dialog.div_content.id="div_dialog_content";dialog.div_content.style.padding=gui.space+"px "+2*gui.space+"px "+2*gui.space+"px "+2*gui.space+"px ";dialog.div_content.style.fontSize=state.fontsize_ui+"px";dialog.div_content.innerHTML="ert erter tre e!";dialog.div_border.appendChild(dialog.div_content);dialog.hide();};dialog.set_header=function(el){purge("div_dialog_header");dialog.div_header.innerHTML="";dialog.div_header.appendChild(el);if(dialog.div_border_outer.style.display=="block"){gui.resize();}};dialog.set_content=function(el){purge("div_dialog_content");dialog.div_content.innerHTML="";dialog.div_content.appendChild(el);if(dialog.div_border_outer.style.display=="block"){gui.resize();}};dialog.show=function(){key.disable_keys=true;dialog.div_border_outer.style.display="block";gui.resize();};dialog.hide=function(){key.disable_keys=false;purge("div_dialog_header");dialog.div_header.innerHTML="";purge("div_dialog_content");dialog.div_content.innerHTML="";dialog.div_border_outer.style.display="none";gui.resize();}; var message={};message.init=function(){message.div_border_outer=document.createElement("div");message.div_border_outer.id="div_message_border_outer";message.div_border_outer.style.zIndex=100;layout.div_message.appendChild(message.div_border_outer);message.div_border=document.createElement("div");message.div_border.id="div_message_border";message.div_border_outer.appendChild(message.div_border);message.div_header=document.createElement("div");message.div_header.id="div_message_header";message.div_header.style.padding="1px "+2*gui.space+"px "+"1px "+2*gui.space+"px ";message.div_header.style.margin=gui.space+"px "+gui.space+"px "+0*gui.space+"px "+gui.space+"px ";message.div_header.style.color="#444";message.div_header.style.background="#fd8";message.div_header.style.borderLeft="1px solid "+gui.color.border_d;message.div_header.style.borderTop="1px solid "+gui.color.border_d;message.div_header.style.borderRight="1px solid "+gui.color.border_l;message.div_header.style.borderBottom="1px solid "+gui.color.border_l;message.div_header.style.fontSize=state.fontsize_ui+"px";message.div_header.innerHTML="The Header";message.div_border.appendChild(message.div_header);message.hide();};message.set=function(el){purge("div_message_header");message.div_header.innerHTML="";message.div_header.appendChild(el);if(message.div_border_outer.style.display=="block"){gui.resize();}};message.show_hint=function(el){div=document.createElement("div");div.appendChild(el);div.appendChild(document.createTextNode("\xa0\xa0 ["));div.appendChild(cmd.plain(document.createTextNode("hide"),function(){message.hide();}));div.appendChild(document.createTextNode("]"));message.set(div);message.show();};message.show=function(){message.div_border_outer.style.display="block";gui.resize();};message.hide=function(){purge("div_message_header");message.div_header.innerHTML="";message.div_border_outer.style.display="none";gui.resize();}; var cmd={};cmd.plain=function cmd_plain(el,_2){var _3=document.createElement("span");_3.style.color="#00f";_3.style.cursor="pointer";_3.style.whiteSpace="nowrap";_3.style.textDecoration="underline";_3.appendChild(el);_3.onclick=_2;return _3;};cmd.area=function cmd_area(el,_5){var _6=document.createElement("span");_6.style.color="#444";_6.style.cursor="pointer";_6.style.whiteSpace="nowrap";_6.style.margin="0 8px 0 0";_6.appendChild(el);_6.onclick=_5;_6.onmouseover=cmd.area_onmouseover;_6.onmouseout=cmd.area_onmouseout;return _6;};cmd.area_onmouseover=function cmd_area_onmouseover(){this.style.color="#e81";};cmd.area_onmouseout=function cmd_area_onmouseout(){this.style.color="#444";};cmd.menu=function cmd_menu(_7){var _8=(_7===undefined)?{}:_7;var _9=document.createElement("span");if(_8.hint){_9.title=_8.hint;} _9.style.whiteSpace="nowrap";_9.style.margin="1px 8px 1px 0";_9.style.padding="0 2px 0 2px";if(_8["bold"]){_9.style.fontWeight="bold";} if(_8["pressed"]){_9.style.borderLeft="1px solid "+gui.color.border_d;_9.style.borderTop="1px solid "+gui.color.border_d;_9.style.borderRight="1px solid "+gui.color.border_l;_9.style.borderBottom="1px solid "+gui.color.border_l;}else{} if(!_8["disabled"]){_9.style.cursor="pointer";if(_8["onclick"]){_9.onclick=_8["onclick"];} _9.onmouseover=cmd.menu_onmouseover;_9.onmouseout=cmd.menu_onmouseout;_9.style.color="#444";}else{_9.style.color=gui.color.disabled_cmd_fg;} if(_8["icon"]&&_8["icon"].length&&state.menu_icons!="off"){_9.innerHTML=""+"\"\""+""+(_8["text"]||"no text");}else{_9.innerHTML=_8["text"]||"no text";} return _9;};cmd.menu_onmouseover=function cmd_menu_onmouseover(){this.style.color="#e81";};cmd.menu_onmouseout=function cmd_menu_onmouseout(){this.style.color="#444";};cmd.tag=function cmd_tag(_a,_b,_c,_d,_e,_f){var _10=document.createElement("span");_10.tag=_a;_10.tag_name=_b;_10.tag_publisher_ids=_c;_10.num_new_articles=_d;_10.style.cursor="pointer";_10.style.whiteSpace="nowrap";_10.style.padding="0 2px 0 2px";_10.style.margin="0 4px 0 2px";cmd.tag_set_style(_10,0);_10.innerHTML=_e;_10.onclick=_f;_10.onmouseover=cmd.tag_onmouseover;_10.onmouseout=cmd.tag_onmouseout;return _10;};cmd.tag_onmouseover=function cmd_tag_onmouseover(){cmd.tag_set_style(this,1);};cmd.tag_onmouseout=function cmd_tag_onmouseout(){cmd.tag_set_style(this,0);};cmd.tag_set_style=function cmd_tag_set_style(el,_12){if(el.tag==state.tag){if(state.tag_selected){el.style.color=gui.color.selected_item_fg;el.style.backgroundColor=gui.color.selected_item_bg;el.style.borderTop="2px none #fff";el.style.borderBottom="2px none #fff";}else{el.style.borderTop="2px solid "+gui.color.selected_item_bg;el.style.borderBottom="2px solid "+gui.color.selected_item_bg;if(_12){el.style.backgroundColor=gui.color.mouseover_item_bg;}else{el.style.backgroundColor="";} if(el.num_new_articles==0){el.style.color=gui.color.read_item;}}}else{el.style.borderTop="2px none #fff";el.style.borderBottom="2px none #fff";if(_12){el.style.backgroundColor=gui.color.mouseover_item_bg;}else{el.style.backgroundColor="";} if(el.num_new_articles==0){el.style.color=gui.color.read_item;}}};cmd.area_link=function cmd_area_link(el,url){var _15=document.createElement("span");_15.style.color="#22f";_15.style.whiteSpace="nowrap";_15.style.margin="0 8px 0 0";var a=document.createElement("a");a["class"]=a["className"]="cmd";a.href=url;a.appendChild(el);_15.appendChild(a);return _15;};cmd.area_link_nw=function cmd_area_link_nw(el,url){var _19=document.createElement("span");_19.style.color="#22f";_19.style.whiteSpace="nowrap";_19.style.margin="0 8px 0 0";var a=document.createElement("a");a["class"]=a["className"]="cmd";a.href=url;a.target="_blank";a.appendChild(el);_19.appendChild(a);return _19;};cmd.area_heading=function cmd_area_heading(el){var _1c=document.createElement("span");_1c.style.color="#000";_1c.style.fontWeight="bold";_1c.style.whiteSpace="nowrap";_1c.style.margin="0 8px 0 0";_1c.appendChild(el);return _1c;};cmd.area_heading=function cmd_area_heading(el){var _1e=document.createElement("span");_1e.style.color="#000";_1e.style.fontWeight="bold";_1e.style.whiteSpace="nowrap";_1e.style.margin="0 8px 0 0";_1e.appendChild(el);return _1e;};cmd.header=function cmd_header(el,fnc){var _21=document.createElement("span");_21.style.color="#444";_21.style.cursor="pointer";_21.style.whiteSpace="nowrap";_21.style.margin="0 8px 0 0";_21.appendChild(el);_21.onclick=fnc;_21.onmouseover=cmd.header_onmouseover;_21.onmouseout=cmd.header_onmouseout;return _21;};cmd.header_onmouseover=function cmd_header_onmouseover(){this.style.color="#e81";};cmd.header_onmouseout=function cmd_header_onmouseout(){this.style.color="#444";};cmd.button=function cmd_button(el,fnc){var _24=document.createElement("input");_24.type="button";_24.value=(el.nodeValue||el);_24.onclick=fnc;return _24;};cmd.button_plain=function cmd_button_plain(el,fnc){var _27=document.createElement("span");_27.style.cursor="pointer";_27.style.whiteSpace="nowrap";_27.style.color="#fff";_27.style.background="#daa520";_27.style.padding="2px 12px 2px 12px";_27.style.borderLeft="1px solid "+gui.color.border_l;_27.style.borderTop="1px solid "+gui.color.border_l;_27.style.borderRight="1px solid "+gui.color.border_d;_27.style.borderBottom="1px solid "+gui.color.border_d;_27.appendChild(el);_27.onclick=fnc;_27.onmouseover=cmd.button_onmouseover;_27.onmouseout=cmd.button_onmouseout;return _27;};cmd.button_onmouseover=function cmd_button_onmouseover(){this.style.background="#ca9510";};cmd.button_onmouseout=function cmd_button_onmouseout(){this.style.background="#daa520";};cmd.space=function cmd_space(el,url){var _2a=document.createElement("span");_2a.appendChild(document.createTextNode(" "));return _2a;}; List=function List(_1){this.NUM_MAX_ITEMS=100;this.num_used_items=0;this.has_focus=false;this.focused_item_num=0;this.ignore_mouse=false;this.container_id=_1;this.container=null;this.div_message=null;};List.prototype.init=function List_init(){this.container=document.getElementById(this.container_id);this.container.List=this;this.container.onmouseover=function List_container_onmousemove(){key.focused_list=this.List.container_id;this.List.ignore_mouse=false;};this.container.onmousemove=function List_container_onmousemove(){this.List.ignore_mouse=false;};this.init_table();};List.prototype.refresh=function List_refresh(){};List.prototype.init_table=function List_init_table(){};List.prototype.draw=function List_draw(){};List.prototype.draw_item=function List_draw_item(){};List.prototype.style_item_assistant=function List_style_item_assistant(){};List.prototype.item_select=function List_item_select(){};List.prototype.key_go=function List_key_go(_2){if(this.table==undefined){this.init();} this.ignore_mouse=true;if(this.focused_item_num+_2=0){var _3=this.focused_item_num;this.focused_item_num+=_2;this.style_item(_3);this.style_item(this.focused_item_num);var _4=this.item[this.focused_item_num].offsetTop;if(key.focused_list=="pld"){this.container.scrollTop=_4-Math.round(xHeight(layout.div_plist)/4);}else{this.container.scrollTop=_4-Math.round(xHeight(layout.div_alist)/4);}}};List.prototype.key_select=function List_key_select(){if(this.table==undefined){this.init();} this.ignore_mouse=true;if(this.focused_item_num>=0&&this.focused_item_num=this.NUM_MAX_ITEMS){return;} var _7=false;if(this.focused_item_num==_6&&key.focused_list==this.container_id){_7=true;} var a=this.style_item_assistant(_6);var _9=a[0];var _a=a[1];var _b=a[2];if(_7&&!_9){if(_a){this.item[_6].style.color=gui.color.focused_item_fg;this.item[_6].style.backgroundColor=gui.color.focused_item_bg;}else{this.item[_6].style.color=gui.color.read_item;this.item[_6].style.backgroundColor=gui.color.focused_item_bg;}}else{if(!_7&&_9){this.item[_6].style.color=gui.color.selected_item_fg;this.item[_6].style.backgroundColor=gui.color.selected_item_bg;}else{if(_7&&_9){this.item[_6].style.color=gui.color.focused_item_bg;this.item[_6].style.backgroundColor=gui.color.selected_item_bg;}else{if(!_7&&!_9){if(_a){this.item[_6].style.color="";this.item[_6].style.backgroundColor="";}else{this.item[_6].style.color=gui.color.read_item;this.item[_6].style.backgroundColor="";}}}}} if(_b){this.item[_6].style.color="";this.item[_6].style.backgroundColor="";}};List.prototype.show_loading=function List_show_loading(_c){if(this.table==undefined){this.init();} this.clear();gui.div_loading(this.div_message);};List.prototype.clear=function List_clear(_d){if(this.table==undefined){this.init();} gui.div_Clear(this.div_message);for(var i=0;i90){state.sep_h_precent=90;}}else{xMoveTo(sep,xLeft(sep)+dx,xTop(sep));sep.total_move_x+=dx;state.sep_v_precent=sep.sep_v_precent+(sep.total_move_x/sep.frame_width*100);if(state.sep_v_precent<5){state.sep_v_precent=5;} if(state.sep_v_precent>95){state.sep_v_precent=95;}}};separator.move_end=function separator_move_end(sep,dx,dy){state.show_original_article=sep.show_original_article;article_view.refresh({"show_loading":0,"fetch":0});sep.style.backgroundColor=gui.color.bg;gui.no_auto_resize=0;storage.send_state(dialog.hide);gui.resize();}; var publishers_list=new List("pld");publishers_list.refresh=function publishers_list_refresh(){if(publishers_list.table==undefined){publishers_list.init();} state.order_publisher_ids.sort(function state_order_publisher_ids_sort(_1,_2){if(_1<100){return-1;}else{if(_2<100){return 1;}} var _3=data.publishers[_1].name;var _4=data.publishers[_2].name;if(_3.toUpperCase){_3=_3.toUpperCase();} if(_4.toUpperCase){_4=_4.toUpperCase();} if(_3>_4){return 1;}else{if(_3<_4){return-1;}else{return 0;}}});publishers_list.draw();};publishers_list.init_table=function publishers_list_init_table(){var _5=[];_5.push("","");for(var i=0;i","","");} _5.push("","","","","
  
  
");publishers_list.table=document.createElement("div");publishers_list.table.style.display="none";publishers_list.table.innerHTML=_5.join("");publishers_list.container.appendChild(publishers_list.table);publishers_list.item=[];publishers_list.item_left=[];publishers_list.item_right=[];publishers_list.id=[];for(var i=0;i=publishers_list.NUM_MAX_ITEMS){return;} publishers_list.style_item(_b);var id=publishers_list.id[_b];var _d=data.publishers[id];var _e=false;var _f=xGetCookie("public")?true:false;if((_d.num_unread_articles||id<=100)){_e=true;} var _10="";if(state.show_feed_icons){_10=""+"\"\"";} var _11="";if(_e){_11=["",(_d.name||"no feed name"),""].join("");}else{_11=_d.name||"no feed name";} var _12="";if(_e&&!_f&&id>100){_12=" ("+_d.num_unread_articles+")";} var _13="";if(_d.http_status==410){_13=" !"+"feed discontinued"+"!";}else{if(_d.http_status==404){_13=" !"+"feed currently unavailable"+"!";}} var url=" ";if(_d.url){url=[" \"\""].join("");} publishers_list.item_left[_b].innerHTML=[_10,url].join("");publishers_list.item_right[_b].innerHTML=[_11,_12,_13].join("");};publishers_list.style_item_assistant=function publishers_list_style_item_assistant(_15){var id=this.id[_15];var _17=data.publishers[id];var _18=false;var _19=false;var _1a=xGetCookie("public")?true:false;if(!state.tag_selected&&state.selected_publisher_ids[id]){_18=true;} if((_17.num_unread_articles||id<=100)){_19=true;} return[_18,_19,_1a];};publishers_list.item_select=function publishers_list_item_select(_1b){var id=publishers_list.id[_1b];var _1d=keys(state.selected_publisher_ids).slice();if(!key.ctrl_mode){state.selected_publisher_ids={};} if(key.ctrl_mode&&state.selected_publisher_ids[id]){state.selected_publisher_ids[id]=0;}else{state.selected_publisher_ids[id]=1;} state.history_publisher_ids[id]=1;state.selected_article_ids={};state.history_article_ids={};publishers_list.style_item(_1b);for(var i in _1d){var _1f=_1d[i];if(publishers_list.item_num[_1f]!==undefined){publishers_list.style_item(publishers_list.item_num[_1f]);}} for(var _20 in keys(state.selected_publisher_ids)){if(publishers_list.item_num[_20]){publishers_list.style_item(publishers_list.item_num[_20]);}} if(state.alist_show_read!==undefined){delete state.alist_show_read;} if(state.alist_show_preview!==undefined){delete state.alist_show_preview;} if(state.tag_selected){state.tag_selected=0;publishers_list.draw_header();publishers_list.draw_tags_list();} setTimeout(function(){publishers_list.draw_header();articles_list.clear();articles_list.refresh();article_view.clear();},20);};publishers_list.draw_header=function publishers_list_draw_header(){var _21;var _22=document.createElement("div");_22.appendChild(area.title(document.createTextNode("Subscriptions")));var div=document.createElement("div");if(xGetCookie("public")){div.appendChild(cmd.area_heading(document.createTextNode("\xa0")));}else{if((keys(state.selected_publisher_ids).length||state.tag_selected)&&!(keys(state.selected_publisher_ids).length==1&&!state.tag_selected&&keys(state.selected_publisher_ids)[0]<100)){div.appendChild(cmd.menu({"icon":"mark_read","text":"mark read","hint":"Mark all articles in selected subscription(s) or tag(s) as read.","onclick":function publishers_list_menu_mark_feed_read(){articles_list.cmd_mark_feed_read();}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"mark_read","text":"mark read","disabled":1}));div.appendChild(cmd.space());} if(!state.plist_show_read){div.appendChild(cmd.menu({"icon":"show_read_items","pressed":0,"text":"show read items","hint":"Display subscriptions with no new unread articles as well.","onclick":function publishers_list_menu_list_all(){publishers_list.cmd_list_all();}}));}else{div.appendChild(cmd.menu({"icon":"show_read_items","pressed":1,"text":"show read items","hint":"Display subscriptions with no new unread articles as well.","onclick":function publishers_list_menu_list_only_unread(){publishers_list.cmd_list_only_unread();}}));} div.appendChild(cmd.space());div.appendChild(cmd.menu({"icon":"add","text":"add","hint":"Add a subscription to your feed collection.","onclick":function publishers_list_menu_add(){if(xGetCookie("un")!=null){code.load("subscribe");subscribe.draw();}else{message.show_hint(document.createTextNode("To subscribe to new feeds you have to login first."));}}}));div.appendChild(cmd.space());if(keys(state.selected_publisher_ids).length>0&&!(keys(state.selected_publisher_ids).length==1&&keys(state.selected_publisher_ids)[0]<100)&&!state.tag_selected){div.appendChild(cmd.menu({"icon":"unsubscribe","text":"unsubscribe","hint":"Remove selected subscription(s) from your collection.","onclick":function publishers_list_menu_unsusbscribe(){if(xGetCookie("un")!=null){code.load("unsubscribe");unsubscribe.draw();}else{message.show_hint(document.createTextNode("To unsubscribe this feeds you have to login first."));}}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"unsubscribe","text":"unsubscribe","disabled":1}));div.appendChild(cmd.space());} if(keys(state.selected_publisher_ids).length>0&&!(keys(state.selected_publisher_ids).length==1&&keys(state.selected_publisher_ids)[0]<100)&&!state.tag_selected){div.appendChild(cmd.menu({"icon":"properties","text":"properties","hint":"Edit properties of selected subscription(s). Includes changing tags.","onclick":function publishers_list_menu_properties(){if(xGetCookie("un")!=null){code.load("subscription");subscription.draw_change_dialog(keys(state.selected_publisher_ids));}else{message.show_hint(document.createTextNode("To edit the subscription properties you have to login first."));}}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"properties","text":"properties","disabled":1}));div.appendChild(cmd.space());}} _22.appendChild(area.menu(div));var _24=document.getElementById("tags_list");if(_24){_24.parentNode.removeChild(_24);_22.appendChild(area.submenu(_24));}else{var _25=document.createElement("div");_25.id="tags_list";_22.appendChild(area.submenu(_25));} area.set_header(publishers_list.container_id,_22);};publishers_list.cmd_mark_all_feeds_read=function publishers_list_cmd_mark_all_feeds_read(){};publishers_list.draw_tags_list=function publishers_list_draw_tags_list(){var _26=document.createElement("div");var el;el=cmd.area_heading(document.createTextNode("Tags:"));el.style.color=gui.color.read_item;_26.appendChild(el);var _28={};var tag;_28[""]={};_28[""].publisher_ids=[];_28[""].num_new_articles=0;_28[" "]={};_28[" "].publisher_ids=[];_28[" "].num_new_articles=0;for(var i in state.order_publisher_ids){var id=state.order_publisher_ids[i];for(var j in data.publishers[id].tags){tag=data.publishers[id].tags[j];if(_28[tag]==undefined){_28[tag]={};_28[tag].publisher_ids=[];_28[tag].num_new_articles=0;} _28[tag].publisher_ids.push(id);_28[tag].num_new_articles+=data.publishers[id].num_unread_articles;} if(data.publishers[id].tags.length==0){_28[" "].publisher_ids.push(id);_28[" "].num_new_articles+=data.publishers[id].num_unread_articles;} _28[""].publisher_ids.push(id);_28[""].num_new_articles+=data.publishers[id].num_unread_articles;} var tag;var _2d;var _2e=[];for(tag in _28){_2e.push(tag);} _2e.sort();for(var i in _2e){tag=_2e[i];if(tag==""){_28[tag].name="["+"all"+"]";}else{if(tag==" "){_28[tag].name="["+"untagged"+"]";}else{_28[tag].name=_2e[i];}} el=cmd.tag(tag,_28[tag].name,_28[tag].publisher_ids.join(","),_28[tag].num_new_articles,(_28[tag].num_new_articles?"":"")+_28[tag].name+(_28[tag].num_new_articles?"":"")+(_28[tag].num_new_articles?" ("+_28[tag].num_new_articles+")":""),function publishers_list_draw_tags_list_onclick_callback(){this.style.color=gui.color.selected_item_fg;this.style.backgroundColor=gui.color.selected_item_bg;publishers_list.show_loading();articles_list.show_loading();state.tag=this.tag;state.tag_name=this.tag_name;if(!state.tag_selected){state.tag_selected=1;publishers_list.draw_header();} if(state.alist_show_read!==undefined){delete state.alist_show_read;} if(state.alist_show_preview!==undefined){delete state.alist_show_preview;} state.selected_publisher_ids={};state.history_publisher_ids={};if(this.tag_publisher_ids.length>0){var _2f=this.tag_publisher_ids.split(",");for(var i in _2f){var id=_2f[i];if(data.publishers[id].num_unread_articles>0){state.selected_publisher_ids[id]=1;state.history_publisher_ids[id]=1;}}} state.selected_article_ids={};state.history_article_ids={};setTimeout(function(){publishers_list.refresh();articles_list.refresh();article_view.refresh();},25);});_26.appendChild(el);_26.appendChild(cmd.space());} gui.div_Clear("tags_list");document.getElementById("tags_list").appendChild(_26);gui.resize();};publishers_list.cmd_list_only_unread=function publishers_list_cmd_list_only_unread(){gui.div_top(publishers_list.container);state.plist_show_read=0;publishers_list.refresh({"show_loading":0,"fetch":0});storage.send_state(dialog.hide);};publishers_list.cmd_list_all=function publishers_list_cmd_list_all(){gui.div_top(publishers_list.container);state.plist_show_read=1;publishers_list.refresh({"show_loading":0,"fetch":0});storage.send_state(dialog.hide);};publishers_list.draw_title=function publishers_list_draw_title(){var _32=0;for(var id in data.publishers){if(id>100){_32+=data.publishers[id].num_unread_articles;}} document.title=(!xGetCookie("public")?"("+_32+") ":"")+"Alesti RSS Reader";}; articles_list=new List("ald");articles_list.refresh=function articles_list_refresh(){if(articles_list.table==undefined){articles_list.init();} if(keys(state.selected_publisher_ids).length==0){articles_list.clear();}else{var _1=keys(state.selected_publisher_ids);state.order_article_ids=[];var _2=(new Date()).getTime();var _3="[].concat(";for(var _4 in state.selected_publisher_ids){var _5=data.publishers[_4];if(!_5.headlines_loaded){state.please_refresh_articles_list=true;articles_list.show_loading();return;} _3+="data.publishers["+_4+"].article_ids, ";} _3+="[])";var _6=eval("("+_3+")");_6.sort().reverse();var _7=(new Date()).getTime();var _8=[];var _9=0;for(var i in _6){var _b=_6[i];var _c=data.articles[_b];var _5=data.publishers[_c.publisher_ref];var _d=(_1.length==1&&data.publishers[_1[0]].num_unread_articles==0);var _e=(_1.length==1&&_1[0]==1);if(state.alist_show_read||data.articles[_b].is_unread||state.history_article_ids[_b]||_d||_e){state.order_article_ids.push(_b);if(data.articles[_b].body===undefined){_8.push(_b);} ++_9;} if(_9==articles_list.NUM_MAX_ITEMS){break;}} articles_list.keys_state_selected_publisher_ids_length=keys(state.selected_publisher_ids).length;articles_list.draw();if(_8.length>0){io.post("c=article_data"+"&article_id="+_8.join(","),function articles_list_fetch_and_draw_io_callback1(_f){eval(_f);articles_list.redraw();var _10=_8;if(_10.length>0){io.post("c=article_bodies"+"&article_id="+_10.join(","),function articles_list_fetch_and_draw_io_callback2(_11){eval(_11);articles_list.redraw();if(state.please_refresh_article_view){delete state.please_refresh_article_view;article_view.refresh();}});}});}}};articles_list.init_table=function articles_list_init_table(){var _12=[];_12.push("","");for(var i=0;i","","");} _12.push("","","","","
  
  
");articles_list.table=document.createElement("div");articles_list.table.style.display="none";articles_list.table.innerHTML=_12.join("");articles_list.container.appendChild(articles_list.table);articles_list.item=[];articles_list.item_left=[];articles_list.item_right=[];articles_list.id=[];for(var i=0;i=articles_list.NUM_MAX_ITEMS){return;} articles_list.style_item(_1b);var id=articles_list.id[_1b];var _1d=data.articles[id];var _1e=data.publishers[data.articles[id].publisher_ref];var _1f=(_1d.is_bookmarked?["[","bookmarked","]\xa0\xa0 "].join(""):"");var _20="";if(_1e&&(_1e.show_author||_1d.publisher_ref<100)&&_1d.author){_20=[" (",_1d.author,")"].join("");} var _21="";if(_1e&&_1e.name&&articles_list.keys_state_selected_publisher_ids_length!=1){_21=[" (",_1e.name,")"].join("");} var _22="";if((state.alist_show_preview===undefined&&_1e&&_1e.show_body)||(state.alist_show_preview!==undefined&&state.alist_show_preview)){_22=["
",(_1d.body||["- ","no content"," -"].join("")),"
"].join("");} articles_list.item_left[_1b].innerHTML=[_1d.date,(_1d.url?[" \"\""].join(""):" ")].join("");articles_list.item_right[_1b].innerHTML=[_1f,(_1d.is_unread?"":""),(_1d.title||"no title"),(_1d.is_unread?"":""),_21,_20,_22].join("");};articles_list.style_item_assistant=function articles_list_style_item_assistant(_23){var id=articles_list.id[_23];var _25=data.articles[id];var _26=data.publishers[data.articles[id].publisher_ref];var _27=false;var _28=false;var _29=state.public_view;if(state.selected_article_ids[id]){_27=true;} if(_25.is_unread){_28=true;} return[_27,_28,_29];};articles_list.item_select=function articles_list_item_select(_2a){var id=articles_list.id[_2a];var el;var id=articles_list.id[_2a];var _2d=keys(state.selected_article_ids)[0]||0;state.selected_article_ids={};state.selected_article_ids[id]=1;state.history_article_ids[id]=1;articles_list.style_item(_2a);if(state.show_original_article!==undefined){delete state.show_original_article;} if(_2d!=0){articles_list.style_item(articles_list.item_num[_2d]);} setTimeout(article_view.refresh,20);};articles_list.draw_header=function articles_list_draw_header(){var _2e;var _2f=document.createElement("div");if(state.tag_selected){var _30=document.createElement("span");if(state.tag==""){_30.innerHTML="Articles of all feeds";}else{if(state.tag==" "){_30.innerHTML="Articles of all untagged feeds";}else{_30.innerHTML="Articles of all feeds wich have been tagged with “%s”".sprintf(state.tag_name);}} _2f.appendChild(area.title(_30));}else{if(keys(state.selected_publisher_ids).length==0){_2f.innerHTML=" ";area.set_header(articles_list.container_id,_2f);return;}else{if(keys(state.selected_publisher_ids).length==1){var _31;if(data.publishers[keys(state.selected_publisher_ids)[0]].tags.length){_31=" ("+"tags:"+" "+data.publishers[keys(state.selected_publisher_ids)[0]].tags.join(" ")+")";}else{_31="";} var _30=document.createElement("span");_30.innerHTML=""+(data.publishers[keys(state.selected_publisher_ids)[0]].url?""+(data.publishers[keys(state.selected_publisher_ids)[0]].name||"no feed name")+"":(data.publishers[keys(state.selected_publisher_ids)[0]].name||"no feed name"))+_31;_2f.appendChild(area.title(_30));}else{var _30=document.createElement("span");_30.innerHTML="Articles of selected feeds";_2f.appendChild(area.title(_30));}}} var div=document.createElement("div");if(1){if(!state.public_view){div.appendChild(cmd.menu({"icon":"mark_read","text":"mark all read","hint":"Mark displayed articles as read. Undisplayed new articles will be kept as unread.","onclick":function articles_list_menu_mark_all_read(){articles_list.cmd_mark_all_articles_read();}}));div.appendChild(cmd.space());if(!state.alist_show_read){div.appendChild(cmd.menu({"icon":"show_read_items","pressed":0,"text":"show read items","hint":"Display read articles as well.","onclick":function articles_list_menu_list_all(){articles_list.cmd_list_all();}}));}else{div.appendChild(cmd.menu({"icon":"show_read_items","pressed":1,"text":"show read items","hint":"Display read articles as well.","onclick":function articles_list_menu_list_only_unread(){articles_list.cmd_list_only_unread();}}));}} div.appendChild(cmd.space());if(!state.alist_show_preview){div.appendChild(cmd.menu({"icon":"show_preview","pressed":0,"text":"show preview","hint":"Display article previews in the list.","onclick":function articles_list_menu_show_preview(){articles_list.cmd_show_preview();}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"show_preview","pressed":1,"text":"show preview","hint":"Display article previews in the list.","onclick":function articles_list_menu_hide_preview(){articles_list.cmd_hide_preview();}}));div.appendChild(cmd.space());}} _2f.appendChild(area.menu(div));area.set_header(articles_list.container_id,_2f);};articles_list.cmd_mark_all_articles_read=function articles_list_cmd_mark_all_articles_read(){gui.div_top(articles_list.container);for(i in state.order_article_ids){var id=state.order_article_ids[i];if(data.articles[id].is_unread){data.articles[id].is_unread=0;if(data.articles[id].publisher_ref>100){--data.publishers[data.articles[id].publisher_ref].num_unread_articles;}}} state.selected_article_ids={};state.history_article_ids={};articles_list.refresh();publishers_list.refresh();article_view.refresh();io.post("c=mark_article_read"+"&article_id="+encodeURIComponent(state.order_article_ids.join(",")),function articles_list_cmd_mark_all_articles_read_io_callback(_34){});};articles_list.cmd_mark_feed_read=function articles_list_cmd_mark_feed_read(){gui.div_top(articles_list.container);io.post("c=mark_feed_read"+"×tamp="+data.timestamp+"&publisher_id="+encodeURIComponent(keys(state.selected_publisher_ids).join(",")));for(var _35 in state.selected_publisher_ids){data.publishers[_35].num_unread_articles=0;for(var i in data.publishers[_35].article_ids){var _37=data.publishers[_35].article_ids[i];if(data.articles[_37]){data.articles[_37].is_unread=0;}}} state.selected_article_ids={};state.history_article_ids={};state.order_article_ids=[];articles_list.draw();article_view.refresh({"show_loading":0,"fetch":0});publishers_list.draw();publishers_list.draw_tags_list();};articles_list.cmd_list_only_unread=function articles_list_cmd_list_only_unread(){gui.div_top(articles_list.container);state.alist_show_read=0;articles_list.refresh({"show_loading":1,"fetch":1});};articles_list.cmd_list_all=function articles_list_cmd_list_all(){var _38=[];for(id in state.selected_publisher_ids){if(id>100){_38.push(id);}} if(_38.length>0){articles_list.show_loading();state.alist_show_read=1;io.post("c=read_articles_from_publisher"+"&publisher_id="+encodeURIComponent(_38.join(","))+"×tamp="+data.timestamp,function subscribe_subscribe_io_callback(_39){eval(_39);articles_list.refresh();});}};articles_list.cmd_show_preview=function articles_list_cmd_show_preview(){gui.div_top(articles_list.container);state.alist_show_preview=1;articles_list.refresh({"show_loading":1,"fetch":1});};articles_list.cmd_hide_preview=function articles_list_cmd_hide_preview(){gui.div_top(articles_list.container);state.alist_show_preview=0;articles_list.refresh({"show_loading":1,"fetch":1});}; var article_view={};article_view.refresh=function article_view_refresh(){var _1=keys(state.selected_article_ids);if(_1.length==0){article_view.clear();}else{var id=_1[0];article_view.draw();if(data.articles[id].is_unread){var _3=data.articles[id].publisher_ref;io.send("?c=mark_article_read"+"&article_id="+id+"&uid="+(xGetCookie("uid")||0)+"&sid="+Math.random());data.articles[id].is_unread=0;if(data.articles[id].publisher_ref>100){--data.publishers[_3].num_unread_articles;} setTimeout(function(){publishers_list.draw_tags_list();publishers_list.draw_title();},20);} article_view.draw_header();articles_list.draw_item(articles_list.item_num[id]);if(publishers_list.item_num[_3]){publishers_list.draw_item(publishers_list.item_num[_3]);}}};article_view.clear=function article_view_clear(){var _4=document.createElement("div");_4.innerHTML=" ";area.set_content("avd",_4);_4=document.createElement("div");_4.innerHTML=" ";area.set_header("avd",_4);};article_view.draw=function article_view_draw(){var _5=keys(state.selected_article_ids);if(state.show_original_article||(state.show_original_article===undefined&&_5.length==1&&data.publishers[data.articles[_5[0]].publisher_ref]&&data.publishers[data.articles[_5[0]].publisher_ref].show_original)){article_view.draw_original();}else{if(data.articles[_5[0]].body===undefined){article_view.draw_header();gui.div_clear("avd");gui.div_loading("avd");state.please_refresh_article_view=true;return;} var _6;var _7;var _8=((data.articles[_5[0]].author&&state.alist_show_author)?" ("+data.articles[_5[0]].author+")":"");gui.div_top("avd");_6=xGetElementById("avd");_6.style.overflow="auto";_6=document.createElement("div");_7=document.createElement("div");_7.style.padding=2*gui.space+"px "+2*gui.space+"px 0 "+2*gui.space+"px";_7.style.backgroundColor="#f5f5ff";_7.style.borderBottom="1px solid #cdf";_7.innerHTML=""+"
"+""+data.articles[_5[0]].date+""+"
";_6.appendChild(_7);var _7=document.createElement("div");_7.style.padding=2*gui.space+"px "+2*gui.space+"px 0 "+2*gui.space+"px";_7.innerHTML=(data.articles[_5[0]].body||("
- "+"no content"+" -"));_6.appendChild(_7);area.set_content("avd",_6);} article_view.draw_header();};article_view.draw_original=function article_view_draw_original(){var _9;var _a=xGetElementById("avd");_a.innerHTML="";_a.style.overflow="hidden";_9=document.createElement("div");_9.innerHTML="";_a.appendChild(_9);_9=xGetElementById("avd_iframe");_9.style.border="0 none #000";_9.setAttribute("frameborder",0);_9.src=data.articles[keys(state.selected_article_ids)[0]].url;article_view.resize();};article_view.resize=function article_view_resize(){var _b=keys(state.selected_article_ids);if(state.show_original_article||(state.show_original_article===undefined&&_b.length==1&&data.publishers[data.articles[_b[0]].publisher_ref]&&data.publishers[data.articles[_b[0]].publisher_ref].show_original)){var _c=xGetElementById("avd");var _d=xGetElementById("avd_iframe");xWidth(_d,xWidth(_c)-2);xHeight(_d,xHeight(_c)-1);}};article_view.draw_header=function article_view_draw_header(){var _e=keys(state.selected_article_ids);var _f;var _10=document.createElement("div");if(_e.length==0){_10.innerHTML=" ";area.set_header("avd",_10);return;} var _11=((data.articles[_e[0]].author&&state.alist_show_author)?" ("+data.articles[_e[0]].author+")":"");var _12=document.createElement("span");if(data.articles[_e[0]].url){_12.innerHTML=""+""+(data.articles[_e[0]].title||"no title")+""+_11;}else{_12.innerHTML=""+(data.articles[_e[0]].title||"no title")+_11;} _10.appendChild(area.title(_12));var div=document.createElement("div");if(!xGetCookie("public")){if(!data.articles[_e[0]].is_bookmarked){div.appendChild(cmd.menu({"icon":"bookmark","pressed":0,"text":"bookmark","hint":"Bookmark this article for reading later.","onclick":function article_view_menu_mark_item(){article_view.cmd_mark_item();}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"bookmark","pressed":1,"text":"bookmark","hint":"Bookmark this article for reading later.","onclick":function article_view_menu_unmark_item(){article_view.cmd_unmark_item();}}));div.appendChild(cmd.space());} if(!data.articles[_e[0]].is_unread){div.appendChild(cmd.menu({"icon":"keep_unread","text":"keep unread","hint":"Keep this article as unread.","onclick":function article_view_menu_mark_article_unread(){article_view.cmd_mark_article_unread();}}));}else{div.appendChild(cmd.menu({"icon":"keep_unread","disabled":1,"text":"keep unread","onclick":function article_view_menu_mark_article_unread(){article_view.cmd_mark_article_unread();}}));} div.appendChild(cmd.space());} if(state.show_original_article===undefined&&_e.length==1){if(data.publishers[data.articles[_e[0]].publisher_ref]){state.show_original_article=data.publishers[data.articles[_e[0]].publisher_ref].show_original;}else{state.show_original_article=0;}} div.appendChild(cmd.menu({"icon":"e-mail","text":"email article","hint":"Email this article to someone.","onclick":function article_view_menu_show_original(){if(xGetCookie("un")!=null){code.load("email");email.draw(_e[0]);}else{message.show_hint(document.createTextNode("To email an article you have to login first."));}}}));div.appendChild(cmd.space());if(!state.show_original_article){div.appendChild(cmd.menu({"icon":"show_original","pressed":0,"text":"show original","hint":"Display original from web site. Not supported by all sites.","onclick":function article_view_menu_show_original(){state.show_original_article=1;article_view.refresh({"show_loading":1,"fetch":1});}}));div.appendChild(cmd.space());}else{div.appendChild(cmd.menu({"icon":"show_original","pressed":1,"text":"show original","hint":"Display original from web site. Not supported by all sites.","onclick":function article_view_menu_show_preview(){state.show_original_article=0;article_view.refresh({"show_loading":1,"fetch":1});}}));div.appendChild(cmd.space());} _10.appendChild(area.menu(div));area.set_header("avd",_10);};article_view.cmd_mark_article_unread=function article_view_cmd_mark_article_unread(){var _14=keys(state.selected_article_ids)[0];var _15=data.articles[_14].publisher_ref;if(!data.articles[_14].is_unread){io.post("c=mark_article_unread"+"&article_id="+encodeURIComponent(keys(state.selected_article_ids)[0]),function(){});data.articles[_14].is_unread=1;++data.publishers[_15].num_unread_articles;} articles_list.draw_item(articles_list.item_num[_14]);article_view.draw_header();if(publishers_list.item_num[_15]){publishers_list.draw_item(publishers_list.item_num[_15]);} publishers_list.draw_tags_list();publishers_list.draw_title();};article_view.cmd_mark_item=function article_view_cmd_mark_item(){io.post("c=mark_item"+"&article_id="+encodeURIComponent(keys(state.selected_article_ids)[0]),function(){});data.articles[keys(state.selected_article_ids)[0]].is_bookmarked=1;data.publishers[1].article_ids.push(keys(state.selected_article_ids)[0]);articles_list.draw_item(articles_list.item_num[keys(state.selected_article_ids)[0]]);article_view.draw_header();};article_view.cmd_unmark_item=function article_view_cmd_unmark_item(){io.post("c=unmark_item"+"&article_id="+encodeURIComponent(keys(state.selected_article_ids)[0]),function(){});data.articles[keys(state.selected_article_ids)[0]].is_bookmarked=0;var _16=[];for(i in data.publishers[1].article_ids){var id=data.publishers[1].article_ids[i];if(id!=keys(state.selected_article_ids)[0]){_16.push(id);}} data.publishers[1].article_ids=_16.slice();articles_list.draw_item(articles_list.item_num[keys(state.selected_article_ids)[0]]);article_view.draw_header();}; var help=new Object();help.draw=function(){console("help.draw");var _1;_1=xGetElementById("avd");_1.style.overflow="auto";area.set_header("avd",area.title(document.createTextNode("Help")));gui.div_loading("avd");io.post("c=help",function(_2){var _3=xGetElementById("avd");_3.innerHTML=_2;});}; var state={};window.onload=function(){gui.div_loading(document.body);if(auto_detect_language){var _1=new Date();_1.setTime(_1.getTime()+3*365*24*60*60*1000);xSetCookie("detected-lang",language,_1);} if(xGetCookie("public")){storage.fetch_state(function(){gui.init();gui.refresh();gui.resize();setTimeout(data.init,25);});}else{storage.fetch_state(function(){gui.init();if(xGetCookie("subscribe")){code.load("subscribe");subscribe.draw_autosubscribe();} gui.refresh();gui.resize();setTimeout(data.init,25);});}};