📄 allcatepop_a.js
字号:
if (this.isUndefined(o.azdAnimAlpha)) {
o.azdAnimAlpha = new Object();
o.azdAnimAlpha.bRunning = false;
}
var anim = o.azdAnimAlpha;
if (anim.bRunning) {
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
}
var alphaDelta = alphaFinal-alphaStart;
var alphaStep = alphaDelta * 1.0 / nSteps; // force floating-point so alphaStep is non-zero
if (nSteps > 1 && Math.abs(alphaStep) > 0.0001) {
anim.alphaStep = alphaStep;
anim.alphaFinal = alphaFinal;
anim.fnDone = fnDone;
var alphaCur = this.getAlphaLevel(o);
anim.nDir = (alphaFinal-alphaCur) > 0 ? 1 : -1;
if (anim.nDir * alphaStep < 0) {
anim.alphaStep = -alphaStep;
}
if (alphaCur >= this.MOZALPHAMAX*100) {
this.setAlphaLevel(o, this.MOZALPHAMAX*100);
}
anim.bRunning = true;
var fn = new Function ("goN2U._animateAlpha('"+sID+"');");
anim.intervalID = setInterval(fn, 25);
} else {
this.setAlphaLevel(o, alphaFinal);
if (fnDone) {
fnDone();
}
}
}
this._animateAlpha = function (sID) {
var o = goN2U.getRawObject(sID);
if (!o) {
;
return;
}
var anim = o.azdAnimAlpha;
if (!anim.bRunning) {
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
return;
}
var alphaNext = this.getAlphaLevel(o) + anim.alphaStep;
if ((anim.alphaFinal-alphaNext) * anim.nDir > 0) {
this.setAlphaLevel(o, alphaNext);
} else {
this.setAlphaLevel(o, anim.alphaFinal);
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
if (anim.fnDone) {
anim.fnDone();
}
}
}
this.animateAlphaCancel = function(sID) {
var o = goN2U.getRawObject(sID);
if (!o) {
;
return;
}
var anim = o.azdAnimAlpha;
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
}
this.isUndefined = function (a) { return (typeof a == 'undefined'); }
this.isDefined = function (a) { return typeof a != 'undefined'; }
this.isFunction = function (a) { return typeof a == 'function'; }
this.isNull = function (a) { return typeof a == 'object' && !a; }
this.isNumber = function (a) { return typeof a == 'number' && isFinite(a); }
this.isObject = function (a) { return (a && typeof a == 'object') || this.isFunction(a); }
this.isString = function (a) { return typeof a == 'string'; }
this.isArray = function (a) { return this.isObject(a) && a.constructor == Array; }
this.isUndefOrNull = function (a) { return (typeof a == 'undefined') || (typeof a == 'object' && !a) }
this.objIsInstanceOf = function(obj, classObj) {
while (obj.__proto__) {
if (obj.__proto__ === classObj) {
return true;
}
obj = obj.__proto__;
}
return false;
}
} // END of goN2Utilities Class
window.N2TextSizer=function(spanID) {
var spanEl = document.createElement("span");
if (spanEl) {
spanEl.setAttribute("id",spanID, 0);
document.body.appendChild(spanEl);
goN2U.hide(spanID);
this.span=spanEl; // expects goN2Utility class to have been initialized
this.sID = spanID;
this.style=null;
}
this.getStringWidth = function (txt, len) {
;
if (len) this.span.innerText = txt.substring(0, len);
else this.span.innerText = txt;
return goN2U.getObjectWidth(this.sID);
}
this.setStyle = function (style) {
if (style != this.style) {
goN2U.setClass (this.span, style);
this.style = style;
}
}
this.truncateToWidth = function (txt, width) {
var len = txt.length;
var txtwidth = this.getStringWidth(txt);
if (txtwidth >width) {
var reqlen = Math.floor(width/txtwidth*len) - 3;
var temptxt = txt.substring(0, reqlen);
temptxt += '...';
return temptxt;
} else {
return txt;
}
}
this.setContent = function (cont) {
this.span.innerHTML=cont;
return goN2U.getObjectWidth(this.span);
}
this.getWidth = function () {
return goN2U.getObjectWidth(this.span);
}
this.getHeight = function () {
return goN2U.getObjectHeight(this.span);
}
}
window.N2FifoQueue=function(n) {
var current = 0;
var next = 0;
var size = n ? n : 20;
var q = new Array(n);
this.add = function (item) {
q[next] = item;
next++;
if (next == size) next = 0;
q[next] = null; // to ensure we don't have current go past
}
this.current = function () {
return q[current];
}
this.next = function () {
var val = null;
if (q[current]) current++; // don't advance past stop fence
if (current == size) current = 0;
val = q[current];
return val;
}
this.nextExists = function () {
var val = null;
var temp = current;
if (q[temp]) temp++; // don't advance past stop fence
if (temp == size) temp = 0;
return q[temp] != null;
}
this.toString = function () {
var txt = "Current: " + current + "\n";
txt += "Next: " + next + "\n";
for (i=0;i<size;i++) {
txt += "["+i+"] = " + q[i];
if (i == current) txt += " <-Current ";
if (i == next) txt += " <-Next";
txt +="\n";
}
return txt
}
}
window.N2BrowseStack=function(n) {
var current = -1;
var size = n ? n : 20;
var q = new Array(n);
this.add = function (item) {
current++;
q[current] = item;
q[current+1] = null; // once we add a new item any past it are toast
}
this.reset = function () {
current = -1;
q[0] = null;
q[1] = null;
}
this.previous = function (item) {
if (current >0) return q[current-1];
return null;
}
this.current = function () {
return q[current];
}
this.next = function () {
return q[current+1];
}
this.goBack = function () { if (current >0) current--; }
this.goForward = function () { if (q[current+1]) current++; }
this.toString = function () {
var txt = "Current: " + current + "\n";
for (i=0;i<=current;i++) {
txt += "["+i+"] = " + q[i].id;
if (i == current) txt += " <-Current ";
txt +="\n";
}
return txt
}
}
window.N2LinkNameInfo=function(sLinkID, sNameOverride) {
if (sLinkID) {
var oLink = goN2U.getRawObject(sLinkID);
var sName = "";
if (oLink) {
sName = oLink.name;
;
}
if (sNameOverride) {
sName = sNameOverride;
;
}
if (sName) {
var tmpArray = sName.split("|");
if (tmpArray.length >1) {
this.sLinkID = sLinkID;
this.sName = sName;
this.sFeature = tmpArray[0];
this.sType = tmpArray[1];
this.sID = tmpArray[2];
this.sParams = tmpArray[3];
for (var i = 4; !goN2U.isUndefined(tmpArray[i]); i++) {
this.sParams = this.sParams + "|" + tmpArray[i];
}
}
}
} else {
;
}
this.getLinkID = function () { return this.sLinkID; }
this.getLinkName= function () { return this.sName; }
this.getFeature = function () { return this.sFeature; }
this.getType = function () { return this.sType; }
this.getID = function () { return this.sID; }
this.getParams = function () { return this.sParams; }
}
var gaN2HandlerChains = new Array();
var gaN2HandlerRunFns = new Array();
window.N2ChainEventHandler=function(sHandlerName, fFn, sComment) {
sHandlerName = sHandlerName.toLowerCase();
sComment = sComment ? sComment : 'unknown';
;
;
if ( (typeof fFn != 'function') || fFn == null) return false;
var aChain;
if (!gaN2HandlerChains[sHandlerName]) {
aChain = gaN2HandlerChains[sHandlerName] = new Array();
} else {
aChain = gaN2HandlerChains[sHandlerName];
}
var oE = window;
if (sHandlerName != 'onload' && sHandlerName != 'onresize') {
oE = document.getElementsByTagName("body")[0];
if (oE == null) {
;
return;
}
}
if (oE[sHandlerName]) {
if (oE[sHandlerName] != gaN2HandlerRunFns[sHandlerName]) {
aChain[0] = oE[sHandlerName];
var fn = new Function ("evt", "evt = evt ? evt : window.event; _N2RunHandlers(evt, '"+sHandlerName+"');");
gaN2HandlerRunFns[sHandlerName] = fn;
oE[sHandlerName] = fn;
}
var len = aChain.length;
;
aChain[len] = fFn;
} else {
;
oE[sHandlerName] = fFn;
}
return true;
}
function _N2RunHandlers( evt, sHandlerName ) {
var aH = gaN2HandlerChains[sHandlerName];
var len = aH.length;
for (var i=0;i<len;i++) {
aH[i](evt);
}
}
if (!window.goN2Initializer) {
function N2Initializer () {
this.aHandlers = new Array();
}
new N2Initializer ();
N2Initializer.prototype.runThisWhen = function (sWhen, fFn, sComment) {
;
;
sWhen = sWhen.toLowerCase();
if ( (sWhen =='inbody' && document.body) ||
(sWhen =='coreloaded' && this.bCoreLoaded) ){
fFn();
} else {
var oTmp = {};
oTmp.sWhen = sWhen;
oTmp.fFn = fFn;
oTmp.sComment = sComment;
this.aHandlers[this.aHandlers.length] = oTmp;
}
}
N2Initializer.prototype.initializeThis = N2Initializer.prototype.runThisWhen;
N2Initializer.prototype.run = function (sWhen) {
sWhen = goN2U.isUndefined(sWhen) ? null : sWhen;
sWhen = sWhen.toLowerCase();
;//goN2Debug.info("N2Initializer called with " + (sWhen ? "'"+sWhen+"'" : "null"));
var aH = this.aHandlers;
var len = aH.length;
for (var i=0;i<len;i++) {
var oTmp = aH[i];
if ((oTmp.bCalled != true) &&
oTmp.fFn &&
(( (sWhen == null) || (sWhen == 'onload') ) ||
(oTmp.sWhen && (oTmp.sWhen == sWhen)))
) {
;
oTmp.fFn();
oTmp.bCalled = true;
}
}
}
goN2Initializer = new N2Initializer();
}
N2ChainEventHandler ('onload', function(){ goN2Initializer.run('onload'); }, 'goN2Initializer' );
var goN2U = new N2Utilities();
goN2Initializer.initializeThis('inbody',
function() { goN2U.initialize(); },
'goN2U Initialization'
);
goN2Initializer.initializeThis('onload',
function() {
if (!document.body) {
alert("Error: Must initialize Utilities library in the body. (body not found)");
return;
}
var sID = goN2U.sAnimationDivID = 'goN2UAnimatedBox';
var o = document.createElement("div");
if (o) {
document.body.appendChild(o);
o.setAttribute("id",sID, 0);
goN2U.setClass(sID, 'animatedBox');
} else {
;
}
}, 'animate box creation' );
if (window.goN2LibMon) goN2LibMon.endLoad('utilities');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -