📄 mztreeview10 开发文档.mht
字号:
}
SPAN.Note {
COLOR: #008000
}
TD.Param {
WIDTH: 80px
}
PRE.Code {
COLOR: #0000d0
}
------=_NextPart_000_0000_01C525BE.7A8CF800
Content-Type: application/x-javascript
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.meizz.com/Scripts/Global.js
<!--
/*___________________________________________________________*\
Filename: Global.js
Subject: http://www.meizz.com/ Global Variable Method Class
Author: meizz
Begin: 2003-12-5
\*___________________________________________________________*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*\
Global variable
\*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
var splitInLine =3D "\x0f"; //List separator in line
var splitEndLine=3D "\r\n"; //List separator after line
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*\
Prototype expand
\*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
String.prototype.trim =3D function(){return =
this.replace(/(^\s+)|(\s+$)/, "");}
String.prototype.ltrim =3D function(){return this.replace(/(^\s+)/, =
"");}
String.prototype.rtrim =3D function(){return this.replace(/(\s+$)/, =
"");}
String.prototype.lenB =3D function(){return =
this.replace(/[^\x00-\xff]/g, "xx").length;}
String.prototype.getParam =3D function(name) //Get value from arguments =
by name
{
var reg =3D new RegExp("(^|;|\\s)"+name+"\\s*:\\s*([^;]*)(\\s|;|$)", =
"i");
var str =3D this.replace(/(;[^:]+)(;|$)/g, function(a,b,c){return =
b.replace(/;/g, "\x0f")+c;});
var r =3D str.match(reg); if (r!=3Dnull) return =
r[2].replace(/[\x0f]/g, ";"); return "";
}
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*\
Custom Method
\*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
function getAbsLeft(e){var l=3De.offsetLeft; while(e=3De.offsetParent) l =
+=3D e.offsetLeft; return l;}
function getAbsTop(e) {var t=3De.offsetTop; while(e=3De.offsetParent) t =
+=3D e.offsetTop; return t;}
function getAbsPoint(e)
{
var x =3D e.offsetLeft, y =3D e.offsetTop;
while(e=3De.offsetParent){x +=3D e.offsetLeft; y +=3D e.offsetTop;}
return {"x": x, "y": y};
}
function getObjectById(id)
{
if (typeof(id) !=3D "string" || id =3D=3D "") return null;
if (document.all) return document.all(id);
if (document.getElementById) return document.getElementById(id);
try {return eval(id);} catch(e){ return null;}
}
function searchByTagName(obj, tag)
{
while(obj !=3D null && typeof(obj.tagName) !=3D "undefind")
{if(obj.tagName =3D=3D tag.toUpperCase()) return(obj);
obj =3D obj.parentElement;} return null;
}
function getQuery(name) //Get value from QueryString by name
{
var reg =3D new RegExp("(^|&)"+ name +"=3D([^&]*)(&|$)");
var r =3D window.location.search.substr(1).match(reg);
if (r!=3Dnull) return unescape(r[2]); return "";
}
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*\
Custom Class
\*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
//Cookie Class
function MzCookie()
{
this.path =3D "/";
this.set =3D function(name, value)
{
var Days=3D 30; //Save 30 days
var exp =3D new Date(); //new Date("December 31, 9998");
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie =3D name + "=3D"+ escape (value)=20
+ ";expires=3D" + exp.toGMTString() + ";path=3D"+ this.path;
}
this.get =3D function(name)
{
var arr,reg=3Dnew RegExp("(^| )"+name+"=3D([^;]*)(;|$)");
if(arr=3Ddocument.cookie.match(reg)) return unescape(arr[2]);
else return null;
}
this.del =3D function(name)
{
var exp =3D new Date();
exp.setTime(exp.getTime() - 1);
var cval=3D this.get(name);
if(cval!=3Dnull) document.cookie=3D name + "=3D"+ cval=20
+";expires=3D"+exp.toGMTString() + ";path=3D"+ this.path;
}
}
//Page Layer
function MzLayer(Tname, onlyIframe)
{
var msie =3D window.navigator.appName =3D=3D "Microsoft Internet =
Explorer";
var ver =3D window.navigator.appVersion;
this.popup =3D !onlyIframe && msie && =
parseFloat(ver.substr(ver.indexOf("MSIE")+5))>=3D5.5;
this.layer =3D this.iframe =3D null;
this.autoFit =3D false;
if (this.popup) this.layer=3D window.createPopup();
else
{
if(typeof(Tname) !=3D "string" || Tname=3D=3D"") throw(new Error(-1, =
'The layer\'s name is wrong=A3=A1'));
document.write("<iframe name=3D'MzLayer_"+ Tname +"' =
id=3D'MzLayer_"+ Tname +"' scrolling=3Dyes"
+" frameborder=3D0 border=3D0 style=3D'position: absolute; =
display: none; z-index: 10;'></iframe>");
this.iframe =3D getObjectById("MzLayer_"+ Tname);
this.layer =3D window.frames["MzLayer_"+ Tname];
this.layer.document.write("<html><head>"
+" <meta http-equiv=3D'Content-Type' content=3D'text/html; =
charset=3Dgb2312'></head><body "
+" onselectstart=3D'return false' oncontextmenu=3D'return =
true'></body></html>");
this.layer.document.close();
}
this.style =3D this.layer.document.body.style;
with(this.style)
{
border =3D "1px solid #808080";
overflow =3D "auto";
overflowX =3D "hidden";
fontSize =3D "12px";
margin =3D "0px";
}
this.hide =3D function()
{
if (this.popup){this.layer.hide();}
else this.iframe.style.display =3D "none";
}
this.write =3D function(str)
{
if(this.popup) this.layer.document.body.innerHTML =3D
"<meta http-equiv=3D'Content-Type' content=3D'text/html; =
charset=3Dgb2312'>"+ str;
else this.layer.document.body.innerHTML =3D str;
}
this.show =3D function(e, width, height) //show layer under =
srcElement
{
if(typeof(e)!=3D"object") return("Layer need a head object=A3=A1");
if( !(width && height)) return("Width or Height is wrong=A3=A1");
var OH =3D e.offsetHeight;
var T =3D getAbsTop(e) + OH;
var L =3D getAbsLeft(e);
var DT =3D document.body.scrollTop;
var DL =3D document.body.scrollLeft;
var W =3D width;
var H =3D height;
if(this.popup)
{
this.layer.show(0, 0, 1, 1);
var LH =3D this.layer.document.body.scrollHeight + 2;
var bLW =3D top.document.body.currentStyle.borderLeftWidth;
var bTW =3D top.document.body.currentStyle.borderTopWidth;
L =3D L-DL+(bLW=3D=3D"" || bLW=3D=3D"medium" ? 2 : parseInt(bLW, =
10));
T =3D T-DT+(bTW=3D=3D"" || bLW=3D=3D"medium" ? 2 : parseInt(bTW, =
10));
W =3D this.autoFit ? this.layer.document.body.scrollWidth : W;
H =3D this.autoFit ? LH : LH>H ? H : LH;
this.layer.show(L, T, W, H, document.body);
}
else
{
with(this.iframe.style){width =3D "1"; height =3D "1"; display =3D =
"";}
var DW =3D document.body.clientWidth;
var DH =3D document.body.clientHeight;
var LH =3D this.layer.document.body.scrollHeight + 2;
W =3D this.autoFit ? this.layer.document.body.scrollWidth : W;
H =3D this.autoFit ? LH : LH>H ? H : LH;
with(this.iframe.style)
{
width =3D W;
height =3D H;
top =3D (DH+DT-T>H) ? T : (T-DT-OH<H) ? T : T-H-OH;
left =3D (DW+DL-L>W) ? L : DW+DL-W;
}
}
}
}
function MzLoadData()
{
}
function iframeAutoFit()
{
if(self!=3Dtop && (window.name=3D=3D"MzMain" || =
window.name=3D=3D"DataBaseInputIframe"))
{
var iframe =3D parent.getObjectById(window.name);
if(iframe)
{
iframe.parentNode.style.height =3D iframe.style.height;
iframe.style.height =3D 10;
var h =3D document.body.scrollHeight;
var minimalHeight =3D parseInt((window.screen.width*11)/16, 10) - =
280;
h =3D h<minimalHeight ? minimalHeight : h;
if(window.navigator.appName =3D=3D "Microsoft Internet Explorer"
&& iframe.frameBorder=3D=3D"1") h +=3D 4;
iframe.parentNode.style.height =3D iframe.style.height =3D h;
}
else alert("Iframe's id unequal to iframe's name!");
}
}
if(document.attachEvent) window.attachEvent("onload", iframeAutoFit);
else window.addEventListener('load', iframeAutoFit, false);
//document.attachEvent("onclick", =
function(){try{top.WM.carrierHide()}catch(e){}});
// -->
------=_NextPart_000_0000_01C525BE.7A8CF800--
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -