⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui.pack.js

📁 Java开的发文件管理系统,可以管理整个服务器的文件,并按要求进行处理!
💻 JS
📖 第 1 页 / 共 5 页
字号:
DragIndicator={init:function(A){},setContent:function(A,F,D){Element.clearChildren(this);
var C=DnD.getDnDDefaultParams(this);
if(!C){C={}
}if(D){Object.extend(C,D)
}if(!C["marker"]){if(C[A]){C["marker"]=C[A]
}else{C["marker"]=this.markers[A]
}}var B;
if(F){B=this.indicatorTemplates["single"]
}else{B=this.indicatorTemplates["multi"]
}new Insertion.Top(this,B.invoke("getContent",C).join(""))
},show:function(){Element.show(this);
this.style.position="absolute"
},hide:function(){Element.hide(this);
this.style.position="";
this.offsets=undefined;
this.leave()
},position:function(A,B){if(!this.offsets){Element.show(this);
this.style.position="absolute";
this.offsets=Position.cumulativeOffset(this);
this.offsets[0]-=this.offsetLeft||0;
this.offsets[1]-=this.offsetTop||0
}Element.setStyle(this,{"left":-this.offsets[0]+A+"px","top":-this.offsets[1]+B+"px"})
},accept:function(){Element.removeClassName(this,"drgind_default");
Element.removeClassName(this,"drgind_reject");
Element.addClassName(this,"drgind_accept");
var A=this.getAcceptClass();
if(A){Element.addClassName(this,A)
}},reject:function(){Element.removeClassName(this,"drgind_default");
Element.removeClassName(this,"drgind_accept");
Element.addClassName(this,"drgind_reject");
var A=this.getRejectClass();
if(A){Element.addClassName(this,A)
}},leave:function(){Element.removeClassName(this,"drgind_accept");
Element.removeClassName(this,"drgind_reject");
Element.addClassName(this,"drgind_default");
var B=this.getAcceptClass();
var A=this.getRejectClass();
if(B){Element.removeClassName(this,B)
}if(A){Element.removeClassName(this,A)
}},getAcceptClass:function(){return this.ils_acceptClass
},getRejectClass:function(){return this.ils_rejectClass
}};
function createDragIndicator(B,C,A){Object.extend(B,DragIndicator);
B.ils_acceptClass=C;
B.ils_rejectClass=A
}DefaultDragIndicatorView=[new E("table",{"style":"height : 100%","className":"drgind_internal","cellspacing":"0","cellpadding":"3","border":"0"},[new E("tbody",{},[new E("tr",{},[new E("td",{"className":"drgind_marker"},[new ET(function(context){return Richfaces.eval("marker",context)
})]),new E("td",{"className":"drgind_text"},[new E("div",{"className":"drgind_wordcut drgind_text_content"},[new ET(function(context){return Richfaces.eval("label",context)
})])])])])]),new E("div",{"className":"drgind_shadow"})]

DnD.SimpleDraggable=Class.create();
Object.extend(DnD.SimpleDraggable.prototype,DnD.Draggable.prototype);
Object.extend(DnD.SimpleDraggable.prototype,{initialize:function(B,A){this.id=$(B);
if(!this.id){alert("drag: Element with ["+B+"] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!");
return 
}this.options=A;
this.dragIndicatorId=this.options.dragIndicator;
this.eventMouseDown=this.initDrag.bindAsEventListener(this);
Event.observe(this.id,"mousedown",this.eventMouseDown)
},getDnDDragParams:function(){if(this.options.dndParams){return this.options.dndParams.parseJSON(EventHandlersWalk)
}return null
},getIndicator:function(){var A=$(this.dragIndicatorId);
if(!A){A=this.getOrCreateDefaultIndicator()
}return A
},ondragstart:function(B,A){A.params=this.options.parameters;
A.params[this.id]=this.id;
this.setIndicator(B)
},getContentType:function(){return this.options.dragType
},getDraggableOptions:function(){return this.options
},initDrag:function(A){if(Event.isLeftClick(A)){var B=Event.element(A);
if(B.tagName&&(B.tagName.toUpperCase()=="INPUT"||B.tagName.toUpperCase()=="SELECT"||B.tagName.toUpperCase()=="OPTION"||B.tagName.toUpperCase()=="BUTTON"||B.tagName.toUpperCase()=="TEXTAREA")){return 
}Event.stop(A);
this.startDrag(A)
}}})

DnD.SimpleDropZone=Class.create();
Object.extend(DnD.SimpleDropZone.prototype,DnD.Dropzone.prototype);
Object.extend(DnD.SimpleDropZone.prototype,{initialize:function(C,A){this.id=C;
var B=$(C);
if(!B){alert("drop: Element with ["+C+"] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!");
return 
}this.element=B;
if(A.acceptedTypes){this.acceptedTypes=A.acceptedTypes
}else{this.acceptedTypes=[]
}if(A.typeMapping){this.typeMapping=A.typeMapping
}else{this.typeMapping={}
}this.mouseoverBound=this.mouseover.bindAsEventListener(this);
this.mouseoutBound=this.mouseout.bindAsEventListener(this);
this.mouseupBound=this.mouseup.bindAsEventListener(this);
Event.observe(B,"mouseover",this.mouseoverBound);
Event.observe(B,"mouseout",this.mouseoutBound);
Event.observe(B,"mouseup",this.mouseupBound);
this.options=A||{}
},getDropzoneOptions:function(){return this.options
},getDnDDropParams:function(){if(this.options.dndParams){return this.options.dndParams.parseJSON(EventHandlersWalk)
}return null
},mouseover:function(A){if(window.drag){this.dragEnter(A)
}},mouseup:function(A){this.dragUp(A)
},mouseout:function(A){if(window.drag){this.dragLeave(A)
}},getAcceptedTypes:function(){return this.acceptedTypes
},getTypeMapping:function(){return this.typeMapping
},drop:function(B,A){alert("I drop")
},onafterdrag:function(A){if(this.options.onafterdrag){this.options.onafterdrag.call(this,A)
}}})

Richfaces.TreeSelectEvent="Richfaces.TreeSelectEvent";
Richfaces.TreeExpandEvent="Richfaces.TreeExpandEvent";
Richfaces.TreeCollapseEvent="Richfaces.TreeCollapseEvent";
Tree=Class.create();
Tree.ID_DEVIDER=":";
Tree.ID_CONTENT="content";
Tree.ID_CHILDS_ROW="childs";
Tree.ID_CHILDS_TD="td";
Tree.ID_HANDLE="handle";
Tree.ID_HANDLE_IMG_EXPANDED="img:expanded";
Tree.ID_HANDLE_IMG_COLLAPSED="img:collapsed";
Tree.ID_ICON="icon";
Tree.ID_TEXT="text";
Tree.ID_MAIN_ROW="mainRow";
Tree.CLASS_ITEM_SELECTED="dr-tree-i-sel";
Tree.CLASS_ITEM_EXPANDED="dr-tree-h-ic-line-exp";
Tree.CLASS_ITEM_COLLAPSED="dr-tree-h-ic-line-clp";
Tree.CLASS_AJAX_SELECTED_LISTENER_FLAG="ajax_selected_listener_flag";
Tree.prototype={initialize:function(H,A,E,D,C,G,F){this.childs=[];
this.elements={};
this.id=H;
this.switchType=E;
this.onselect=new Function("event",(D.onselect?D.onselect:"")+"; return true;");
this.onexpand=new Function("event",(D.onexpand?D.onexpand:"")+"; return true;");
this.oncollapse=new Function("event",(D.oncollapse?D.oncollapse:"")+"; return true;");
this.onAjaxSelect=C;
this.element=$(H);
this.inputId=A;
this.input=$(this.inputId);
this.toggleOnClick=G;
this.showConnectingLines=F;
var B=Object.extend({columnCount:0},arguments[1]||{});
this.options=B;
this.getElements();
this.selectionManager=new Tree.SelectionManager(this);
this.selectionManager.restoreSelection();
Event.observe(this.element,"click",function(M){if(Richfaces.eventIsSynthetic(M)){var N=M["treeItem"];
if(M[Richfaces.TreeSelectEvent]){Event.stop(M);
var K=N.getRichAttribute("onselected");
K=new Function("event",(K?K:"")+"; return true;");
var O=this.selectionManager.activeItem;
N.toggleSelection(M);
var L=K(M);
if(!L){M["cancelSelection"]=true;
M["treeItem"]=O;
if(O){O.toggleSelection(M)
}return 
}L=this.onselect(M);
if(!L){M["cancelSelection"]=true;
M["treeItem"]=O;
if(O){O.toggleSelection(M)
}return 
}var I=Richfaces.getNSAttribute("ajaxselectedlistener",$(M.selectedNode+Tree.ID_DEVIDER+Tree.ID_ICON));
if(I){this.onAjaxSelect(M)
}}else{if(M[Richfaces.TreeExpandEvent]){Event.stop(M);
var J=N.getRichAttribute("onexpand");
if(J){new Function("event",J).call(Event.element(M),M)
}this.onexpand(M)
}else{if(M[Richfaces.TreeCollapseEvent]){Event.stop(M);
var J=N.getRichAttribute("oncollapse");
if(J){new Function("event",J).call(Event.element(M),M)
}this.oncollapse(M)
}}}}}.bindAsEventListener(this))
},getElements:function(B){this.elements.contentTd=$(this.id+Tree.ID_DEVIDER+Tree.ID_CHILDS_ROW);
if(this.elements.contentTd){for(var A=this.elements.contentTd.firstChild;
A!=null;
A=A.nextSibling){if(A.nodeType==1&&A.tagName.toLowerCase()=="table"){this.addChild(new Tree.Item(A,this,this,B))
}}}},addChild:function(A){this.childs.push(A)
},getNodeElements:function(B){if(B){for(var A=0;
A<B.length;
A++){var C=B[A];
if(C!=this.id){this._getNodeElements(this,C,C.substring(0,C.lastIndexOf(":")))
}else{for(var A=0;
A<this.childs.length;
A++){var D=this.childs[A];
D.destroy()
}this.childs=[];
this.getElements(true)
}}this.input=$(this.inputId);
this.selectionManager.restoreSelection()
}},_getNodeElements:function(D,E,A){for(var B=0;
B<D.childs.length;
B++){var G=D.childs[B];
var F=G.id;
if(F==E){G.destroy();
D.childs[B]=new Tree.Item(F,this,G.parent,true);
break
}else{var C=F.substring(0,F.lastIndexOf(":"));
if(A.substr(0,C.length)==C&&A.charAt(C.length)==":"){this._getNodeElements(G,E,A);
break
}}}},showNode:function(F){var D=F;
var C=0;
while(D&&Element.isChildOf(D,this.element)){C+=D.offsetTop;
D=D.offsetParent
}D=F;
var E=C+D.offsetHeight;
var A=this.element.scrollTop;
var B=A+this.element.clientHeight;
if(C<A){this.element.scrollTop=C
}else{if(E>B){this.element.scrollTop=E-this.element.clientHeight
}}},getElement:function(){return $(this.id)
}}

Tree.SelectionManager=Class.create();
Tree.SelectionManager.prototype={initialize:function(A){this.tree=A;
this.eventKeyPress=this.processKeyDown.bindAsEventListener(this);
Event.observe(document,"keypress",this.eventKeyPress);
this.eventLostFocus=this.processLostFocus.bindAsEventListener(this);
Event.observe(document,"click",this.eventLostFocus);
this.eventPreventLostFocus=this.processPreventLostFocus.bindAsEventListener(this);
Event.observe(this.tree.element,"click",this.eventPreventLostFocus)
},restoreSelection:function(){if(this.tree.input.value){var A=$(this.tree.input.value);
if(A){this.inFocus=true;
this.setSelection(A.object)
}}},processPreventLostFocus:function(A){if(Richfaces.eventIsSynthetic(A)){return 
}this.inFocus=true;
this.preventLostFocus=true
},processLostFocus:function(A){if(Richfaces.eventIsSynthetic(A)){return 
}if(!this.preventLostFocus){this.lostFocus()
}else{this.preventLostFocus=false
}},lostFocus:function(){this.inFocus=false
},setSelection:function(A){A.toggleSelection();
this.activeItem=A
},processKeyDown:function(E){if(!this.activeItem){return 
}if(!($(this.activeItem.id))){this.activeItem=null;
this.tree.input.value="";
return 
}var C=false;
var B=E.keyCode||E.charCode;
switch(B){case Event.KEY_UP:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){var D=this.activeItem;
do{var A=this.getPreviousItemForSelection(D);
if(A&&A!=D){D=A;
if(D.toggleSelection(E)){this.activeItem=D;
D=null
}}else{D=null
}}while(D)
}C=true
}break;
case Event.KEY_DOWN:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){var D=this.activeItem;
do{var A=this.getNextItemForSelection(D);
if(A&&A!=D){D=A;
if(D.toggleSelection(E)){this.activeItem=D;
D=null
}}else{D=null
}}while(D)
}C=true
}break;
case Event.KEY_LEFT:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){this.activeItem.collapse()
}C=true
}break;
case Event.KEY_RIGHT:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){this.activeItem.expand()
}C=true
}break;
case Event.KEY_TAB:this.lostFocus()
}if(C){if(E.preventBubble){E.preventBubble()
}Event.stop(E)
}},getNextItemForSelection:function(C){if(!C.isCollapsed()&&C.hasChilds()){return C.childs.first()
}else{var B=C.next();
if(B!=C){return B
}else{var A=C.parent;
while(A&&A!=this.tree){var B=A.next();
if(B!=A){return B
}else{A=A.parent
}}return C
}}},getPreviousItemForSelection:function(B){var A=B.previous();
if(A==B){if(A.parent==this.tree){A=B
}else{A=B.parent
}}else{if(!A.isCollapsed()&&A.hasChilds()){A=A.childs.last();
while(!A.isCollapsed()&&A.hasChilds()){A=A.childs.last()
}}}return A
}}

Tree.Item=Class.create();
Tree.Item.prototype={initialize:function(E,A,C,D){this.parent=C;
this.tree=A;
this.elements={};
this.elementID={};
var B;
if(typeof E=="string"){B=$(E);
this.id=E
}else{B=E;
this.id=B.id
}B.object=this;
this.elementID.children=this.id+Tree.ID_DEVIDER+Tree.ID_CHILDS_ROW;
this.elementID.mainRow=this.id+Tree.ID_DEVIDER+Tree.ID_MAIN_ROW;
this.elementID.handle=this.id+Tree.ID_DEVIDER+Tree.ID_HANDLE;
this.elementID.handleImgExpanded=this.elementID.handle+Tree.ID_DEVIDER+Tree.ID_HANDLE_IMG_EXPANDED;
this.elementID.handleImgCollapsed=this.elementID.handle+Tree.ID_DEVIDER+Tree.ID_HANDLE_IMG_COLLAPSED;
this.elementID.icon=this.id+Tree.ID_DEVIDER+Tree.ID_ICON;
this.elementID.text=this.id+Tree.ID_DEVIDER+Tree.ID_TEXT;
this.getElements(B,D);
this.eventSelectionClick=this.toggleSelection.bindAsEventListener(this);
this.eventMouseOut=this.processMouseOut.bindAsEventListener(this);
this.eventMouseOver=this.processMouseOver.bindAsEventListener(this);
this.observeEvents(B)
},destroy:function(){if(this==this.tree.selectionManager.activeItem){this.tree.selectionManager.activeItem=null
}for(var A=0;
A<this.childs.length;
A++){this.childs[A].destroy()
}this.childs=null
},observeEvents:function(D){var B=null;
var E=null;
if("NETSCAPE"==RichFaces.navigatorType()){B=$(this.elementID.icon);
E=$(this.elementID.text)
}else{var A=D.rows[0].cells;
B=A[this.elementID.icon];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -