Google 的个性化主页

// JScript source code
//获取id=a的元素
function _gel(a){return document.getElementById?document.getElementById(a):null}
//根据标签名称获取该名称的标签数组
function _gelstn(a){return document.getElementsByTagName?document.getElementsByTagName(a):new Array()}
//转化为大写
function _uc(a){return a.toUpperCase()}
//去掉空格
function _trim(a){return a.replace(/^/s*|/s*$/g,"")}
//编码
function _esc(a){return window.encodeURIComponent?encodeURIComponent(a):escape(a)}
//解码
function _hesc(a){return a.replace(/</g,"&lt;").replace(/>/g,"&gt;")}
function _jesc(a){return a.replace(/"/g,'//"').replace(/'/g,"//'")}
var aK=0;function _uid(){return"obj"+aK++}
//取较小者
function _min(a,aa){return a<aa?a:aa}
//取较大者
function _max(a,aa){return a>aa?a:aa}
//执行xmlhttp请求,aa是一个函数,这是一个传递函数调用的用法
var aF=navigator.userAgent.indexOf("Safari")>=0;
function _sendx(a,aa){var ab=aL();if(!ab||aF&&!aa){(new Image()).src=a}else{ab.open("GET",a,true);if(aa){ab.onreadystatechange=function(){if(ab.readyState==4){aa(ab.responseText)}}
}ab.send(null)}}
//。。。
function _uhc(a,aa,ab){var ac="m_"+a+"_"+aa;var ad=_gel(ac);if(!ad){ad=document.createElement("INPUT");ad.type="hidden";ad.disabled=true;ad.name=ac;_gel("m_"+a+"_form").appendChild(ad)}ad.value=ab;ad.disabled=false}
//返回一个适用于浏览器差异的xmlhttp对象
function aL(){var a=null;if(window.ActiveXObject){a=new ActiveXObject("Msxml2.XMLHTTP");if(!a){a=new ActiveXObject("Microsoft.XMLHTTP")}}else if(window.XMLHttpRequest){a=new XMLHttpRequest()}return a}
var _et="";var as="/ig/setp";
//新建一个input设置name=aa,value=ab,type=hidden然后把它们添加到a中,以便于之后提交该a时把该数据提交给服务器
function an(a,aa,ab){var ac=document.createElement("input");ac.type="hidden";ac.name=aa;ac.value=ab;a.appendChild(ac)}
//构造参数为?pa1=pa1value&pa2=pa2value的形式
function ar(){var a=document.location.search;return a?a+"&":"?"}
//设置a的action=as,as在28行定义,method=get,并在a中添加hidden input分别设置其name和value
function _fsetp(a,aa,ab){a.action=as;a.method="get";an(a,"url",document.location);an(a,"et",_et);an(a,"m_"+aa+"_t",ab);return true}
function _xsetp(a){_sendx(as+ar()+"et="+_et+"&"+a,null)}
//刷新页面
function _dlsetp(a){document.location=as+ar()+"et="+_et+"&url="+escape(document.location)+"&"+a}
//换样式表,将.a的样式中的第aa个元素的值修改为ab
function _ssbc(a,aa,ab){if(document.styleSheets){a="."+a;for(var ac=0;ac<document.styleSheets.length;ac++){var ad=document.styleSheets[ac];var ae=ad.rules;if(!ae){ae=ad.cssRules;if(!ae){return}}for(var af=0;af<ae.length;af++){if(ae[af].selectorText.toLowerCase()==a){ae[af].style[aa]=ab}}}}else{var ag=_gelstn("*");for(var ac=0;ac<ag.length;ac++){if(ag[ac].className==a){ag[ac].style[aa]=ab}}}}
//修改编辑是否可见
function _edit(a,aa){_gel("m_"+a).className="modbox_e";if(aa){aa()}return false}
function _cedit(a){_gel("m_"+a).className="modbox";_gel("m_"+a+"_form").reset();return false}
//删除
function _del(a,aa){_dlsetp("m_"+a+"_enab=0&m_"+a+"_t="+aa);return false}
//
var aC="https://www.google.com/accounts";
function _enableGS(a,aa){a.action=aC+"/CheckCookie";a.method="get";an(a,"service",aa);an(a,"continue",document.location);an(a,"skipvpage",true);return true}
function aJ(a){_xsetp("pnlo="+(a?1:0))}
var _uli;var _pnlo;var _pl;var _mod;var ay=false;
//初始化可移动部件
function _upc(){_ssbc("medit","display",_pnlo||_uli?"":"none");_ssbc("panelo","display",_pnlo?"":"none");_ssbc("panelc","display",_pnlo?"none":"");_ssbc("mod","display",_mod?"":"none");_ssbc("unmod","display",_mod?"none":"");if(_pl&&(_uli||_pnlo)){if(!ay){aE([_gel("c_1"),_gel("c_2"),_gel("c_3")]);ay=true}_ssbc("mttl","cursor","move")}}
//
var aq=0;function _tp(a){if(aq>0)clearInterval(ap);_pnlo=a;_mod=true;aJ(a);_upc();var aa=_gel("cpnl");var ab=_gel("cpnls");var ac=_gel("cpnlc");var ad=_gel("nhdr");var ae=_gel("ehdr");var af=aa.offsetWidth;var ag;var ai;if(a){ag=ac.offsetWidth;ai="visible";ae.style.display="";ad.style.display="none"}else{ag=1;ai="hidden";ae.style.display="none";ad.style.display=""}aa.style.overflow="hidden";var ak=100;var at=10;var au=0;aq=setInterval(function(){var av=au/at;var az=af+(ag-af)*av;ab.width=(aa.style.width=az);au++;if(av>=1){clearInterval(aq);aq=0;ab.width=(aa.style.width=ag);aa.style.overflow=ai}}
,ak/at);return false}
function _ts(a,aa){var ab=_gel(a+aa);var ac;if(ab.className=="mlist_open"){ab.className="mlist_closed";ac="pnlsc"}else{ab.className="mlist_open";ac="pnlso"}_xsetp(ac+"="+_esc(aa));return false}
function _add_m(a){_dlsetp(a)}
function _add_f(a){_dlsetp("n_25="+_esc("url="+_esc(a)))}
function _find_feed(){var a=_gelstn("div");if(a){for(var aa=0;aa<a.length;aa++){if(a[aa].id&&(a[aa].id.indexOf("ps")==0&&a[aa].className=="mlist_open")){_ts("ps",a[aa].id.substring(2))}}}var ab=_gel("add_custom").value;_sendx("/ig/feeds"+ar()+"q="+_esc(ab),aB);return false}
function aB(a){var aa=_gel("ffresults");var ab=/^_add_m/(/'[^']+/'/)$/;if(a.length>0&&a.charAt(0)=="<"){aa.innerHTML=a}else if(a.match(ab)){eval(a)}}
var aj=[];var ap=0;var am=null;
//创建一个div并将添加到document.body中,返回它**这个是单件模式哦^_^
function ah(){if(!am){am=document.createElement("DIV");am.style.display="none";am.style.position="absolute";am.style.cursor="move";am.style.backgroundColor="#ffffff";am.style.paddingBottom="0px";document.body.appendChild(am)}return am}
//给a添加鼠标点下等事件,init一个a后,鼠标按下时绑定拖动的处理程序,
var al={"obj":null,"init":function(a){a.onmousedown=al.start;if(isNaN(parseInt(ah().style.left)))ah().style.left="0px";if(isNaN(parseInt(ah().style.top)))ah().style.top="0px";a.onDragStart=new Function();a.onDragEnd=new Function();a.onDrag=new Function()}
,"start":function(a){var aa=al.obj=this;a=al.fixE(a);var ab=parseInt(ah().style.top);var ac=parseInt(ah().style.left);aa.onDragStart(ac,ab,a.clientX,a.clientY);aa.lastMouseX=a.clientX;aa.lastMouseY=a.clientY;document.onmousemove=al.drag;document.onmouseup=al.end;return false}
,"drag":function(a){a=al.fixE(a);var aa=al.obj;var ab=a.clientY;var ac=a.clientX;var ad=parseInt(ah().style.top);var ae=parseInt(ah().style.left);var af,ag;af=ae+ac-aa.lastMouseX;ag=ad+ab-aa.lastMouseY;ah().style.left=af+"px";ah().style.top=ag+"px";aa.lastMouseX=ac;aa.lastMouseY=ab;aa.onDrag(af,ag,a.clientX,a.clientY);return false}
,"end":function(){document.onmousemove=null;document.onmouseup=null;al.obj.onDragEnd(parseInt(ah().style.left),parseInt(ah().style.top));al.obj=null}
,"fixE":function(a){if(typeof a=="undefined")a=window.event;if(typeof a.layerX=="undefined")a.layerX=a.offsetX;if(typeof a.layerY=="undefined")a.layerY=a.offsetY;return a}
};
//
var aw=false;
function aE(a){if(aw)return;aw=true;aj=a;for(var aa=0;aa<aj.length;aa++){for(var ab=0;ab<aj[aa].childNodes.length-1;ab++){var ac=aj[aa].childNodes[ab];var ad=_gel(ac.id+"_h");if(!ad)continue;ad.module=ac;al.init(ad);var ae=_gel(ac.id+"_url");if(ae){ae.h=ad;ae.onmousedown=function(){this.h.href=this.href;this.h.target=this.target}
}ad.onDragStart=function(af,ag){clearInterval(ap);var ai=this.module;aA(ai);ai.origNextSibling=ai.nextSibling;var ak=ah();ak.style.left=ao(ai,true);ak.style.top=ao(ai,false);ak.style.height=ai.offsetHeight;ak.style.width=ai.offsetWidth;ak.style.display="block";ak.style.opacity=0.8;ak.style.filter="alpha(opacity=80)";ak.innerHTML=ai.innerHTML;ak.className=ai.className;this.dragged=false}
;ad.onDrag=function(af,ag){aG(this.module,af,ag);this.dragged=true}
;ad.onDragEnd=function(af,ag){if(this.dragged){ap=aD(this.module,150,15)}else{ax();if(this.href){if(this.target){window.open(this.href,this.target)}else{document.location=this.href}}}this.target=null;this.href=null;if(this.module.nextSibling!=this.module.origNextSibling){aI()}}
}}}
//使得复制div不可见
function ax(){ah().style.display="none"}
//使得复制div恢复到元素a的位置,很好的效果^_^
function aD(a,aa,ab){var ac=parseInt(ah().style.left);var ad=parseInt(ah().style.top);var ae=(ac-ao(a,true))/ab;var af=(ad-ao(a,false))/ab;return setInterval(function(){if(ab<1){clearInterval(ap);ax();return}ab--;ac-=ae;ad-=af;ah().style.left=parseInt(ac)+"px";ah().style.top=parseInt(ad)+"px"},aa/ab)}
//移动aj中所有与a相等的元素到a的位置
function aA(a){for(var aa=0;aa<aj.length;aa++){var ab=0;for(var ac=0;ac<aj[aa].childNodes.length;ac++){var ad=aj[aa].childNodes[ac];if(ad==a)ab=ad.offsetHeight;ad.pagePosLeft=ao(ad,true);ad.pagePosTop=ao(ad,false)-ab}}}
//a距离祖先容器top或者left的距离,top和left取决于aa==true?
function ao(a,aa){var ab=0;while(a!=null){ab+=a["offset"+(aa?"Left":"Top")];a=a.offsetParent}return ab}
//移动并最后插入到其中即真正的移动了内容模块
function aG(a,aa,ab){var ac=null;var ad=100000000;for(var ae=0;ae<aj.length;ae++){for(var af=0;af<aj[ae].childNodes.length;af++){var ag=aj[ae].childNodes[af];if(ag==a)continue;var ai=Math.sqrt(Math.pow(aa-ag.pagePosLeft,2)+Math.pow(ab-ag.pagePosTop,2));if(isNaN(ai))continue;if(ai<ad){ad=ai;ac=ag}}}if(ac!=null&&a.nextSibling!=ac){ac.parentNode.insertBefore(a,ac);aH(a)}}
//隐藏元素a的父容器
function aH(a){a.parentNode.style.display="none";a.parentNode.style.display=""}
阅读更多
上一篇GIS开发
下一篇Python入门记录
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭