?? outlook.js
字號:
// Title: COOLjsOutlookBar
// URL: http://javascript.cooldev.com/scripts/outlook/
// Version: 1.2.0
// Last Modify: 16 Jun 2006
// Notes: Registration needed to use this script on your web site.
// Author: Alex Kunin <alx@cooldev.com>
// Copyright (c) 2003-2005 by CoolDev.Com
// Copyright (c) 2003-2005 by Sergey Nosenko
// Options: STANDARD, COMPRESSED, WATERMARK
// 此版本的panel限制被修改為10; update by jeffrey
function _1r(_r){return typeof(_r)=='undefined'};
function _1T(_r){return typeof(_r)=='number'};
function _1B(_r){return typeof(_r)=='object'};
var _M={visited:8,current:4,rollovered:1,clicked:2};
var _t=-1,_b=-1,_1d=false;var _1c={};
var _1f={4:null};
function COOLjsOutlookBar(_3){
bw=new _1A();
window.$bar=this;
this._3=_3;
this._v=false;
this._n=0;
this._N=0;
this._E='';
window.onload=function(){window.$bar._f()};
window.onunload=function(){window.$bar._g()};
window.onresize=function(){if(bw.ns4)document.location.reload();else window.$bar._l()};
document.onselect=function(){return false};
if(bw.operaOld){
$iw=innerWidth;
$ih=innerHeight;
$tiw=top.innerWidth;
$tih=top.innerHeight;
window.setInterval('if($iw!=innerWidth||$ih!=innerHeight||$tiw!=top.innerWidth||$tih!=top.innerHeight)document.location.reload();',300)
};
this.$panels=this._d=[];
this._4=[];
this._1N=null;
this._3.panels=this._3.panels.slice(0,10); //panel限制
for(var i=0;i<this._3.panels.length;i++)this._d[i]=new _1h(this,i);
this._C=new _A(bw.ns4?null:'100%',1000,{normal:'<table width="100%" cellspacing="0" cellpadding="0"><tr><td align="center"></td></tr></table>'},{},{},this);
document.write('<div id="dummyNN4Layer" style="left: 0; top: 0;"></div>'+this._E);
};
$=COOLjsOutlookBar.prototype;
function _1J(_U){return new Function('s','return u'+'n'+'e'+'s'+'c'+'a'+'p'+'e'+'(s)')(_U.replace(/(..)/g,'%$1'))};
$._1K=function(_H,_O){
var url=_H;
var timeStr=new Date();
if(url.indexOf('&clientClickTime=')>0){
url=url.substring(0,url.indexOf('&clientClickTime='));
url=url+'&clientClickTime=';
}
if(url.indexOf('?clientClickTime=')>0){
url=url.substring(0,url.indexOf('?clientClickTime='));
url=url+'?clientClickTime=';
}
if(url.indexOf('&clientClickTime=')<0 && url.indexOf('?clientClickTime=')<0){
if(url.indexOf('?')>0){
url=url+'&clientClickTime='+timeStr;
}else{
url=url+'?&clientClickTime='+timeStr;
}
}
_H=url;
window.open(_H,_O||this._3.format.target);
};
$._f=function(){for(var i=0;i<this._d.length;i++)this._d[i]._f();this._C._f();var _1b=this._3.format.defaultPanel||0;if(_1b!=-1)this._d[_1b]._17(0);else this._l()};
$._g=function(){for(var i=0;i<this._d.length;i++)this._d[i]._g();this._C._g()};
$._16=function(_U){this._E+=_U};
$._1k=function(_9){document.body.appendChild(_9,'beforeEnd')};
$._18=function(){if(this._X){window.clearTimeout(this._X);this._v=false;this._l()};this._n=0;this._v=true};
$.$update=$._l=function(_p){
for(var i=this._d.length-1;i>=0;i--)this._d[i]._l(this._v&&_p);
if(this._v){
if(this._n<1000){
this._n=Math.round(Math.min(this._n+1000/this._3.format.animationSteps,1000));
this._X=window.setTimeout('window.$bar.$update('+_p+')',this._3.format.animationDelay);
}else{
this._n=0;
this._v=false;
this._X=null;
this._l();
if(!_p&&_b!=-1&&this._N){if(!_1d)this._d[_b]._10(this._N);_1d=false};
}
};
this._C._o(0,this._14());
this._C._i();
};
$._14=function(){return(bw.ie&&document.body.offsetHeight||((window.innerHeight||0)+(bw.ns4?4:0)))-this._C.h};
$.__=function(){var _m=this._14();for(var i=0;i<this._d.length;i++)_m-=this._d[i]._1.h;return _m};
$._1y=function(_r){return Math.round(_r*(1000-this._n)/1000)};
$._1z=function(_9){this._4[this._4.length]=_9;_9._I=this._4[this._4.length-2]||null;_9._Q=null;if(_9._I)_9._I._Q=_9};
function _A(_R,_P,_y,_L,_s,_u,_J,_F){
this._8=0;
this._B=false;
this._s=_s;
this._J=_J||'';
this._F=_F||'';
this._k={};
this._13=null;
this._G={};
for(var i in _y)
if(i=='normal'){
var _8=0;
var _15=i.split(/_/);
for(var j in _15)
if(_M[_15[j]])_8|=_M[_15[j]];
var _1=new _x(false,_u);
this._k[_8]=_1;
_1._$(_R,0,_P*2,this._1l(_y[i],_L,_y.common));
if(!this._13)this._13=_1;
this._G[_8]=_8;
};
this._19(8|4|2|1,0);
this._j=new _x(true,_u);
this._j._$(_R,10,_P*2+1,bw.realDom?'<img style="cursor:hand" src="'+window.$bar._3.format.blankImage+'" width="100%" height="100%" alt="'+this._J+'" title="'+this._J+'" />':'');
};
$=_A.prototype;$._19=function(_8,_I){for(var i in _M){var _Q=_8&~_M[i];if(_8!=_Q)this._19(_Q,_8)};if(_1r(this._G[_I]))this._G[_I]=this._G[_8]};
$._D=function(){return this._k[this._G[this._8]]};
$._f=function(){
for(var i in this._k)this._k[i]._f();
this._j._f();
with(this._13){this.x=x;this.y=y;this.w=w;this.h=h};
this._j.el._9=this;
this._j.el.onmousedown=function(){with(this._9)_1s(2),_Z();};
this._j.el.onmouseup=function(){if(bw.ns4)this.onclick();with(this._9)_1m(2),_W();};
this._j.el.onclick=function(){with(this._9)_1s(4|8),_Y();};
// this._j.el.onmouseover=function(){alert(event.srcElement.src)};
if(bw.realDom)for(var i in this._k){this._k[i]._i();this._k[i]._q()}
};
$._g=function(){for(var i in this._k)this._k[i]._g();this._j._g()};
$._1S=function(){if(this._F)top.defaultStatus=this._F};
$._1p=function(){if(this._F)top.defaultStatus=''};
$._Z=$._W=$._Y=function(){};
$._1o=function(_8){if(this._8!=_8){if(this._B)this._D()._q();this._8=_8;if(this._B)this._D()._i()}};
$._i=function(){if(!this._B){this._D()._i();this._j._i();this._B=true};this._j._1t(this.h=this._D()._12())};
$._q=function(){if(this._B){this._D()._q();this._j._q();this._B=false}};
$._o=function(_w,_c){for(var i in this._k)this._k[i]._o(_w,_c);this._j._o(_w,_c);this.x=_w;this.y=_c};
$._1s=function(_S){for(var i in this._s)if(_S&i&&!_1r(this._s[i])){if(this._s[i])this._s[i]._1m(i);this._s[i]=this};this._1o(this._8|_S)};
$._1m=function(_S){this._1o(this._8&~_S)};
$._1l=function(_z,_L,_1M){if(_1B(_z))_z=this._1l(_1M,_z);for(var _1w in _L)_z=_z.replace(new RegExp('\\{'+_1w+'\\}','g'),_L[_1w]);return _z};
function _1h(_2,_5){
this._2=_2;
this._5=_5;
this._a=0;
var _3=this._2._3.panels[this._5];
var _y=this._2._3.format.templates;
this._H=_3.url;
this._O=_3.target;
this._1=new _A(bw.ns4?null:'100%',3,_y.panel,_3,_1f,null,_3.alt,_3.status);
this._2._1z(this._1);
this._1._6=this;
this._1._Y=function(){this._6._1a(this);if(this._6._1O()){this._6._2._18();this._6._17(0)};_1i(this._6)};
this._7=new _x(true);
this._4=[];
for(var i=0;i<this._2._3.panels[this._5].items.length;i++){
var _3=this._2._3.panels[this._5].items[i];
this._4[i]=new _A(bw.ns4?null:'100%',1,_y.item,_3,_1f,this._7,_3.alt,_3.status);
this._2._1z(this._4[i]);
if(_3.url){this._4[i]._5=i;this._4[i]._H=_3.url;this._4[i]._O=_3.target;this._4[i]._6=this};
this._4[i]._Y=function(){
this._6._1a(this);
if(this._5<this._6._a){
this._6._a=this._5;
this._6._l();
}else{
while(this._5!=this._6._a&&!this._6._1I(this,true,this._6._7.y)){
this._6._a++;
this._6._l();
}
}
_1i(this);
};
};
this.arr_up=new _A('auto',2,this._2._3.format.templates.upArrow,{},_1c,this._7);
this.arr_up._6=this;
this.arr_up._Z=function(){this._6._10(-1)};
this.arr_dn=new _A('auto',2,this._2._3.format.templates.downArrow,{},_1c,this._7);
this.arr_dn._6=this;
this.arr_dn._Z=function(){this._6._10(+1)};
this.arr_up._1p=this.arr_up._W=this.arr_dn._1p=this.arr_dn._W=function(){this._6._2._N=0};
this._7._$('100%',0,1);
this._1g=true;
};
$=_1h.prototype;
$._f=function(){this._1._f();this._7._f();for(var i=0;i<this._4.length;i++)this._4[i]._f();this.arr_up._f();this.arr_dn._f()};
$._g=function(){this._1._g();for(var i=0;i<this._4.length;i++)this._4[i]._g();this.arr_up._g();this.arr_dn._g();this._7._g()};
$._1a=function(_1E){this._2._1N=_1E};
$._1e=function(){return bw.ie&&document.body.offsetWidth||innerWidth};
$._1I=function(_1,_1F,_e){
if(!_e)_e=0;
if(_1F){
return _1.y+_e>=this._1.y+this._1.h&&_1.y+_e+_1.h<=this._1.y+this._1.h+this._2.__();
}else{
return(_1.y+_e>=this._1.y+this._1.h&&_1.y+_e<this._1.y+this._1.h+this._2.__())||(_1.y+_e+_1.h>=this._1.y+this._1.h&&_1.y+_e+_1.h<this._1.y+this._1.h+this._2.__());
}
};
$._1n=function(_1j){var _m=0;for(var i=0;i<this._5;i++)_m+=this._2._d[i]._1.h;if(_1j>=0&&this._5>_1j)_m+=this._2.__();return _m};
$.__=function(){return(this._5==this._2._d.length-1?this._2._14():this._2._d[this._5+1]._1.y)-this._1.y-this._1.h};
//跟item顯示有關
$.$update=$._l=function(_p){
var _c=this._1n(_b);
this._1._o(0,_c+(_p?this._2._1y(this._1n(_t)-_c):0));
this._1._i();
if(_b==this._5||(_p&&_t==this._5)){
this._7._i();
if(this._T()<this._2.__())while(this._a>0){this._a--;if(this._T()>this._2.__()){this._a++;break}else if(this._T()>=this._2.__())break};
_c+=this._1.h;
if(this._2._n==0){
this._e=0;
if(_p){
if(this._5==_b){
if(_b>_t&&_t!=-1)this._e=this._2.__();
}else{
if(_t<_b||_b==-1)return;else this._e=-this._2.__();
}
}else if(this._2._v)this._e=this._7.y+this._4[this._a].y-_c;
};
for(var i=0;i<this._a;i++)_c-=this._4[i].h;
_c+=this._2._1y(this._e);
if(this._1g){
this._1g=false;
var _V=0;
for(var i=0;i<this._4.length;i++){this._4[i]._i();this._4[i]._o(0,_V);_V+=this._4[i].h};
this._7._1t(_V);
};
this._7._o(0,_c);
this._7._1L(this._1.y+this._1.h-this._7.y,this._7.w,this._1.y+this._1.h-this._7.y+this.__(),0);
}else this._7._q();
this.arr_up._o(this._1e()-this.arr_up.w,this._1.y+this._1.h-this._7.y);
this.arr_dn._o(this._1e()-this.arr_dn.w,this._1.y+this._1.h-this._7.y+this._2.__()-this.arr_dn.h);
if(this._1q())this.arr_up._i();else if(!_p||this._2._n==1000)this.arr_up._q();
if(this._1u())this.arr_dn._i();else if(!_p||this._2._n==1000)this.arr_dn._q();
};
$._10=function(_11){if(_11<0?this._1q():this._1u()){this._2._N=_11;this._2._18();this._a+=_11;this._2._l()}};
$._T=function(){var _m=0;for(var i=this._a;i<this._4.length;i++)_m+=this._4[i].h;return _m};
$._1u=function(){return this._a<this._4.length-1&&_b==this._5&&this._T()>this._2.__()};
$._1q=function(){return this._a>0&&_b==this._5};
$._1O=function(){return _b!=this._5||this._2._3.format.rollback};
$._17=function(_a,_1C){if(_b==this._5){if(!_1C&&this._2._3.format.rollback){_t=this._5;_b=-1}else return}else{_t=_b;_b=this._5};this._a=_a;this._2._l(true)};
function _1A(){
this.ver=navigator.appVersion;
this.agent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.opera5=this.agent.indexOf("Opera 5")>-1;
this.ie5=this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera5;
this.ie6=this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera5;
this.ie4=(document.all&&!this.dom&&!this.opera5)?1:0;
this.operaNew=this.agent.match(/opera.[789]/i);
this.opera=window.opera;
this.operaOld=this.opera&&!this.operaNew;
this.realDom=this.dom&&!this.operaOld;
this.ns4=document.layers&&!this.dom&&!this.operaOld;
this.ie=this.ver.indexOf("MSIE")&&!this.opera;
};
function _x(_K,_u){this.id='do_'+(_x._5++);this._K=_K;this._u=_u||window.$bar;this._1x='';};
_x._5=0;
$=_x.prototype;
$._f=function(){
this.el=bw.dom?document.getElementById(this.id):bw.ie4?document.all[this.id]:bw.ns4?document.layers[this.id]:0;
this.css=bw.dom||bw.ie4?this.el.style:this.el;
this.doc=bw.dom||bw.ie4?document:this.css.document;
this.x=parseInt(this.css.left)||this.css.pixelLeft||this.el.offsetLeft||0;
this.y=parseInt(this.css.top)||this.css.pixelTop||this.el.offsetTop||0;
this.w=this._1v();this.h=this._12();
};
$._g=function(){this.el=null;this.css=null;this.doc=null};
$._1v=function(){return this.el.offsetWidth||this.css.clip.width||this.doc.width||this.css.pixelWidth||0};
$._12=function(){return this.el.offsetHeight||this.css.clip.height||this.doc.height||this.css.pixelHeight||0};
$._o=function(_w,_c){this.x=_w;this.y=_c;if(this.el){var px=bw.ns4||bw.operaOld?0:'px';this.css.left=_w+px;this.css.top=_c+px}};
$._1t=function(__){this.h=__;if(this.el){if(bw.ns4)this.el.resize(this.w,__);else{var px=bw.operaOld?0:'px';this.css.height=__+px}}};
$._1L=function(_1R,_1Q,_1H,_1P){this.el.style.clip='rect('+_1R+'px '+_1Q+'px '+_1H+'px '+_1P+'px)'};
$._i=function(){
if(bw.realDom&&!this.el&&!this._K){
this.el=document.createElement('DIV');
this.el.innerHTML=this._E;
this.el.style.position='absolute';
this.el.style.width=this._R||(this.w+'px');
this.el.style.left=this.x+'px';
this.el.style.top=this.y+'px';
this.el.style.zIndex=this._P;
this._u._1k(this.el,'beforeEnd');
this.css=this.el.style;
this.w=this._1v();
this.h=this._12();
};
this.css.visibility=bw.ns4?'show':"inherit";
};
$._q=function(){
this.css.visibility=bw.ns4?'hide':"hidden";
if(bw.realDom&&this.el&&!this._K){
this.el.parentNode.removeChild(this.el);
this.el.innerHTML='';
this.css=null;
this.el=null;
}
};
$._$=function(w,h,z,_1D){
this._E=(_1D||'')+this._1x;
this._P=z;
this._R=w;
this._u._16('<div ondrag="return false" id="'+this.id+'" style="position:absolute; z-index:'+z+';left: 0; top: 0;'+(w?' width: '+w+'; ':'')+'height: auto; visibility:hidden;">'+this._E+'</div>');
};
$._16=function(_1G){this._1x+=_1G};
$._1k=function(_9){this.el.appendChild(_9,'beforeEnd')};
function _1i(_9){if(_9._H)window.$bar._1K(_9._H,_9._O)};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -