From 85a182c0a93f67216043ba5ef4eccb0a51cb6938 Mon Sep 17 00:00:00 2001 From: zTreeAPI Date: Sat, 4 Apr 2020 22:46:38 +0800 Subject: [PATCH] * fixed TypeScript type definition Thanks @UtillYou * Update demo 'super/keyboard_navigation.html' Thanks @bseddon * Update demo 'core/searchNodes.html' Thanks @bseddon * add setting.view.nodeClasses Thanks @bseddon --- README.md | 2 +- api/API_cn.html | 2 +- api/API_en.html | 2 +- api/apiCss/api.js | 3 +- api/apiCss/jquery.ztree.core.js | 2 +- api/cn/setting.view.nodeClasses.html | 51 +++++++++ api/en/setting.view.nodeClasses.html | 51 +++++++++ demo/cn/core/searchNodes.html | 124 ++++++++++++++++++++-- demo/en/core/searchNodes.html | 151 +++++++++++++++++++++++---- demo/js/keyboard_navigation.js | 35 ++++++- index.d.ts | 145 +++++++++++++++---------- js/jquery.ztree.all.js | 33 ++++-- js/jquery.ztree.all.min.js | 2 +- js/jquery.ztree.core.js | 25 ++++- js/jquery.ztree.core.min.js | 2 +- js/jquery.ztree.excheck.js | 4 +- js/jquery.ztree.exedit.js | 4 +- js/jquery.ztree.exhide.js | 4 +- log v3.x.txt | 8 +- package.json | 2 +- 20 files changed, 541 insertions(+), 111 deletions(-) create mode 100644 api/cn/setting.view.nodeClasses.html create mode 100644 api/en/setting.view.nodeClasses.html diff --git a/README.md b/README.md index 2b2e464df..65e6299b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ jQuery Tree Plugin ---- zTree ============ -last verson : 3.5.42 +last verson : 3.5.43 **Donate to zTree** : http://www.treejs.cn/v3/donate.php diff --git a/api/API_cn.html b/api/API_cn.html index c1997512e..a8b1acd71 100644 --- a/api/API_cn.html +++ b/api/API_cn.html @@ -35,7 +35,7 @@
浏览本网站建议您使用 Chrome、FireFox、Opera、IE9 等浏览器(只要不是 IE6 7 8 就行), 速度会更快,画面会更炫!
-

zTree v3.5.42 API 文档

+

zTree v3.5.43 API 文档

all.js = core + excheck + exedit ( 不包括 exhide ); 发现错误请及时通知,谢谢。

diff --git a/demo/js/keyboard_navigation.js b/demo/js/keyboard_navigation.js index 11f5e05c2..f9344d570 100644 --- a/demo/js/keyboard_navigation.js +++ b/demo/js/keyboard_navigation.js @@ -13,6 +13,13 @@ ( function ($) { + /** + * Dummy function to provide a placeholder for the destroy function + */ + $.fn.zTreeKeyboardNavigationDestroy = function() + { + } + /** * Creates a function that adds keyboard navigation: * Home: home key (keycode 36) Goes to the first root element is visible @@ -22,8 +29,11 @@ * Up: up cursor key (keycode 37) Goes to the prior visible node at the same level * Previous: left cursor key (keycode 38) Goes to the prior visible node following the hierarchy * Toggle: space key (keycode 32) Toggles the expand/collapse state of a parent node + * @param {IxTreeObj} zTree + * @param {string|JQuery; + chkDisabled?: boolean; + click?: CallBackOnFn; + getCheckStatus?: () => object; + getIndex?: () => number; + getNextNode?: () => ITreeNode; + getParentNode?: () => ITreeNode; + getPath?: () => Array; + getPrevNode?: () => ITreeNode; + halfCheck?: boolean; + icon?: string; + iconClose?: string; + iconOpen?: string; + iconSkin?: string; + isHidden?: boolean; + isParent?: boolean; + name?: string; + nocheck?: boolean; + open?: boolean; + target?: string; + url?: string; + check_Child_State?: number; + check_Focus?: boolean; + checkedOld?: boolean; + editNameFlag?: boolean; + isAjaxing?: boolean; + isFirstNode?: boolean; + isHover?: boolean; + isLastNode?: boolean; + level?: number; + parentTId?: string; + tId?: string; + [key: string]: any; +} type ApplicationType = 'application/x-www-form-urlencoded' | 'application/json'; type AjaxType = 'get' | 'post'; -type dataType = 'text' | 'json' | 'jsonp' | 'html' | 'xml' | 'script'; +type DataType = 'text' | 'json' | 'jsonp' | 'html' | 'xml' | 'script'; + interface IAsync { autoParam?: string[]; contentType?: ApplicationType; - dataFilter?: (treeId: string, parentNode: object, responseData: IJSON[] | IJSON | string) => IJSON[] | IJSON; - dataType?: dataType; + dataFilter?: (treeId: string, parentNode: ITreeNode, responseData: IJSON[] | IJSON | string) => IJSON[] | IJSON; + dataType?: DataType; enable?: boolean; otherParam?: string[] | IJSON; type?: AjaxType; headers?: object; xhrFields?: object; - url: string; + url: ((treeId: string, treeNode: ITreeNode) => string) | string; } -type CallBackBeforeFn = (treeId: string, treeNode: object) => boolean; -type CallBackOnFn = (event: Event, treeId: string, treeNode: IJSON) => void; +type CallBackBeforeFn = (treeId: string, treeNode: ITreeNode) => boolean | Promise; +type CallBackOnFn = (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise; interface ICallback { beforeAsync?: CallBackBeforeFn; beforeCheck?: CallBackBeforeFn; - beforeClick?: (treeId: string, treeNode: object, clickFlag: number) => boolean; + beforeClick?: (treeId: string, treeNode: ITreeNode, clickFlag: number) => boolean | Promise; beforeCollapse?: CallBackBeforeFn; beforeDblClick?: CallBackBeforeFn; - beforeDrag?: (treeId: string, treeNode: IJSON[]) => boolean; + beforeDrag?: (treeId: string, treeNode: ITreeNode[]) => boolean | Promise; beforeDragOpen?: CallBackBeforeFn; - beforeDrop?: (treeId: string, treeNode: IJSON[], targetNode: object, moveType: string, isCopy: boolean) => boolean; + beforeDrop?: (treeId: string, treeNode: ITreeNode[], targetNode: object, moveType: string, isCopy: boolean) => boolean | Promise; beforeEditName?: CallBackBeforeFn; beforeExpand?: CallBackBeforeFn; beforeMouseDown?: CallBackBeforeFn; beforeMouseUp?: CallBackBeforeFn; beforeRemove?: CallBackBeforeFn; - beforeRename?: (treeId: string, treeNode: object, newName: string, isCancel: boolean) => boolean; + beforeRename?: (treeId: string, treeNode: ITreeNode, newName: string, isCancel: boolean) => boolean | Promise; beforeRightClick?: CallBackBeforeFn; - onAsyncError?: (event: Event, treeId: string, treeNode: object, XMLHttpRequest: any, textStatus: string, errorThrown: string) => void; - onAsyncSuccess?: (event: Event, treeId: string, treeNode: object, msg: string | object) => void; - onCheck?: (event: Event, treeId: string, treeNode: object) => void; - onClick?: (event: Event, treeId: string, treeNode: object, clickFlag: number) => void; - onCollapse?: (event: Event, treeId: string, treeNode: object) => void; - onDblClick?: (event: Event, treeId: string, treeNode: object) => void; - onDrag?: (event: Event, treeId: string, treeNodes: IJSON[]) => void; - onDragMove?: (event: Event, treeId: string, treeNodes: IJSON[]) => void; - onDrop?: (event: Event, treeId: string, treeNodes: IJSON[], targetNode: object, moveType: string, isCopy: boolean) => void; + onAsyncError?: (event: Event, treeId: string, treeNode: ITreeNode, XMLHttpRequest: any, textStatus: string, errorThrown: string) => void | Promise; + onAsyncSuccess?: (event: Event, treeId: string, treeNode: ITreeNode, msg: string | object) => void | Promise; + onCheck?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise; + onClick?: (event: Event, treeId: string, treeNode: ITreeNode, clickFlag: number) => void | Promise; + onCollapse?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise; + onDblClick?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise; + onDrag?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void | Promise; + onDragMove?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void | Promise; + onDrop?: (event: Event, treeId: string, treeNodes: ITreeNode[], targetNode: object, moveType: string, isCopy: boolean) => void | Promise; onExpand?: CallBackOnFn; onMouseDown?: CallBackOnFn; onMouseUp?: CallBackOnFn; onNodeCreated?: CallBackOnFn; onRemove?: CallBackOnFn; - onRename?: (event: Event, treeId: string, treeNode: IJSON, isCancel: boolean) => void; + onRename?: (event: Event, treeId: string, treeNode: ITreeNode, isCancel: boolean) => void | Promise; onRightClick?: CallBackOnFn; } @@ -97,7 +133,7 @@ interface IData { } -type removeFnType = (treeId: string, treeNode: object) => T; +type removeFnType = (treeId: string, treeNode: ITreeNode) => T; interface IEdit { drag?: { @@ -122,7 +158,7 @@ interface IEdit { } -type dblClickExpandFn = (treeId: string, treeNode: object) => T; +type dblClickExpandFn = (treeId: string, treeNode: ITreeNode) => T; interface IView { addDiyDom?: dblClickExpandFn; @@ -150,51 +186,52 @@ interface ISetting { } -type filterFnType = (node: IJSON) => boolean; +type filterFnType = (node: ITreeNode) => boolean; interface IzTreeObj { setting: ISetting; - addNodes: (parentNode: object, index?: number, newNodes?: IJSON[] | IJSON, isSilentBoolean?: boolean) => IJSON[]; + addNodes: (parentNode: object, index?: number, newNodes?: ITreeNode[] | ITreeNode, isSilentBoolean?: boolean) => ITreeNode[]; cancelEditName: (newName?: string) => void; - cancelSelectedNode: (treeNode?: object) => void; + cancelSelectedNode: (treeNode?: ITreeNode) => void; checkAllNodes: (checked: boolean) => void; - checkNode: (treeNode: IJSON, checked?: boolean, checkTypeFlag?: boolean, callbackFlag?: boolean) => void; - copyNode: (targetNode: object, treeNode: IJSON, moveType: string, isSilent: boolean) => IJSON; + checkNode: (treeNode: ITreeNode, checked?: boolean, checkTypeFlag?: boolean, callbackFlag?: boolean) => void; + copyNode: (targetNode: object, treeNode: ITreeNode, moveType: string, isSilent: boolean) => ITreeNode; destroy: () => void; - editName: (treeNode: IJSON) => void; + editName: (treeNode: ITreeNode) => void; expandAll: (expandFlag: boolean) => boolean | null; - expandNode: (treeNode: IJSON, expandFlag?: boolean, sonSign?: boolean, focus?: boolean, callbackFlag?: boolean) => boolean | null; - getChangeCheckedNodes: () => IJSON[]; - getCheckedNodes: (checked?: boolean) => IJSON[]; + expandNode: (treeNode: ITreeNode, expandFlag?: boolean, sonSign?: boolean, focus?: boolean, callbackFlag?: boolean) => boolean | null; + getChangeCheckedNodes: () => ITreeNode[]; + getCheckedNodes: (checked?: boolean) => ITreeNode[]; getNodeByParam: (key: string, value: any, parentNode?: object) => object; - getNodeByTId: (tId: string) => object; - getNodeIndex: (treeNode: IJSON) => number; - getNodes: () => IJSON[]; - getNodesByFilter: (filter: filterFnType, isSingle?: boolean, parentNode?: IJSON, invokeParam?: any) => object; + getNodeByTId: (tId: string) => ITreeNode; + getNodeIndex: (treeNode: ITreeNode) => number; + getNodes: () => ITreeNode[]; + getNodesByFilter: (filter: filterFnType, isSingle?: boolean, parentNode?: ITreeNode, invokeParam?: any) => any; getNodesByParam: (key: string, value: any, parentNode?: object) => object; getNodesByParamFuzzy: (key: string, value: string, parentNode?: object) => object; - getSelectedNodes: () => any; - hideNode: (treeNode: IJSON) => void; - hideNodes: (treeNodes: IJSON[]) => void; - moveNode: (targetNode: object, treeNode: IJSON, moveType: string, isSilent?: boolean) => IJSON; - reAsyncChildNodes: (parentNode: IJSON, reloadType: string, isSilent?: boolean, callback?: any) => void; - reAsyncChildNodesPromise: (parentNode: IJSON, reloadType: string, isSilent?: boolean) => any; // ps: return Promise object + getSelectedNodes: (isTure: boolean) => any; + hideNode: (treeNode: ITreeNode) => void; + hideNodes: (treeNodes: ITreeNode[]) => void; + moveNode: (targetNode: object, treeNode: ITreeNode, moveType: string, isSilent?: boolean) => ITreeNode; + reAsyncChildNodes: (parentNode: ITreeNode, reloadType: string, isSilent?: boolean, callback?: any) => void; + reAsyncChildNodesPromise: (parentNode: ITreeNode, reloadType: string, isSilent?: boolean) => any; // ps: return Promise object refresh: () => void; - removeChildNodes: (parentNode: IJSON) => IJSON[]; - removeNode: (treeNode: IJSON, callbackFlag?: boolean) => void; - selectNode: (treeNode: IJSON, addFlag?: boolean, isSilent?: boolean) => void; - setChkDisabled: (treeNode: IJSON, disabled?: boolean, inheritParent?: boolean, inheritChildren?: boolean) => void; + removeChildNodes: (parentNode: ITreeNode) => ITreeNode[]; + removeNode: (treeNode: ITreeNode, callbackFlag?: boolean) => void; + selectNode: (treeNode: ITreeNode, addFlag?: boolean, isSilent?: boolean) => void; + setChkDisabled: (treeNode: ITreeNode, disabled?: boolean, inheritParent?: boolean, inheritChildren?: boolean) => void; setEditable: (editable: boolean) => void; - showNode: (treeNode: IJSON) => void; - showNodes: (treeNodes: IJSON[]) => void; - transformToArray: (treeNodes: IJSON[] | IJSON) => IJSON[]; - transformTozTreeNodes: (simpleNodes: IJSON[] | IJSON) => IJSON[]; - updateNode: (treeNode: IJSON, checkTypeFlag?: boolean) => void; + showNode: (treeNode: ITreeNode) => void; + showNodes: (treeNodes: ITreeNode[]) => void; + transformToArray: (treeNodes: ITreeNode[] | ITreeNode) => ITreeNode[]; + transformTozTreeNodes: (simpleNodes: ITreeNode[] | ITreeNode) => ITreeNode[]; + updateNode: (treeNode: ITreeNode, checkTypeFlag?: boolean) => void; + updateNodeIconSkin: (treeNode: ITreeNode) => void; } interface IzTree { - init?: (dom: any, setting: ISetting, zNodes: IJSON[] | object) => IzTreeObj; + init?: (dom: any, setting: ISetting, zNodes: ITreeNode[] | object) => IzTreeObj; getZTreeObj?: (treeId: string) => IzTreeObj; destroy?: (treeId: string) => void; _z?: any; -} +} \ No newline at end of file diff --git a/js/jquery.ztree.all.js b/js/jquery.ztree.all.js index 8c2788393..65202b9bf 100644 --- a/js/jquery.ztree.all.js +++ b/js/jquery.ztree.all.js @@ -1,6 +1,6 @@ /* * JQuery zTree core - * v3.5.42 + * v3.5.43 * http://treejs.cn/ * * Copyright (c) 2010 Hunter.z @@ -8,7 +8,7 @@ * Licensed same as jquery - MIT License * http://www.opensource.org/licenses/mit-license.php * - * Date: 2020-01-19 + * Date: 2020-04-04 */ (function ($) { @@ -67,6 +67,7 @@ dblClickExpand: true, expandSpeed: "fast", fontCss: {}, + nodeClasses: {}, nameIsHTML: false, selectedMulti: true, showIcon: true, @@ -1323,11 +1324,14 @@ var title = data.nodeTitle(setting, node), url = view.makeNodeUrl(setting, node), fontcss = view.makeNodeFontCss(setting, node), + nodeClasses = view.makeNodeClasses(setting, node), fontStyle = []; for (var f in fontcss) { fontStyle.push(f, ":", fontcss[f], ";"); } - html.push(" 0) ? "href='" + url + "'" : ""), " target='", view.makeNodeTarget(node), "' style='", fontStyle.join(''), "'"); if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) { @@ -1339,6 +1343,10 @@ var fontCss = tools.apply(setting.view.fontCss, [setting.treeId, node], setting.view.fontCss); return (fontCss && ((typeof fontCss) != "function")) ? fontCss : {}; }, + makeNodeClasses: function (setting, node) { + var classes = tools.apply(setting.view.nodeClasses, [setting.treeId, node], setting.view.nodeClasses); + return (classes && (typeof classes !== "function")) ? classes : {add:[], remove:[]}; + }, makeNodeIcoClass: function (setting, node) { var icoCss = ["ico"]; if (!node.isAjaxing) { @@ -1641,6 +1649,16 @@ aObj.css(fontCss); } }, + setNodeClasses: function (setting, treeNode) { + var aObj = $$(treeNode, consts.id.A, setting), + classes = view.makeNodeClasses(setting, treeNode); + if ('add' in classes && classes.add.length) { + aObj.addClass(classes.add.join(' ')); + } + if ('remove' in classes && classes.remove.length) { + aObj.removeClass(classes.remove.join(' ')); + } + }, setNodeLineIcos: function (setting, node) { if (!node) return; var switchObj = $$(node, consts.id.SWITCH, setting), @@ -1966,6 +1984,7 @@ view.setNodeUrl(setting, node); view.setNodeLineIcos(setting, node); view.setNodeFontCss(setting, node); + view.setNodeClasses(setting, node); } } }; @@ -1987,7 +2006,7 @@ })(jQuery); /* * JQuery zTree excheck - * v3.5.42 + * v3.5.43 * http://treejs.cn/ * * Copyright (c) 2010 Hunter.z @@ -1995,7 +2014,7 @@ * Licensed same as jquery - MIT License * http://www.opensource.org/licenses/mit-license.php * - * Date: 2020-01-19 + * Date: 2020-04-04 */ (function ($) { @@ -2639,7 +2658,7 @@ })(jQuery); /* * JQuery zTree exedit - * v3.5.42 + * v3.5.43 * http://treejs.cn/ * * Copyright (c) 2010 Hunter.z @@ -2647,7 +2666,7 @@ * Licensed same as jquery - MIT License * http://www.opensource.org/licenses/mit-license.php * - * Date: 2020-01-19 + * Date: 2020-04-04 */ (function ($) { diff --git a/js/jquery.ztree.all.min.js b/js/jquery.ztree.all.min.js index 274165d44..feabc33df 100644 --- a/js/jquery.ztree.all.min.js +++ b/js/jquery.ztree.all.min.js @@ -1,3 +1,3 @@ -!function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch",NAME:"node_name"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{isParent:"isParent",children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",headers:{},xhrFields:{},url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(e){var t=data.getRoot(e);t||(t={},data.setRoot(e,t)),data.nodeChildren(e,t,[]),t.expandTriggerFlag=!1,t.curSelectedList=[],t.noSelection=!0,t.createdNodes=[],t.zId=0,t._ver=(new Date).getTime()},_initCache=function(e){var t=data.getCache(e);t||(t={},data.setCache(e,t)),t.nodes=[],t.doms=[]},_bindEvent=function(d){var e=d.treeObj,t=consts.event;e.bind(t.NODECREATED,function(e,t,n){tools.apply(d.callback.onNodeCreated,[e,t,n])}),e.bind(t.CLICK,function(e,t,n,o,a){tools.apply(d.callback.onClick,[t,n,o,a])}),e.bind(t.EXPAND,function(e,t,n){tools.apply(d.callback.onExpand,[e,t,n])}),e.bind(t.COLLAPSE,function(e,t,n){tools.apply(d.callback.onCollapse,[e,t,n])}),e.bind(t.ASYNC_SUCCESS,function(e,t,n,o){tools.apply(d.callback.onAsyncSuccess,[e,t,n,o])}),e.bind(t.ASYNC_ERROR,function(e,t,n,o,a,r){tools.apply(d.callback.onAsyncError,[e,t,n,o,a,r])}),e.bind(t.REMOVE,function(e,t,n){tools.apply(d.callback.onRemove,[e,t,n])}),e.bind(t.SELECTED,function(e,t,n){tools.apply(d.callback.onSelected,[t,n])}),e.bind(t.UNSELECTED,function(e,t,n){tools.apply(d.callback.onUnSelected,[t,n])})},_unbindEvent=function(e){var t=e.treeObj,n=consts.event;t.unbind(n.NODECREATED).unbind(n.CLICK).unbind(n.EXPAND).unbind(n.COLLAPSE).unbind(n.ASYNC_SUCCESS).unbind(n.ASYNC_ERROR).unbind(n.REMOVE).unbind(n.SELECTED).unbind(n.UNSELECTED)},_eventProxy=function(e){var t=e.target,n=data.getSetting(e.data.treeId),o="",a=null,r="",d="",i=null,s=null,l=null;if(tools.eqs(e.type,"mousedown")?d="mousedown":tools.eqs(e.type,"mouseup")?d="mouseup":tools.eqs(e.type,"contextmenu")?d="contextmenu":tools.eqs(e.type,"click")?tools.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+consts.id.SWITCH)?(o=tools.getNodeMainDom(t).id,r="switchNode"):(l=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(o=tools.getNodeMainDom(l).id,r="clickNode"):tools.eqs(e.type,"dblclick")&&(d="dblclick",(l=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(o=tools.getNodeMainDom(l).id,r="switchNode")),0=r.length&&(n=-1):(r=data.nodeChildren(e,t,[]),n=-1),0=u.length-n.length)&&(a=-1);for(var p=0,f=n.length;p/g,">");e.push("",a,"")},makeDOMNodeLine:function(e,t,n){e.push("")},makeDOMNodeMainAfter:function(e,t,n){e.push("")},makeDOMNodeMainBefore:function(e,t,n){e.push("
  • ")},makeDOMNodeNameAfter:function(e,t,n){e.push("")},makeDOMNodeNameBefore:function(e,t,n){var o=data.nodeTitle(t,n),a=view.makeNodeUrl(t,n),r=view.makeNodeFontCss(t,n),d=[];for(var i in r)d.push(i,":",r[i],";");e.push("/g,">"),"'"),e.push(">")},makeNodeFontCss:function(e,t){var n=tools.apply(e.view.fontCss,[e.treeId,t],e.view.fontCss);return n&&"function"!=typeof n?n:{}},makeNodeIcoClass:function(e,t){var n=["ico"];if(!t.isAjaxing){var o=data.nodeIsParent(e,t);n[0]=(t.iconSkin?t.iconSkin+"_":"")+n[0],o?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU)}return consts.className.BUTTON+" "+n.join("_")},makeNodeIcoStyle:function(e,t){var n=[];if(!t.isAjaxing){var o=data.nodeIsParent(e,t)&&t.iconOpen&&t.iconClose?t.open?t.iconOpen:t.iconClose:t[e.data.key.icon];o&&n.push("background:url(",o,") 0 0 no-repeat;"),0!=e.view.showIcon&&tools.apply(e.view.showIcon,[e.treeId,t],!0)||n.push("display:none;")}return n.join("")},makeNodeLineClass:function(e,t){var n=[];return e.view.showLine?0==t.level&&t.isFirstNode&&t.isLastNode?n.push(consts.line.ROOT):0==t.level&&t.isFirstNode?n.push(consts.line.ROOTS):t.isLastNode?n.push(consts.line.BOTTOM):n.push(consts.line.CENTER):n.push(consts.line.NOLINE),data.nodeIsParent(e,t)?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU),view.makeNodeLineClassEx(t)+n.join("_")},makeNodeLineClassEx:function(e){return consts.className.BUTTON+" "+consts.className.LEVEL+e.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(e){return e.target||"_blank"},makeNodeUrl:function(e,t){var n=e.data.key.url;return t[n]?t[n]:null},makeUlHtml:function(e,t,n,o){n.push("
      "),n.push(o),n.push("
    ")},makeUlLineClass:function(e,t){return e.view.showLine&&!t.isLastNode?consts.line.LINE:""},removeChildNodes:function(e,t){if(t){var n=data.nodeChildren(e,t);if(n){for(var o=0,a=n.length;on.bottom||o.right>n.right||o.left=r.length&&(n=-1):(r=data.nodeChildren(e,t,[]),n=-1),0=u.length-n.length)&&(a=-1);for(var p=0,f=n.length;p/g,">");e.push("",a,"")},makeDOMNodeLine:function(e,t,n){e.push("")},makeDOMNodeMainAfter:function(e,t,n){e.push("
  • ")},makeDOMNodeMainBefore:function(e,t,n){e.push("
  • ")},makeDOMNodeNameAfter:function(e,t,n){e.push("")},makeDOMNodeNameBefore:function(e,t,n){var o=data.nodeTitle(t,n),a=view.makeNodeUrl(t,n),r=view.makeNodeFontCss(t,n),d=view.makeNodeClasses(t,n),i=[];for(var s in r)i.push(s,":",r[s],";");e.push("/g,">"),"'"),e.push(">")},makeNodeFontCss:function(e,t){var n=tools.apply(e.view.fontCss,[e.treeId,t],e.view.fontCss);return n&&"function"!=typeof n?n:{}},makeNodeClasses:function(e,t){var n=tools.apply(e.view.nodeClasses,[e.treeId,t],e.view.nodeClasses);return n&&"function"!=typeof n?n:{add:[],remove:[]}},makeNodeIcoClass:function(e,t){var n=["ico"];if(!t.isAjaxing){var o=data.nodeIsParent(e,t);n[0]=(t.iconSkin?t.iconSkin+"_":"")+n[0],o?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU)}return consts.className.BUTTON+" "+n.join("_")},makeNodeIcoStyle:function(e,t){var n=[];if(!t.isAjaxing){var o=data.nodeIsParent(e,t)&&t.iconOpen&&t.iconClose?t.open?t.iconOpen:t.iconClose:t[e.data.key.icon];o&&n.push("background:url(",o,") 0 0 no-repeat;"),0!=e.view.showIcon&&tools.apply(e.view.showIcon,[e.treeId,t],!0)||n.push("display:none;")}return n.join("")},makeNodeLineClass:function(e,t){var n=[];return e.view.showLine?0==t.level&&t.isFirstNode&&t.isLastNode?n.push(consts.line.ROOT):0==t.level&&t.isFirstNode?n.push(consts.line.ROOTS):t.isLastNode?n.push(consts.line.BOTTOM):n.push(consts.line.CENTER):n.push(consts.line.NOLINE),data.nodeIsParent(e,t)?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU),view.makeNodeLineClassEx(t)+n.join("_")},makeNodeLineClassEx:function(e){return consts.className.BUTTON+" "+consts.className.LEVEL+e.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(e){return e.target||"_blank"},makeNodeUrl:function(e,t){var n=e.data.key.url;return t[n]?t[n]:null},makeUlHtml:function(e,t,n,o){n.push("
      "),n.push(o),n.push("
    ")},makeUlLineClass:function(e,t){return e.view.showLine&&!t.isLastNode?consts.line.LINE:""},removeChildNodes:function(e,t){if(t){var n=data.nodeChildren(e,t);if(n){for(var o=0,a=n.length;on.bottom||o.right>n.right||o.left
  • ",Z)).append(Pe(d,he.id.A,Z).clone()),r.css("padding","0"),r.children("#"+d.tId+he.id.A).removeClass(he.node.CURSELECTED),te.append(r),t==Z.edit.drag.maxShowNodeNum-1&&(r=Pe("
  • ...
  • ",Z),te.append(r)));te.attr("id",ee[0].tId+he.id.UL+"_tmp"),te.addClass(Z.treeObj.attr("class")),te.appendTo(ie),(oe=Pe("",Z)).attr("id","zTreeMove_arrow_tmp"),oe.appendTo(ie),Z.treeObj.trigger(he.event.DRAG,[e,Z.treeId,ee])}if(1==$.dragFlag){if(de&&oe.attr("id")==e.target.id&&ue&&e.clientX+ae.scrollLeft()+2>fe("#"+ue+he.id.A,de).offset().left){var s=fe("#"+ue+he.id.A,de);e.target=0Z.edit.drag.borderMin,b=fZ.edit.drag.borderMin,R=EZ.edit.drag.borderMin,P=IZ.edit.drag.borderMin,C=T>Z.edit.drag.borderMin&&f>Z.edit.drag.borderMin&&E>Z.edit.drag.borderMin&&I>Z.edit.drag.borderMin,w=h&&se.treeObj.scrollTop()<=0,M=b&&se.treeObj.scrollTop()+se.treeObj.height()+10>=m,_=R&&se.treeObj.scrollLeft()<=0,O=P&&se.treeObj.scrollLeft()+se.treeObj.width()+10>=p;if(e.target&&Ie.isChildOrSelf(e.target,se.treeId)){for(var D=e.target;D&&D.tagName&&!Ie.eqs(D.tagName,"li")&&D.id!=se.treeId;)D=D.parentNode;var y=!0;for(t=0,o=ee.length;tse.edit.drag.autoOpenTime&&Ie.apply(se.callback.beforeDragOpen,[se.treeId,A],!0)&&(be.switchNode(se,A),se.edit.drag.autoExpandTrigger&&se.treeObj.trigger(he.event.EXPAND,[se.treeId,A]))},se.edit.drag.autoOpenTime+50),window.zTreeMoveTargetNodeTId=A.tId)}}else F()}else ge=he.move.TYPE_INNER,de&&Ie.apply(se.edit.drag.inner,[se.treeId,ee,null],!!se.edit.drag.inner)?de.addClass(he.node.TMPTARGET_TREE):de=null,oe.css({display:"none"}),window.zTreeMoveTimer&&(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null);ce=ue,Ne=ge,Z.treeObj.trigger(he.event.DRAGMOVE,[e,Z.treeId,ee])}return!1}function Te(d){if(window.zTreeMoveTimer&&(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null),Ne=ce=null,ae.unbind("mousemove",s),ae.unbind("mouseup",Te),ae.unbind("selectstart",c),ie.css("cursor",""),de&&(de.removeClass(he.node.TMPTARGET_TREE),ue&&fe("#"+ue+he.id.A,de).removeClass(he.node.TMPTARGET_NODE+"_"+he.move.TYPE_PREV).removeClass(he.node.TMPTARGET_NODE+"_"+Ee.move.TYPE_NEXT).removeClass(he.node.TMPTARGET_NODE+"_"+Ee.move.TYPE_INNER)),Ie.showIfameMask(Z,!1),J.showHoverDom=!0,0!=$.dragFlag){var e,t,o;for(e=$.dragFlag=0,t=ee.length;e",e);l.appendTo(Pe("body",e)),o.dragMaskList.push(l)}}},view:{addEditBtn:function(e,t){if(!(t.editNameFlag||0