📄 ui.pack.js
字号:
E=A[this.elementID.text]
}if(B){var C=Richfaces.getNSAttribute("oncontextmenu",B);
if(C&&C.length>0){this.onContextMenu=new Function("event",C+"; return true;").bindAsEventListener(this)
}}if(B){Event.observe(B,"mousedown",this.eventSelectionClick);
Event.observe(B,"mouseout",this.eventMouseOut);
Event.observe(B,"mouseover",this.eventMouseOver);
if(this.onContextMenu){B.oncontextmenu=this.onContextMenu
}}if(E){Event.observe(E,"mousedown",this.eventSelectionClick);
Event.observe(E,"mouseout",this.eventMouseOut);
Event.observe(E,"mouseover",this.eventMouseOver);
if(this.onContextMenu){E.oncontextmenu=this.onContextMenu
}}if(this.tree.switchType=="client"&&this.childs.length>0){this.eventCollapsionClick=this.toggleCollapsion.bindAsEventListener(this);
var F=this.tree.toggleOnClick?this.elementID.mainRow:this.elementID.handle;
Event.observe(F,"click",this.eventCollapsionClick)
}},getElements:function(B,E){this.childs=[];
var C=B.nextSibling;
if(E&&this.tree.showConnectingLines){var A=B.rows[0].cells[0];
if(A.style&&A.style.removeExpression){A.style.backgroundImage=A.currentStyle.backgroundImage;
A.style.removeExpression("backgroundImage")
}if(C){if(C.style&&C.style.removeExpression){C.style.backgroundImage=C.currentStyle.backgroundImage;
C.style.removeExpression("backgroundImage")
}}}if(C){var D=C.firstChild;
while(D!=null){if(D.nodeType==1&&D.tagName.toLowerCase()=="table"){this.addChild(new Tree.Item(D,this.tree,this))
}D=D.nextSibling
}}},addChild:function(A){this.childs.push(A)
},fireExpansionEvent:function(){var A=new Object();
A[Richfaces.TreeExpandEvent]=true;
A["expandedNode"]=this.id;
A["treeItem"]=this;
Richfaces.createEvent("click",this.tree.element,null,A).fire()
},fireCollapsionEvent:function(){var A=new Object();
A[Richfaces.TreeCollapseEvent]=true;
A["collapsedNode"]=this.id;
A["treeItem"]=this;
Richfaces.createEvent("click",this.tree.element,null,A).fire()
},toggleCollapsion:function(){var D=this.id+Tree.ID_DEVIDER+Tree.ID_CHILDS_ROW;
if(this.hasChilds()){Element.toggle(D)
}var C=$(this.elementID.mainRow);
if(C){Element.hide(C);
Element.show(C)
}var B=$(this.id+"NodeExpanded");
var A=$(this.elementID.icon);
if(this.isCollapsed()){Element.hide(this.elementID.handleImgExpanded);
Element.show(this.elementID.handleImgCollapsed);
if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_EXPANDED)){Element.removeClassName(A,Tree.CLASS_ITEM_EXPANDED);
Element.addClassName(A,Tree.CLASS_ITEM_COLLAPSED)
}if(B){B.value="false"
}this.fireCollapsionEvent()
}else{Element.show(this.elementID.handleImgExpanded);
Element.hide(this.elementID.handleImgCollapsed);
if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_COLLAPSED)){Element.removeClassName(A,Tree.CLASS_ITEM_COLLAPSED);
Element.addClassName(A,Tree.CLASS_ITEM_EXPANDED)
}if(B){B.value="true"
}this.fireExpansionEvent()
}},getRichAttribute:function(A){return Richfaces.getNSAttribute(A,$(this.elementID.icon))
},collapse:function(){if(!this.isCollapsed()&&this.tree.switchType!="client"){var B=$(this.tree.toggleOnClick?this.elementID.mainRow:this.elementID.handle);
if(B){B.onclick()
}}if(this.hasChilds()&&!this.isCollapsed()){Element.hide(this.elementID.children);
Element.hide(this.elementID.handleImgExpanded);
Element.show(this.elementID.handleImgCollapsed);
var A=$(this.elementID.icon);
if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_EXPANDED)){Element.removeClassName(A,Tree.CLASS_ITEM_EXPANDED);
Element.addClassName(A,Tree.CLASS_ITEM_COLLAPSED)
}}this.fireCollapsionEvent()
},expand:function(){if(this.isCollapsed()&&this.tree.switchType!="client"){var B=$(this.tree.toggleOnClick?this.elementID.mainRow:this.elementID.handle);
if(B){B.onclick()
}}if(this.hasChilds()&&this.isCollapsed()){Element.show(this.elementID.children);
Element.show(this.elementID.handleImgExpanded);
Element.hide(this.elementID.handleImgCollapsed);
var A=$(this.elementID.icon);
if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_COLLAPSED)){Element.removeClassName(A,Tree.CLASS_ITEM_COLLAPSED);
Element.addClassName(A,Tree.CLASS_ITEM_EXPANDED)
}}this.fireExpansionEvent()
},isCollapsed:function(){var A=$(this.elementID.children);
if(A){return A.style.display=="none"
}else{return true
}},processMouseOut:function(C){if(this.isMouseIn){this.isMouseIn=false;
var B=$(this.elementID.text);
var E=Richfaces.getNSAttribute("highlightedclass",B);
if(E){var D=E.split(" ");
for(var A=0;
A<D.length;
A++){Element.removeClassName(B,D[A])
}if(window.drag){this.dragLeave(C)
}}}},processMouseOver:function(C){if(!this.isMouseIn){this.isMouseIn=true;
var B=$(this.elementID.text);
var E=Richfaces.getNSAttribute("highlightedclass",B);
if(E){var D=E.split(" ");
for(var A=0;
A<D.length;
A++){Element.addClassName(B,D[A])
}if(window.drag){this.dragEnter(C)
}}}},toggleSelection:function(G){if(G&&!G[Richfaces.TreeSelectEvent]&&!Richfaces.eventIsSynthetic(G)){if(G&&G.type=="mousedown"){if(Event.isLeftClick(G)){var A=Event.element(G);
if(A.tagName&&/^(input|select|option|button|textarea)$/i.test(A.tagName)){return
}Event.stop(G)
}else{return
}}var H=new Object();
H[Richfaces.TreeSelectEvent]=true;
H["originatingEventType"]=G.type;
H["treeItem"]=this;
H["selectedNode"]=this.id;
var I=Richfaces.createEvent("click",this.tree.element,null,H);
I.fire();
return !I.event["cancelSelection"]
}else{var E=this.tree.selectionManager.activeItem;
if(E){E.deselect()
}var F=$(this.elementID.text);
var C=Richfaces.getNSAttribute("selectedclass",F);
if(C){var B=C.split(" ");
for(var D=0;
D<B.length;
D++){Element.addClassName(F,B[D])
}this.tree.input.value=this.id;
this.tree.selectionManager.activeItem=this;
if(this.tree.options.onSelection){this.tree.options.onSelection(this.id)
}this.tree.showNode(F.parentNode);
if(G&&G["originatingEventType"]=="mousedown"){this.startDrag(G)
}}return true
}},isSelected:function(){return Element.hasClassName(this.elementID.text,Tree.CLASS_ITEM_SELECTED)
},deselect:function(){var B=$(this.elementID.text);
var D=Richfaces.getNSAttribute("selectedclass",B);
if(D){var C=D.split(" ");
for(var A=0;
A<C.length;
A++){Element.removeClassName(B,C[A])
}}},next:function(){var B=this.parent.childs;
for(var A=0;
A<B.length-1;
A++){if(B[A]==this){return B[A+1]
}}return this
},previous:function(){var B=this.parent.childs;
for(var A=1;
A<B.length;
A++){if(B[A]==this){return B[A-1]
}}return this
},hasChilds:function(){return this.childs.length>0
}}
Object.extend(Tree.Item.prototype,DnD.Dropzone.prototype);
Object.extend(Tree.Item.prototype,DnD.Draggable.prototype);
Object.extend(Tree.Item.prototype,{getAcceptedTypes:function(){var B=this.getDropzoneOptions();
if(B){var A=B["acceptedTypes"];
if(A){return A
}}return[]
},mergeParams:function(C){var A=C(this.tree.getElement());
var B=C(this.getElement());
if(A){if(B){Object.extend(A,B)
}return A
}else{return B
}},getDnDDefaultParams:function(){return this.mergeParams(DnD.getDnDDefaultParams)
},getDnDDragParams:function(){return this.mergeParams(DnD.getDnDDragParams)
},getDnDDropParams:function(){return this.mergeParams(DnD.getDnDDropParams)
},getDropzoneOptions:function(){var A=Richfaces.getNSAttribute("dropzoneoptions",$(this.elementID.icon));
if(A){return A.parseJSON(EventHandlersWalk)
}return null
},drop:function(C,A){A.params[DnD.Dropzone.DROP_TARGET_ID]=this.id;
var B=this.getDropzoneOptions();
if(B&&B.parameters){Object.extend(A.params,B.parameters)
}this.tree.drop.call(this,C,A)
},getIndicator:function(){var C=this.getDraggableOptions();
var B=C?C.dragIndicator:null;
var A=$(B);
if(!A){A=this.getOrCreateDefaultIndicator()
}return A
},ondragstart:function(C,A){A.params[this.id]=this.id;
var B=this.getDraggableOptions();
if(B&&B.parameters){Object.extend(A.params,B.parameters)
}this.dragEnter(C)
},ondragend:function(B,A){this.dragStarted=false
},getDraggableOptions:function(){if(window.drag&&window.drag.treeDraggableOptions){return window.drag.treeDraggableOptions
}var A=Richfaces.getNSAttribute("draggableoptions",$(this.elementID.icon));
if(A){var B=A.parseJSON(EventHandlersWalk);
if(window.drag){window.drag.treeDraggableOptions=B
}return B
}return null
},getContentType:function(){var A=this.getDraggableOptions();
if(A){return A["dragType"]
}return""
},getElement:function(){return $(this.elementID.text).parentNode
}})
if(!window.DW){window.DW={}
}if(!window.Richfaces){window.Richfaces={}
}sizeA=4;
sizeB=40;
function discardElement(A){var B=document.getElementById("IELeakGarbageBin");
if(!B){B=document.createElement("DIV");
B.id="IELeakGarbageBin";
B.style.display="none";
document.body.appendChild(B)
}Event.unloadElementsCache(A);
B.appendChild(A);
B.innerHTML=""
}ModalPanel=Class.create();
var searchString="MSIE";
var agent=navigator.userAgent;
var idx=agent.indexOf(searchString);
if(idx!=-1){var versIdx=agent.indexOf(";",idx);
var versString;
if(versIdx!=-1){versString=agent.substring(idx+searchString.length,versIdx)
}else{versString=agent.substring(idx+searchString.length)
}if(parseFloat(versString)<7){ModalPanel.disableSelects=true
}}ModalPanel.panels=new Array();
A4J.AJAX.AddListener({onafterajax:function(D,C,E){var B=0;
while(B<ModalPanel.panels.length){var A=ModalPanel.panels[B];
if(Element.isUninitialized(A.markerId)){A.destroy();
ModalPanel.panels.splice(B,1);
B=0
}else{B++
}}}});
ModalPanel.Context=Class.create();
ModalPanel.Context.prototype={initialize:function(A){this.cdiv=A.contentDiv;
this.isPositionFixed=Richfaces.getComputedStyle(this.cdiv,"position")=="fixed"
},left:function(A){return A
},top:function(A){return A
},width:function(){return $(this.cdiv).offsetWidth
},height:function(){return $(this.cdiv).offsetHeight
}};
function getSizeElement(){var A;
if(RichFaces.navigatorType()!="OPERA"&&document.compatMode=="CSS1Compat"){A=document.documentElement
}else{A=document.body
}return A
}ModalPanel.prototype={initialize:function(E,B){this.markerId=$(E);
this.id=$(E+"Container");
this.options=B;
this.baseZIndex=this.options.zindex?this.options.zindex:100;
this.minWidth=Math.max(this.options.minWidth,2*sizeA+2);
this.minHeight=Math.max(this.options.minHeight,2*sizeA+2);
this.div=E+"Div";
this.cursorDiv=E+"CursorDiv";
this.cdiv=E+"CDiv";
this.contentDiv=E+"ContentDiv";
this.shadowDiv=E+"ShadowDiv";
this.context=new ModalPanel.Context(this);
this.borders=new Array();
if(this.options.resizeable){this.borders.push(new ModalPanel.Border(E+"ResizerNWU",this,"NW-resize",ModalPanel.Sizer.NWU));
this.borders.push(new ModalPanel.Border(E+"ResizerN",this,"N-resize",ModalPanel.Sizer.N));
this.borders.push(new ModalPanel.Border(E+"ResizerNEU",this,"NE-resize",ModalPanel.Sizer.NEU));
this.borders.push(new ModalPanel.Border(E+"ResizerNEL",this,"NE-resize",ModalPanel.Sizer.NEL));
this.borders.push(new ModalPanel.Border(E+"ResizerE",this,"E-resize",ModalPanel.Sizer.E));
this.borders.push(new ModalPanel.Border(E+"ResizerSEU",this,"SE-resize",ModalPanel.Sizer.SEU));
this.borders.push(new ModalPanel.Border(E+"ResizerSEL",this,"SE-resize",ModalPanel.Sizer.SEL));
this.borders.push(new ModalPanel.Border(E+"ResizerS",this,"S-resize",ModalPanel.Sizer.S));
this.borders.push(new ModalPanel.Border(E+"ResizerSWL",this,"SW-resize",ModalPanel.Sizer.SWL));
this.borders.push(new ModalPanel.Border(E+"ResizerSWU",this,"SW-resize",ModalPanel.Sizer.SWU));
this.borders.push(new ModalPanel.Border(E+"ResizerW",this,"W-resize",ModalPanel.Sizer.W));
this.borders.push(new ModalPanel.Border(E+"ResizerNWL",this,"NW-resize",ModalPanel.Sizer.NWL))
}if(this.options.moveable&&$(E+"Header")){this.header=new ModalPanel.Border(E+"Header",this,"move",ModalPanel.Header)
}this.markerId.component=this;
var A=$(this.div);
if(A.style.setExpression){if(ModalPanel.disableSelects||Richfaces.getComputedStyle(A,"position")!="fixed"){A.style.position="absolute";
var C=$(this.cursorDiv);
C.style.position="absolute";
A.style.width="1px";
A.style.height="1px";
C.style.width="1px";
C.style.height="1px";
var D=$(this.cdiv);
D.style.position="absolute";
D.mpUseExpr=true
}}if(this.options.onshow&&this.options.onshow!=""){this.eventOnShow=new Function("event",this.options.onshow).bindAsEventListener(this)
}if(this.options.onhide&&this.options.onhide!=""){this.eventOnHide=new Function("event",this.options.onhide).bindAsEventListener(this)
}ModalPanel.panels.push(this);
this.eventFirstOnfocus=this.firstOnfocus.bindAsEventListener(this);
this.eventLastOnfocus=this.lastOnfocus.bindAsEventListener(this);
this.firstHref=E+"FirstHref";
this.lastHref=E+"LastHref";
this.selectBehavior=B.selectBehavior
},destroy:function(){this.traverseSelects(true);
this.parent=null;
this.firstOutside=null;
this.lastOutside=null;
if(this.header){this.header.destroy();
this.header=null
}for(var A=0;
A<this.borders.length;
A++){this.borders[A].destroy()
}this.borders=null;
if(this.floatedToBody){var B=this.id;
var C=B.parentNode;
if(C){C.removeChild(B);
discardElement(B)
}}this.markerId.component=null;
this.markerId=null
},initIframe:function(){if(this.contentWindow){Element.setStyle(this.contentWindow.document.body,{"margin":"0px 0px 0px 0px"})
}else{}if("transparent"==Element.getStyle(document.body,"background-color")){this.allowTransparency=true
}},traverseSelects:function(C){if(!ModalPanel.disableSelects){return
}var F=document.body.childNodes;
for(var A=0;
A<F.length;
A++){var G=F[A];
if(G!=this.id&&G.getElementsByTagName){var E=G.getElementsByTagName("SELECT");
for(var D=0;
D<E.length;
D++){var B=E[D];
if(this.selectBehavior&&"hide"==this.selectBehavior){if(C){if(B._mdwCount){B._mdwCount-=1;
if(B._mdwCount==0){if(B._mdwHidden){Element.setStyle(B,{"visibility":B._mdwHidden});
B._mdwHidden=undefined
}else{Element.setStyle(B,{"visibility":""})
}B._mdwCount=undefined
}}}else{if(B._mdwCount){B._mdwCount+=1
}else{if(B.style.visibility&&""!=B.style.visibility){B._mdwHidden=B.style.visibility
}Element.setStyle(B,{"visibility":"hidden"});
B._mdwCount=1
}}}else{if(C){if(B._mdwCount){B._mdwCount-=1;
if(B._mdwCount==0){if(B._mdwDisabled){B._mdwDisabled=undefined
}else{B.disabled=false
}B._mdwCount=undefined
}}}else{if(B._mdwCount){B._mdwCount+=1
}else{if(B.disabled){B._mdwDisabled=true
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -