?? showalbummodule.config
字號:
for(var k,id,i=0,data={},n=xmlNode.childNodes; i<n.length; i++)
{
if(n[i].nodeType==1){id=n[i].getAttribute("id")||this.getUniqueId();
if(n[i].hasChildNodes()){for(k=0,nic=n[i].childNodes;k<nic.length;k++)
{
if(nic[k].nodeType==1){this._loadXmlNodeData(n[i], id, mapping);break;}}
}
for(var k=0,s="",a=n[i].attributes; k<a.length; k++)
{
if(mapping) s=s.setAttribute(mapping[a[k].name.toLowerCase()]||a[k].name, a[k].value);
else s=s.setAttribute(a[k].name, a[k].value);
}
if(!s.getAttribute("text")) s="text:;"+ s;
a=parentId + this.divider + id; data[a]=s;}
}
this.appendData(data);
};
//public
MzDataProvider.prototype.loadUlData=function(HtmlUL, parentId)
{
if("undefined"==typeof parentId) parentId=this.rootId; var ul;
if("string"==typeof HtmlUL&&(ul=document.getElementById(HtmlUL)));
else if("object"==typeof HtmlUL&&(ul=HtmlUL.tagName)&&
"UL OL".indexOf(ul.toUpperCase())>-1) ul=HtmlUL;
if("object"==typeof ul)
{
var data={}; for(var i=0, n=ul.childNodes; i<n.length; i++)
{
if(n[i].nodeType==1 && n[i].tagName=="LI")
{
var id=n[i].getAttribute("sourceid")||this.getUniqueId(),txt="",link="";
for(var k=0; k<n[i].childNodes.length; k++)
{
var node=n[i].childNodes[k];
if(node.nodeType==3) txt += node.nodeValue;
if(node.nodeType==1)
{
switch(node.tagName)
{
case "UL":
case "OL": this.loadUlData(node, id); break;
case "A" : if(!link) link=node; break;
}
}
}
var str="";
if(link)
{
str=str.setAttribute("target", link.target);
str=str.setAttribute("url", link.href);
str=str.setAttribute("text", link.innerHTML);
}
else str = str.setAttribute("text", txt);
var a=n[i].attributes; //<li>.attributes
for(var k=0; k<a.length; k++)
{
if(a[k].specified && a[k].name!="style")
str = str.setAttribute(a[k].name, a[k].value);
}
a=parentId + this.divider + id;
data[a]=str;
}
}
this.appendData(data);
}
}
//public: check node has child
MzDataNode.prototype.hasChildNodes = function()
{
var $=this.$$caller;
this.hasChild=$.indexes.indexOf($.__+ this.id + $.divider)>-1
||(this.sourceIndex&&(this.get("JSData")!=null||this.get("XMLData")!=null
|| this.get("ULData")!=null)); return this.hasChild;
};
//public: get node attribute
MzDataNode.prototype.get = function(attribName)
{
if("undefined"!=typeof(this[attribName]))return this[attribName]; else
{
var s=this.$$caller.dataSource[this.sourceIndex];
if("string"==typeof(s)) return s.getAttribute(attribName);
else if("object"==typeof(s)) return s[attribName];
}
};
//public: set node attribute
MzDataNode.prototype.set = function(attribName, value)
{
if("undefined"!=typeof(this[attribName])) this[attribName]=value; else
{
var s=this.$$caller.dataSource[this.sourceIndex];
if("string"==typeof(s))
this.$$caller.dataSource[this.sourceIndex]=s.setAttribute(attribName,value);
else if("object"==typeof(s)) s[attribName]=value;
}
};
//private: load all node's node and init
MzDataNode.prototype.loadChildNodes = function(DataNodeClass)
{
var $=this.$$caller,r=$.dividerEncoding,_=$.__, i, cs;
var tcn=this.childNodes;tcn.length=0;if(this.sourceIndex){
if((i=this.get("JSData"))) $.loadJsData((/^\w+\.js(\s|\?|$)/i.test(i)?$.jsDataPath:"")+i);
if((i=this.get("ULData"))) $.loadUlData(i, this.id);
if((i=this.get("XMLData")))$.loadXmlData((/^\w+\.xml(\s|\?|$)/i.test(i)?$.xmlDataPath:"")+i,this.id);}
var reg=new RegExp(_ + this.id + r +"[^"+ _ + r +"]+", "g");
if((cs=$.indexes.match(reg))){for(i=0;i<cs.length;i++){
tcn[tcn.length]=this.DTO(DataNodeClass, cs[i].substr(_.length));}}
this.isLoaded = true;
};
MzDataNode.prototype.DTO=function(DataNodeClass, sourceIndex)
{
var C=DataNodeClass||MzDataNode,$=this.$$caller,d=$.divider,n=new C,s;
n.$$caller=this.$$caller; s=$.dataSource[n.sourceIndex=sourceIndex];
n.id=sourceIndex.substr(sourceIndex.indexOf(d)+d.length);
n.hasChildNodes(); n.parentNode=this; $.nodes[n.index]=n;
n.path=this.path+d+n.id;
if("string"!=typeof($.indexMapping[n.sourceIndex])) $.indexMapping[n.sourceIndex]="";
$.indexMapping[n.sourceIndex]=$.indexMapping[n.sourceIndex].setAttribute("index_"+ $.hashCode,n.index);
n.set("index_"+ $.hashCode,n.index);
if("string"==typeof(s)) n.text=s.getAttribute("text");
else if("object"==typeof(s)) n.text=s.text; return n;
};
String.prototype.getAttribute = function(attribute)
{
if(new RegExp("(^|;)\\s*"+attribute+"\\s*:\\s*([^;]*)\\s*(;|$)","i").test(this))
return RegExp.$2.replace(/%3B/gi,";").replace(/%25/g,"%"); return null;
};
String.prototype.setAttribute = function(attribute, value)
{
value=(""+value).replace(/%/g,"%25").replace(/;/g,"%3B").replace(/\r|\n/g,"");
return (attribute +":"+ value +";" + this);
};
String.prototype.deleteAttribute = function(attribute)
{
return this.replace(new RegExp("\\b\\s*"+attribute+"\\s*:\\s*([^;]*)\\s*(;|$)","gi"),"");
};
/*** MzRotateImage.js ***/
/*---------------------------------------------------------------------------*\
| Subject: Rotate AD
| NameSpace: System.Web.UI.WebControls.MzRotateImage
| Author: meizz
| Created: 2006-11-11
| Version: 2006-12-06
\*---------------------------------------------------------------------------*/
//Using("System.Data.MzDataProvider");
//Using("System.Web.Forms.MzBehavior");
//node{url, target, summary, img, alt}
function MzRotateImage()
{
MzDataProvider.call(this); this.stateChangeHandle(1);
this.timer = null;
this.interval = 3000;
this.duration = 2000;
this.activeIndex = 1;
this.currentIndex = 0;
this.floatControlBar = false;
this.useFilter = System.ie && MzBrowser.version>=5.5;
}
MzRotateImage.Extends(MzDataProvider, "MzRotateImage");
//System.loadCssFile(System.resourcePath +"/MzRotateImage.css", "MzRotateImage_CSS");
MzRotateImage.prototype.render=function()
{
this.dataInit(); this.images=new Array();
var d = this.nodes = this.rootNode.childNodes;
for(var i=0; i<d.length; i++)
{
this.images[i] = new Image();
this.images[i].src = d[i].get("img");
}
var id=this.id="MzRotateImage_"+this.hashCode,s=[];
var width = this.width = parseInt(this.width);
var height = this.height = parseInt(this.height);
s.push("<div id='"+id+"' style='width:"+width+"px;' class='MzRotateImage'>");
s.push("<div id='"+id+"_ImageBox' class='MzRotateImage_ImageBox' style='height:"+ height +"px'>");
if(this.useFilter) { if(d.length>0) //filter: revealTrans
{
var alt = d[0].get("alt"), src = this.images[0].src;
s.push("<a href='#'><img alt='"+ (alt||"") +"' src='"+src+"' ");if(d.length>1)
s.push("style='filter:revealTrans(duration="+(this.duration/1000)+")'");
s.push(" id='"+ id +"_img' /></a>");}
}
else
{
for(i=0; i<d.length; i++) //new MzBehavior.Rotate()
{
var alt2=d[i].get("alt");
s.push("<div id='"+id+"_item_"+i+"' style='width: "+width+"px;");
if (i>0) s.push(" display: none;");
s.push(" height: "+ height +"px; overflow: hidden;'>");
s.push("<a href='"+ (d[i].get("url") || "#")+"'");
s.push(" target='"+ (d[i].get("target") || "_self") +"'>");
s.push("<img alt='"+(d[i].get("alt") || "") +"'");
s.push(" src='"+ this.images[i].src +"' /></a></div>");
}
}
s.push("</div>");
s.push("</div>"); s = s.join("");
this.stateChangeHandle(2); this._onload();
return s;
};
MzRotateImage.prototype.stateChangeHandle=function(n)
{
this.readyState = n||0;
this.dispatchEvent(new System.Event("onreadystatechange"));
};
MzRotateImage.prototype._onload=function()
{
var me=this;
if(MzElement.check(this.id))
{
this.stateChangeHandle(4);
if(this.useFilter) this.timer=
setTimeout(function(){me.filter();}, me.interval+me.duration);
else
{
this._rotate = new MzBehavior.Rotate(me.id +"_ImageBox",
{interval:me.interval,duration:me.duration});
this._rotate.addEventListeners("onchange", function(e)
{
me.activeIndex = e.target.activeIndex;
me.currentIndex = e.target.currentIndex;
e= new System.Event("onchange"); e.target=me;
me.dispatchEvent(e);
});
}
}
else setTimeout(function(){me._onload();}, 10);
};
MzRotateImage.prototype.focus=function(n)
{
clearTimeout(this.timer);
if(this.useFilter){this.activeIndex=n; this.filter();}
else if(this._rotate) this._rotate.focus(n);
};
MzRotateImage.prototype.filter=function()
{
var me = this;
if(me.dispatchEvent(new System.Event("onchange")))
{
var img;
if(img=MzElement.check(me.id +"_img"))
{
if(me.nodes.length>1)
{
img.filters.revealTrans.Transition=23;
img.filters.revealTrans.apply();
var a = img.parentNode;
var N=me.activeIndex;
this.currentIndex = N;
this.activeIndex = N+1>=me.nodes.length ? 0 : N+1;
a.href = (me.nodes[N].get("url") || "#");
a.target = (me.nodes[N].get("target") || "_self");
img.src = me.images[N].src;
img.alt = (me.nodes[N].get("alt") || "");
img.filters.revealTrans.play();
}
else if(me.nodes.length==1)
{
var a = img.parentNode;
a.href = (me.nodes[0].get("url") || "#");
a.target = (me.nodes[0].get("target") || "_self");
img.src = me.images[0].src;
img.alt = (me.nodes[0].get("alt") || "");
}
}
}
this.timer=setTimeout(function(){me.filter();}, me.interval+me.duration);
};
/*** MzBehavior.js ***/
/*---------------------------------------------------------------------------*\
| Subject: Html Element behavior base
| NameSpace: System.Web.Forms.MzBehavior
| Author: meizz
| Created: 2006-08-05
| Version: 2007-05-21
\*---------------------------------------------------------------------------*/
//Using("System.Web.Forms.MzEffect");
//op{interval, duration, dynamic}
function MzBehavior()
{
this.element=MzElement.check(arguments[0]);
if(!this.element) return; System.call(this);
this.options=System.extend({
interval: 20, //milliseconds
duration: 360, //milliseconds
dynamic: true
},arguments[1]||{}); var t;
//prevent repeated behavior
this.attributeName = "att_"+ this._className.replace(/\W/g, "_");
if(t=this.element.getAttribute(this.attributeName)) return;
this.element.setAttribute(this.attributeName, this.hashCode, 0);
if("function"==typeof(this.initialize)) this.initialize();
}
MzBehavior.Extends(System, "MzBehavior");
//op{color, beginColor, backgroundColor, backgroundImage}
MzBehavior.Highlight=function(obj,op)
{
op=System.extend({backgroundColor: "#D4D0C8"}, op||{});
MzBehavior.apply(this, [obj, op]);
};
t=MzBehavior.Highlight.Extends(MzBehavior, "MzBehavior.Highlight");
t.initialize=function()
{
var me=this, op=me.options, obj=me.element;
op._color = obj.style.color;
op._backgroundColor = obj.style.backgroundColor;
op._backgroundImage = obj.style.backgroundImage; if(!op.beginColor){
op.beginColor=(obj.currentStyle||obj.style).backgroundColor;
if(!op.beginColor || op.beginColor=="transparent")op.beginColor="#FFFFFF";}
op.beginColor = MzEffect.formatColor(op.beginColor);
this.mouseover=function()
{
if(me.outer) return;
if(op.color) obj.style.color=op.color;
if(op.dynamic)
{
MzEffect.highlight(obj, {
interval: op.interval,
duration: op.duration,
beginColor: op.beginColor,
endColor: op.backgroundColor,
finalColor: op.backgroundColor,
onafterfinish: function(e)
{
if(op.color) obj.style.color=op.color;
if(op.backgroundImage) obj.style.backgroundImage=op.backgroundImage;
}});
}
else
{
if(op.color)
obj.style.color=op.color;if(op.backgroundImage)
obj.style.backgroundImage = op.backgroundImage;
obj.style.backgroundColor = op.backgroundColor;
}
me.outer=true;
};
this.mouseout=function()
{
if(me.inner) return; obj.style.color=op._color;
if(op.dynamic)
{
MzEffect.highlight(obj, {
interval: op.interval,
duration: op.duration,
beginColor: op.backgroundColor,
endColor: op.beginColor,
finalColor: op.beginColor,
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -