Commit 765d3273 by 潘建波

feat 设备树搜索改为服务端搜索

2 parents 396f8de8 589f9512
Showing 52 changed files with 7805 additions and 183 deletions
......@@ -12,6 +12,7 @@
},
"dependencies": {
"@svgdotjs/svg.js": "^3.0.16",
"@ztree/ztree_v3": "^3.5.46",
"axios": "^0.19.0",
"core-js": "^3.3.2",
"echarts": "^4.5.0",
......@@ -22,7 +23,9 @@
"particles.js": "^2.0.0",
"rimraf": "^3.0.2",
"svg.js": "^2.7.1",
"view-design": "^4.5.0",
"vue": "^2.6.10",
"vue-giant-tree": "^0.1.4",
"vue-router": "^3.1.3",
"vuex": "^3.0.1"
},
......
......@@ -5,10 +5,17 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<link rel="stylesheet" href="<%= BASE_URL %>zTree_v3/css/zTreeStyle/zTreeStyle.css"></link>
<title>AI视频分析平台</title>
<script src="<%= BASE_URL %>js/kinetic-v5.1.0.min.js"></script>
<script src="<%= BASE_URL %>js/ObjTree.js"></script>
<script src="<%= BASE_URL %>js/jquery.min.js"></script>
<!-- <script src="<%= BASE_URL %>zTree_v3/js/jquery-1.4.4.main.js"></script> -->
<script src="<%= BASE_URL %>zTree_v3/js/jquery.ztree.core.min.js"></script>
<script src="<%= BASE_URL %>zTree_v3/js/jquery.ztree.excheck.min.js"></script>
<script src="<%= BASE_URL %>zTree_v3/js/jquery.ztree.exhide.min.js"></script>
<script src="<%= BASE_URL %>zTree_v3/js/fuzzysearch.js"></script>
<script src="<%= BASE_URL %>js/keymaster.js"></script>
</head>
<body id="theme-name">
......
/*
* email: bigablecat@hotmail.com
* Date: 2018-04-14
*/
/**
* @param zTreeId the ztree id used to get the ztree object
* @param searchField selector of your input for fuzzy search
* @param isHighLight whether highlight the match words, default true
* @param isExpand whether to expand the node, default false
*
* @returns
*/
function fuzzySearch(zTreeId, searchField, isHighLight, isExpand){
var zTreeObj = $.fn.zTree.getZTreeObj(zTreeId);//get the ztree object by ztree id
if(!zTreeObj){
alert("fail to get ztree object");
}
var nameKey = zTreeObj.setting.data.key.name; //get the key of the node name
isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
isExpand = isExpand?true:false; // not to expand in default
zTreeObj.setting.view.nameIsHTML = isHighLight; //allow use html in node name for highlight use
var metaChar = '[\\[\\]\\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; //js meta characters
var rexMeta = new RegExp(metaChar, 'gi');//regular expression to match meta characters
// keywords filter function
function ztreeFilter(zTreeObj,_keywords,callBackFunc) {
if(!_keywords){
_keywords =''; //default blank for _keywords
}
// function to find the matching node
function filterFunc(node) {
if(node && node.oldname && node.oldname.length>0){
node[nameKey] = node.oldname; //recover oldname of the node if exist
}
zTreeObj.updateNode(node); //update node to for modifications take effect
if (_keywords.length == 0) {
//return true to show all nodes if the keyword is blank
zTreeObj.showNode(node);
zTreeObj.expandNode(node,isExpand);
return true;
}
//transform node name and keywords to lowercase
if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase())!=-1) {
if(isHighLight){ //highlight process
//a new variable 'newKeywords' created to store the keywords information
//keep the parameter '_keywords' as initial and it will be used in next node
//process the meta characters in _keywords thus the RegExp can be correctly used in str.replace
var newKeywords = _keywords.replace(rexMeta,function(matchStr){
//add escape character before meta characters
return '\\' + matchStr;
});
node.oldname = node[nameKey]; //store the old name
var rexGlobal = new RegExp(newKeywords, 'gi');//'g' for global,'i' for ignore case
//use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
node[nameKey] = node.oldname.replace(rexGlobal, function(originalText){
//highlight the matching words in node name
var highLightText =
'<span style="color: whitesmoke;background-color: darkred;">'
+ originalText
+'</span>';
return highLightText;
});
zTreeObj.updateNode(node); //update node for modifications take effect
}
zTreeObj.showNode(node);//show node with matching keywords
return true; //return true and show this node
}
zTreeObj.hideNode(node); // hide node that not matched
return false; //return false for node not matched
}
var nodesShow = zTreeObj.getNodesByFilter(filterFunc); //get all nodes that would be shown
processShowNodes(nodesShow, _keywords);//nodes should be reprocessed to show correctly
}
/**
* reprocess of nodes before showing
*/
function processShowNodes(nodesShow,_keywords){
if(nodesShow && nodesShow.length>0){
//process the ancient nodes if _keywords is not blank
if(_keywords.length>0){
$.each(nodesShow, function(n,obj){
var pathOfOne = obj.getPath();//get all the ancient nodes including current node
if(pathOfOne && pathOfOne.length>0){
//i < pathOfOne.length-1 process every node in path except self
for(var i=0;i<pathOfOne.length-1;i++){
zTreeObj.showNode(pathOfOne[i]); //show node
zTreeObj.expandNode(pathOfOne[i],true); //expand node
}
}
});
}else{ //show all nodes when _keywords is blank and expand the root nodes
var rootNodes = zTreeObj.getNodesByParam('level','0');//get all root nodes
$.each(rootNodes,function(n,obj){
zTreeObj.expandNode(obj,true); //expand all root nodes
});
}
}
}
//listen to change in input element
$(searchField).bind('input propertychange', function() {
var _keywords = $(this).val();
searchNodeLazy(_keywords); //call lazy load
});
var timeoutId = null;
var lastKeyword = '';
// excute lazy load once after input change, the last pending task will be cancled
function searchNodeLazy(_keywords) {
if (timeoutId) {
//clear pending task
clearTimeout(timeoutId);
}
timeoutId = setTimeout(function() {
if (lastKeyword === _keywords) {
return;
}
ztreeFilter(zTreeObj,_keywords); //lazy load ztreeFilter function
// $(searchField).focus();//focus input field again after filtering
lastKeyword = _keywords;
}, 500);
}
}
\ No newline at end of file
{"commit":"bacfed303de17d1adb667265fe3aa2967acf6950","commitDate":"2020-12-24 10:40","buildDate":"2020-12-29 15:46","version":"2.0.9","info":"提交合并后版本"}
\ No newline at end of file
<<<<<<< HEAD
{"commit":"bacfed303de17d1adb667265fe3aa2967acf6950","commitDate":"2020-12-24 10:40","buildDate":"2020-12-29 15:46","version":"2.0.9","info":"提交合并后版本"}
=======
{"commit":"cc5f1ada409915cb24fb8ea80b9e70df5019074d","commitDate":"2021-2-20 13:59","buildDate":"2021-2-20 14:1","version":"2.0.9","info":"修改任务设置树形结构"}
>>>>>>> 589f9512265f8154bb08c340fd94dbb43af77e09
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover
## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
############
## Windows
############
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
# Mac crap
.DS_Store
MIT License
Copyright (c) 2020 zTree
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
jQuery Tree Plugin ---- zTree
============
last verson : 3.5.46
**Donate to zTree** : http://www.treejs.cn/v3/donate.php
zTree API : http://www.treejs.cn/v3/api.php
zTree Demo : http://www.treejs.cn/v3/demo.php
Install
============
```
npm install @ztree/ztree_v3
```
Introduction of zTree (简介)
============
* zTree is a multi-functional "tree plug-ins." based on jQuery. The main advantages of zTree includes excellent performance, flexible configuration, and the combination of multiple functions.
(zTree 是一个依靠 jQuery 实现的多功能 “树插件”。优异的性能、灵活的配置、多种功能的组合是 zTree 最大优点。)
* zTree is a free tree plug-in and uses the MIT license.
(zTree 是开源免费的软件, 使用 MIT 许可证)
* The code of zTree v3.x has been seperated according to the various functions. You can only load the code you need.
(zTree v3.x 将核心代码按照功能进行了分割,不需要的代码可以不用加载)
* zTree v3.x uses delay loading technique, which can easily load tens of thousands of nodes in seconds even in IE6 browser.
(采用了 延迟加载 技术,上万节点轻松加载,即使在 IE6 下也能基本做到秒杀)
* Compatible with IE, FireFox?, Chrome, Opera, Safari and other browsers.
(兼容 IE、FireFox?、Chrome、Opera、Safari 等浏览器)
* Support for JSON data.
(支持 JSON 数据)
* Support for static and asynchronous data loading node.
(支持静态 和 Ajax 异步加载节点数据)
* Replace the skin / custom icon flexibllly.
(支持任意更换皮肤 / 自定义图标)
* Support extremely flexible checkbox or radio selection function.
(支持极其灵活的 checkbox 或 radio 选择功能)
* Provide enough incident response callback.
(提供多种事件响应回调)
* Flexible editing (add / delete / change / search) functions, such as drag and drop nodes,you can even drag and drop multiple nodes.
(灵活的编辑(增/删/改/查)功能,可随意拖拽节点,还可以多节点拖拽哟)
* Enable to generate multiple instances of zTree in one page.
(在一个页面内可同时生成多个 Tree 实例)
* Simple parameters to achieve flexible configuration capabilities.
(简单的参数配置实现 灵活多变的功能)
* To enhance performance, zTree transforms the js & css structure to provide excellent browser compatibility and make the development more easily
(zTree v3.x(JQuery Tree 插件),性能全面提升,js & css 架构全面调整,提供更好的兼容性和易开发性)
/*-------------------------------------
zTree Style using fontawesome instead of images
version: 1.1
author: Mike King
email: mikkelking @ hotmail . com
website: http://code.google.com/p/jquerytree/
-------------------------------------*/
/* Definitions ----------------------*/
/* End of Definitions ---------------*/
/* Imports -------------------------*/
/* End of Imports ------------------*/
.ztree * {
padding: 0;
margin: 0;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif;
background-color: #af0000;
}
.ztree {
margin: 0;
padding: 5px;
color: #ffffff;
background-color: #af0000;
}
.ztree li {
padding: 0;
margin: 0;
list-style: none;
line-height: 17px;
text-align: left;
white-space: nowrap;
outline: 0;
}
.ztree li ul {
margin: 0px;
padding: 0 0 0 18px;
}
.ztree li a {
padding-right: 3px;
margin: 0;
cursor: pointer;
height: 17px;
color: #ffffff;
background-color: transparent;
text-decoration: none;
vertical-align: top;
display: inline-block;
}
.ztree li a input.rename {
height: 14px;
width: 80px;
padding: 0;
margin: 0;
color: #af0000;
background-color: #ffffff;
font-size: 12px;
border: 1px #585956 solid;
*border: 0px;
}
.ztree li a:hover {
text-decoration: underline;
}
.ztree li a.curSelectedNode {
padding-top: 0px;
background-color: #af4040;
color: #ffff00;
height: 17px;
opacity: 0.8;
}
.ztree li a.curSelectedNode_Edit {
padding-top: 0px;
background-color: transparent;
color: #ffff00;
height: 17px;
border: 1px #666 solid;
opacity: 0.8;
}
.ztree li a.tmpTargetNode_inner {
padding-top: 0px;
background-color: #aaa;
color: #ffff00;
height: 17px;
border: 1px #666 solid;
opacity: 0.8;
filter: alpha(opacity=80);
}
.ztree li span {
line-height: 17px;
margin-right: 2px;
background-color: transparent;
}
.ztree li span.button {
line-height: 0;
margin: 0;
padding: 0;
width: 15px;
height: 17px;
display: inline-block;
vertical-align: top;
border: 0px solid;
cursor: pointer;
outline: none;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
}
.ztree li span.button::before {
color: #ffffff;
font-family: FontAwesome;
padding-top: 10px;
}
.ztree li span.button.chk {
margin: 0px;
cursor: auto;
width: 12px;
display: inline-block;
padding-top: 10px;
padding-left: 2px;
}
.ztree li span.button.chk.checkbox_false_full::before {
content: "\f096";
}
.ztree li span.button.chk.checkbox_false_full_focus::before {
content: "\f096";
color: #ffff00;
}
.ztree li span.button.chk.checkbox_false_part::before {
content: "\f096";
color: #aaaaaa;
}
.ztree li span.button.chk.checkbox_false_part_focus::before {
content: "\f096";
color: #cad96c;
}
.ztree li span.button.chk.checkbox_false_disable::before {
content: "\f096";
color: #808080;
}
.ztree li span.button.chk.checkbox_true_full::before {
content: "\f046";
}
.ztree li span.button.chk.checkbox_true_full_focus::before {
content: "\f046";
}
.ztree li span.button.chk.checkbox_true_part::before {
content: "\f14a";
}
.ztree li span.button.chk.checkbox_true_part_focus::before {
content: "\f14a";
color: #ffff00;
}
.ztree li span.button.chk.checkbox_true_full_focus::before {
content: "\f046";
color: #ffff00;
}
.ztree li span.button.chk.checkbox_true_part::before {
content: "\f046";
color: #aaaaaa;
}
.ztree li span.button.chk.checkbox_true_part_focus::before {
content: "\f046";
color: #cad96c;
}
.ztree li span.button.chk.checkbox_true_disable::before {
content: "\f046";
color: #808080;
}
.ztree li span.button.chk.radio_false_full::before {
content: "\f10c";
}
.ztree li span.button.chk.radio_false_full_focus::before {
content: "\f10c";
color: #ffff00;
}
.ztree li span.button.chk.radio_false_part::before {
content: "\f10c";
color: #aaaaaa;
}
.ztree li span.button.chk.radio_false_part_focus::before {
content: "\f10c";
color: #ffff00;
}
.ztree li span.button.chk.radio_false_disable::before {
content: "\f1db";
color: #808080;
}
.ztree li span.button.chk.radio_true_full::before {
content: "\f192";
}
.ztree li span.button.chk.radio_true_full_focus::before {
content: "\f192";
color: #ffff00;
}
.ztree li span.button.chk.radio_true_part::before {
content: "\f192";
color: #aaaaaa;
}
.ztree li span.button.chk.radio_true_part_focus::before {
content: "\f192";
color: #aaaaaa;
}
.ztree li span.button.chk.radio_true_disable::before {
content: "\f1db";
color: #808080;
}
.ztree li span.button.switch {
width: 15px;
height: 17px;
}
.ztree li span.button.root_open::before {
content: "\f078";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.root_close::before {
content: "\f054";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.roots_open::before {
content: "\f078";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.roots_close::before {
content: "\f054";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.center_open::before {
content: "\f078";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.center_close::before {
content: "\f054";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.bottom_open::before {
content: "\f078";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.bottom_close::before {
content: "\f054";
padding-top: 10px;
padding-left: 2px;
display: inline-block;
}
.ztree li span.button.root_docu {
background: none;
}
.ztree li span.button.roots_docu::before {
content: "\f022";
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.center_docu::before {
padding-top: 10px;
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.bottom_docu::before {
padding-top: 10px;
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.noline_docu {
background: none;
}
.ztree li span.button.ico_open::before {
content: "\f115";
font-family: FontAwesome;
padding-top: 10px;
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.ico_close::before {
content: "\f114";
font-family: FontAwesome;
padding-top: 10px;
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.ico_docu::before {
content: "\f022";
font-family: FontAwesome;
padding-top: 10px;
padding-left: 2px;
display: inline-block;
color: #ffffff;
}
.ztree li span.button.edit {
margin-left: 4px;
margin-right: -1px;
vertical-align: top;
*vertical-align: middle;
padding-top: 10px;
}
.ztree li span.button.edit::before {
content: "\f044";
font-family: FontAwesome;
}
.ztree li span.button.remove {
margin-left: 4px;
margin-right: -1px;
vertical-align: top;
*vertical-align: middle;
padding-top: 10px;
}
.ztree li span.button.remove::before {
content: "\f1f8";
font-family: FontAwesome;
}
.ztree li span.button.add {
margin-left: 4px;
margin-right: -1px;
vertical-align: top;
*vertical-align: middle;
padding-top: 10px;
}
.ztree li span.button.add::before {
content: "\f067";
font-family: FontAwesome;
}
.ztree li span.button.ico_loading {
margin-right: 2px;
background: url(./img/loading.gif) no-repeat scroll 0 0 transparent;
vertical-align: top;
*vertical-align: middle;
}
ul.tmpTargetzTree {
background-color: #FFE6B0;
opacity: 0.8;
filter: alpha(opacity=80);
}
span.tmpzTreeMove_arrow {
width: 16px;
height: 17px;
display: inline-block;
padding: 0;
margin: 2px 0 0 1px;
border: 0 none;
position: absolute;
background-color: transparent;
background-attachment: scroll;
}
span.tmpzTreeMove_arrow::before {
content: "\f04b";
font-family: FontAwesome;
color: #ffff00;
}
ul.ztree.zTreeDragUL {
margin: 0;
padding: 0;
position: absolute;
width: auto;
height: auto;
overflow: hidden;
background-color: #cfcfcf;
border: 1px #ffff00 dotted;
opacity: 0.8;
filter: alpha(opacity=80);
}
.ztreeMask {
z-index: 10000;
background-color: #cfcfcf;
opacity: 0.0;
filter: alpha(opacity=0);
position: absolute;
}
/*-------------------------------------
zTree Style using fontawesome instead of images
version: 1.1
author: Mike King
email: mikkelking @ hotmail . com
website: http://code.google.com/p/jquerytree/
-------------------------------------*/
/* Definitions ----------------------*/
@font-size: 12px;
// Regular icon and text color is white, which suits any medium -> dark background
@color-normal: white;
// Background color
@color-bg: #af0000;
// Highlight color
@color-highlight: yellow;
// Partially selected (checkboxes, radio buttons)
@color-partial: #aaaaaa;
// Partially selected and focused (checkboxes, radio buttons)
@color-partfocus: #cad96c;
// Disabled altogether
@color-disabled: #808080;
// Editing color
@color-edit: yellow;
@w: 15px;
@h: 17px;
@pad-left: 2px;
@pad-top: 10px;
/* End of Definitions ---------------*/
/* Imports -------------------------*/
@import "fa.less";
/* End of Imports ------------------*/
.ztree * {padding:0; margin:0; font-size:@font-size; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif; background-color: @color-bg;}
.ztree {
margin:0; padding:5px; color:@color-normal; background-color: @color-bg;
li {
padding:0; margin:0; list-style:none; line-height:17px; text-align:left; white-space:nowrap; outline:0;
ul {
margin: 0px; padding:0 0 0 18px;
}
ul.line { }
a {padding-right:3px; margin:0; cursor:pointer; height:@h; color:@color-normal; background-color: transparent;
text-decoration:none; vertical-align:top; display: inline-block;
input.rename {height:14px; width:80px; padding:0; margin:0;
color: @color-bg; background-color: @color-normal;
font-size:@font-size; border:1px #585956 solid; *border:0px}
}
a:hover {text-decoration:underline}
a.curSelectedNode {padding-top:0px; background-color:#af4040; color:@color-highlight; height:@h; opacity:0.8;}
a.curSelectedNode_Edit {padding-top:0px; background-color:transparent; color:@color-highlight; height:@h; border:1px #666 solid; opacity:0.8;}
a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:@color-highlight; height:@h; border:1px #666 solid;
opacity:0.8; filter:alpha(opacity=80)}
a.tmpTargetNode_prev {}
a.tmpTargetNode_next {}
span {line-height:@h; margin-right:2px; background-color:transparent;}
span.button {line-height:0; margin:0; padding: 0; width:@w; height:@h; display: inline-block; vertical-align:top;
border:0px solid; cursor: pointer;outline:none;
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
&::before{color: @color-normal; font-family: FontAwesome; padding-top:@pad-top;}
&.chk { margin:0px; cursor: auto; width: 12px;
display: inline-block;padding-top:@pad-top;padding-left:@pad-left;
&.checkbox_false_full::before {content: @fa-square-o;}
&.checkbox_false_full_focus::before {content: @fa-square-o; color:@color-highlight;}
&.checkbox_false_part::before {content: @fa-square-o;color: @color-partial;}
&.checkbox_false_part_focus::before {content: @fa-square-o; color:@color-partfocus;}
&.checkbox_false_disable::before {content: @fa-square-o; color:@color-disabled;}
&.checkbox_true_full::before {content: @fa-check-square-o;}
&.checkbox_true_full_focus::before {content: @fa-check-square-o;}
&.checkbox_true_part::before {content: @fa-check-square;}
&.checkbox_true_part_focus::before {content: @fa-check-square; color: @color-highlight}
&.checkbox_true_full_focus::before {content: @fa-check-square-o; color: @color-highlight}
&.checkbox_true_part::before {content: @fa-check-square-o;color: @color-partial}
&.checkbox_true_part_focus::before {content: @fa-check-square-o;color: @color-partfocus;}
&.checkbox_true_disable::before {content: @fa-check-square-o;color: @color-disabled}
&.radio_false_full::before {content: @fa-circle-o;}
&.radio_false_full_focus::before {content: @fa-circle-o;color: @color-highlight}
&.radio_false_part::before {content: @fa-circle-o;color: @color-partial}
&.radio_false_part_focus::before {content: @fa-circle-o;color: @color-highlight}
&.radio_false_disable::before {content: @fa-circle-thin;color: @color-disabled}
&.radio_true_full::before {content: @fa-dot-circle-o;}
&.radio_true_full_focus::before {content: @fa-dot-circle-o;color: @color-highlight}
&.radio_true_part::before {content: @fa-dot-circle-o;color: @color-partial}
&.radio_true_part_focus::before {content: @fa-dot-circle-o;color: @color-partial;}
&.radio_true_disable::before {content: @fa-circle-thin;color: @color-disabled}
}
&.switch {width:@w; height:@h}
&.root_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.root_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.roots_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.roots_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.center_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.center_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.bottom_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.bottom_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;}
&.noline_open{}
&.noline_close{}
&.root_docu{ background:none;}
&.roots_docu::before{content: @fa-list-alt;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.center_docu::before{padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.bottom_docu::before{padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.noline_docu{ background:none;}
&.ico_open::before {content: @fa-folder-open-o;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.ico_close::before {content: @fa-folder-o;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.ico_docu::before{content: @fa-list-alt;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;}
&.edit {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;}
&.edit::before{content: @fa-pencil-square-o;font-family: FontAwesome;}
&.remove {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;}
&.remove::before{content: @fa-trash;font-family: FontAwesome;}
&.add {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;}
&.add::before{content: @fa-plus;font-family: FontAwesome;}
&.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
}
}
}
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
// this is the arrow that moves
span.tmpzTreeMove_arrow{width:16px; height:@h; display: inline-block;
padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
background-color:transparent; background-attachment: scroll;
}
span.tmpzTreeMove_arrow::before{content: @fa-play;font-family: FontAwesome;color: @color-highlight;
}
// outline
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden;
background-color:#cfcfcf; border:1px @color-highlight dotted; opacity:0.8; filter:alpha(opacity=80)}
.ztreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
@fa-glass: "\f000";
@fa-music: "\f001";
@fa-search: "\f002";
@fa-envelope-o: "\f003";
@fa-heart: "\f004";
@fa-star: "\f005";
@fa-star-o: "\f006";
@fa-user: "\f007";
@fa-film: "\f008";
@fa-th-large: "\f009";
@fa-th: "\f00a";
@fa-th-list: "\f00b";
@fa-check: "\f00c";
@fa-times: "\f00d";
@fa-search-plus: "\f00e";
@fa-search-minus: "\f010";
@fa-power-off: "\f011";
@fa-signal: "\f012";
@fa-cog: "\f013";
@fa-trash-o: "\f014";
@fa-home: "\f015";
@fa-file-o: "\f016";
@fa-clock-o: "\f017";
@fa-road: "\f018";
@fa-download: "\f019";
@fa-arrow-circle-o-down: "\f01a";
@fa-arrow-circle-o-up: "\f01b";
@fa-inbox: "\f01c";
@fa-play-circle-o: "\f01d";
@fa-repeat: "\f01e";
@fa-refresh: "\f021";
@fa-list-alt: "\f022";
@fa-lock: "\f023";
@fa-flag: "\f024";
@fa-headphones: "\f025";
@fa-volume-off: "\f026";
@fa-volume-down: "\f027";
@fa-volume-up: "\f028";
@fa-qrcode: "\f029";
@fa-barcode: "\f02a";
@fa-tag: "\f02b";
@fa-tags: "\f02c";
@fa-book: "\f02d";
@fa-bookmark: "\f02e";
@fa-print: "\f02f";
@fa-camera: "\f030";
@fa-font: "\f031";
@fa-bold: "\f032";
@fa-italic: "\f033";
@fa-text-height: "\f034";
@fa-text-width: "\f035";
@fa-align-left: "\f036";
@fa-align-center: "\f037";
@fa-align-right: "\f038";
@fa-align-justify: "\f039";
@fa-list: "\f03a";
@fa-outdent: "\f03b";
@fa-indent: "\f03c";
@fa-video-camera: "\f03d";
@fa-picture-o: "\f03e";
@fa-pencil: "\f040";
@fa-map-marker: "\f041";
@fa-adjust: "\f042";
@fa-tint: "\f043";
@fa-pencil-square-o: "\f044";
@fa-share-square-o: "\f045";
@fa-check-square-o: "\f046";
@fa-arrows: "\f047";
@fa-step-backward: "\f048";
@fa-fast-backward: "\f049";
@fa-backward: "\f04a";
@fa-play: "\f04b";
@fa-pause: "\f04c";
@fa-stop: "\f04d";
@fa-forward: "\f04e";
@fa-fast-forward: "\f050";
@fa-step-forward: "\f051";
@fa-eject: "\f052";
@fa-chevron-left: "\f053";
@fa-chevron-right: "\f054";
@fa-plus-circle: "\f055";
@fa-minus-circle: "\f056";
@fa-times-circle: "\f057";
@fa-check-circle: "\f058";
@fa-question-circle: "\f059";
@fa-info-circle: "\f05a";
@fa-crosshairs: "\f05b";
@fa-times-circle-o: "\f05c";
@fa-check-circle-o: "\f05d";
@fa-ban: "\f05e";
@fa-arrow-left: "\f060";
@fa-arrow-right: "\f061";
@fa-arrow-up: "\f062";
@fa-arrow-down: "\f063";
@fa-share: "\f064";
@fa-expand: "\f065";
@fa-compress: "\f066";
@fa-plus: "\f067";
@fa-minus: "\f068";
@fa-asterisk: "\f069";
@fa-exclamation-circle: "\f06a";
@fa-gift: "\f06b";
@fa-leaf: "\f06c";
@fa-fire: "\f06d";
@fa-eye: "\f06e";
@fa-eye-slash: "\f070";
@fa-exclamation-triangle: "\f071";
@fa-plane: "\f072";
@fa-calendar: "\f073";
@fa-random: "\f074";
@fa-comment: "\f075";
@fa-magnet: "\f076";
@fa-chevron-up: "\f077";
@fa-chevron-down: "\f078";
@fa-retweet: "\f079";
@fa-shopping-cart: "\f07a";
@fa-folder: "\f07b";
@fa-folder-open: "\f07c";
@fa-arrows-v: "\f07d";
@fa-arrows-h: "\f07e";
@fa-bar-chart: "\f080";
@fa-twitter-square: "\f081";
@fa-facebook-square: "\f082";
@fa-camera-retro: "\f083";
@fa-key: "\f084";
@fa-cogs: "\f085";
@fa-comments: "\f086";
@fa-thumbs-o-up: "\f087";
@fa-thumbs-o-down: "\f088";
@fa-star-half: "\f089";
@fa-heart-o: "\f08a";
@fa-sign-out: "\f08b";
@fa-linkedin-square: "\f08c";
@fa-thumb-tack: "\f08d";
@fa-external-link: "\f08e";
@fa-sign-in: "\f090";
@fa-trophy: "\f091";
@fa-github-square: "\f092";
@fa-upload: "\f093";
@fa-lemon-o: "\f094";
@fa-phone: "\f095";
@fa-square-o: "\f096";
@fa-bookmark-o: "\f097";
@fa-phone-square: "\f098";
@fa-twitter: "\f099";
@fa-facebook: "\f09a";
@fa-github: "\f09b";
@fa-unlock: "\f09c";
@fa-credit-card: "\f09d";
@fa-rss: "\f09e";
@fa-hdd-o: "\f0a0";
@fa-bullhorn: "\f0a1";
@fa-bell: "\f0f3";
@fa-certificate: "\f0a3";
@fa-hand-o-right: "\f0a4";
@fa-hand-o-left: "\f0a5";
@fa-hand-o-up: "\f0a6";
@fa-hand-o-down: "\f0a7";
@fa-arrow-circle-left: "\f0a8";
@fa-arrow-circle-right: "\f0a9";
@fa-arrow-circle-up: "\f0aa";
@fa-arrow-circle-down: "\f0ab";
@fa-globe: "\f0ac";
@fa-wrench: "\f0ad";
@fa-tasks: "\f0ae";
@fa-filter: "\f0b0";
@fa-briefcase: "\f0b1";
@fa-arrows-alt: "\f0b2";
@fa-users: "\f0c0";
@fa-link: "\f0c1";
@fa-cloud: "\f0c2";
@fa-flask: "\f0c3";
@fa-scissors: "\f0c4";
@fa-files-o: "\f0c5";
@fa-paperclip: "\f0c6";
@fa-floppy-o: "\f0c7";
@fa-square: "\f0c8";
@fa-bars: "\f0c9";
@fa-list-ul: "\f0ca";
@fa-list-ol: "\f0cb";
@fa-strikethrough: "\f0cc";
@fa-underline: "\f0cd";
@fa-table: "\f0ce";
@fa-magic: "\f0d0";
@fa-truck: "\f0d1";
@fa-pinterest: "\f0d2";
@fa-pinterest-square: "\f0d3";
@fa-google-plus-square: "\f0d4";
@fa-google-plus: "\f0d5";
@fa-money: "\f0d6";
@fa-caret-down: "\f0d7";
@fa-caret-up: "\f0d8";
@fa-caret-left: "\f0d9";
@fa-caret-right: "\f0da";
@fa-columns: "\f0db";
@fa-sort: "\f0dc";
@fa-sort-desc: "\f0dd";
@fa-sort-asc: "\f0de";
@fa-envelope: "\f0e0";
@fa-linkedin: "\f0e1";
@fa-undo: "\f0e2";
@fa-gavel: "\f0e3";
@fa-tachometer: "\f0e4";
@fa-comment-o: "\f0e5";
@fa-comments-o: "\f0e6";
@fa-bolt: "\f0e7";
@fa-sitemap: "\f0e8";
@fa-umbrella: "\f0e9";
@fa-clipboard: "\f0ea";
@fa-lightbulb-o: "\f0eb";
@fa-exchange: "\f0ec";
@fa-cloud-download: "\f0ed";
@fa-cloud-upload: "\f0ee";
@fa-user-md: "\f0f0";
@fa-stethoscope: "\f0f1";
@fa-suitcase: "\f0f2";
@fa-bell-o: "\f0a2";
@fa-coffee: "\f0f4";
@fa-cutlery: "\f0f5";
@fa-file-text-o: "\f0f6";
@fa-building-o: "\f0f7";
@fa-hospital-o: "\f0f8";
@fa-ambulance: "\f0f9";
@fa-medkit: "\f0fa";
@fa-fighter-jet: "\f0fb";
@fa-beer: "\f0fc";
@fa-h-square: "\f0fd";
@fa-plus-square: "\f0fe";
@fa-angle-double-left: "\f100";
@fa-angle-double-right: "\f101";
@fa-angle-double-up: "\f102";
@fa-angle-double-down: "\f103";
@fa-angle-left: "\f104";
@fa-angle-right: "\f105";
@fa-angle-up: "\f106";
@fa-angle-down: "\f107";
@fa-desktop: "\f108";
@fa-laptop: "\f109";
@fa-tablet: "\f10a";
@fa-mobile: "\f10b";
@fa-circle-o: "\f10c";
@fa-quote-left: "\f10d";
@fa-quote-right: "\f10e";
@fa-spinner: "\f110";
@fa-circle: "\f111";
@fa-reply: "\f112";
@fa-github-alt: "\f113";
@fa-folder-o: "\f114";
@fa-folder-open-o: "\f115";
@fa-smile-o: "\f118";
@fa-frown-o: "\f119";
@fa-meh-o: "\f11a";
@fa-gamepad: "\f11b";
@fa-keyboard-o: "\f11c";
@fa-flag-o: "\f11d";
@fa-flag-checkered: "\f11e";
@fa-terminal: "\f120";
@fa-code: "\f121";
@fa-reply-all: "\f122";
@fa-star-half-o: "\f123";
@fa-location-arrow: "\f124";
@fa-crop: "\f125";
@fa-code-fork: "\f126";
@fa-chain-broken: "\f127";
@fa-question: "\f128";
@fa-info: "\f129";
@fa-exclamation: "\f12a";
@fa-superscript: "\f12b";
@fa-subscript: "\f12c";
@fa-eraser: "\f12d";
@fa-puzzle-piece: "\f12e";
@fa-microphone: "\f130";
@fa-microphone-slash: "\f131";
@fa-shield: "\f132";
@fa-calendar-o: "\f133";
@fa-fire-extinguisher: "\f134";
@fa-rocket: "\f135";
@fa-maxcdn: "\f136";
@fa-chevron-circle-left: "\f137";
@fa-chevron-circle-right: "\f138";
@fa-chevron-circle-up: "\f139";
@fa-chevron-circle-down: "\f13a";
@fa-html5: "\f13b";
@fa-css3: "\f13c";
@fa-anchor: "\f13d";
@fa-unlock-alt: "\f13e";
@fa-bullseye: "\f140";
@fa-ellipsis-h: "\f141";
@fa-ellipsis-v: "\f142";
@fa-rss-square: "\f143";
@fa-play-circle: "\f144";
@fa-ticket: "\f145";
@fa-minus-square: "\f146";
@fa-minus-square-o: "\f147";
@fa-level-up: "\f148";
@fa-level-down: "\f149";
@fa-check-square: "\f14a";
@fa-pencil-square: "\f14b";
@fa-external-link-square: "\f14c";
@fa-share-square: "\f14d";
@fa-compass: "\f14e";
@fa-caret-square-o-down: "\f150";
@fa-caret-square-o-up: "\f151";
@fa-caret-square-o-right: "\f152";
@fa-eur: "\f153";
@fa-gbp: "\f154";
@fa-usd: "\f155";
@fa-inr: "\f156";
@fa-jpy: "\f157";
@fa-rub: "\f158";
@fa-krw: "\f159";
@fa-btc: "\f15a";
@fa-file: "\f15b";
@fa-file-text: "\f15c";
@fa-sort-alpha-asc: "\f15d";
@fa-sort-alpha-desc: "\f15e";
@fa-sort-amount-asc: "\f160";
@fa-sort-amount-desc: "\f161";
@fa-sort-numeric-asc: "\f162";
@fa-sort-numeric-desc: "\f163";
@fa-thumbs-up: "\f164";
@fa-thumbs-down: "\f165";
@fa-youtube-square: "\f166";
@fa-youtube: "\f167";
@fa-xing: "\f168";
@fa-xing-square: "\f169";
@fa-youtube-play: "\f16a";
@fa-dropbox: "\f16b";
@fa-stack-overflow: "\f16c";
@fa-instagram: "\f16d";
@fa-flickr: "\f16e";
@fa-adn: "\f170";
@fa-bitbucket: "\f171";
@fa-bitbucket-square: "\f172";
@fa-tumblr: "\f173";
@fa-tumblr-square: "\f174";
@fa-long-arrow-down: "\f175";
@fa-long-arrow-up: "\f176";
@fa-long-arrow-left: "\f177";
@fa-long-arrow-right: "\f178";
@fa-apple: "\f179";
@fa-windows: "\f17a";
@fa-android: "\f17b";
@fa-linux: "\f17c";
@fa-dribbble: "\f17d";
@fa-skype: "\f17e";
@fa-foursquare: "\f180";
@fa-trello: "\f181";
@fa-female: "\f182";
@fa-male: "\f183";
@fa-gittip: "\f184";
@fa-sun-o: "\f185";
@fa-moon-o: "\f186";
@fa-archive: "\f187";
@fa-bug: "\f188";
@fa-vk: "\f189";
@fa-weibo: "\f18a";
@fa-renren: "\f18b";
@fa-pagelines: "\f18c";
@fa-stack-exchange: "\f18d";
@fa-arrow-circle-o-right: "\f18e";
@fa-arrow-circle-o-left: "\f190";
@fa-caret-square-o-left: "\f191";
@fa-dot-circle-o: "\f192";
@fa-wheelchair: "\f193";
@fa-vimeo-square: "\f194";
@fa-try: "\f195";
@fa-plus-square-o: "\f196";
@fa-space-shuttle: "\f197";
@fa-slack: "\f198";
@fa-envelope-square: "\f199";
@fa-wordpress: "\f19a";
@fa-openid: "\f19b";
@fa-university: "\f19c";
@fa-graduation-cap: "\f19d";
@fa-yahoo: "\f19e";
@fa-google: "\f1a0";
@fa-reddit: "\f1a1";
@fa-reddit-square: "\f1a2";
@fa-stumbleupon-circle: "\f1a3";
@fa-stumbleupon: "\f1a4";
@fa-delicious: "\f1a5";
@fa-digg: "\f1a6";
@fa-pied-piper: "\f1a7";
@fa-pied-piper-alt: "\f1a8";
@fa-drupal: "\f1a9";
@fa-joomla: "\f1aa";
@fa-language: "\f1ab";
@fa-fax: "\f1ac";
@fa-building: "\f1ad";
@fa-child: "\f1ae";
@fa-paw: "\f1b0";
@fa-spoon: "\f1b1";
@fa-cube: "\f1b2";
@fa-cubes: "\f1b3";
@fa-behance: "\f1b4";
@fa-behance-square: "\f1b5";
@fa-steam: "\f1b6";
@fa-steam-square: "\f1b7";
@fa-recycle: "\f1b8";
@fa-car: "\f1b9";
@fa-taxi: "\f1ba";
@fa-tree: "\f1bb";
@fa-spotify: "\f1bc";
@fa-deviantart: "\f1bd";
@fa-soundcloud: "\f1be";
@fa-database: "\f1c0";
@fa-file-pdf-o: "\f1c1";
@fa-file-word-o: "\f1c2";
@fa-file-excel-o: "\f1c3";
@fa-file-powerpoint-o: "\f1c4";
@fa-file-image-o: "\f1c5";
@fa-file-archive-o: "\f1c6";
@fa-file-audio-o: "\f1c7";
@fa-file-video-o: "\f1c8";
@fa-file-code-o: "\f1c9";
@fa-vine: "\f1ca";
@fa-codepen: "\f1cb";
@fa-jsfiddle: "\f1cc";
@fa-life-ring: "\f1cd";
@fa-circle-o-notch: "\f1ce";
@fa-rebel: "\f1d0";
@fa-empire: "\f1d1";
@fa-git-square: "\f1d2";
@fa-git: "\f1d3";
@fa-hacker-news: "\f1d4";
@fa-tencent-weibo: "\f1d5";
@fa-qq: "\f1d6";
@fa-weixin: "\f1d7";
@fa-paper-plane: "\f1d8";
@fa-paper-plane-o: "\f1d9";
@fa-history: "\f1da";
@fa-circle-thin: "\f1db";
@fa-header: "\f1dc";
@fa-paragraph: "\f1dd";
@fa-sliders: "\f1de";
@fa-share-alt: "\f1e0";
@fa-share-alt-square: "\f1e1";
@fa-bomb: "\f1e2";
@fa-futbol-o: "\f1e3";
@fa-tty: "\f1e4";
@fa-binoculars: "\f1e5";
@fa-plug: "\f1e6";
@fa-slideshare: "\f1e7";
@fa-twitch: "\f1e8";
@fa-yelp: "\f1e9";
@fa-newspaper-o: "\f1ea";
@fa-wifi: "\f1eb";
@fa-calculator: "\f1ec";
@fa-paypal: "\f1ed";
@fa-google-wallet: "\f1ee";
@fa-cc-visa: "\f1f0";
@fa-cc-mastercard: "\f1f1";
@fa-cc-discover: "\f1f2";
@fa-cc-amex: "\f1f3";
@fa-cc-paypal: "\f1f4";
@fa-cc-stripe: "\f1f5";
@fa-bell-slash: "\f1f6";
@fa-bell-slash-o: "\f1f7";
@fa-trash: "\f1f8";
@fa-copyright: "\f1f9";
@fa-at: "\f1fa";
@fa-eyedropper: "\f1fb";
@fa-paint-brush: "\f1fc";
@fa-birthday-cake: "\f1fd";
@fa-area-chart: "\f1fe";
@fa-pie-chart: "\f200";
@fa-line-chart: "\f201";
@fa-lastfm: "\f202";
@fa-lastfm-square: "\f203";
@fa-toggle-off: "\f204";
@fa-toggle-on: "\f205";
@fa-bicycle: "\f206";
@fa-bus: "\f207";
@fa-ioxhost: "\f208";
@fa-angellist: "\f209";
@fa-cc: "\f20a";
@fa-ils: "\f20b";
@fa-meanpath: "\f20c";
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;padding: 0;border: 0;outline: 0;font-weight: inherit;font-style: inherit;font-size: 100%;font-family: inherit;vertical-align: baseline;}
body {color: #2f332a;font: 15px/21px Arial, Helvetica, simsun, sans-serif;background: #f0f6e4 \9;}
h1, h2, h3, h4, h5, h6 {color: #2f332a;font-weight: bold;font-family: Helvetica, Arial, sans-serif;padding-bottom: 5px;}
h1 {font-size: 24px;line-height: 34px;text-align: center;}
h2 {font-size: 14px;line-height: 24px;padding-top: 5px;}
h6 {font-weight: normal;font-size: 12px;letter-spacing: 1px;line-height: 24px;text-align: center;}
a {color:#3C6E31;text-decoration: underline;}
a:hover {background-color:#3C6E31;color:white;}
input.radio {margin: 0 2px 0 8px;}
input.radio.first {margin-left:0;}
input.empty {color: lightgray;}
code {color: #2f332a;}
.highlight_red {color:#A60000;}
.highlight_green {color:#A7F43D;}
li {list-style: circle;font-size: 12px;}
li.title {list-style: none;}
ul.list {margin-left: 17px;}
div.content_wrap {width: 600px;height:380px;}
div.content_wrap div.left{float: left;width: 250px;}
div.content_wrap div.right{float: right;width: 340px;}
div.zTreeDemoBackground {width:250px;height:362px;text-align:left;}
ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:360px;overflow-y:scroll;overflow-x:auto;}
ul.log {border: 1px solid #617775;background: #f0f6e4;width:300px;height:170px;overflow: hidden;}
ul.log.small {height:45px;}
ul.log li {color: #666666;list-style: none;padding-left: 10px;}
ul.log li.dark {background-color: #E3E3E3;}
/* ruler */
div.ruler {height:20px; width:220px; background-color:#f0f6e4;border: 1px solid #333; margin-bottom: 5px; cursor: pointer}
div.ruler div.cursor {height:20px; width:30px; background-color:#3C6E31; color:white; text-align: right; padding-right: 5px; cursor: pointer}
\ No newline at end of file
/*-------------------------------------
zTree Style
version: 3.4
author: Hunter.z
email: hunter.z@263.net
website: http://code.google.com/p/jquerytree/
-------------------------------------*/
.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
.ztree {margin:0; padding:5px; color:#333}
.ztree li{padding:0; margin:0; list-style:none; line-height:17px; text-align:left; white-space:nowrap; outline:0}
.ztree li ul{ margin:0; padding:0 0 0 18px}
.ztree li ul.line{ background:url(./img/line_conn.png) 0 0 repeat-y;}
.ztree li a {padding-right:3px; margin:0; cursor:pointer; height:21px; color:#333; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block}
.ztree li a:hover {text-decoration:underline}
.ztree li a.curSelectedNode {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; opacity:0.8;}
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; border:1px #666 solid; opacity:0.8;}
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:white; height:21px; border:1px #666 solid;
opacity:0.8; filter:alpha(opacity=80)}
.ztree li a.tmpTargetNode_prev {}
.ztree li a.tmpTargetNode_next {}
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
font-size:12px; border:1px #585956 solid; *border:0px}
.ztree li span {line-height:21px; margin-right:2px}
.ztree li span.button {line-height:0; margin:0; padding: 0; width:21px; height:21px; display: inline-block; vertical-align:middle;
border:0 none; cursor: pointer;outline:none;
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
.ztree li span.button.chk {width:13px; height:13px; margin:0 2px; cursor: auto}
.ztree li span.button.chk.checkbox_false_full {background-position: -5px -5px;}
.ztree li span.button.chk.checkbox_false_full_focus {background-position: -5px -26px;}
.ztree li span.button.chk.checkbox_false_part {background-position: -5px -48px;}
.ztree li span.button.chk.checkbox_false_part_focus {background-position: -5px -68px;}
.ztree li span.button.chk.checkbox_false_disable {background-position: -5px -89px;}
.ztree li span.button.chk.checkbox_true_full {background-position: -26px -5px;}
.ztree li span.button.chk.checkbox_true_full_focus {background-position: -26px -26px;}
.ztree li span.button.chk.checkbox_true_part {background-position: -26px -48px;}
.ztree li span.button.chk.checkbox_true_part_focus {background-position: -26px -68px;}
.ztree li span.button.chk.checkbox_true_disable {background-position: -26px -89px;}
.ztree li span.button.chk.radio_false_full {background-position: -47px -5px;}
.ztree li span.button.chk.radio_false_full_focus {background-position: -47px -26px;}
.ztree li span.button.chk.radio_false_part {background-position: -47px -47px;}
.ztree li span.button.chk.radio_false_part_focus {background-position: -47px -68px;}
.ztree li span.button.chk.radio_false_disable {background-position: -47px -89px;}
.ztree li span.button.chk.radio_true_full {background-position: -68px -5px;}
.ztree li span.button.chk.radio_true_full_focus {background-position: -68px -26px;}
.ztree li span.button.chk.radio_true_part {background-position: -68px -47px;}
.ztree li span.button.chk.radio_true_part_focus {background-position: -68px -68px;}
.ztree li span.button.chk.radio_true_disable {background-position: -68px -89px;}
.ztree li span.button.switch {width:21px; height:21px}
.ztree li span.button.root_open{background-position:-105px -63px}
.ztree li span.button.root_close{background-position:-126px -63px}
.ztree li span.button.roots_open{background-position: -105px 0;}
.ztree li span.button.roots_close{background-position: -126px 0;}
.ztree li span.button.center_open{background-position: -105px -21px;}
.ztree li span.button.center_close{background-position: -126px -21px;}
.ztree li span.button.bottom_open{background-position: -105px -42px;}
.ztree li span.button.bottom_close{background-position: -126px -42px;}
.ztree li span.button.noline_open{background-position: -105px -84px;}
.ztree li span.button.noline_close{background-position: -126px -84px;}
.ztree li span.button.root_docu{ background:none;}
.ztree li span.button.roots_docu{background-position: -84px 0;}
.ztree li span.button.center_docu{background-position: -84px -21px;}
.ztree li span.button.bottom_docu{background-position: -84px -42px;}
.ztree li span.button.noline_docu{ background:none;}
.ztree li span.button.ico_open{margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico_close{margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico_docu{margin-right:2px; background-position: -147px -42px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.edit {margin-left:2px; margin-right: -1px; background-position: -189px -21px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.edit:hover {
background-position: -168px -21px;
}
.ztree li span.button.remove {margin-left:2px; margin-right: -1px; background-position: -189px -42px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.remove:hover {
background-position: -168px -42px;
}
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position: -189px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.add:hover {
background-position: -168px 0;
}
.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
span.tmpzTreeMove_arrow {width:16px; height:21px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
background-position:-168px -84px; background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
.ztreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
/*-------------------------------------
zTree Style
version: 3.5.19
author: Hunter.z
email: hunter.z@263.net
website: http://code.google.com/p/jquerytree/
-------------------------------------*/
.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
.ztree {margin:0; padding:5px; color:#333}
.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0}
.ztree li ul{ margin:0; padding:0 0 0 18px}
.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;}
.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent;
text-decoration:none; vertical-align:top; display: inline-block}
.ztree li a:hover {text-decoration:underline}
.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid;
opacity:0.8; filter:alpha(opacity=80)}
.ztree li a.tmpTargetNode_prev {}
.ztree li a.tmpTargetNode_next {}
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
font-size:12px; border:1px #7EC4CC solid; *border:0px}
.ztree li span {line-height:16px; margin-right:2px}
.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle;
border:0 none; cursor: pointer;outline:none;
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto}
.ztree li span.button.chk.checkbox_false_full {background-position:0 0}
.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px}
.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px}
.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px}
.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px}
.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0}
.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px}
.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px}
.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px}
.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px}
.ztree li span.button.chk.radio_false_full {background-position:-28px 0}
.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px}
.ztree li span.button.chk.radio_false_part {background-position:-28px -28px}
.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px}
.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px}
.ztree li span.button.chk.radio_true_full {background-position:-42px 0}
.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px}
.ztree li span.button.chk.radio_true_part {background-position:-42px -28px}
.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px}
.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px}
.ztree li span.button.switch {width:18px; height:18px}
.ztree li span.button.root_open{background-position:-92px -54px}
.ztree li span.button.root_close{background-position:-74px -54px}
.ztree li span.button.roots_open{background-position:-92px 0}
.ztree li span.button.roots_close{background-position:-74px 0}
.ztree li span.button.center_open{background-position:-92px -18px}
.ztree li span.button.center_close{background-position:-74px -18px}
.ztree li span.button.bottom_open{background-position:-92px -36px}
.ztree li span.button.bottom_close{background-position:-74px -36px}
.ztree li span.button.noline_open{background-position:-92px -72px}
.ztree li span.button.noline_close{background-position:-74px -72px}
.ztree li span.button.root_docu{ background:none;}
.ztree li span.button.roots_docu{background-position:-56px 0}
.ztree li span.button.center_docu{background-position:-56px -18px}
.ztree li span.button.bottom_docu{background-position:-56px -36px}
.ztree li span.button.noline_docu{ background:none;}
.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
/* level style*/
/*.ztree li span.button.level0 {
display:none;
}
.ztree li ul.level0 {
padding:0;
background:none;
}*/
\ No newline at end of file
interface JQuery {
zTree: IzTree;
}
interface IJSON {
[key: string]: any
}
interface ITreeNode {
checked?: boolean;
children?: Array<ITreeNode>;
chkDisabled?: boolean;
click?: CallBackOnFn;
getCheckStatus?: () => object;
getIndex?: () => number;
getNextNode?: () => ITreeNode;
getParentNode?: () => ITreeNode;
getPath?: () => Array<ITreeNode>;
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';
/**
* Defines a class to be returned by the zTree view.nodeClasses function
*/
interface INodeClasses
{
add: string[];
remove: string[];
}
interface IAsync {
autoParam?: string[];
contentType?: ApplicationType;
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: ((treeId: string, treeNode: ITreeNode) => string) | string;
}
type CallBackBeforeFn = (treeId: string, treeNode: ITreeNode) => boolean | Promise<boolean>;
type CallBackOnFn = (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise<void>;
interface ICallback {
beforeAsync?: CallBackBeforeFn;
beforeCheck?: CallBackBeforeFn;
beforeClick?: (treeId: string, treeNode: ITreeNode, clickFlag: number) => boolean | Promise<boolean>;
beforeCollapse?: CallBackBeforeFn;
beforeDblClick?: CallBackBeforeFn;
beforeDrag?: (treeId: string, treeNode: ITreeNode[]) => boolean | Promise<boolean>;
beforeDragOpen?: CallBackBeforeFn;
beforeDrop?: (treeId: string, treeNode: ITreeNode[], targetNode: object, moveType: string, isCopy: boolean) => boolean | Promise<boolean>;
beforeEditName?: CallBackBeforeFn;
beforeExpand?: CallBackBeforeFn;
beforeMouseDown?: CallBackBeforeFn;
beforeMouseUp?: CallBackBeforeFn;
beforeRemove?: CallBackBeforeFn;
beforeRename?: (treeId: string, treeNode: ITreeNode, newName: string, isCancel: boolean) => boolean | Promise<boolean>;
beforeRightClick?: CallBackBeforeFn;
onAsyncError?: (event: Event, treeId: string, treeNode: ITreeNode, XMLHttpRequest: any, textStatus: string, errorThrown: string) => void | Promise<void>;
onAsyncSuccess?: (event: Event, treeId: string, treeNode: ITreeNode, msg: string | object) => void | Promise<void>;
onCheck?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise<void>;
onClick?: (event: Event, treeId: string, treeNode: ITreeNode, clickFlag: number) => void | Promise<void>;
onCollapse?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise<void>;
onDblClick?: (event: Event, treeId: string, treeNode: ITreeNode) => void | Promise<void>;
onDrag?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void | Promise<void>;
onDragMove?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void | Promise<void>;
onDrop?: (event: Event, treeId: string, treeNodes: ITreeNode[], targetNode: object, moveType: string, isCopy: boolean) => void | Promise<void>;
onExpand?: CallBackOnFn;
onMouseDown?: CallBackOnFn;
onMouseUp?: CallBackOnFn;
onNodeCreated?: CallBackOnFn;
onRemove?: CallBackOnFn;
onRename?: (event: Event, treeId: string, treeNode: ITreeNode, isCancel: boolean) => void | Promise<void>;
onRightClick?: CallBackOnFn;
}
interface ICheck {
autoCheckTrigger?: boolean;
chkboxType?: IJSON;
chkStyle?: string;
enable?: boolean;
nocheckInherit?: boolean;
chkDisabledInherit?: boolean;
radioType?: string;
}
interface IData {
keep?: {
leaf?: boolean;
parent?: boolean;
},
key?: {
checked?: string;
children?: string;
isParent?: string;
isHidden?: string;
name?: string;
title?: string;
url?: string;
},
simpleData?: {
enable?: boolean;
idKey?: string;
pIdKey?: string;
rootPId?: any;
}
}
type removeFnType<T> = (treeId: string, treeNode: ITreeNode) => T;
interface IEdit {
drag?: {
autoExpandTrigger?: boolean;
isCopy?: boolean;
isMove?: boolean;
prev?: boolean;
next?: boolean;
inner?: boolean;
borderMax?: number;
borderMin?: number;
minMoveSize?: number;
maxShowNodeNum?: number;
autoOpenTime?: number;
},
editNameSelectAll?: boolean;
enable?: boolean;
removeTitle?: string | removeFnType<string>;
renameTitle?: string | removeFnType<string>;
showRemoveBtn?: boolean | removeFnType<boolean>;
showRenameBtn?: boolean | removeFnType<boolean>;
}
type dblClickExpandFn<T> = (treeId: string, treeNode: ITreeNode) => T;
interface IView {
addDiyDom?: dblClickExpandFn<void>;
addHoverDom?: dblClickExpandFn<void>;
autoCancelSelected?: boolean;
dblClickExpand?: boolean | dblClickExpandFn<boolean>;
expandSpeed?: string | number;
fontCss?: IJSON | dblClickExpandFn<IJSON>;
nodeClasses?: INodeClasses | dblClickExpandFn<INodeClasses>;
nameIsHTML?: boolean;
removeHoverDom?: dblClickExpandFn<void>;
selectedMulti?: boolean;
showIcon?: boolean | dblClickExpandFn<boolean>;
showLine?: boolean;
showTitle?: boolean | dblClickExpandFn<boolean>;
txtSelectedEnable?: boolean;
}
interface ISetting {
async?: IAsync;
callback?: ICallback;
check?: ICheck;
data?: IData;
edit?: IEdit;
view?: IView;
}
type filterFnType = (node: ITreeNode) => boolean;
interface IzTreeObj {
setting: ISetting;
addNodes: (parentNode: object, index?: number, newNodes?: ITreeNode[] | ITreeNode, isSilentBoolean?: boolean) => ITreeNode[];
cancelEditName: (newName?: string) => void;
cancelSelectedNode: (treeNode?: ITreeNode) => void;
checkAllNodes: (checked: boolean) => void;
checkNode: (treeNode: ITreeNode, checked?: boolean, checkTypeFlag?: boolean, callbackFlag?: boolean) => void;
copyNode: (targetNode: object, treeNode: ITreeNode, moveType: string, isSilent: boolean) => ITreeNode;
destroy: () => void;
editName: (treeNode: ITreeNode) => void;
expandAll: (expandFlag: boolean) => boolean | null;
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) => 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: (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: 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: 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: ITreeNode[] | object) => IzTreeObj;
getZTreeObj?: (treeId: string) => IzTreeObj;
destroy?: (treeId: string) => void;
_z?: any;
}
\ No newline at end of file
/*
* email: bigablecat@hotmail.com
* Date: 2018-04-14
*/
/**
* @param zTreeId the ztree id used to get the ztree object
* @param searchField selector of your input for fuzzy search
* @param isHighLight whether highlight the match words, default true
* @param isExpand whether to expand the node, default false
*
* @returns
*/
function fuzzySearch(zTreeId, searchField, isHighLight, isExpand){
var zTreeObj = $.fn.zTree.getZTreeObj(zTreeId);//get the ztree object by ztree id
if(!zTreeObj){
alert("fail to get ztree object");
}
var nameKey = zTreeObj.setting.data.key.name; //get the key of the node name
isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
isExpand = isExpand?true:false; // not to expand in default
zTreeObj.setting.view.nameIsHTML = isHighLight; //allow use html in node name for highlight use
var metaChar = '[\\[\\]\\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; //js meta characters
var rexMeta = new RegExp(metaChar, 'gi');//regular expression to match meta characters
// keywords filter function
function ztreeFilter(zTreeObj,_keywords,callBackFunc) {
if(!_keywords){
_keywords =''; //default blank for _keywords
}
// function to find the matching node
function filterFunc(node) {
if(node && node.oldname && node.oldname.length>0){
node[nameKey] = node.oldname; //recover oldname of the node if exist
}
zTreeObj.updateNode(node); //update node to for modifications take effect
if (_keywords.length == 0) {
//return true to show all nodes if the keyword is blank
zTreeObj.showNode(node);
zTreeObj.expandNode(node,isExpand);
return true;
}
//transform node name and keywords to lowercase
if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase())!=-1) {
if(isHighLight){ //highlight process
//a new variable 'newKeywords' created to store the keywords information
//keep the parameter '_keywords' as initial and it will be used in next node
//process the meta characters in _keywords thus the RegExp can be correctly used in str.replace
var newKeywords = _keywords.replace(rexMeta,function(matchStr){
//add escape character before meta characters
return '\\' + matchStr;
});
node.oldname = node[nameKey]; //store the old name
var rexGlobal = new RegExp(newKeywords, 'gi');//'g' for global,'i' for ignore case
//use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
node[nameKey] = node.oldname.replace(rexGlobal, function(originalText){
//highlight the matching words in node name
var highLightText =
'<span style="color: whitesmoke;background-color: darkred;">'
+ originalText
+'</span>';
return highLightText;
});
zTreeObj.updateNode(node); //update node for modifications take effect
}
zTreeObj.showNode(node);//show node with matching keywords
return true; //return true and show this node
}
zTreeObj.hideNode(node); // hide node that not matched
return false; //return false for node not matched
}
var nodesShow = zTreeObj.getNodesByFilter(filterFunc); //get all nodes that would be shown
processShowNodes(nodesShow, _keywords);//nodes should be reprocessed to show correctly
}
/**
* reprocess of nodes before showing
*/
function processShowNodes(nodesShow,_keywords){
if(nodesShow && nodesShow.length>0){
//process the ancient nodes if _keywords is not blank
if(_keywords.length>0){
$.each(nodesShow, function(n,obj){
var pathOfOne = obj.getPath();//get all the ancient nodes including current node
if(pathOfOne && pathOfOne.length>0){
//i < pathOfOne.length-1 process every node in path except self
for(var i=0;i<pathOfOne.length-1;i++){
zTreeObj.showNode(pathOfOne[i]); //show node
zTreeObj.expandNode(pathOfOne[i],true); //expand node
}
}
});
}else{ //show all nodes when _keywords is blank and expand the root nodes
var rootNodes = zTreeObj.getNodesByParam('level','0');//get all root nodes
$.each(rootNodes,function(n,obj){
zTreeObj.expandNode(obj,true); //expand all root nodes
});
}
}
}
//listen to change in input element
$(searchField).bind('input propertychange', function() {
var _keywords = $(this).val();
searchNodeLazy(_keywords); //call lazy load
});
var timeoutId = null;
var lastKeyword = '';
// excute lazy load once after input change, the last pending task will be cancled
function searchNodeLazy(_keywords) {
if (timeoutId) {
//clear pending task
clearTimeout(timeoutId);
}
timeoutId = setTimeout(function() {
if (lastKeyword === _keywords) {
return;
}
ztreeFilter(zTreeObj,_keywords); //lazy load ztreeFilter function
// $(searchField).focus();//focus input field again after filtering
lastKeyword = _keywords;
}, 500);
}
}
\ No newline at end of file
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Nov 11 19:04:53 2010 -0500
*/
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
This diff could not be displayed because it is too large.
!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:{},nodeClasses:{},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"},render:{name:null,title:null},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<d.length&&0==o.length&&(l=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(o=tools.getNodeMainDom(l).id),0<o.length)switch(a=data.getNodeCache(n,o),r){case"switchNode":data.nodeIsParent(n,a)&&(tools.eqs(e.type,"click")||tools.eqs(e.type,"dblclick")&&tools.apply(n.view.dblClickExpand,[n.treeId,a],n.view.dblClickExpand))?i=handler.onSwitchNode:r="";break;case"clickNode":i=handler.onClickNode}switch(d){case"mousedown":s=handler.onZTreeMousedown;break;case"mouseup":s=handler.onZTreeMouseup;break;case"dblclick":s=handler.onZTreeDblclick;break;case"contextmenu":s=handler.onZTreeContextmenu}return{stop:!1,node:a,nodeEventType:r,nodeEventCallback:i,treeEventType:d,treeEventCallback:s}},_initNode=function(e,t,n,o,a,r,d){if(n){var i=data.getRoot(e),s=data.nodeChildren(e,n);n.level=t,n.tId=e.treeId+"_"+ ++i.zId,n.parentTId=o?o.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open;var l=data.nodeIsParent(e,n);tools.isArray(s)?(data.nodeIsParent(e,n,!0),n.zAsync=!0):(l=data.nodeIsParent(e,n,l),n.open=!(!l||e.async.enable)&&n.open,n.zAsync=!l),n.isFirstNode=a,n.isLastNode=r,n.getParentNode=function(){return data.getNodeCache(e,n.parentTId)},n.getPreNode=function(){return data.getPreNode(e,n)},n.getNextNode=function(){return data.getNextNode(e,n)},n.getIndex=function(){return data.getNodeIndex(e,n)},n.getPath=function(){return data.getNodePath(e,n)},n.isAjaxing=!1,data.fixPIdKeyValue(e,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(e,t){data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=t},getNodeCacheId:function(e){return e.substring(e.lastIndexOf("_")+1)},addAfterA:function(e){_init.afterA.push(e)},addBeforeA:function(e){_init.beforeA.push(e)},addInnerAfterA:function(e){_init.innerAfterA.push(e)},addInnerBeforeA:function(e){_init.innerBeforeA.push(e)},addInitBind:function(e){_init.bind.push(e)},addInitUnBind:function(e){_init.unbind.push(e)},addInitCache:function(e){_init.caches.push(e)},addInitNode:function(e){_init.nodes.push(e)},addInitProxy:function(e,t){t?_init.proxys.splice(0,0,e):_init.proxys.push(e)},addInitRoot:function(e){_init.roots.push(e)},addNodesData:function(e,t,n,o){var a,r=data.nodeChildren(e,t);r?n>=r.length&&(n=-1):(r=data.nodeChildren(e,t,[]),n=-1),0<r.length&&0===n?(r[0].isFirstNode=!1,view.setNodeLineIcos(e,r[0])):0<r.length&&n<0&&(r[r.length-1].isLastNode=!1,view.setNodeLineIcos(e,r[r.length-1])),data.nodeIsParent(e,t,!0),n<0?data.nodeChildren(e,t,r.concat(o)):(a=[n,0].concat(o),r.splice.apply(r,a))},addSelectedNode:function(e,t){var n=data.getRoot(e);data.isSelectedNode(e,t)||n.curSelectedList.push(t)},addCreatedNode:function(e,t){(e.callback.onNodeCreated||e.view.addDiyDom)&&data.getRoot(e).createdNodes.push(t)},addZTreeTools:function(e){_init.zTreeTools.push(e)},exSetting:function(e){$.extend(!0,_setting,e)},fixPIdKeyValue:function(e,t){e.data.simpleData.enable&&(t[e.data.simpleData.pIdKey]=t.parentTId?t.getParentNode()[e.data.simpleData.idKey]:e.data.simpleData.rootPId)},getAfterA:function(e,t,n){for(var o=0,a=_init.afterA.length;o<a;o++)_init.afterA[o].apply(this,arguments)},getBeforeA:function(e,t,n){for(var o=0,a=_init.beforeA.length;o<a;o++)_init.beforeA[o].apply(this,arguments)},getInnerAfterA:function(e,t,n){for(var o=0,a=_init.innerAfterA.length;o<a;o++)_init.innerAfterA[o].apply(this,arguments)},getInnerBeforeA:function(e,t,n){for(var o=0,a=_init.innerBeforeA.length;o<a;o++)_init.innerBeforeA[o].apply(this,arguments)},getCache:function(e){return caches[e.treeId]},getNodeIndex:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length-1;a<=r;a++)if(o[a]===t)return a;return-1},getNextNode:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length-1;a<=r;a++)if(o[a]===t)return a==r?null:o[a+1];return null},getNodeByParam:function(e,t,n,o){if(!t||!n)return null;for(var a=0,r=t.length;a<r;a++){var d=t[a];if(d[n]==o)return t[a];var i=data.nodeChildren(e,d),s=data.getNodeByParam(e,i,n,o);if(s)return s}return null},getNodeCache:function(e,t){if(!t)return null;var n=caches[e.treeId].nodes[data.getNodeCacheId(t)];return n||null},getNodePath:function(e,t){return t?((n=t.parentTId?t.getParentNode().getPath():[])&&n.push(t),n):null;var n},getNodes:function(e){return data.nodeChildren(e,data.getRoot(e))},getNodesByParam:function(e,t,n,o){if(!t||!n)return[];for(var a=[],r=0,d=t.length;r<d;r++){var i=t[r];i[n]==o&&a.push(i);var s=data.nodeChildren(e,i);a=a.concat(data.getNodesByParam(e,s,n,o))}return a},getNodesByParamFuzzy:function(e,t,n,o){if(!t||!n)return[];var a=[];o=o.toLowerCase();for(var r=0,d=t.length;r<d;r++){var i=t[r];"string"==typeof i[n]&&-1<t[r][n].toLowerCase().indexOf(o)&&a.push(i);var s=data.nodeChildren(e,i);a=a.concat(data.getNodesByParamFuzzy(e,s,n,o))}return a},getNodesByFilter:function(e,t,n,o,a){if(!t)return o?null:[];for(var r=o?null:[],d=0,i=t.length;d<i;d++){var s=t[d];if(tools.apply(n,[s,a],!1)){if(o)return s;r.push(s)}var l=data.nodeChildren(e,s),c=data.getNodesByFilter(e,l,n,o,a);if(o&&c)return c;r=o?c:r.concat(c)}return r},getPreNode:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length;a<r;a++)if(o[a]===t)return 0==a?null:o[a-1];return null},getRoot:function(e){return e?roots[e.treeId]:null},getRoots:function(){return roots},getSetting:function(e){return settings[e]},getSettings:function(){return settings},getZTreeTools:function(e){var t=this.getRoot(this.getSetting(e));return t?t.treeTools:null},initCache:function(e){for(var t=0,n=_init.caches.length;t<n;t++)_init.caches[t].apply(this,arguments)},initNode:function(e,t,n,o,a,r){for(var d=0,i=_init.nodes.length;d<i;d++)_init.nodes[d].apply(this,arguments)},initRoot:function(e){for(var t=0,n=_init.roots.length;t<n;t++)_init.roots[t].apply(this,arguments)},isSelectedNode:function(e,t){for(var n=data.getRoot(e),o=0,a=n.curSelectedList.length;o<a;o++)if(t===n.curSelectedList[o])return!0;return!1},nodeChildren:function(e,t,n){if(!t)return null;var o=e.data.key.children;return void 0!==n&&(t[o]=n),t[o]},nodeIsParent:function(e,t,n){if(!t)return!1;var o=e.data.key.isParent;return void 0!==n?("string"==typeof n&&(n=tools.eqs(n,"true")),n=!!n,t[o]=n):"string"==typeof t[o]?t[o]=tools.eqs(t[o],"true"):t[o]=!!t[o],t[o]},nodeName:function(e,t,n){var o=e.data.key.name;void 0!==n&&(t[o]=n);var a=""+t[o];return"function"==typeof e.data.render.name?e.data.render.name.call(this,a,t):a},nodeTitle:function(e,t){var n=""+t[""===e.data.key.title?e.data.key.name:e.data.key.title];return"function"==typeof e.data.render.title?e.data.render.title.call(this,n,t):n},removeNodeCache:function(e,t){var n=data.nodeChildren(e,t);if(n)for(var o=0,a=n.length;o<a;o++)data.removeNodeCache(e,n[o]);data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=null},removeSelectedNode:function(e,t){for(var n=data.getRoot(e),o=0,a=n.curSelectedList.length;o<a;o++)t!==n.curSelectedList[o]&&data.getNodeCache(e,n.curSelectedList[o].tId)||(n.curSelectedList.splice(o,1),e.treeObj.trigger(consts.event.UNSELECTED,[e.treeId,t]),o--,a--)},setCache:function(e,t){caches[e.treeId]=t},setRoot:function(e,t){roots[e.treeId]=t},setZTreeTools:function(e,t){for(var n=0,o=_init.zTreeTools.length;n<o;n++)_init.zTreeTools[n].apply(this,arguments)},transformToArrayFormat:function(n,e){if(!e)return[];var o=[];if(tools.isArray(e))for(var t=0,a=e.length;t<a;t++){r(e[t])}else r(e);return o;function r(e){o.push(e);var t=data.nodeChildren(n,e);t&&(o=o.concat(data.transformToArrayFormat(n,t)))}},transformTozTreeFormat:function(e,t){var n,o,a=e.data.simpleData.idKey,r=e.data.simpleData.pIdKey;if(!a||""==a||!t)return[];if(tools.isArray(t)){var d=[],i={};for(n=0,o=t.length;n<o;n++)i[t[n][a]]=t[n];for(n=0,o=t.length;n<o;n++){var s=i[t[n][r]];if(s&&t[n][a]!=t[n][r]){var l=data.nodeChildren(e,s);(l=l||data.nodeChildren(e,s,[])).push(t[n])}else d.push(t[n])}return d}return[t]}},event={bindEvent:function(e){for(var t=0,n=_init.bind.length;t<n;t++)_init.bind[t].apply(this,arguments)},unbindEvent:function(e){for(var t=0,n=_init.unbind.length;t<n;t++)_init.unbind[t].apply(this,arguments)},bindTree:function(e){var t={treeId:e.treeId},n=e.treeObj;e.view.txtSelectedEnable||n.bind("selectstart",handler.onSelectStart).css({"-moz-user-select":"-moz-none"}),n.bind("click",t,event.proxy),n.bind("dblclick",t,event.proxy),n.bind("mouseover",t,event.proxy),n.bind("mouseout",t,event.proxy),n.bind("mousedown",t,event.proxy),n.bind("mouseup",t,event.proxy),n.bind("contextmenu",t,event.proxy)},unbindTree:function(e){e.treeObj.unbind("selectstart",handler.onSelectStart).unbind("click",event.proxy).unbind("dblclick",event.proxy).unbind("mouseover",event.proxy).unbind("mouseout",event.proxy).unbind("mousedown",event.proxy).unbind("mouseup",event.proxy).unbind("contextmenu",event.proxy)},doProxy:function(e){for(var t=[],n=0,o=_init.proxys.length;n<o;n++){var a=_init.proxys[n].apply(this,arguments);if(t.push(a),a.stop)break}return t},proxy:function(e){var t=data.getSetting(e.data.treeId);if(!tools.uCanDo(t,e))return!0;for(var n=event.doProxy(e),o=!0,a=0,r=n.length;a<r;a++){var d=n[a];d.nodeEventCallback&&(o=d.nodeEventCallback.apply(d,[e,d.node])&&o),d.treeEventCallback&&(o=d.treeEventCallback.apply(d,[e,d.node])&&o)}return o}},handler={onSwitchNode:function(e,t){var n=data.getSetting(e.data.treeId);if(t.open){if(0==tools.apply(n.callback.beforeCollapse,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}else{if(0==tools.apply(n.callback.beforeExpand,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}return!0},onClickNode:function(e,t){var n=data.getSetting(e.data.treeId),o=n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&data.isSelectedNode(n,t)?0:n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&n.view.selectedMulti?2:1;return 0==tools.apply(n.callback.beforeClick,[n.treeId,t,o],!0)||(0==o?view.cancelPreSelectedNode(n,t):view.selectNode(n,t,2==o),n.treeObj.trigger(consts.event.CLICK,[e,n.treeId,t,o])),!0},onZTreeMousedown:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseDown,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseDown,[e,n.treeId,t]),!0},onZTreeMouseup:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseUp,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseUp,[e,n.treeId,t]),!0},onZTreeDblclick:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeDblClick,[n.treeId,t],!0)&&tools.apply(n.callback.onDblClick,[e,n.treeId,t]),!0},onZTreeContextmenu:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeRightClick,[n.treeId,t],!0)&&tools.apply(n.callback.onRightClick,[e,n.treeId,t]),"function"!=typeof n.callback.onRightClick},onSelectStart:function(e){var t=e.originalEvent.srcElement.nodeName.toLowerCase();return"input"===t||"textarea"===t}},tools={apply:function(e,t,n){return"function"==typeof e?e.apply(zt,t||[]):n},canAsync:function(e,t){var n=data.nodeChildren(e,t),o=data.nodeIsParent(e,t);return e.async.enable&&t&&o&&!(t.zAsync||n&&0<n.length)},clone:function(e){if(null===e)return null;var t=tools.isArray(e)?[]:{};for(var n in e)t[n]=e[n]instanceof Date?new Date(e[n].getTime()):"object"==typeof e[n]?tools.clone(e[n]):e[n];return t},eqs:function(e,t){return e.toLowerCase()===t.toLowerCase()},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},isElement:function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},$:function(e,t,n){return t&&"string"!=typeof t&&(n=t,t=""),"string"==typeof e?$(e,n?n.treeObj.get(0).ownerDocument:null):$("#"+e.tId+t,n?n.treeObj:null)},getMDom:function(e,t,n){if(!t)return null;for(;t&&t.id!==e.treeId;){for(var o=0,a=n.length;t.tagName&&o<a;o++)if(tools.eqs(t.tagName,n[o].tagName)&&null!==t.getAttribute(n[o].attrName))return t;t=t.parentNode}return null},getNodeMainDom:function(e){return $(e).parent("li").get(0)||$(e).parentsUntil("li").parent().get(0)},isChildOrSelf:function(e,t){return 0<$(e).closest("#"+t).length},uCanDo:function(e,t){return!0}},view={addNodes:function(e,t,n,o,a){var r=data.nodeIsParent(e,t);if(!e.data.keep.leaf||!t||r)if(tools.isArray(o)||(o=[o]),e.data.simpleData.enable&&(o=data.transformTozTreeFormat(e,o)),t){var d=$$(t,consts.id.SWITCH,e),i=$$(t,consts.id.ICON,e),s=$$(t,consts.id.UL,e);t.open||(view.replaceSwitchClass(t,d,consts.folder.CLOSE),view.replaceIcoClass(t,i,consts.folder.CLOSE),t.open=!1,s.css({display:"none"})),data.addNodesData(e,t,n,o),view.createNodes(e,t.level+1,o,t,n),a||view.expandCollapseParentNode(e,t,!0)}else data.addNodesData(e,data.getRoot(e),n,o),view.createNodes(e,0,o,null,n)},appendNodes:function(e,t,n,o,a,r,d){if(!n)return[];var i,s,l=[],c=o||data.getRoot(e),u=data.nodeChildren(e,c);(!u||a>=u.length-n.length)&&(a=-1);for(var p=0,f=n.length;p<f;p++){var g=n[p];r&&(i=(0===a||u.length==n.length)&&0==p,s=a<0&&p==n.length-1,data.initNode(e,t,g,o,i,s,d),data.addNodeCache(e,g));var v=data.nodeIsParent(e,g),N=[],h=data.nodeChildren(e,g);h&&0<h.length&&(N=view.appendNodes(e,t+1,h,g,-1,r,d&&g.open)),d&&(view.makeDOMNodeMainBefore(l,e,g),view.makeDOMNodeLine(l,e,g),data.getBeforeA(e,g,l),view.makeDOMNodeNameBefore(l,e,g),data.getInnerBeforeA(e,g,l),view.makeDOMNodeIcon(l,e,g),data.getInnerAfterA(e,g,l),view.makeDOMNodeNameAfter(l,e,g),data.getAfterA(e,g,l),v&&g.open&&view.makeUlHtml(e,g,l,N.join("")),view.makeDOMNodeMainAfter(l,e,g),data.addCreatedNode(e,g))}return l},appendParentULDom:function(e,t){var n=[],o=$$(t,e);!o.get(0)&&t.parentTId&&(view.appendParentULDom(e,t.getParentNode()),o=$$(t,e));var a=$$(t,consts.id.UL,e);a.get(0)&&a.remove();var r=data.nodeChildren(e,t),d=view.appendNodes(e,t.level+1,r,t,-1,!1,!0);view.makeUlHtml(e,t,n,d.join("")),o.append(n.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l,isParent=data.nodeIsParent(setting,node);if(node&&!isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"",class:consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={},autoParam=tools.apply(setting.async.autoParam,[setting.treeId,node],setting.async.autoParam);for(i=0,l=autoParam.length;node&&i<l;i++){var pKey=autoParam[i].split("="),spKey=pKey;1<pKey.length&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}var otherParam=tools.apply(setting.async.otherParam,[setting.treeId,node],setting.async.otherParam);if(tools.isArray(otherParam))for(i=0,l=otherParam.length;i<l;i+=2)tmpParam[otherParam[i]]=otherParam[i+1];else for(var p in otherParam)tmpParam[p]=otherParam[p];var _tmpV=data.getRoot(setting)._ver;return $.ajax({contentType:setting.async.contentType,cache:!1,type:setting.async.type,url:tools.apply(setting.async.url,[setting.treeId,node],setting.async.url),data:-1<setting.async.contentType.indexOf("application/json")?JSON.stringify(tmpParam):tmpParam,dataType:setting.async.dataType,headers:setting.async.headers,xhrFields:setting.async.xhrFields,success:function(msg){if(_tmpV==data.getRoot(setting)._ver){var newNodes=[];try{newNodes=msg&&0!=msg.length?"string"==typeof msg?eval("("+msg+")"):msg:[]}catch(e){newNodes=msg}node&&(node.isAjaxing=null,node.zAsync=!0),view.setNodeLineIcos(setting,node),newNodes&&""!==newNodes?(newNodes=tools.apply(setting.async.dataFilter,[setting.treeId,node,newNodes],newNodes),view.addNodes(setting,node,-1,newNodes?tools.clone(newNodes):[],!!isSilent)):view.addNodes(setting,node,-1,[],!!isSilent),setting.treeObj.trigger(consts.event.ASYNC_SUCCESS,[setting.treeId,node,msg]),tools.apply(callback)}},error:function(e,t,n){_tmpV==data.getRoot(setting)._ver&&(node&&(node.isAjaxing=null),view.setNodeLineIcos(setting,node),setting.treeObj.trigger(consts.event.ASYNC_ERROR,[setting.treeId,node,e,t,n]))}}),!0},cancelPreSelectedNode:function(e,t,n){var o,a,r=data.getRoot(e).curSelectedList;for(o=r.length-1;0<=o;o--)if(t===(a=r[o])||!t&&(!n||n!==a)){if($$(a,consts.id.A,e).removeClass(consts.node.CURSELECTED),t){data.removeSelectedNode(e,t);break}r.splice(o,1),e.treeObj.trigger(consts.event.UNSELECTED,[e.treeId,a])}},createNodeCallback:function(e){if(e.callback.onNodeCreated||e.view.addDiyDom)for(var t=data.getRoot(e);0<t.createdNodes.length;){var n=t.createdNodes.shift();tools.apply(e.view.addDiyDom,[e.treeId,n]),e.callback.onNodeCreated&&e.treeObj.trigger(consts.event.NODECREATED,[e.treeId,n])}},createNodes:function(e,t,n,o,a){if(n&&0!=n.length){var r=data.getRoot(e),d=!o||o.open||!!$$(data.nodeChildren(e,o)[0],e).get(0);r.createdNodes=[];var i,s,l=view.appendNodes(e,t,n,o,a,!0,d);if(o){var c=$$(o,consts.id.UL,e);c.get(0)&&(i=c)}else i=e.treeObj;i&&(0<=a&&(s=i.children()[a]),0<=a&&s?$(s).before(l.join("")):i.append(l.join(""))),view.createNodeCallback(e)}},destroy:function(e){e&&(data.initCache(e),data.initRoot(e),event.unbindTree(e),event.unbindEvent(e),e.treeObj.empty(),delete settings[e.treeId])},expandCollapseNode:function(e,t,n,o,a){var r,d=data.getRoot(e);if(t){var i=data.nodeChildren(e,t),s=data.nodeIsParent(e,t);if(d.expandTriggerFlag&&(r=a,a=function(){r&&r(),t.open?e.treeObj.trigger(consts.event.EXPAND,[e.treeId,t]):e.treeObj.trigger(consts.event.COLLAPSE,[e.treeId,t])},d.expandTriggerFlag=!1),!t.open&&s&&(!$$(t,consts.id.UL,e).get(0)||i&&0<i.length&&!$$(i[0],e).get(0))&&(view.appendParentULDom(e,t),view.createNodeCallback(e)),t.open!=n){var l=$$(t,consts.id.UL,e),c=$$(t,consts.id.SWITCH,e),u=$$(t,consts.id.ICON,e);s?(t.open=!t.open,t.iconOpen&&t.iconClose&&u.attr("style",view.makeNodeIcoStyle(e,t)),t.open?(view.replaceSwitchClass(t,c,consts.folder.OPEN),view.replaceIcoClass(t,u,consts.folder.OPEN),0==o||""==e.view.expandSpeed?(l.show(),tools.apply(a,[])):i&&0<i.length?l.slideDown(e.view.expandSpeed,a):(l.show(),tools.apply(a,[]))):(view.replaceSwitchClass(t,c,consts.folder.CLOSE),view.replaceIcoClass(t,u,consts.folder.CLOSE),0!=o&&""!=e.view.expandSpeed&&i&&0<i.length?l.slideUp(e.view.expandSpeed,a):(l.hide(),tools.apply(a,[])))):tools.apply(a,[])}else tools.apply(a,[])}else tools.apply(a,[])},expandCollapseParentNode:function(e,t,n,o,a){t&&(t.parentTId?(view.expandCollapseNode(e,t,n,o),t.parentTId&&view.expandCollapseParentNode(e,t.getParentNode(),n,o,a)):view.expandCollapseNode(e,t,n,o,a))},expandCollapseSonNode:function(e,t,n,o,a){var r=data.getRoot(e),d=t?data.nodeChildren(e,t):data.nodeChildren(e,r),i=!t&&o,s=data.getRoot(e).expandTriggerFlag;if(data.getRoot(e).expandTriggerFlag=!1,d)for(var l=0,c=d.length;l<c;l++)d[l]&&view.expandCollapseSonNode(e,d[l],n,i);data.getRoot(e).expandTriggerFlag=s,view.expandCollapseNode(e,t,n,o,a)},isSelectedNode:function(e,t){if(!t)return!1;var n,o=data.getRoot(e).curSelectedList;for(n=o.length-1;0<=n;n--)if(t===o[n])return!0;return!1},makeDOMNodeIcon:function(e,t,n){var o=data.nodeName(t,n),a=t.view.nameIsHTML?o:o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.push("<span id='",n.tId,consts.id.ICON,"' title='' treeNode",consts.id.ICON," class='",view.makeNodeIcoClass(t,n),"' style='",view.makeNodeIcoStyle(t,n),"'></span><span id='",n.tId,consts.id.SPAN,"' class='",consts.className.NAME,"'>",a,"</span>")},makeDOMNodeLine:function(e,t,n){e.push("<span id='",n.tId,consts.id.SWITCH,"' title='' class='",view.makeNodeLineClass(t,n),"' treeNode",consts.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(e,t,n){e.push("</li>")},makeDOMNodeMainBefore:function(e,t,n){e.push("<li id='",n.tId,"' class='",consts.className.LEVEL,n.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(e,t,n){e.push("</a>")},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("<a id='",n.tId,consts.id.A,"' class='",consts.className.LEVEL,n.level,d.add?" "+d.add.join(" "):"","' treeNode",consts.id.A,n.click?' onclick="'+n.click+'"':"",null!=a&&0<a.length?" href='"+a+"'":""," target='",view.makeNodeTarget(n),"' style='",i.join(""),"'"),tools.apply(t.view.showTitle,[t.treeId,n],t.view.showTitle)&&o&&e.push("title='",o.replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"'"),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("<ul id='",t.tId,consts.id.UL,"' class='",consts.className.LEVEL,t.level," ",view.makeUlLineClass(e,t),"' style='display:",t.open?"block":"none","'>"),n.push(o),n.push("</ul>")},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;o<a;o++)data.removeNodeCache(e,n[o]);if(data.removeSelectedNode(e),delete t[e.data.key.children],e.data.keep.parent)$$(t,consts.id.UL,e).empty();else{data.nodeIsParent(e,t,!1),t.open=!1;var r=$$(t,consts.id.SWITCH,e),d=$$(t,consts.id.ICON,e);view.replaceSwitchClass(t,r,consts.folder.DOCU),view.replaceIcoClass(t,d,consts.folder.DOCU),$$(t,consts.id.UL,e).remove()}}}},scrollIntoView:function(e,t){if(t)if("undefined"!=typeof Element&&"undefined"!=typeof HTMLElement)Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(n){"use strict";function e(e,t){return{start:e,length:t,end:e+t}}function t(e,t){return!1===n||t.start<e.end&&e.start<t.end?Math.max(e.end-t.length,Math.min(t.start,e.start)):(e.start+e.end-t.length)/2}function a(n,o){return{x:n,y:o,translate:function(e,t){return a(n+e,o+t)}}}function o(e,t){for(;e;)t=t.translate(e.offsetLeft,e.offsetTop),e=e.offsetParent;return t}for(var r,d=o(this,a(0,0)),i=a(this.offsetWidth,this.offsetHeight),s=this.parentNode;s instanceof HTMLElement;)r=o(s,a(s.clientLeft,s.clientTop)),s.scrollLeft=t(e(d.x-r.x,i.x),e(s.scrollLeft,s.clientWidth)),s.scrollTop=t(e(d.y-r.y,i.y),e(s.scrollTop,s.clientHeight)),d=d.translate(-s.scrollLeft,-s.scrollTop),s=s.parentNode}),t.scrollIntoViewIfNeeded();else{var n=e.treeObj.get(0).getBoundingClientRect(),o=t.getBoundingClientRect();(o.top<n.top||o.bottom>n.bottom||o.right>n.right||o.left<n.left)&&t.scrollIntoView()}},setFirstNode:function(e,t){var n=data.nodeChildren(e,t);0<n.length&&(n[0].isFirstNode=!0)},setLastNode:function(e,t){var n=data.nodeChildren(e,t);0<n.length&&(n[n.length-1].isLastNode=!0)},removeNode:function(e,t){var n=data.getRoot(e),o=t.parentTId?t.getParentNode():n;if(t.isFirstNode=!1,t.isLastNode=!1,t.getPreNode=function(){return null},t.getNextNode=function(){return null},data.getNodeCache(e,t.tId)){$$(t,e).remove(),data.removeNodeCache(e,t),data.removeSelectedNode(e,t);for(var a=data.nodeChildren(e,o),r=0,d=a.length;r<d;r++)if(a[r].tId==t.tId){a.splice(r,1);break}view.setFirstNode(e,o),view.setLastNode(e,o);var i,s,l,c=a.length;if(e.data.keep.parent||0!=c){if(e.view.showLine&&0<c){var u=a[c-1];if(i=$$(u,consts.id.UL,e),s=$$(u,consts.id.SWITCH,e),l=$$(u,consts.id.ICON,e),o==n)if(1==a.length)view.replaceSwitchClass(u,s,consts.line.ROOT);else{var p=$$(a[0],consts.id.SWITCH,e);view.replaceSwitchClass(a[0],p,consts.line.ROOTS),view.replaceSwitchClass(u,s,consts.line.BOTTOM)}else view.replaceSwitchClass(u,s,consts.line.BOTTOM);i.removeClass(consts.line.LINE)}}else data.nodeIsParent(e,o,!1),o.open=!1,delete o[e.data.key.children],i=$$(o,consts.id.UL,e),s=$$(o,consts.id.SWITCH,e),l=$$(o,consts.id.ICON,e),view.replaceSwitchClass(o,s,consts.folder.DOCU),view.replaceIcoClass(o,l,consts.folder.DOCU),i.css("display","none")}},replaceIcoClass:function(e,t,n){if(t&&!e.isAjaxing){var o=t.attr("class");if(null!=o){var a=o.split("_");switch(n){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:a[a.length-1]=n}t.attr("class",a.join("_"))}}},replaceSwitchClass:function(e,t,n){if(t){var o=t.attr("class");if(null!=o){var a=o.split("_");switch(n){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:a[0]=view.makeNodeLineClassEx(e)+n;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:a[1]=n}t.attr("class",a.join("_")),n!==consts.folder.DOCU?t.removeAttr("disabled"):t.attr("disabled","disabled")}}},selectNode:function(e,t,n){n||view.cancelPreSelectedNode(e,null,t),$$(t,consts.id.A,e).addClass(consts.node.CURSELECTED),data.addSelectedNode(e,t),e.treeObj.trigger(consts.event.SELECTED,[e.treeId,t])},setNodeFontCss:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeFontCss(e,t);o&&n.css(o)},setNodeClasses:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeClasses(e,t);"add"in o&&o.add.length&&n.addClass(o.add.join(" ")),"remove"in o&&o.remove.length&&n.removeClass(o.remove.join(" "))},setNodeLineIcos:function(e,t){if(t){var n=$$(t,consts.id.SWITCH,e),o=$$(t,consts.id.UL,e),a=$$(t,consts.id.ICON,e),r=view.makeUlLineClass(e,t);0==r.length?o.removeClass(consts.line.LINE):o.addClass(r),n.attr("class",view.makeNodeLineClass(e,t)),data.nodeIsParent(e,t)?n.removeAttr("disabled"):n.attr("disabled","disabled"),a.removeAttr("style"),a.attr("style",view.makeNodeIcoStyle(e,t)),a.attr("class",view.makeNodeIcoClass(e,t))}},setNodeName:function(e,t){var n=data.nodeTitle(e,t),o=$$(t,consts.id.SPAN,e);o.empty(),e.view.nameIsHTML?o.html(data.nodeName(e,t)):o.text(data.nodeName(e,t)),tools.apply(e.view.showTitle,[e.treeId,t],e.view.showTitle)&&$$(t,consts.id.A,e).attr("title",n||"")},setNodeTarget:function(e,t){$$(t,consts.id.A,e).attr("target",view.makeNodeTarget(t))},setNodeUrl:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeUrl(e,t);null==o||0==o.length?n.removeAttr("href"):n.attr("href",o)},switchNode:function(e,t){if(t.open||!tools.canAsync(e,t))view.expandCollapseNode(e,t,!t.open);else if(e.async.enable){if(!view.asyncNode(e,t))return void view.expandCollapseNode(e,t,!t.open)}else t&&view.expandCollapseNode(e,t,!t.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(e){var t=data.getZTreeTools(e);return t||null},destroy:function(e){if(e&&0<e.length)view.destroy(data.getSetting(e));else for(var t in settings)view.destroy(settings[t])},init:function(e,t,n){var s=tools.clone(_setting);$.extend(!0,s,t),s.treeId=e.attr("id"),s.treeObj=e,s.treeObj.empty(),settings[s.treeId]=s,void 0===document.body.style.maxHeight&&(s.view.expandSpeed=""),data.initRoot(s);var o=data.getRoot(s);n=n?tools.clone(tools.isArray(n)?n:[n]):[],s.data.simpleData.enable?data.nodeChildren(s,o,data.transformTozTreeFormat(s,n)):data.nodeChildren(s,o,n),data.initCache(s),event.unbindTree(s),event.bindTree(s),event.unbindEvent(s),event.bindEvent(s);var r={setting:s,addNodes:function(e,t,n,o){e=e||null;var a=data.nodeIsParent(s,e);if(e&&!a&&s.data.keep.leaf)return null;var r=parseInt(t,10);if(t=isNaN(r)?(o=!!n,n=t,-1):r,!n)return null;var d=tools.clone(tools.isArray(n)?n:[n]);function i(){view.addNodes(s,e,t,d,1==o)}return tools.canAsync(s,e)?view.asyncNode(s,e,o,i):i(),d},cancelSelectedNode:function(e){view.cancelPreSelectedNode(s,e)},destroy:function(){view.destroy(s)},expandAll:function(e){return e=!!e,view.expandCollapseSonNode(s,null,e,!0),e},expandNode:function(t,e,n,o,a){return t&&data.nodeIsParent(s,t)?(!0!==e&&!1!==e&&(e=!t.open),(a=!!a)&&e&&0==tools.apply(s.callback.beforeExpand,[s.treeId,t],!0)||a&&!e&&0==tools.apply(s.callback.beforeCollapse,[s.treeId,t],!0)?null:(e&&t.parentTId&&view.expandCollapseParentNode(s,t.getParentNode(),e,!1),e!==t.open||n?(data.getRoot(s).expandTriggerFlag=a,!tools.canAsync(s,t)&&n?view.expandCollapseSonNode(s,t,e,!0,r):(t.open=!e,view.switchNode(this.setting,t),r()),e):null)):null;function r(){var e=$$(t,s).get(0);e&&!1!==o&&view.scrollIntoView(s,e)}},getNodes:function(){return data.getNodes(s)},getNodeByParam:function(e,t,n){return e?data.getNodeByParam(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodeByTId:function(e){return data.getNodeCache(s,e)},getNodesByParam:function(e,t,n){return e?data.getNodesByParam(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodesByParamFuzzy:function(e,t,n){return e?data.getNodesByParamFuzzy(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodesByFilter:function(e,t,n,o){return t=!!t,e&&"function"==typeof e?data.getNodesByFilter(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t,o):t?null:[]},getNodeIndex:function(e){if(!e)return null;for(var t=e.parentTId?e.getParentNode():data.getRoot(s),n=data.nodeChildren(s,t),o=0,a=n.length;o<a;o++)if(n[o]==e)return o;return-1},getSelectedNodes:function(){for(var e=[],t=data.getRoot(s).curSelectedList,n=0,o=t.length;n<o;n++)e.push(t[n]);return e},isSelectedNode:function(e){return data.isSelectedNode(s,e)},reAsyncChildNodesPromise:function(n,o,a){return new Promise(function(e,t){try{r.reAsyncChildNodes(n,o,a,function(){e(n)})}catch(e){t(e)}})},reAsyncChildNodes:function(e,t,n,o){if(this.setting.async.enable){var a=!e;if(a&&(e=data.getRoot(s)),"refresh"==t){for(var r=data.nodeChildren(s,e),d=0,i=r?r.length:0;d<i;d++)data.removeNodeCache(s,r[d]);if(data.removeSelectedNode(s),data.nodeChildren(s,e,[]),a)this.setting.treeObj.empty();else $$(e,consts.id.UL,s).empty()}view.asyncNode(this.setting,a?null:e,!!n,o)}},refresh:function(){this.setting.treeObj.empty();var e=data.getRoot(s),t=data.nodeChildren(s,e);data.initRoot(s),data.nodeChildren(s,e,t),data.initCache(s),view.createNodes(s,0,data.nodeChildren(s,e),null,-1)},removeChildNodes:function(e){if(!e)return null;var t=data.nodeChildren(s,e);return view.removeChildNodes(s,e),t||null},removeNode:function(e,t){e&&((t=!!t)&&0==tools.apply(s.callback.beforeRemove,[s.treeId,e],!0)||(view.removeNode(s,e),t&&this.setting.treeObj.trigger(consts.event.REMOVE,[s.treeId,e])))},selectNode:function(t,e,n){if(t&&tools.uCanDo(s)){if(e=s.view.selectedMulti&&e,t.parentTId)view.expandCollapseParentNode(s,t.getParentNode(),!0,!1,function(){if(n)return;var e=$$(t,s).get(0);view.scrollIntoView(s,e)});else if(!n)try{$$(t,s).focus().blur()}catch(e){}view.selectNode(s,t,e)}},transformTozTreeNodes:function(e){return data.transformTozTreeFormat(s,e)},transformToArray:function(e){return data.transformToArrayFormat(s,e)},updateNode:function(e,t){e&&$$(e,s).get(0)&&tools.uCanDo(s)&&(view.setNodeName(s,e),view.setNodeTarget(s,e),view.setNodeUrl(s,e),view.setNodeLineIcos(s,e),view.setNodeFontCss(s,e),view.setNodeClasses(s,e))}};o.treeTools=r,data.setZTreeTools(s,r);var a=data.nodeChildren(s,o);return a&&0<a.length?view.createNodes(s,0,a,null,-1):s.async.enable&&s.async.url&&""!==s.async.url&&view.asyncNode(s),r}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(jQuery);
!function(e){var t={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},c={check:{enable:!1,autoCheckTrigger:!1,chkStyle:t.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:t.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},r={onCheckNode:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId);if(0==o.apply(c.callback.beforeCheck,[c.treeId,t],!0))return!0;var h=C.nodeChecked(c,t);C.nodeChecked(c,t,!h),l.checkNodeRelation(c,t);var a=f(t,s.id.CHECK,c);return l.setChkClass(c,a,t),l.repairParentChkClassWithSelf(c,t),c.treeObj.trigger(s.event.CHECK,[e,c.treeId,t]),!0},onMouseoverCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!0,l.setChkClass(c,h,t),!0},onMouseoutCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!1,l.setChkClass(c,h,t),!0}},h={tools:{},view:{checkNodeRelation:function(e,t){var c,h,a,n=s.radio,i=C.nodeChecked(e,t);if(e.check.chkStyle==n.STYLE){var r=C.getRadioCheckedList(e);if(i)if(e.check.radioType==n.TYPE_ALL){for(h=r.length-1;0<=h;h--){c=r[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),r.splice(h,1),l.setChkClass(e,f(c,s.id.CHECK,e),c),c.parentTId!=t.parentTId&&l.repairParentChkClassWithSelf(e,c))}r.push(t)}else{var o=t.parentTId?t.getParentNode():C.getRoot(e);for(h=0,a=(d=C.nodeChildren(e,o)).length;h<a;h++){c=d[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),l.setChkClass(e,f(c,s.id.CHECK,e),c))}}else if(e.check.radioType==n.TYPE_ALL)for(h=0,a=r.length;h<a;h++)if(t==r[h]){r.splice(h,1);break}}else{var d=C.nodeChildren(e,t);i&&(!d||0==d.length||-1<e.check.chkboxType.Y.indexOf("s"))&&l.setSonNodeCheckBox(e,t,!0),i||d&&0!=d.length&&!(-1<e.check.chkboxType.N.indexOf("s"))||l.setSonNodeCheckBox(e,t,!1),i&&-1<e.check.chkboxType.Y.indexOf("p")&&l.setParentNodeCheckBox(e,t,!0),!i&&-1<e.check.chkboxType.N.indexOf("p")&&l.setParentNodeCheckBox(e,t,!1)}},makeChkClass:function(e,t){var c=s.checkbox,h=s.radio,a="",n=C.nodeChecked(e,t);a=!0===t.chkDisabled?c.DISABLED:t.halfCheck?c.PART:e.check.chkStyle==h.STYLE?t.check_Child_State<1?c.FULL:c.PART:n?2===t.check_Child_State||-1===t.check_Child_State?c.FULL:c.PART:t.check_Child_State<1?c.FULL:c.PART;var i=e.check.chkStyle+"_"+(n?c.TRUE:c.FALSE)+"_"+a;return i=t.check_Focus&&!0!==t.chkDisabled?i+"_"+c.FOCUS:i,s.className.BUTTON+" "+c.DEFAULT+" "+i},repairAllChk:function(e,t){if(e.check.enable&&e.check.chkStyle===s.checkbox.STYLE)for(var c=C.getRoot(e),h=C.nodeChildren(e,c),a=0,n=h.length;a<n;a++){var i=h[a];!0!==i.nocheck&&!0!==i.chkDisabled&&C.nodeChecked(e,i,t),l.setSonNodeCheckBox(e,i,t)}},repairChkClass:function(e,t){if(t&&(C.makeChkFlag(e,t),!0!==t.nocheck)){var c=f(t,s.id.CHECK,e);l.setChkClass(e,c,t)}},repairParentChkClass:function(e,t){if(t&&t.parentTId){var c=t.getParentNode();l.repairChkClass(e,c),l.repairParentChkClass(e,c)}},repairParentChkClassWithSelf:function(e,t){if(t){var c=C.nodeChildren(e,t);c&&0<c.length?l.repairParentChkClass(e,c[0]):l.repairParentChkClass(e,t)}},repairSonChkDisabled:function(e,t,c,h){if(t){t.chkDisabled!=c&&(t.chkDisabled=c),l.repairChkClass(e,t);var a=C.nodeChildren(e,t);if(a&&h)for(var n=0,i=a.length;n<i;n++){var r=a[n];l.repairSonChkDisabled(e,r,c,h)}}},repairParentChkDisabled:function(e,t,c,h){t&&(t.chkDisabled!=c&&h&&(t.chkDisabled=c),l.repairChkClass(e,t),l.repairParentChkDisabled(e,t.getParentNode(),c,h))},setChkClass:function(e,t,c){t&&(!0===c.nocheck?t.hide():t.show(),t.attr("class",l.makeChkClass(e,c)))},setParentNodeCheckBox:function(e,t,c,h){var a=f(t,s.id.CHECK,e);if(h=h||t,C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled&&(C.nodeChecked(e,t,c),l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t])),t.parentTId){var n=!0;if(!c)for(var i=C.nodeChildren(e,t.getParentNode()),r=0,o=i.length;r<o;r++){var d=i[r],k=C.nodeChecked(e,d);if(!0!==d.nocheck&&!0!==d.chkDisabled&&k||(!0===d.nocheck||!0===d.chkDisabled)&&0<d.check_Child_State){n=!1;break}}n&&l.setParentNodeCheckBox(e,t.getParentNode(),c,h)}},setSonNodeCheckBox:function(e,t,c,h){if(t){var a=f(t,s.id.CHECK,e);h=h||t;var n=!1,i=C.nodeChildren(e,t);if(i)for(var r=0,o=i.length;r<o;r++){var d=i[r];l.setSonNodeCheckBox(e,d,c,h),!0===d.chkDisabled&&(n=!0)}t!=C.getRoot(e)&&!0!==t.chkDisabled&&(n&&!0!==t.nocheck&&C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled?(C.nodeChecked(e,t,c),n||(t.check_Child_State=i&&0<i.length?c?2:0:-1)):t.check_Child_State=-1,l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&!0!==t.nocheck&&!0!==t.chkDisabled&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t]))}}},event:{},data:{getRadioCheckedList:function(e){for(var t=C.getRoot(e).radioCheckedList,c=0,h=t.length;c<h;c++)C.getNodeCache(e,t[c].tId)||(t.splice(c,1),c--,h--);return t},getCheckStatus:function(e,t){if(!e.check.enable||t.nocheck||t.chkDisabled)return null;var c=C.nodeChecked(e,t);return{checked:c,half:t.halfCheck?t.halfCheck:e.check.chkStyle==s.radio.STYLE?2===t.check_Child_State:c?-1<t.check_Child_State&&t.check_Child_State<2:0<t.check_Child_State}},getTreeCheckedNodes:function(e,t,c,h){if(!t)return[];var a=c&&e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL;h=h||[];for(var n=0,i=t.length;n<i;n++){var r=t[n],o=C.nodeChildren(e,r),d=C.nodeChecked(e,r);if(!0!==r.nocheck&&!0!==r.chkDisabled&&d==c&&(h.push(r),a))break;if(C.getTreeCheckedNodes(e,o,c,h),a&&0<h.length)break}return h},getTreeChangeCheckedNodes:function(e,t,c){if(!t)return[];c=c||[];for(var h=0,a=t.length;h<a;h++){var n=t[h],i=C.nodeChildren(e,n),r=C.nodeChecked(e,n);!0!==n.nocheck&&!0!==n.chkDisabled&&r!=n.checkedOld&&c.push(n),C.getTreeChangeCheckedNodes(e,i,c)}return c},makeChkFlag:function(e,t){if(t){var c=-1,h=C.nodeChildren(e,t);if(h)for(var a=0,n=h.length;a<n;a++){var i=h[a],r=C.nodeChecked(e,i),o=-1;if(e.check.chkStyle==s.radio.STYLE){if(2==(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck||r||0<i.check_Child_State?2:0)){c=2;break}0==o&&(c=0)}else if(e.check.chkStyle==s.checkbox.STYLE){if(1===(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck?1:r?-1===i.check_Child_State||2===i.check_Child_State?2:1:0<i.check_Child_State?1:0)){c=1;break}if(2===o&&-1<c&&0<a&&o!==c){c=1;break}if(2===c&&-1<o&&o<2){c=1;break}-1<o&&(c=o)}}t.check_Child_State=c}}}};e.extend(!0,e.fn.zTree.consts,t),e.extend(!0,e.fn.zTree._z,h);var a=e.fn.zTree,o=a._z.tools,s=a.consts,l=a._z.view,C=a._z.data,f=(a._z.event,o.$);C.nodeChecked=function(e,t,c){if(!t)return!1;var h=e.data.key.checked;return void 0!==c?("string"==typeof c&&(c=o.eqs(c,"true")),c=!!c,t[h]=c):"string"==typeof t[h]?t[h]=o.eqs(t[h],"true"):t[h]=!!t[h],t[h]},C.exSetting(c),C.addInitBind(function(a){var e=a.treeObj,t=s.event;e.bind(t.CHECK,function(e,t,c,h){e.srcEvent=t,o.apply(a.callback.onCheck,[e,c,h])})}),C.addInitUnBind(function(e){var t=e.treeObj,c=s.event;t.unbind(c.CHECK)}),C.addInitCache(function(e){}),C.addInitNode(function(e,t,c,h,a,n,i){if(c){var r=C.nodeChecked(e,c);if(c.checkedOld=r,"string"==typeof c.nocheck&&(c.nocheck=o.eqs(c.nocheck,"true")),c.nocheck=!!c.nocheck||e.check.nocheckInherit&&h&&!!h.nocheck,"string"==typeof c.chkDisabled&&(c.chkDisabled=o.eqs(c.chkDisabled,"true")),c.chkDisabled=!!c.chkDisabled||e.check.chkDisabledInherit&&h&&!!h.chkDisabled,"string"==typeof c.halfCheck&&(c.halfCheck=o.eqs(c.halfCheck,"true")),c.halfCheck=!!c.halfCheck,c.check_Child_State=-1,c.check_Focus=!1,c.getCheckStatus=function(){return C.getCheckStatus(e,c)},e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL&&r)C.getRoot(e).radioCheckedList.push(c)}}),C.addInitProxy(function(e){var t=e.target,c=C.getSetting(e.data.treeId),h="",a=null,n="",i=null;if(o.eqs(e.type,"mouseover")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoverCheck"):o.eqs(e.type,"mouseout")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoutCheck"):o.eqs(e.type,"click")&&c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="checkNode"),0<h.length)switch(a=C.getNodeCache(c,h),n){case"checkNode":i=r.onCheckNode;break;case"mouseoverCheck":i=r.onMouseoverCheck;break;case"mouseoutCheck":i=r.onMouseoutCheck}return{stop:"checkNode"===n,node:a,nodeEventType:n,nodeEventCallback:i,treeEventType:"",treeEventCallback:null}},!0),C.addInitRoot(function(e){C.getRoot(e).radioCheckedList=[]}),C.addBeforeA(function(e,t,c){e.check.enable&&(C.makeChkFlag(e,t),c.push("<span ID='",t.tId,s.id.CHECK,"' class='",l.makeChkClass(e,t),"' treeNode",s.id.CHECK,!0===t.nocheck?" style='display:none;'":"","></span>"))}),C.addZTreeTools(function(i,h){h.checkNode=function(e,t,c,h){var a=C.nodeChecked(i,e);if(!0!==e.chkDisabled&&(!0!==t&&!1!==t&&(t=!a),h=!!h,(a!==t||c)&&(!h||0!=o.apply(this.setting.callback.beforeCheck,[this.setting.treeId,e],!0))&&o.uCanDo(this.setting)&&this.setting.check.enable&&!0!==e.nocheck)){C.nodeChecked(i,e,t);var n=f(e,s.id.CHECK,this.setting);!c&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,n,e),l.repairParentChkClassWithSelf(this.setting,e),h&&this.setting.treeObj.trigger(s.event.CHECK,[null,this.setting.treeId,e])}},h.checkAllNodes=function(e){l.repairAllChk(this.setting,!!e)},h.getCheckedNodes=function(e){e=!1!==e;var t=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeCheckedNodes(this.setting,t,e)},h.getChangeCheckedNodes=function(){var e=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeChangeCheckedNodes(this.setting,e)},h.setChkDisabled=function(e,t,c,h){t=!!t,c=!!c,h=!!h,l.repairSonChkDisabled(this.setting,e,t,h),l.repairParentChkDisabled(this.setting,e.getParentNode(),t,c)};var a=h.updateNode;h.updateNode=function(e,t){if((a&&a.apply(h,arguments),e&&this.setting.check.enable)&&(f(e,this.setting).get(0)&&o.uCanDo(this.setting))){var c=f(e,s.id.CHECK,this.setting);1!=t&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,c,e),l.repairParentChkClassWithSelf(this.setting,e)}}});var n=l.createNodes;l.createNodes=function(e,t,c,h,a){n&&n.apply(l,arguments),c&&l.repairParentChkClassWithSelf(e,h)};var i=l.removeNode;l.removeNode=function(e,t){var c=t.getParentNode();i&&i.apply(l,arguments),t&&c&&(l.repairChkClass(e,c),l.repairParentChkClass(e,c))};var d=l.appendNodes;l.appendNodes=function(e,t,c,h,a,n,i){var r="";return d&&(r=d.apply(l,arguments)),h&&C.makeChkFlag(e,h),r}}(jQuery);
!function(fe){var Ee={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},s={onHoverOverNode:function(e,t){var o=Re.getSetting(e.data.treeId),d=Re.getRoot(o);d.curHoverNode!=t&&s.onHoverOutNode(e),d.curHoverNode=t,be.addHoverDom(o,t)},onHoverOutNode:function(e,t){var o=Re.getSetting(e.data.treeId),d=Re.getRoot(o);d.curHoverNode&&!Re.isSelectedNode(o,d.curHoverNode)&&(be.removeTreeDom(o,d.curHoverNode),d.curHoverNode=null)},onMousedownNode:function(e,t){var o,d,Z=Re.getSetting(e.data.treeId),$=Re.getRoot(Z),J=Re.getRoots();if(2==e.button||!Z.edit.enable||!Z.edit.drag.isCopy&&!Z.edit.drag.isMove)return!0;var r=e.target,n=Re.getRoot(Z).curSelectedList,ee=[];if(Re.isSelectedNode(Z,t))for(o=0,d=n.length;o<d;o++){if(n[o].editNameFlag&&Ie.eqs(r.tagName,"input")&&null!==r.getAttribute("treeNode"+he.id.INPUT))return!0;if(ee.push(n[o]),ee[0].parentTId!==n[o].parentTId){ee=[t];break}}else ee=[t];be.editNodeBlur=!0,be.cancelCurEditNode(Z);var te,oe,de,re,ne,ae=fe(Z.treeObj.get(0).ownerDocument),ie=fe(Z.treeObj.get(0).ownerDocument.body),le=!1,se=Z,l=Z,ce=null,Ne=null,ue=null,ge=he.move.TYPE_INNER,ve=e.clientX,me=e.clientY,pe=(new Date).getTime();function s(e){if(0==$.dragFlag&&Math.abs(ve-e.clientX)<Z.edit.drag.minMoveSize&&Math.abs(me-e.clientY)<Z.edit.drag.minMoveSize)return!0;var t,o,d,r,n;if(ie.css("cursor","pointer"),0==$.dragFlag){if(0==Ie.apply(Z.callback.beforeDrag,[Z.treeId,ee],!0))return Te(e),!0;for(t=0,o=ee.length;t<o;t++)0==t&&($.dragNodeShowBefore=[]),d=ee[t],Re.nodeIsParent(Z,d)&&d.open?(be.expandCollapseNode(Z,d,!d.open),$.dragNodeShowBefore[d.tId]=!0):$.dragNodeShowBefore[d.tId]=!1;$.dragFlag=1,J.showHoverDom=!1,Ie.showIfameMask(Z,!0);var a=!0,i=-1;if(1<ee.length){var l=ee[0].parentTId?Re.nodeChildren(Z,ee[0].getParentNode()):Re.getNodes(Z);for(n=[],t=0,o=l.length;t<o;t++)if(void 0!==$.dragNodeShowBefore[l[t].tId]&&(a&&-1<i&&i+1!==t&&(a=!1),n.push(l[t]),i=t),ee.length===n.length){ee=n;break}}for(a&&(re=ee[0].getPreNode(),ne=ee[ee.length-1].getNextNode()),te=Pe("<ul class='zTreeDragUL'></ul>",Z),t=0,o=ee.length;t<o;t++)(d=ee[t]).editNameFlag=!1,be.selectNode(Z,d,0<t),be.removeTreeDom(Z,d),t>Z.edit.drag.maxShowNodeNum-1||((r=Pe("<li id='"+d.tId+"_tmp'></li>",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("<li id='"+d.tId+"_moretmp'><a> ... </a></li>",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("<span class='tmpzTreeMove_arrow'></span>",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=0<s.length?s.get(0):e.target}else 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));ue=de=null,le=!1,se=Z;var c=Re.getSettings();for(var N in c)c[N].treeId&&c[N].edit.enable&&c[N].treeId!=Z.treeId&&(e.target.id==c[N].treeId||0<fe(e.target).parents("#"+c[N].treeId).length)&&(le=!0,se=c[N]);var u=ae.scrollTop(),g=ae.scrollLeft(),v=se.treeObj.offset(),m=se.treeObj.get(0).scrollHeight,p=se.treeObj.get(0).scrollWidth,T=e.clientY+u-v.top,f=se.treeObj.height()+v.top-e.clientY-u,E=e.clientX+g-v.left,I=se.treeObj.width()+v.left-e.clientX-g,h=T<Z.edit.drag.borderMax&&T>Z.edit.drag.borderMin,b=f<Z.edit.drag.borderMax&&f>Z.edit.drag.borderMin,R=E<Z.edit.drag.borderMax&&E>Z.edit.drag.borderMin,P=I<Z.edit.drag.borderMax&&I>Z.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;t<o;t++){if(d=ee[t],D.id===d.tId){y=!1;break}if(0<Pe(d,Z).find("#"+D.id).length){y=!1;break}}y&&e.target&&Ie.isChildOrSelf(e.target,D.id+he.id.A)&&(de=fe(D),ue=D.id)}d=ee[0],C&&Ie.isChildOrSelf(e.target,se.treeId)&&(!de&&(e.target.id==se.treeId||w||M||_||O)&&(le||!le&&d.parentTId)&&(de=se.treeObj),h?se.treeObj.scrollTop(se.treeObj.scrollTop()-10):b&&se.treeObj.scrollTop(se.treeObj.scrollTop()+10),R?se.treeObj.scrollLeft(se.treeObj.scrollLeft()-10):P&&se.treeObj.scrollLeft(se.treeObj.scrollLeft()+10),de&&de!=se.treeObj&&de.offset().left<se.treeObj.offset().left&&se.treeObj.scrollLeft(se.treeObj.scrollLeft()+de.offset().left-se.treeObj.offset().left)),te.css({top:e.clientY+u+3+"px",left:e.clientX+g+3+"px"});var k=0,S=0;if(de&&de.attr("id")!=se.treeId){var A=null==ue?null:Re.getNodeCache(se,ue),L=(e.ctrlKey||e.metaKey)&&Z.edit.drag.isMove&&Z.edit.drag.isCopy||!Z.edit.drag.isMove&&Z.edit.drag.isCopy,Y=!(!re||ue!==re.tId),x=!(!ne||ue!==ne.tId),j=d.parentTId&&d.parentTId==ue,z=(L||!x)&&Ie.apply(se.edit.drag.prev,[se.treeId,ee,A],!!se.edit.drag.prev),B=(L||!Y)&&Ie.apply(se.edit.drag.next,[se.treeId,ee,A],!!se.edit.drag.next),H=(L||!j)&&!(se.data.keep.leaf&&!Re.nodeIsParent(Z,A))&&Ie.apply(se.edit.drag.inner,[se.treeId,ee,A],!!se.edit.drag.inner);function F(){de=null,ue="",ge=he.move.TYPE_INNER,oe.css({display:"none"}),window.zTreeMoveTimer&&(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null)}if(z||B||H){var V=fe("#"+ue+he.id.A,de),U=A.isLastNode?null:fe("#"+A.getNextNode().tId+he.id.A,de.next()),G=V.offset().top,X=V.offset().left,q=z?H?.25:B?.5:1:-1,W=B?H?.75:z?.5:0:-1,K=(e.clientY+u-G)/V.height();if((1==q||K<=q&&-.2<=K)&&z?(k=1-oe.width(),S=G-oe.height()/2,ge=he.move.TYPE_PREV):(0==W||W<=K&&K<=1.2)&&B?(k=1-oe.width(),S=null==U||Re.nodeIsParent(Z,A)&&A.open?G+V.height()-oe.height()/2:U.offset().top-oe.height()/2,ge=he.move.TYPE_NEXT):H?(k=5-oe.width(),S=G,ge=he.move.TYPE_INNER):F(),de&&(oe.css({display:"block",top:S+"px",left:X+k+"px"}),V.addClass(he.node.TMPTARGET_NODE+"_"+ge),ce==ue&&Ne==ge||(pe=(new Date).getTime()),A&&Re.nodeIsParent(Z,A)&&ge==he.move.TYPE_INNER)){var Q=!0;window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==A.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===A.tId&&(Q=!1),Q&&(window.zTreeMoveTimer=setTimeout(function(){ge==he.move.TYPE_INNER&&A&&Re.nodeIsParent(Z,A)&&!A.open&&(new Date).getTime()-pe>se.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<t;e++)o=ee[e],Re.nodeIsParent(Z,o)&&$.dragNodeShowBefore[o.tId]&&!o.open&&(be.expandCollapseNode(Z,o,!o.open),delete $.dragNodeShowBefore[o.tId]);te&&te.remove(),oe&&oe.remove();var r=(d.ctrlKey||d.metaKey)&&Z.edit.drag.isMove&&Z.edit.drag.isCopy||!Z.edit.drag.isMove&&Z.edit.drag.isCopy;if(!r&&de&&ue&&ee[0].parentTId&&ue==ee[0].parentTId&&ge==he.move.TYPE_INNER&&(de=null),de){var n=null==ue?null:Re.getNodeCache(se,ue);if(0==Ie.apply(Z.callback.beforeDrop,[se.treeId,ee,n,ge,r],!0))return void be.selectNodes(l,ee);var a=r?Ie.clone(ee):ee;function i(){if(le){if(!r)for(var e=0,t=ee.length;e<t;e++)be.removeNode(Z,ee[e]);ge==he.move.TYPE_INNER?be.addNodes(se,n,-1,a):be.addNodes(se,n.getParentNode(),ge==he.move.TYPE_PREV?n.getIndex():n.getIndex()+1,a)}else if(r&&ge==he.move.TYPE_INNER)be.addNodes(se,n,-1,a);else if(r)be.addNodes(se,n.getParentNode(),ge==he.move.TYPE_PREV?n.getIndex():n.getIndex()+1,a);else if(ge!=he.move.TYPE_NEXT)for(e=0,t=a.length;e<t;e++)be.moveNode(se,n,a[e],ge,!1);else for(e=-1,t=a.length-1;e<t;t--)be.moveNode(se,n,a[t],ge,!1);be.selectNodes(se,a);var o=Pe(a[0],Z).get(0);be.scrollIntoView(Z,o),Z.treeObj.trigger(he.event.DROP,[d,se.treeId,a,n,ge,r])}ge==he.move.TYPE_INNER&&Ie.canAsync(se,n)?be.asyncNode(se,n,!1,i):i()}else be.selectNodes(l,ee),Z.treeObj.trigger(he.event.DROP,[d,Z.treeId,ee,null,null,null])}}function c(){return!1}return Ie.uCanDo(Z)&&ae.bind("mousemove",s),ae.bind("mouseup",Te),ae.bind("selectstart",c),!0}},e={tools:{getAbs:function(e){var t=e.getBoundingClientRect(),o=document.body.scrollTop+document.documentElement.scrollTop,d=document.body.scrollLeft+document.documentElement.scrollLeft;return[t.left+d,t.top+o]},inputFocus:function(e){e.get(0)&&(e.focus(),Ie.setCursorPosition(e.get(0),e.val().length))},inputSelect:function(e){e.get(0)&&(e.focus(),e.select())},setCursorPosition:function(e,t){if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,t);else if(e.createTextRange){var o=e.createTextRange();o.collapse(!0),o.moveEnd("character",t),o.moveStart("character",t),o.select()}},showIfameMask:function(e,t){for(var o=Re.getRoot(e);0<o.dragMaskList.length;)o.dragMaskList[0].remove(),o.dragMaskList.shift();if(t)for(var d=Pe("iframe",e),r=0,n=d.length;r<n;r++){var a=d.get(r),i=Ie.getAbs(a),l=Pe("<div id='zTreeMask_"+r+"' class='zTreeMask' style='top:"+i[1]+"px; left:"+i[0]+"px; width:"+a.offsetWidth+"px; height:"+a.offsetHeight+"px;'></div>",e);l.appendTo(Pe("body",e)),o.dragMaskList.push(l)}}},view:{addEditBtn:function(e,t){if(!(t.editNameFlag||0<Pe(t,he.id.EDIT,e).length)&&Ie.apply(e.edit.showRenameBtn,[e.treeId,t],e.edit.showRenameBtn)){var o=Pe(t,he.id.A,e),d="<span class='"+he.className.BUTTON+" edit' id='"+t.tId+he.id.EDIT+"' title='"+Ie.apply(e.edit.renameTitle,[e.treeId,t],e.edit.renameTitle)+"' treeNode"+he.id.EDIT+" style='display:none;'></span>";o.append(d),Pe(t,he.id.EDIT,e).bind("click",function(){return Ie.uCanDo(e)&&0!=Ie.apply(e.callback.beforeEditName,[e.treeId,t],!0)&&be.editNode(e,t),!1}).show()}},addRemoveBtn:function(e,t){if(!(t.editNameFlag||0<Pe(t,he.id.REMOVE,e).length)&&Ie.apply(e.edit.showRemoveBtn,[e.treeId,t],e.edit.showRemoveBtn)){var o=Pe(t,he.id.A,e),d="<span class='"+he.className.BUTTON+" remove' id='"+t.tId+he.id.REMOVE+"' title='"+Ie.apply(e.edit.removeTitle,[e.treeId,t],e.edit.removeTitle)+"' treeNode"+he.id.REMOVE+" style='display:none;'></span>";o.append(d),Pe(t,he.id.REMOVE,e).bind("click",function(){return Ie.uCanDo(e)&&0!=Ie.apply(e.callback.beforeRemove,[e.treeId,t],!0)&&(be.removeNode(e,t),e.treeObj.trigger(he.event.REMOVE,[e.treeId,t])),!1}).bind("mousedown",function(e){return!0}).show()}},addHoverDom:function(e,t){Re.getRoots().showHoverDom&&(t.isHover=!0,e.edit.enable&&(be.addEditBtn(e,t),be.addRemoveBtn(e,t)),Ie.apply(e.view.addHoverDom,[e.treeId,t]))},cancelCurEditNode:function(e,t,o){var d=Re.getRoot(e),r=d.curEditNode;if(r){var n=d.curEditInput,a=t||(o?Re.nodeName(e,r):n.val());if(!1===Ie.apply(e.callback.beforeRename,[e.treeId,r,a,o],!0))return!1;Re.nodeName(e,r,a),Pe(r,he.id.A,e).removeClass(he.node.CURSELECTED_EDIT),n.unbind(),be.setNodeName(e,r),r.editNameFlag=!1,d.curEditNode=null,d.curEditInput=null,be.selectNode(e,r,!1),e.treeObj.trigger(he.event.RENAME,[e.treeId,r,o])}return d.noSelection=!0},editNode:function(t,e){var o=Re.getRoot(t);if(be.editNodeBlur=!1,Re.isSelectedNode(t,e)&&o.curEditNode==e&&e.editNameFlag)setTimeout(function(){Ie.inputFocus(o.curEditInput)},0);else{e.editNameFlag=!0,be.removeTreeDom(t,e),be.cancelCurEditNode(t),be.selectNode(t,e,!1),Pe(e,he.id.SPAN,t).html("<input type=text class='rename' id='"+e.tId+he.id.INPUT+"' treeNode"+he.id.INPUT+" >");var d=Pe(e,he.id.INPUT,t);d.attr("value",Re.nodeName(t,e)),t.edit.editNameSelectAll?Ie.inputSelect(d):Ie.inputFocus(d),d.bind("blur",function(e){be.editNodeBlur||be.cancelCurEditNode(t)}).bind("keydown",function(e){"13"==e.keyCode?(be.editNodeBlur=!0,be.cancelCurEditNode(t)):"27"==e.keyCode&&be.cancelCurEditNode(t,null,!0)}).bind("click",function(e){return!1}).bind("dblclick",function(e){return!1}),Pe(e,he.id.A,t).addClass(he.node.CURSELECTED_EDIT),o.curEditInput=d,o.noSelection=!1,o.curEditNode=e}},moveNode:function(e,t,o,d,r,n){var a=Re.getRoot(e);if(t!=o&&(!e.data.keep.leaf||!t||Re.nodeIsParent(e,t)||d!=he.move.TYPE_INNER)){var i=o.parentTId?o.getParentNode():a,l=null===t||t==a;l&&null===t&&(t=a),l&&(d=he.move.TYPE_INNER);var s,c,N=t.parentTId?t.getParentNode():a;if(d!=he.move.TYPE_PREV&&d!=he.move.TYPE_NEXT&&(d=he.move.TYPE_INNER),d==he.move.TYPE_INNER&&(l?o.parentTId=null:(Re.nodeIsParent(e,t)||(Re.nodeIsParent(e,t,!0),t.open=!!t.open,be.setNodeLineIcos(e,t)),o.parentTId=t.tId)),l)c=s=e.treeObj;else{if(n||d!=he.move.TYPE_INNER?n||be.expandCollapseNode(e,t.getParentNode(),!0,!1):be.expandCollapseNode(e,t,!0,!1),s=Pe(t,e),c=Pe(t,he.id.UL,e),s.get(0)&&!c.get(0)){var u=[];be.makeUlHtml(e,t,u,""),s.append(u.join(""))}c=Pe(t,he.id.UL,e)}var g=Pe(o,e);g.get(0)?s.get(0)||g.remove():g=be.appendNodes(e,o.level,[o],null,-1,!1,!0).join(""),c.get(0)&&d==he.move.TYPE_INNER?c.append(g):s.get(0)&&d==he.move.TYPE_PREV?s.before(g):s.get(0)&&d==he.move.TYPE_NEXT&&s.after(g);var v,m,p=-1,T=0,f=null,E=null,I=o.level,h=Re.nodeChildren(e,i),b=Re.nodeChildren(e,N),R=Re.nodeChildren(e,t);if(o.isFirstNode)p=0,1<h.length&&((f=h[1]).isFirstNode=!0);else if(o.isLastNode)(f=h[(p=h.length-1)-1]).isLastNode=!0;else for(v=0,m=h.length;v<m;v++)if(h[v].tId==o.tId){p=v;break}if(0<=p&&h.splice(p,1),d!=he.move.TYPE_INNER)for(v=0,m=b.length;v<m;v++)b[v].tId==t.tId&&(T=v);if(d==he.move.TYPE_INNER?(0<(R=R||Re.nodeChildren(e,t,[])).length&&((E=R[R.length-1]).isLastNode=!1),R.splice(R.length,0,o),o.isLastNode=!0,o.isFirstNode=1==R.length):t.isFirstNode&&d==he.move.TYPE_PREV?(b.splice(T,0,o),(E=t).isFirstNode=!1,o.parentTId=t.parentTId,o.isFirstNode=!0,o.isLastNode=!1):t.isLastNode&&d==he.move.TYPE_NEXT?(b.splice(T+1,0,o),(E=t).isLastNode=!1,o.parentTId=t.parentTId,o.isFirstNode=!1,o.isLastNode=!0):(d==he.move.TYPE_PREV?b.splice(T,0,o):b.splice(T+1,0,o),o.parentTId=t.parentTId,o.isFirstNode=!1,o.isLastNode=!1),Re.fixPIdKeyValue(e,o),Re.setSonNodeLevel(e,o.getParentNode(),o),be.setNodeLineIcos(e,o),be.repairNodeLevelClass(e,o,I),!e.data.keep.parent&&h.length<1){Re.nodeIsParent(e,i,!1),i.open=!1;var P=Pe(i,he.id.UL,e),C=Pe(i,he.id.SWITCH,e),w=Pe(i,he.id.ICON,e);be.replaceSwitchClass(i,C,he.folder.DOCU),be.replaceIcoClass(i,w,he.folder.DOCU),P.css("display","none")}else f&&be.setNodeLineIcos(e,f);E&&be.setNodeLineIcos(e,E),e.check&&e.check.enable&&be.repairChkClass&&(be.repairChkClass(e,i),be.repairParentChkClassWithSelf(e,i),i!=o.parent&&be.repairParentChkClassWithSelf(e,o)),n||be.expandCollapseParentNode(e,o.getParentNode(),!0,r)}},removeEditBtn:function(e,t){Pe(t,he.id.EDIT,e).unbind().remove()},removeRemoveBtn:function(e,t){Pe(t,he.id.REMOVE,e).unbind().remove()},removeTreeDom:function(e,t){t.isHover=!1,be.removeEditBtn(e,t),be.removeRemoveBtn(e,t),Ie.apply(e.view.removeHoverDom,[e.treeId,t])},repairNodeLevelClass:function(e,t,o){if(o!==t.level){var d=Pe(t,e),r=Pe(t,he.id.A,e),n=Pe(t,he.id.UL,e),a=he.className.LEVEL+o,i=he.className.LEVEL+t.level;d.removeClass(a),d.addClass(i),r.removeClass(a),r.addClass(i),n.removeClass(a),n.addClass(i)}},selectNodes:function(e,t){for(var o=0,d=t.length;o<d;o++)be.selectNode(e,t[o],0<o)}},event:{},data:{setSonNodeLevel:function(e,t,o){if(o){var d=Re.nodeChildren(e,o);if(o.level=t?t.level+1:0,d)for(var r=0,n=d.length;r<n;r++)d[r]&&Re.setSonNodeLevel(e,o,d[r])}}}};fe.extend(!0,fe.fn.zTree.consts,Ee),fe.extend(!0,fe.fn.zTree._z,e);var t=fe.fn.zTree,Ie=t._z.tools,he=t.consts,be=t._z.view,Re=t._z.data,Pe=(t._z.event,Ie.$);Re.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5,maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}}),Re.addInitBind(function(i){var e=i.treeObj,t=he.event;e.bind(t.RENAME,function(e,t,o,d){Ie.apply(i.callback.onRename,[e,t,o,d])}),e.bind(t.DRAG,function(e,t,o,d){Ie.apply(i.callback.onDrag,[t,o,d])}),e.bind(t.DRAGMOVE,function(e,t,o,d){Ie.apply(i.callback.onDragMove,[t,o,d])}),e.bind(t.DROP,function(e,t,o,d,r,n,a){Ie.apply(i.callback.onDrop,[t,o,d,r,n,a])})}),Re.addInitUnBind(function(e){var t=e.treeObj,o=he.event;t.unbind(o.RENAME),t.unbind(o.DRAG),t.unbind(o.DRAGMOVE),t.unbind(o.DROP)}),Re.addInitCache(function(e){}),Re.addInitNode(function(e,t,o,d,r,n,a){o&&(o.isHover=!1,o.editNameFlag=!1)}),Re.addInitProxy(function(e){var t=e.target,o=Re.getSetting(e.data.treeId),d=e.relatedTarget,r="",n=null,a="",i=null,l=null;if(Ie.eqs(e.type,"mouseover")?(l=Ie.getMDom(o,t,[{tagName:"a",attrName:"treeNode"+he.id.A}]))&&(r=Ie.getNodeMainDom(l).id,a="hoverOverNode"):Ie.eqs(e.type,"mouseout")?(l=Ie.getMDom(o,d,[{tagName:"a",attrName:"treeNode"+he.id.A}]))||(r="remove",a="hoverOutNode"):Ie.eqs(e.type,"mousedown")&&(l=Ie.getMDom(o,t,[{tagName:"a",attrName:"treeNode"+he.id.A}]))&&(r=Ie.getNodeMainDom(l).id,a="mousedownNode"),0<r.length)switch(n=Re.getNodeCache(o,r),a){case"mousedownNode":i=s.onMousedownNode;break;case"hoverOverNode":i=s.onHoverOverNode;break;case"hoverOutNode":i=s.onHoverOutNode}return{stop:!1,node:n,nodeEventType:a,nodeEventCallback:i,treeEventType:"",treeEventCallback:null}}),Re.addInitRoot(function(e){var t=Re.getRoot(e),o=Re.getRoots();t.curEditNode=null,t.curEditInput=null,t.curHoverNode=null,t.dragFlag=0,t.dragNodeShowBefore=[],t.dragMaskList=new Array,o.showHoverDom=!0}),Re.addZTreeTools(function(l,e){e.cancelEditName=function(e){Re.getRoot(this.setting).curEditNode&&be.cancelCurEditNode(this.setting,e||null,!0)},e.copyNode=function(e,t,o,d){if(!t)return null;var r=Re.nodeIsParent(l,e);if(e&&!r&&this.setting.data.keep.leaf&&o===he.move.TYPE_INNER)return null;var n=this,a=Ie.clone(t);if(e||(e=null,o=he.move.TYPE_INNER),o==he.move.TYPE_INNER){function i(){be.addNodes(n.setting,e,-1,[a],d)}Ie.canAsync(this.setting,e)?be.asyncNode(this.setting,e,d,i):i()}else be.addNodes(this.setting,e.parentNode,-1,[a],d),be.moveNode(this.setting,e,a,o,!1,d);return a},e.editName=function(e){e&&e.tId&&e===Re.getNodeCache(this.setting,e.tId)&&(e.parentTId&&be.expandCollapseParentNode(this.setting,e.getParentNode(),!0),be.editNode(this.setting,e))},e.moveNode=function(e,t,o,d){if(!t)return t;var r=Re.nodeIsParent(l,e);if(e&&!r&&this.setting.data.keep.leaf&&o===he.move.TYPE_INNER)return null;if(e&&(t.parentTId==e.tId&&o==he.move.TYPE_INNER||0<Pe(t,this.setting).find("#"+e.tId).length))return null;e=e||null;var n=this;function a(){be.moveNode(n.setting,e,t,o,!1,d)}return Ie.canAsync(this.setting,e)&&o===he.move.TYPE_INNER?be.asyncNode(this.setting,e,d,a):a(),t},e.setEditable=function(e){return this.setting.edit.enable=e,this.refresh()}});var n=be.cancelPreSelectedNode;be.cancelPreSelectedNode=function(e,t){for(var o=Re.getRoot(e).curSelectedList,d=0,r=o.length;d<r&&(t&&t!==o[d]||(be.removeTreeDom(e,o[d]),!t));d++);n&&n.apply(be,arguments)};var a=be.createNodes;be.createNodes=function(e,t,o,d,r){a&&a.apply(be,arguments),o&&be.repairParentChkClassWithSelf&&be.repairParentChkClassWithSelf(e,d)};var o=be.makeNodeUrl;be.makeNodeUrl=function(e,t){return e.edit.enable?null:o.apply(be,arguments)};var d=be.removeNode;be.removeNode=function(e,t){var o=Re.getRoot(e);o.curEditNode===t&&(o.curEditNode=null),d&&d.apply(be,arguments)};var r=be.selectNode;be.selectNode=function(e,t,o){var d=Re.getRoot(e);return(!Re.isSelectedNode(e,t)||d.curEditNode!=t||!t.editNameFlag)&&(r&&r.apply(be,arguments),be.addHoverDom(e,t),!0)};var i=Ie.uCanDo;Ie.uCanDo=function(e,t){var o=Re.getRoot(e);return!(!t||!(Ie.eqs(t.type,"mouseover")||Ie.eqs(t.type,"mouseout")||Ie.eqs(t.type,"mousedown")||Ie.eqs(t.type,"mouseup")))||(o.curEditNode&&(be.editNodeBlur=!1,o.curEditInput.focus()),!o.curEditNode&&(!i||i.apply(be,arguments)))}}(jQuery);
\ No newline at end of file
/*
* JQuery zTree core
* v3.5.46
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
(function ($) {
var settings = {}, roots = {}, caches = {},
//default consts of core
_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"
}
},
//default setting of core
_setting = {
treeId: "",
treeObj: null,
view: {
addDiyDom: null,
autoCancelSelected: true,
dblClickExpand: true,
expandSpeed: "fast",
fontCss: {},
nodeClasses: {},
nameIsHTML: false,
selectedMulti: true,
showIcon: true,
showLine: true,
showTitle: true,
txtSelectedEnable: false
},
data: {
key: {
isParent: "isParent",
children: "children",
name: "name",
title: "",
url: "url",
icon: "icon"
},
render: {
name: null,
title: null,
},
simpleData: {
enable: false,
idKey: "id",
pIdKey: "pId",
rootPId: null
},
keep: {
parent: false,
leaf: false
}
},
async: {
enable: false,
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
}
},
//default root of core
//zTree use root to save full data
_initRoot = function (setting) {
var r = data.getRoot(setting);
if (!r) {
r = {};
data.setRoot(setting, r);
}
data.nodeChildren(setting, r, []);
r.expandTriggerFlag = false;
r.curSelectedList = [];
r.noSelection = true;
r.createdNodes = [];
r.zId = 0;
r._ver = (new Date()).getTime();
},
//default cache of core
_initCache = function (setting) {
var c = data.getCache(setting);
if (!c) {
c = {};
data.setCache(setting, c);
}
c.nodes = [];
c.doms = [];
},
//default bindEvent of core
_bindEvent = function (setting) {
var o = setting.treeObj,
c = consts.event;
o.bind(c.NODECREATED, function (event, treeId, node) {
tools.apply(setting.callback.onNodeCreated, [event, treeId, node]);
});
o.bind(c.CLICK, function (event, srcEvent, treeId, node, clickFlag) {
tools.apply(setting.callback.onClick, [srcEvent, treeId, node, clickFlag]);
});
o.bind(c.EXPAND, function (event, treeId, node) {
tools.apply(setting.callback.onExpand, [event, treeId, node]);
});
o.bind(c.COLLAPSE, function (event, treeId, node) {
tools.apply(setting.callback.onCollapse, [event, treeId, node]);
});
o.bind(c.ASYNC_SUCCESS, function (event, treeId, node, msg) {
tools.apply(setting.callback.onAsyncSuccess, [event, treeId, node, msg]);
});
o.bind(c.ASYNC_ERROR, function (event, treeId, node, XMLHttpRequest, textStatus, errorThrown) {
tools.apply(setting.callback.onAsyncError, [event, treeId, node, XMLHttpRequest, textStatus, errorThrown]);
});
o.bind(c.REMOVE, function (event, treeId, treeNode) {
tools.apply(setting.callback.onRemove, [event, treeId, treeNode]);
});
o.bind(c.SELECTED, function (event, treeId, node) {
tools.apply(setting.callback.onSelected, [treeId, node]);
});
o.bind(c.UNSELECTED, function (event, treeId, node) {
tools.apply(setting.callback.onUnSelected, [treeId, node]);
});
},
_unbindEvent = function (setting) {
var o = setting.treeObj,
c = consts.event;
o.unbind(c.NODECREATED)
.unbind(c.CLICK)
.unbind(c.EXPAND)
.unbind(c.COLLAPSE)
.unbind(c.ASYNC_SUCCESS)
.unbind(c.ASYNC_ERROR)
.unbind(c.REMOVE)
.unbind(c.SELECTED)
.unbind(c.UNSELECTED);
},
//default event proxy of core
_eventProxy = function (event) {
var target = event.target,
setting = data.getSetting(event.data.treeId),
tId = "", node = null,
nodeEventType = "", treeEventType = "",
nodeEventCallback = null, treeEventCallback = null,
tmp = null;
if (tools.eqs(event.type, "mousedown")) {
treeEventType = "mousedown";
} else if (tools.eqs(event.type, "mouseup")) {
treeEventType = "mouseup";
} else if (tools.eqs(event.type, "contextmenu")) {
treeEventType = "contextmenu";
} else if (tools.eqs(event.type, "click")) {
if (tools.eqs(target.tagName, "span") && target.getAttribute("treeNode" + consts.id.SWITCH) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "switchNode";
} else {
tmp = tools.getMDom(setting, target, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "clickNode";
}
}
} else if (tools.eqs(event.type, "dblclick")) {
treeEventType = "dblclick";
tmp = tools.getMDom(setting, target, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "switchNode";
}
}
if (treeEventType.length > 0 && tId.length == 0) {
tmp = tools.getMDom(setting, target, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
}
}
// event to node
if (tId.length > 0) {
node = data.getNodeCache(setting, tId);
switch (nodeEventType) {
case "switchNode" :
var isParent = data.nodeIsParent(setting, node);
if (!isParent) {
nodeEventType = "";
} else if (tools.eqs(event.type, "click")
|| (tools.eqs(event.type, "dblclick") && tools.apply(setting.view.dblClickExpand, [setting.treeId, node], setting.view.dblClickExpand))) {
nodeEventCallback = handler.onSwitchNode;
} else {
nodeEventType = "";
}
break;
case "clickNode" :
nodeEventCallback = handler.onClickNode;
break;
}
}
// event to zTree
switch (treeEventType) {
case "mousedown" :
treeEventCallback = handler.onZTreeMousedown;
break;
case "mouseup" :
treeEventCallback = handler.onZTreeMouseup;
break;
case "dblclick" :
treeEventCallback = handler.onZTreeDblclick;
break;
case "contextmenu" :
treeEventCallback = handler.onZTreeContextmenu;
break;
}
var proxyResult = {
stop: false,
node: node,
nodeEventType: nodeEventType,
nodeEventCallback: nodeEventCallback,
treeEventType: treeEventType,
treeEventCallback: treeEventCallback
};
return proxyResult
},
//default init node of core
_initNode = function (setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return;
var r = data.getRoot(setting),
children = data.nodeChildren(setting, n);
n.level = level;
n.tId = setting.treeId + "_" + (++r.zId);
n.parentTId = parentNode ? parentNode.tId : null;
n.open = (typeof n.open == "string") ? tools.eqs(n.open, "true") : !!n.open;
var isParent = data.nodeIsParent(setting, n);
if (tools.isArray(children)) {
data.nodeIsParent(setting, n, true);
n.zAsync = true;
} else {
isParent = data.nodeIsParent(setting, n, isParent);
n.open = (isParent && !setting.async.enable) ? n.open : false;
n.zAsync = !isParent;
}
n.isFirstNode = isFirstNode;
n.isLastNode = isLastNode;
n.getParentNode = function () {
return data.getNodeCache(setting, n.parentTId);
};
n.getPreNode = function () {
return data.getPreNode(setting, n);
};
n.getNextNode = function () {
return data.getNextNode(setting, n);
};
n.getIndex = function () {
return data.getNodeIndex(setting, n);
};
n.getPath = function () {
return data.getNodePath(setting, n);
};
n.isAjaxing = false;
data.fixPIdKeyValue(setting, n);
},
_init = {
bind: [_bindEvent],
unbind: [_unbindEvent],
caches: [_initCache],
nodes: [_initNode],
proxys: [_eventProxy],
roots: [_initRoot],
beforeA: [],
afterA: [],
innerBeforeA: [],
innerAfterA: [],
zTreeTools: []
},
//method of operate data
data = {
addNodeCache: function (setting, node) {
data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = node;
},
getNodeCacheId: function (tId) {
return tId.substring(tId.lastIndexOf("_") + 1);
},
addAfterA: function (afterA) {
_init.afterA.push(afterA);
},
addBeforeA: function (beforeA) {
_init.beforeA.push(beforeA);
},
addInnerAfterA: function (innerAfterA) {
_init.innerAfterA.push(innerAfterA);
},
addInnerBeforeA: function (innerBeforeA) {
_init.innerBeforeA.push(innerBeforeA);
},
addInitBind: function (bindEvent) {
_init.bind.push(bindEvent);
},
addInitUnBind: function (unbindEvent) {
_init.unbind.push(unbindEvent);
},
addInitCache: function (initCache) {
_init.caches.push(initCache);
},
addInitNode: function (initNode) {
_init.nodes.push(initNode);
},
addInitProxy: function (initProxy, isFirst) {
if (!!isFirst) {
_init.proxys.splice(0, 0, initProxy);
} else {
_init.proxys.push(initProxy);
}
},
addInitRoot: function (initRoot) {
_init.roots.push(initRoot);
},
addNodesData: function (setting, parentNode, index, nodes) {
var children = data.nodeChildren(setting, parentNode), params;
if (!children) {
children = data.nodeChildren(setting, parentNode, []);
index = -1;
} else if (index >= children.length) {
index = -1;
}
if (children.length > 0 && index === 0) {
children[0].isFirstNode = false;
view.setNodeLineIcos(setting, children[0]);
} else if (children.length > 0 && index < 0) {
children[children.length - 1].isLastNode = false;
view.setNodeLineIcos(setting, children[children.length - 1]);
}
data.nodeIsParent(setting, parentNode, true);
if (index < 0) {
data.nodeChildren(setting, parentNode, children.concat(nodes));
} else {
params = [index, 0].concat(nodes);
children.splice.apply(children, params);
}
},
addSelectedNode: function (setting, node) {
var root = data.getRoot(setting);
if (!data.isSelectedNode(setting, node)) {
root.curSelectedList.push(node);
}
},
addCreatedNode: function (setting, node) {
if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) {
var root = data.getRoot(setting);
root.createdNodes.push(node);
}
},
addZTreeTools: function (zTreeTools) {
_init.zTreeTools.push(zTreeTools);
},
exSetting: function (s) {
$.extend(true, _setting, s);
},
fixPIdKeyValue: function (setting, node) {
if (setting.data.simpleData.enable) {
node[setting.data.simpleData.pIdKey] = node.parentTId ? node.getParentNode()[setting.data.simpleData.idKey] : setting.data.simpleData.rootPId;
}
},
getAfterA: function (setting, node, array) {
for (var i = 0, j = _init.afterA.length; i < j; i++) {
_init.afterA[i].apply(this, arguments);
}
},
getBeforeA: function (setting, node, array) {
for (var i = 0, j = _init.beforeA.length; i < j; i++) {
_init.beforeA[i].apply(this, arguments);
}
},
getInnerAfterA: function (setting, node, array) {
for (var i = 0, j = _init.innerAfterA.length; i < j; i++) {
_init.innerAfterA[i].apply(this, arguments);
}
},
getInnerBeforeA: function (setting, node, array) {
for (var i = 0, j = _init.innerBeforeA.length; i < j; i++) {
_init.innerBeforeA[i].apply(this, arguments);
}
},
getCache: function (setting) {
return caches[setting.treeId];
},
getNodeIndex: function (setting, node) {
if (!node) return null;
var p = node.parentTId ? node.getParentNode() : data.getRoot(setting),
children = data.nodeChildren(setting, p);
for (var i = 0, l = children.length - 1; i <= l; i++) {
if (children[i] === node) {
return i;
}
}
return -1;
},
getNextNode: function (setting, node) {
if (!node) return null;
var p = node.parentTId ? node.getParentNode() : data.getRoot(setting),
children = data.nodeChildren(setting, p);
for (var i = 0, l = children.length - 1; i <= l; i++) {
if (children[i] === node) {
return (i == l ? null : children[i + 1]);
}
}
return null;
},
getNodeByParam: function (setting, nodes, key, value) {
if (!nodes || !key) return null;
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node[key] == value) {
return nodes[i];
}
var children = data.nodeChildren(setting, node);
var tmp = data.getNodeByParam(setting, children, key, value);
if (tmp) return tmp;
}
return null;
},
getNodeCache: function (setting, tId) {
if (!tId) return null;
var n = caches[setting.treeId].nodes[data.getNodeCacheId(tId)];
return n ? n : null;
},
getNodePath: function (setting, node) {
if (!node) return null;
var path;
if (node.parentTId) {
path = node.getParentNode().getPath();
} else {
path = [];
}
if (path) {
path.push(node);
}
return path;
},
getNodes: function (setting) {
return data.nodeChildren(setting, data.getRoot(setting));
},
getNodesByParam: function (setting, nodes, key, value) {
if (!nodes || !key) return [];
var result = [];
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node[key] == value) {
result.push(node);
}
var children = data.nodeChildren(setting, node);
result = result.concat(data.getNodesByParam(setting, children, key, value));
}
return result;
},
getNodesByParamFuzzy: function (setting, nodes, key, value) {
if (!nodes || !key) return [];
var result = [];
value = value.toLowerCase();
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (typeof node[key] == "string" && nodes[i][key].toLowerCase().indexOf(value) > -1) {
result.push(node);
}
var children = data.nodeChildren(setting, node);
result = result.concat(data.getNodesByParamFuzzy(setting, children, key, value));
}
return result;
},
getNodesByFilter: function (setting, nodes, filter, isSingle, invokeParam) {
if (!nodes) return (isSingle ? null : []);
var result = isSingle ? null : [];
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (tools.apply(filter, [node, invokeParam], false)) {
if (isSingle) {
return node;
}
result.push(node);
}
var children = data.nodeChildren(setting, node);
var tmpResult = data.getNodesByFilter(setting, children, filter, isSingle, invokeParam);
if (isSingle && !!tmpResult) {
return tmpResult;
}
result = isSingle ? tmpResult : result.concat(tmpResult);
}
return result;
},
getPreNode: function (setting, node) {
if (!node) return null;
var p = node.parentTId ? node.getParentNode() : data.getRoot(setting),
children = data.nodeChildren(setting, p);
for (var i = 0, l = children.length; i < l; i++) {
if (children[i] === node) {
return (i == 0 ? null : children[i - 1]);
}
}
return null;
},
getRoot: function (setting) {
return setting ? roots[setting.treeId] : null;
},
getRoots: function () {
return roots;
},
getSetting: function (treeId) {
return settings[treeId];
},
getSettings: function () {
return settings;
},
getZTreeTools: function (treeId) {
var r = this.getRoot(this.getSetting(treeId));
return r ? r.treeTools : null;
},
initCache: function (setting) {
for (var i = 0, j = _init.caches.length; i < j; i++) {
_init.caches[i].apply(this, arguments);
}
},
initNode: function (setting, level, node, parentNode, preNode, nextNode) {
for (var i = 0, j = _init.nodes.length; i < j; i++) {
_init.nodes[i].apply(this, arguments);
}
},
initRoot: function (setting) {
for (var i = 0, j = _init.roots.length; i < j; i++) {
_init.roots[i].apply(this, arguments);
}
},
isSelectedNode: function (setting, node) {
var root = data.getRoot(setting);
for (var i = 0, j = root.curSelectedList.length; i < j; i++) {
if (node === root.curSelectedList[i]) return true;
}
return false;
},
nodeChildren: function (setting, node, newChildren) {
if (!node) {
return null;
}
var key = setting.data.key.children;
if (typeof newChildren !== 'undefined') {
node[key] = newChildren;
}
return node[key];
},
nodeIsParent: function (setting, node, newIsParent) {
if (!node) {
return false;
}
var key = setting.data.key.isParent;
if (typeof newIsParent !== 'undefined') {
if (typeof newIsParent === "string") {
newIsParent = tools.eqs(newIsParent, "true");
}
newIsParent = !!newIsParent;
node[key] = newIsParent;
} else if (typeof node[key] == "string"){
node[key] = tools.eqs(node[key], "true");
} else {
node[key] = !!node[key];
}
return node[key];
},
nodeName: function (setting, node, newName) {
var key = setting.data.key.name;
if (typeof newName !== 'undefined') {
node[key] = newName;
}
var rawName = "" + node[key];
if(typeof setting.data.render.name === 'function') {
return setting.data.render.name.call(this,rawName,node);
}
return rawName;
},
nodeTitle: function (setting, node) {
var t = setting.data.key.title === "" ? setting.data.key.name : setting.data.key.title;
var rawTitle = "" + node[t];
if(typeof setting.data.render.title === 'function') {
return setting.data.render.title.call(this,rawTitle,node);
}
return rawTitle;
},
removeNodeCache: function (setting, node) {
var children = data.nodeChildren(setting, node);
if (children) {
for (var i = 0, l = children.length; i < l; i++) {
data.removeNodeCache(setting, children[i]);
}
}
data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = null;
},
removeSelectedNode: function (setting, node) {
var root = data.getRoot(setting);
for (var i = 0, j = root.curSelectedList.length; i < j; i++) {
if (node === root.curSelectedList[i] || !data.getNodeCache(setting, root.curSelectedList[i].tId)) {
root.curSelectedList.splice(i, 1);
setting.treeObj.trigger(consts.event.UNSELECTED, [setting.treeId, node]);
i--;
j--;
}
}
},
setCache: function (setting, cache) {
caches[setting.treeId] = cache;
},
setRoot: function (setting, root) {
roots[setting.treeId] = root;
},
setZTreeTools: function (setting, zTreeTools) {
for (var i = 0, j = _init.zTreeTools.length; i < j; i++) {
_init.zTreeTools[i].apply(this, arguments);
}
},
transformToArrayFormat: function (setting, nodes) {
if (!nodes) return [];
var r = [];
if (tools.isArray(nodes)) {
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
_do(node);
}
} else {
_do(nodes);
}
return r;
function _do(_node) {
r.push(_node);
var children = data.nodeChildren(setting, _node);
if (children) {
r = r.concat(data.transformToArrayFormat(setting, children));
}
}
},
transformTozTreeFormat: function (setting, sNodes) {
var i, l,
key = setting.data.simpleData.idKey,
parentKey = setting.data.simpleData.pIdKey;
if (!key || key == "" || !sNodes) return [];
if (tools.isArray(sNodes)) {
var r = [];
var tmpMap = {};
for (i = 0, l = sNodes.length; i < l; i++) {
tmpMap[sNodes[i][key]] = sNodes[i];
}
for (i = 0, l = sNodes.length; i < l; i++) {
var p = tmpMap[sNodes[i][parentKey]];
if (p && sNodes[i][key] != sNodes[i][parentKey]) {
var children = data.nodeChildren(setting, p);
if (!children) {
children = data.nodeChildren(setting, p, []);
}
children.push(sNodes[i]);
} else {
r.push(sNodes[i]);
}
}
return r;
} else {
return [sNodes];
}
}
},
//method of event proxy
event = {
bindEvent: function (setting) {
for (var i = 0, j = _init.bind.length; i < j; i++) {
_init.bind[i].apply(this, arguments);
}
},
unbindEvent: function (setting) {
for (var i = 0, j = _init.unbind.length; i < j; i++) {
_init.unbind[i].apply(this, arguments);
}
},
bindTree: function (setting) {
var eventParam = {
treeId: setting.treeId
},
o = setting.treeObj;
if (!setting.view.txtSelectedEnable) {
// for can't select text
o.bind('selectstart', handler.onSelectStart).css({
"-moz-user-select": "-moz-none"
});
}
o.bind('click', eventParam, event.proxy);
o.bind('dblclick', eventParam, event.proxy);
o.bind('mouseover', eventParam, event.proxy);
o.bind('mouseout', eventParam, event.proxy);
o.bind('mousedown', eventParam, event.proxy);
o.bind('mouseup', eventParam, event.proxy);
o.bind('contextmenu', eventParam, event.proxy);
},
unbindTree: function (setting) {
var o = setting.treeObj;
o.unbind('selectstart', handler.onSelectStart)
.unbind('click', event.proxy)
.unbind('dblclick', event.proxy)
.unbind('mouseover', event.proxy)
.unbind('mouseout', event.proxy)
.unbind('mousedown', event.proxy)
.unbind('mouseup', event.proxy)
.unbind('contextmenu', event.proxy);
},
doProxy: function (e) {
var results = [];
for (var i = 0, j = _init.proxys.length; i < j; i++) {
var proxyResult = _init.proxys[i].apply(this, arguments);
results.push(proxyResult);
if (proxyResult.stop) {
break;
}
}
return results;
},
proxy: function (e) {
var setting = data.getSetting(e.data.treeId);
if (!tools.uCanDo(setting, e)) return true;
var results = event.doProxy(e),
r = true, x = false;
for (var i = 0, l = results.length; i < l; i++) {
var proxyResult = results[i];
if (proxyResult.nodeEventCallback) {
x = true;
r = proxyResult.nodeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r;
}
if (proxyResult.treeEventCallback) {
x = true;
r = proxyResult.treeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r;
}
}
return r;
}
},
//method of event handler
handler = {
onSwitchNode: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (node.open) {
if (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false) return true;
data.getRoot(setting).expandTriggerFlag = true;
view.switchNode(setting, node);
} else {
if (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false) return true;
data.getRoot(setting).expandTriggerFlag = true;
view.switchNode(setting, node);
}
return true;
},
onClickNode: function (event, node) {
var setting = data.getSetting(event.data.treeId),
clickFlag = ((setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey)) && data.isSelectedNode(setting, node)) ? 0 : (setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey) && setting.view.selectedMulti) ? 2 : 1;
if (tools.apply(setting.callback.beforeClick, [setting.treeId, node, clickFlag], true) == false) return true;
if (clickFlag === 0) {
view.cancelPreSelectedNode(setting, node);
} else {
view.selectNode(setting, node, clickFlag === 2);
}
setting.treeObj.trigger(consts.event.CLICK, [event, setting.treeId, node, clickFlag]);
return true;
},
onZTreeMousedown: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeMouseDown, [setting.treeId, node], true)) {
tools.apply(setting.callback.onMouseDown, [event, setting.treeId, node]);
}
return true;
},
onZTreeMouseup: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeMouseUp, [setting.treeId, node], true)) {
tools.apply(setting.callback.onMouseUp, [event, setting.treeId, node]);
}
return true;
},
onZTreeDblclick: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeDblClick, [setting.treeId, node], true)) {
tools.apply(setting.callback.onDblClick, [event, setting.treeId, node]);
}
return true;
},
onZTreeContextmenu: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeRightClick, [setting.treeId, node], true)) {
tools.apply(setting.callback.onRightClick, [event, setting.treeId, node]);
}
return (typeof setting.callback.onRightClick) != "function";
},
onSelectStart: function (e) {
var n = e.originalEvent.srcElement.nodeName.toLowerCase();
return (n === "input" || n === "textarea");
}
},
//method of tools for zTree
tools = {
apply: function (fun, param, defaultValue) {
if ((typeof fun) == "function") {
return fun.apply(zt, param ? param : []);
}
return defaultValue;
},
canAsync: function (setting, node) {
var children = data.nodeChildren(setting, node);
var isParent = data.nodeIsParent(setting, node);
return (setting.async.enable && node && isParent && !(node.zAsync || (children && children.length > 0)));
},
clone: function (obj) {
if (obj === null) return null;
var o = tools.isArray(obj) ? [] : {};
for (var i in obj) {
o[i] = (obj[i] instanceof Date) ? new Date(obj[i].getTime()) : (typeof obj[i] === "object" ? tools.clone(obj[i]) : obj[i]);
}
return o;
},
eqs: function (str1, str2) {
return str1.toLowerCase() === str2.toLowerCase();
},
isArray: function (arr) {
return Object.prototype.toString.apply(arr) === "[object Array]";
},
isElement: function (o) {
return (
typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"
);
},
$: function (node, exp, setting) {
if (!!exp && typeof exp != "string") {
setting = exp;
exp = "";
}
if (typeof node == "string") {
return $(node, setting ? setting.treeObj.get(0).ownerDocument : null);
} else {
return $("#" + node.tId + exp, setting ? setting.treeObj : null);
}
},
getMDom: function (setting, curDom, targetExpr) {
if (!curDom) return null;
while (curDom && curDom.id !== setting.treeId) {
for (var i = 0, l = targetExpr.length; curDom.tagName && i < l; i++) {
if (tools.eqs(curDom.tagName, targetExpr[i].tagName) && curDom.getAttribute(targetExpr[i].attrName) !== null) {
return curDom;
}
}
curDom = curDom.parentNode;
}
return null;
},
getNodeMainDom: function (target) {
return ($(target).parent("li").get(0) || $(target).parentsUntil("li").parent().get(0));
},
isChildOrSelf: function (dom, parentId) {
return ($(dom).closest("#" + parentId).length > 0);
},
uCanDo: function (setting, e) {
return true;
}
},
//method of operate ztree dom
view = {
addNodes: function (setting, parentNode, index, newNodes, isSilent) {
var isParent = data.nodeIsParent(setting, parentNode);
if (setting.data.keep.leaf && parentNode && !isParent) {
return;
}
if (!tools.isArray(newNodes)) {
newNodes = [newNodes];
}
if (setting.data.simpleData.enable) {
newNodes = data.transformTozTreeFormat(setting, newNodes);
}
if (parentNode) {
var target_switchObj = $$(parentNode, consts.id.SWITCH, setting),
target_icoObj = $$(parentNode, consts.id.ICON, setting),
target_ulObj = $$(parentNode, consts.id.UL, setting);
if (!parentNode.open) {
view.replaceSwitchClass(parentNode, target_switchObj, consts.folder.CLOSE);
view.replaceIcoClass(parentNode, target_icoObj, consts.folder.CLOSE);
parentNode.open = false;
target_ulObj.css({
"display": "none"
});
}
data.addNodesData(setting, parentNode, index, newNodes);
view.createNodes(setting, parentNode.level + 1, newNodes, parentNode, index);
if (!isSilent) {
view.expandCollapseParentNode(setting, parentNode, true);
}
} else {
data.addNodesData(setting, data.getRoot(setting), index, newNodes);
view.createNodes(setting, 0, newNodes, null, index);
}
},
appendNodes: function (setting, level, nodes, parentNode, index, initFlag, openFlag) {
if (!nodes) return [];
var html = [];
var tmpPNode = (parentNode) ? parentNode : data.getRoot(setting),
tmpPChild = data.nodeChildren(setting, tmpPNode),
isFirstNode, isLastNode;
if (!tmpPChild || index >= tmpPChild.length - nodes.length) {
index = -1;
}
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (initFlag) {
isFirstNode = ((index === 0 || tmpPChild.length == nodes.length) && (i == 0));
isLastNode = (index < 0 && i == (nodes.length - 1));
data.initNode(setting, level, node, parentNode, isFirstNode, isLastNode, openFlag);
data.addNodeCache(setting, node);
}
var isParent = data.nodeIsParent(setting, node);
var childHtml = [];
var children = data.nodeChildren(setting, node);
if (children && children.length > 0) {
//make child html first, because checkType
childHtml = view.appendNodes(setting, level + 1, children, node, -1, initFlag, openFlag && node.open);
}
if (openFlag) {
view.makeDOMNodeMainBefore(html, setting, node);
view.makeDOMNodeLine(html, setting, node);
data.getBeforeA(setting, node, html);
view.makeDOMNodeNameBefore(html, setting, node);
data.getInnerBeforeA(setting, node, html);
view.makeDOMNodeIcon(html, setting, node);
data.getInnerAfterA(setting, node, html);
view.makeDOMNodeNameAfter(html, setting, node);
data.getAfterA(setting, node, html);
if (isParent && node.open) {
view.makeUlHtml(setting, node, html, childHtml.join(''));
}
view.makeDOMNodeMainAfter(html, setting, node);
data.addCreatedNode(setting, node);
}
}
return html;
},
appendParentULDom: function (setting, node) {
var html = [],
nObj = $$(node, setting);
if (!nObj.get(0) && !!node.parentTId) {
view.appendParentULDom(setting, node.getParentNode());
nObj = $$(node, setting);
}
var ulObj = $$(node, consts.id.UL, setting);
if (ulObj.get(0)) {
ulObj.remove();
}
var children = data.nodeChildren(setting, node),
childHtml = view.appendNodes(setting, node.level + 1, children, node, -1, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
},
asyncNode: function (setting, node, isSilent, callback) {
var i, l;
var isParent = data.nodeIsParent(setting, node);
if (node && !isParent) {
tools.apply(callback);
return false;
} else if (node && node.isAjaxing) {
return false;
} else if (tools.apply(setting.callback.beforeAsync, [setting.treeId, node], true) == false) {
tools.apply(callback);
return false;
}
if (node) {
node.isAjaxing = true;
var icoObj = $$(node, consts.id.ICON, setting);
icoObj.attr({"style": "", "class": consts.className.BUTTON + " " + consts.className.ICO_LOADING});
}
var tmpParam = {};
var autoParam = tools.apply(setting.async.autoParam, [setting.treeId, node], setting.async.autoParam);
for (i = 0, l = autoParam.length; node && i < l; i++) {
var pKey = autoParam[i].split("="), spKey = pKey;
if (pKey.length > 1) {
spKey = pKey[1];
pKey = pKey[0];
}
tmpParam[spKey] = node[pKey];
}
var otherParam = tools.apply(setting.async.otherParam, [setting.treeId, node], setting.async.otherParam);
if (tools.isArray(otherParam)) {
for (i = 0, l = otherParam.length; i < l; i += 2) {
tmpParam[otherParam[i]] = otherParam[i + 1];
}
} else {
for (var p in otherParam) {
tmpParam[p] = otherParam[p];
}
}
var _tmpV = data.getRoot(setting)._ver;
$.ajax({
contentType: setting.async.contentType,
cache: false,
type: setting.async.type,
url: tools.apply(setting.async.url, [setting.treeId, node], setting.async.url),
data: setting.async.contentType.indexOf('application/json') > -1 ? JSON.stringify(tmpParam) : tmpParam,
dataType: setting.async.dataType,
headers: setting.async.headers,
xhrFields: setting.async.xhrFields,
success: function (msg) {
if (_tmpV != data.getRoot(setting)._ver) {
return;
}
var newNodes = [];
try {
if (!msg || msg.length == 0) {
newNodes = [];
} else if (typeof msg == "string") {
newNodes = eval("(" + msg + ")");
} else {
newNodes = msg;
}
} catch (err) {
newNodes = msg;
}
if (node) {
node.isAjaxing = null;
node.zAsync = true;
}
view.setNodeLineIcos(setting, node);
if (newNodes && newNodes !== "") {
newNodes = tools.apply(setting.async.dataFilter, [setting.treeId, node, newNodes], newNodes);
view.addNodes(setting, node, -1, !!newNodes ? tools.clone(newNodes) : [], !!isSilent);
} else {
view.addNodes(setting, node, -1, [], !!isSilent);
}
setting.treeObj.trigger(consts.event.ASYNC_SUCCESS, [setting.treeId, node, msg]);
tools.apply(callback);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
if (_tmpV != data.getRoot(setting)._ver) {
return;
}
if (node) node.isAjaxing = null;
view.setNodeLineIcos(setting, node);
setting.treeObj.trigger(consts.event.ASYNC_ERROR, [setting.treeId, node, XMLHttpRequest, textStatus, errorThrown]);
}
});
return true;
},
cancelPreSelectedNode: function (setting, node, excludeNode) {
var list = data.getRoot(setting).curSelectedList,
i, n;
for (i = list.length - 1; i >= 0; i--) {
n = list[i];
if (node === n || (!node && (!excludeNode || excludeNode !== n))) {
$$(n, consts.id.A, setting).removeClass(consts.node.CURSELECTED);
if (node) {
data.removeSelectedNode(setting, node);
break;
} else {
list.splice(i, 1);
setting.treeObj.trigger(consts.event.UNSELECTED, [setting.treeId, n]);
}
}
}
},
createNodeCallback: function (setting) {
if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) {
var root = data.getRoot(setting);
while (root.createdNodes.length > 0) {
var node = root.createdNodes.shift();
tools.apply(setting.view.addDiyDom, [setting.treeId, node]);
if (!!setting.callback.onNodeCreated) {
setting.treeObj.trigger(consts.event.NODECREATED, [setting.treeId, node]);
}
}
}
},
createNodes: function (setting, level, nodes, parentNode, index) {
if (!nodes || nodes.length == 0) return;
var root = data.getRoot(setting),
openFlag = !parentNode || parentNode.open || !!$$(data.nodeChildren(setting, parentNode)[0], setting).get(0);
root.createdNodes = [];
var zTreeHtml = view.appendNodes(setting, level, nodes, parentNode, index, true, openFlag),
parentObj, nextObj;
if (!parentNode) {
parentObj = setting.treeObj;
//setting.treeObj.append(zTreeHtml.join(''));
} else {
var ulObj = $$(parentNode, consts.id.UL, setting);
if (ulObj.get(0)) {
parentObj = ulObj;
//ulObj.append(zTreeHtml.join(''));
}
}
if (parentObj) {
if (index >= 0) {
nextObj = parentObj.children()[index];
}
if (index >= 0 && nextObj) {
$(nextObj).before(zTreeHtml.join(''));
} else {
parentObj.append(zTreeHtml.join(''));
}
}
view.createNodeCallback(setting);
},
destroy: function (setting) {
if (!setting) return;
data.initCache(setting);
data.initRoot(setting);
event.unbindTree(setting);
event.unbindEvent(setting);
setting.treeObj.empty();
delete settings[setting.treeId];
},
expandCollapseNode: function (setting, node, expandFlag, animateFlag, callback) {
var root = data.getRoot(setting);
var tmpCb, _callback;
if (!node) {
tools.apply(callback, []);
return;
}
var children = data.nodeChildren(setting, node);
var isParent = data.nodeIsParent(setting, node);
if (root.expandTriggerFlag) {
_callback = callback;
tmpCb = function () {
if (_callback) _callback();
if (node.open) {
setting.treeObj.trigger(consts.event.EXPAND, [setting.treeId, node]);
} else {
setting.treeObj.trigger(consts.event.COLLAPSE, [setting.treeId, node]);
}
};
callback = tmpCb;
root.expandTriggerFlag = false;
}
if (!node.open && isParent && ((!$$(node, consts.id.UL, setting).get(0)) || (children && children.length > 0 && !$$(children[0], setting).get(0)))) {
view.appendParentULDom(setting, node);
view.createNodeCallback(setting);
}
if (node.open == expandFlag) {
tools.apply(callback, []);
return;
}
var ulObj = $$(node, consts.id.UL, setting),
switchObj = $$(node, consts.id.SWITCH, setting),
icoObj = $$(node, consts.id.ICON, setting);
if (isParent) {
node.open = !node.open;
if (node.iconOpen && node.iconClose) {
icoObj.attr("style", view.makeNodeIcoStyle(setting, node));
}
if (node.open) {
view.replaceSwitchClass(node, switchObj, consts.folder.OPEN);
view.replaceIcoClass(node, icoObj, consts.folder.OPEN);
if (animateFlag == false || setting.view.expandSpeed == "") {
ulObj.show();
tools.apply(callback, []);
} else {
if (children && children.length > 0) {
ulObj.slideDown(setting.view.expandSpeed, callback);
} else {
ulObj.show();
tools.apply(callback, []);
}
}
} else {
view.replaceSwitchClass(node, switchObj, consts.folder.CLOSE);
view.replaceIcoClass(node, icoObj, consts.folder.CLOSE);
if (animateFlag == false || setting.view.expandSpeed == "" || !(children && children.length > 0)) {
ulObj.hide();
tools.apply(callback, []);
} else {
ulObj.slideUp(setting.view.expandSpeed, callback);
}
}
} else {
tools.apply(callback, []);
}
},
expandCollapseParentNode: function (setting, node, expandFlag, animateFlag, callback) {
if (!node) return;
if (!node.parentTId) {
view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback);
return;
} else {
view.expandCollapseNode(setting, node, expandFlag, animateFlag);
}
if (node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, animateFlag, callback);
}
},
expandCollapseSonNode: function (setting, node, expandFlag, animateFlag, callback) {
var root = data.getRoot(setting),
treeNodes = (node) ? data.nodeChildren(setting, node) : data.nodeChildren(setting, root),
selfAnimateSign = (node) ? false : animateFlag,
expandTriggerFlag = data.getRoot(setting).expandTriggerFlag;
data.getRoot(setting).expandTriggerFlag = false;
if (treeNodes) {
for (var i = 0, l = treeNodes.length; i < l; i++) {
if (treeNodes[i]) view.expandCollapseSonNode(setting, treeNodes[i], expandFlag, selfAnimateSign);
}
}
data.getRoot(setting).expandTriggerFlag = expandTriggerFlag;
view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback);
},
isSelectedNode: function (setting, node) {
if (!node) {
return false;
}
var list = data.getRoot(setting).curSelectedList,
i;
for (i = list.length - 1; i >= 0; i--) {
if (node === list[i]) {
return true;
}
}
return false;
},
makeDOMNodeIcon: function (html, setting, node) {
var nameStr = data.nodeName(setting, node),
name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
html.push("<span id='", node.tId, consts.id.ICON,
"' title='' treeNode", consts.id.ICON, " class='", view.makeNodeIcoClass(setting, node),
"' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN,
"' class='", consts.className.NAME,
"'>", name, "</span>");
},
makeDOMNodeLine: function (html, setting, node) {
html.push("<span id='", node.tId, consts.id.SWITCH, "' title='' class='", view.makeNodeLineClass(setting, node), "' treeNode", consts.id.SWITCH, "></span>");
},
makeDOMNodeMainAfter: function (html, setting, node) {
html.push("</li>");
},
makeDOMNodeMainBefore: function (html, setting, node) {
html.push("<li id='", node.tId, "' class='", consts.className.LEVEL, node.level, "' tabindex='0' hidefocus='true' treenode>");
},
makeDOMNodeNameAfter: function (html, setting, node) {
html.push("</a>");
},
makeDOMNodeNameBefore: function (html, setting, node) {
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("<a id='", node.tId, consts.id.A, "' class='", consts.className.LEVEL, node.level,
nodeClasses.add ? ' ' + nodeClasses.add.join(' ') : '',
"' treeNode", consts.id.A,
node.click ? " onclick=\"" + node.click + "\"" : "",
((url != null && url.length > 0) ? " href='" + url + "'" : ""), " target='", view.makeNodeTarget(node), "' style='", fontStyle.join(''),
"'");
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) {
html.push("title='", title.replace(/'/g, "&#39;").replace(/</g, '&lt;').replace(/>/g, '&gt;'), "'");
}
html.push(">");
},
makeNodeFontCss: function (setting, node) {
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) {
var isParent = data.nodeIsParent(setting, node);
icoCss[0] = (node.iconSkin ? node.iconSkin + "_" : "") + icoCss[0];
if (isParent) {
icoCss.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE);
} else {
icoCss.push(consts.folder.DOCU);
}
}
return consts.className.BUTTON + " " + icoCss.join('_');
},
makeNodeIcoStyle: function (setting, node) {
var icoStyle = [];
if (!node.isAjaxing) {
var isParent = data.nodeIsParent(setting, node);
var icon = (isParent && node.iconOpen && node.iconClose) ? (node.open ? node.iconOpen : node.iconClose) : node[setting.data.key.icon];
if (icon) icoStyle.push("background:url(", icon, ") 0 0 no-repeat;");
if (setting.view.showIcon == false || !tools.apply(setting.view.showIcon, [setting.treeId, node], true)) {
icoStyle.push("display:none;");
}
}
return icoStyle.join('');
},
makeNodeLineClass: function (setting, node) {
var lineClass = [];
if (setting.view.showLine) {
if (node.level == 0 && node.isFirstNode && node.isLastNode) {
lineClass.push(consts.line.ROOT);
} else if (node.level == 0 && node.isFirstNode) {
lineClass.push(consts.line.ROOTS);
} else if (node.isLastNode) {
lineClass.push(consts.line.BOTTOM);
} else {
lineClass.push(consts.line.CENTER);
}
} else {
lineClass.push(consts.line.NOLINE);
}
if (data.nodeIsParent(setting, node)) {
lineClass.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE);
} else {
lineClass.push(consts.folder.DOCU);
}
return view.makeNodeLineClassEx(node) + lineClass.join('_');
},
makeNodeLineClassEx: function (node) {
return consts.className.BUTTON + " " + consts.className.LEVEL + node.level + " " + consts.className.SWITCH + " ";
},
makeNodeTarget: function (node) {
return (node.target || "_blank");
},
makeNodeUrl: function (setting, node) {
var urlKey = setting.data.key.url;
return node[urlKey] ? node[urlKey] : null;
},
makeUlHtml: function (setting, node, html, content) {
html.push("<ul id='", node.tId, consts.id.UL, "' class='", consts.className.LEVEL, node.level, " ", view.makeUlLineClass(setting, node), "' style='display:", (node.open ? "block" : "none"), "'>");
html.push(content);
html.push("</ul>");
},
makeUlLineClass: function (setting, node) {
return ((setting.view.showLine && !node.isLastNode) ? consts.line.LINE : "");
},
removeChildNodes: function (setting, node) {
if (!node) return;
var nodes = data.nodeChildren(setting, node);
if (!nodes) return;
for (var i = 0, l = nodes.length; i < l; i++) {
data.removeNodeCache(setting, nodes[i]);
}
data.removeSelectedNode(setting);
delete node[setting.data.key.children];
if (!setting.data.keep.parent) {
data.nodeIsParent(setting, node, false);
node.open = false;
var tmp_switchObj = $$(node, consts.id.SWITCH, setting),
tmp_icoObj = $$(node, consts.id.ICON, setting);
view.replaceSwitchClass(node, tmp_switchObj, consts.folder.DOCU);
view.replaceIcoClass(node, tmp_icoObj, consts.folder.DOCU);
$$(node, consts.id.UL, setting).remove();
} else {
$$(node, consts.id.UL, setting).empty();
}
},
scrollIntoView: function (setting, dom) {
if (!dom) {
return;
}
// support IE 7 / 8
if (typeof Element === 'undefined' || typeof HTMLElement === 'undefined') {
var contRect = setting.treeObj.get(0).getBoundingClientRect(),
findMeRect = dom.getBoundingClientRect();
if (findMeRect.top < contRect.top || findMeRect.bottom > contRect.bottom
|| findMeRect.right > contRect.right || findMeRect.left < contRect.left) {
dom.scrollIntoView();
}
return;
}
// CC-BY jocki84@googlemail.com, https://gist.github.com/jocki84/6ffafd003387179a988e
if (!Element.prototype.scrollIntoViewIfNeeded) {
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {
"use strict";
function makeRange(start, length) {
return {"start": start, "length": length, "end": start + length};
}
function coverRange(inner, outer) {
if (
false === centerIfNeeded ||
(outer.start < inner.end && inner.start < outer.end)
) {
return Math.max(
inner.end - outer.length,
Math.min(outer.start, inner.start)
);
}
return (inner.start + inner.end - outer.length) / 2;
}
function makePoint(x, y) {
return {
"x": x,
"y": y,
"translate": function translate(dX, dY) {
return makePoint(x + dX, y + dY);
}
};
}
function absolute(elem, pt) {
while (elem) {
pt = pt.translate(elem.offsetLeft, elem.offsetTop);
elem = elem.offsetParent;
}
return pt;
}
var target = absolute(this, makePoint(0, 0)),
extent = makePoint(this.offsetWidth, this.offsetHeight),
elem = this.parentNode,
origin;
while (elem instanceof HTMLElement) {
// Apply desired scroll amount.
origin = absolute(elem, makePoint(elem.clientLeft, elem.clientTop));
elem.scrollLeft = coverRange(
makeRange(target.x - origin.x, extent.x),
makeRange(elem.scrollLeft, elem.clientWidth)
);
elem.scrollTop = coverRange(
makeRange(target.y - origin.y, extent.y),
makeRange(elem.scrollTop, elem.clientHeight)
);
// Determine actual scroll amount by reading back scroll properties.
target = target.translate(-elem.scrollLeft, -elem.scrollTop);
elem = elem.parentNode;
}
};
}
dom.scrollIntoViewIfNeeded();
},
setFirstNode: function (setting, parentNode) {
var children = data.nodeChildren(setting, parentNode);
if (children.length > 0) {
children[0].isFirstNode = true;
}
},
setLastNode: function (setting, parentNode) {
var children = data.nodeChildren(setting, parentNode);
if (children.length > 0) {
children[children.length - 1].isLastNode = true;
}
},
removeNode: function (setting, node) {
var root = data.getRoot(setting),
parentNode = (node.parentTId) ? node.getParentNode() : root;
node.isFirstNode = false;
node.isLastNode = false;
node.getPreNode = function () {
return null;
};
node.getNextNode = function () {
return null;
};
if (!data.getNodeCache(setting, node.tId)) {
return;
}
$$(node, setting).remove();
data.removeNodeCache(setting, node);
data.removeSelectedNode(setting, node);
var children = data.nodeChildren(setting, parentNode);
for (var i = 0, l = children.length; i < l; i++) {
if (children[i].tId == node.tId) {
children.splice(i, 1);
break;
}
}
view.setFirstNode(setting, parentNode);
view.setLastNode(setting, parentNode);
var tmp_ulObj, tmp_switchObj, tmp_icoObj,
childLength = children.length;
//repair nodes old parent
if (!setting.data.keep.parent && childLength == 0) {
//old parentNode has no child nodes
data.nodeIsParent(setting, parentNode, false);
parentNode.open = false;
delete parentNode[setting.data.key.children];
tmp_ulObj = $$(parentNode, consts.id.UL, setting);
tmp_switchObj = $$(parentNode, consts.id.SWITCH, setting);
tmp_icoObj = $$(parentNode, consts.id.ICON, setting);
view.replaceSwitchClass(parentNode, tmp_switchObj, consts.folder.DOCU);
view.replaceIcoClass(parentNode, tmp_icoObj, consts.folder.DOCU);
tmp_ulObj.css("display", "none");
} else if (setting.view.showLine && childLength > 0) {
//old parentNode has child nodes
var newLast = children[childLength - 1];
tmp_ulObj = $$(newLast, consts.id.UL, setting);
tmp_switchObj = $$(newLast, consts.id.SWITCH, setting);
tmp_icoObj = $$(newLast, consts.id.ICON, setting);
if (parentNode == root) {
if (children.length == 1) {
//node was root, and ztree has only one root after move node
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.ROOT);
} else {
var tmp_first_switchObj = $$(children[0], consts.id.SWITCH, setting);
view.replaceSwitchClass(children[0], tmp_first_switchObj, consts.line.ROOTS);
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM);
}
} else {
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM);
}
tmp_ulObj.removeClass(consts.line.LINE);
}
},
replaceIcoClass: function (node, obj, newName) {
if (!obj || node.isAjaxing) return;
var tmpName = obj.attr("class");
if (tmpName == undefined) return;
var tmpList = tmpName.split("_");
switch (newName) {
case consts.folder.OPEN:
case consts.folder.CLOSE:
case consts.folder.DOCU:
tmpList[tmpList.length - 1] = newName;
break;
}
obj.attr("class", tmpList.join("_"));
},
replaceSwitchClass: function (node, obj, newName) {
if (!obj) return;
var tmpName = obj.attr("class");
if (tmpName == undefined) return;
var tmpList = tmpName.split("_");
switch (newName) {
case consts.line.ROOT:
case consts.line.ROOTS:
case consts.line.CENTER:
case consts.line.BOTTOM:
case consts.line.NOLINE:
tmpList[0] = view.makeNodeLineClassEx(node) + newName;
break;
case consts.folder.OPEN:
case consts.folder.CLOSE:
case consts.folder.DOCU:
tmpList[1] = newName;
break;
}
obj.attr("class", tmpList.join("_"));
if (newName !== consts.folder.DOCU) {
obj.removeAttr("disabled");
} else {
obj.attr("disabled", "disabled");
}
},
selectNode: function (setting, node, addFlag) {
if (!addFlag) {
view.cancelPreSelectedNode(setting, null, node);
}
$$(node, consts.id.A, setting).addClass(consts.node.CURSELECTED);
data.addSelectedNode(setting, node);
setting.treeObj.trigger(consts.event.SELECTED, [setting.treeId, node]);
},
setNodeFontCss: function (setting, treeNode) {
var aObj = $$(treeNode, consts.id.A, setting),
fontCss = view.makeNodeFontCss(setting, treeNode);
if (fontCss) {
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),
ulObj = $$(node, consts.id.UL, setting),
icoObj = $$(node, consts.id.ICON, setting),
ulLine = view.makeUlLineClass(setting, node);
if (ulLine.length == 0) {
ulObj.removeClass(consts.line.LINE);
} else {
ulObj.addClass(ulLine);
}
switchObj.attr("class", view.makeNodeLineClass(setting, node));
if (data.nodeIsParent(setting, node)) {
switchObj.removeAttr("disabled");
} else {
switchObj.attr("disabled", "disabled");
}
icoObj.removeAttr("style");
icoObj.attr("style", view.makeNodeIcoStyle(setting, node));
icoObj.attr("class", view.makeNodeIcoClass(setting, node));
},
setNodeName: function (setting, node) {
var title = data.nodeTitle(setting, node),
nObj = $$(node, consts.id.SPAN, setting);
nObj.empty();
if (setting.view.nameIsHTML) {
nObj.html(data.nodeName(setting, node));
} else {
nObj.text(data.nodeName(setting, node));
}
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle)) {
var aObj = $$(node, consts.id.A, setting);
aObj.attr("title", !title ? "" : title);
}
},
setNodeTarget: function (setting, node) {
var aObj = $$(node, consts.id.A, setting);
aObj.attr("target", view.makeNodeTarget(node));
},
setNodeUrl: function (setting, node) {
var aObj = $$(node, consts.id.A, setting),
url = view.makeNodeUrl(setting, node);
if (url == null || url.length == 0) {
aObj.removeAttr("href");
} else {
aObj.attr("href", url);
}
},
switchNode: function (setting, node) {
if (node.open || !tools.canAsync(setting, node)) {
view.expandCollapseNode(setting, node, !node.open);
} else if (setting.async.enable) {
if (!view.asyncNode(setting, node)) {
view.expandCollapseNode(setting, node, !node.open);
return;
}
} else if (node) {
view.expandCollapseNode(setting, node, !node.open);
}
}
};
// zTree defind
$.fn.zTree = {
consts: _consts,
_z: {
tools: tools,
view: view,
event: event,
data: data
},
getZTreeObj: function (treeId) {
var o = data.getZTreeTools(treeId);
return o ? o : null;
},
destroy: function (treeId) {
if (!!treeId && treeId.length > 0) {
view.destroy(data.getSetting(treeId));
} else {
for (var s in settings) {
view.destroy(settings[s]);
}
}
},
init: function (obj, zSetting, zNodes) {
var setting = tools.clone(_setting);
$.extend(true, setting, zSetting);
setting.treeId = obj.attr("id");
setting.treeObj = obj;
setting.treeObj.empty();
settings[setting.treeId] = setting;
//For some older browser,(e.g., ie6)
if (typeof document.body.style.maxHeight === "undefined") {
setting.view.expandSpeed = "";
}
data.initRoot(setting);
var root = data.getRoot(setting);
zNodes = zNodes ? tools.clone(tools.isArray(zNodes) ? zNodes : [zNodes]) : [];
if (setting.data.simpleData.enable) {
data.nodeChildren(setting, root, data.transformTozTreeFormat(setting, zNodes));
} else {
data.nodeChildren(setting, root, zNodes);
}
data.initCache(setting);
event.unbindTree(setting);
event.bindTree(setting);
event.unbindEvent(setting);
event.bindEvent(setting);
var zTreeTools = {
setting: setting,
addNodes: function (parentNode, index, newNodes, isSilent) {
if (!parentNode) parentNode = null;
var isParent = data.nodeIsParent(setting, parentNode);
if (parentNode && !isParent && setting.data.keep.leaf) return null;
var i = parseInt(index, 10);
if (isNaN(i)) {
isSilent = !!newNodes;
newNodes = index;
index = -1;
} else {
index = i;
}
if (!newNodes) return null;
var xNewNodes = tools.clone(tools.isArray(newNodes) ? newNodes : [newNodes]);
function addCallback() {
view.addNodes(setting, parentNode, index, xNewNodes, (isSilent == true));
}
if (tools.canAsync(setting, parentNode)) {
view.asyncNode(setting, parentNode, isSilent, addCallback);
} else {
addCallback();
}
return xNewNodes;
},
cancelSelectedNode: function (node) {
view.cancelPreSelectedNode(setting, node);
},
destroy: function () {
view.destroy(setting);
},
expandAll: function (expandFlag) {
expandFlag = !!expandFlag;
view.expandCollapseSonNode(setting, null, expandFlag, true);
return expandFlag;
},
expandNode: function (node, expandFlag, sonSign, focus, callbackFlag) {
if (!node || !data.nodeIsParent(setting, node)) return null;
if (expandFlag !== true && expandFlag !== false) {
expandFlag = !node.open;
}
callbackFlag = !!callbackFlag;
if (callbackFlag && expandFlag && (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false)) {
return null;
} else if (callbackFlag && !expandFlag && (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false)) {
return null;
}
if (expandFlag && node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, false);
}
if (expandFlag === node.open && !sonSign) {
return null;
}
data.getRoot(setting).expandTriggerFlag = callbackFlag;
if (!tools.canAsync(setting, node) && sonSign) {
view.expandCollapseSonNode(setting, node, expandFlag, true, showNodeFocus);
} else {
node.open = !expandFlag;
view.switchNode(this.setting, node);
showNodeFocus();
}
return expandFlag;
function showNodeFocus() {
var a = $$(node, setting).get(0);
if (a && focus !== false) {
view.scrollIntoView(setting, a);
}
}
},
getNodes: function () {
return data.getNodes(setting);
},
getNodeByParam: function (key, value, parentNode) {
if (!key) return null;
return data.getNodeByParam(setting, parentNode ? data.nodeChildren(setting, parentNode) : data.getNodes(setting), key, value);
},
getNodeByTId: function (tId) {
return data.getNodeCache(setting, tId);
},
getNodesByParam: function (key, value, parentNode) {
if (!key) return null;
return data.getNodesByParam(setting, parentNode ? data.nodeChildren(setting, parentNode) : data.getNodes(setting), key, value);
},
getNodesByParamFuzzy: function (key, value, parentNode) {
if (!key) return null;
return data.getNodesByParamFuzzy(setting, parentNode ? data.nodeChildren(setting, parentNode) : data.getNodes(setting), key, value);
},
getNodesByFilter: function (filter, isSingle, parentNode, invokeParam) {
isSingle = !!isSingle;
if (!filter || (typeof filter != "function")) return (isSingle ? null : []);
return data.getNodesByFilter(setting, parentNode ? data.nodeChildren(setting, parentNode) : data.getNodes(setting), filter, isSingle, invokeParam);
},
getNodeIndex: function (node) {
if (!node) return null;
var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
var children = data.nodeChildren(setting, parentNode);
for (var i = 0, l = children.length; i < l; i++) {
if (children[i] == node) return i;
}
return -1;
},
getSelectedNodes: function () {
var r = [], list = data.getRoot(setting).curSelectedList;
for (var i = 0, l = list.length; i < l; i++) {
r.push(list[i]);
}
return r;
},
isSelectedNode: function (node) {
return data.isSelectedNode(setting, node);
},
reAsyncChildNodesPromise: function (parentNode, reloadType, isSilent) {
var promise = new Promise(function (resolve, reject) {
try {
zTreeTools.reAsyncChildNodes(parentNode, reloadType, isSilent, function () {
resolve(parentNode);
});
} catch (e) {
reject(e);
}
});
return promise;
},
reAsyncChildNodes: function (parentNode, reloadType, isSilent, callback) {
if (!this.setting.async.enable) return;
var isRoot = !parentNode;
if (isRoot) {
parentNode = data.getRoot(setting);
}
if (reloadType == "refresh") {
var children = data.nodeChildren(setting, parentNode);
for (var i = 0, l = children ? children.length : 0; i < l; i++) {
data.removeNodeCache(setting, children[i]);
}
data.removeSelectedNode(setting);
data.nodeChildren(setting, parentNode, []);
if (isRoot) {
this.setting.treeObj.empty();
} else {
var ulObj = $$(parentNode, consts.id.UL, setting);
ulObj.empty();
}
}
view.asyncNode(this.setting, isRoot ? null : parentNode, !!isSilent, callback);
},
refresh: function () {
this.setting.treeObj.empty();
var root = data.getRoot(setting),
nodes = data.nodeChildren(setting, root);
data.initRoot(setting);
data.nodeChildren(setting, root, nodes);
data.initCache(setting);
view.createNodes(setting, 0, data.nodeChildren(setting, root), null, -1);
},
removeChildNodes: function (node) {
if (!node) return null;
var nodes = data.nodeChildren(setting, node);
view.removeChildNodes(setting, node);
return nodes ? nodes : null;
},
removeNode: function (node, callbackFlag) {
if (!node) return;
callbackFlag = !!callbackFlag;
if (callbackFlag && tools.apply(setting.callback.beforeRemove, [setting.treeId, node], true) == false) return;
view.removeNode(setting, node);
if (callbackFlag) {
this.setting.treeObj.trigger(consts.event.REMOVE, [setting.treeId, node]);
}
},
selectNode: function (node, addFlag, isSilent) {
if (!node) return;
if (tools.uCanDo(setting)) {
addFlag = setting.view.selectedMulti && addFlag;
if (node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), true, false, showNodeFocus);
} else if (!isSilent) {
try {
$$(node, setting).focus().blur();
} catch (e) {
}
}
view.selectNode(setting, node, addFlag);
}
function showNodeFocus() {
if (isSilent) {
return;
}
var a = $$(node, setting).get(0);
view.scrollIntoView(setting, a);
}
},
transformTozTreeNodes: function (simpleNodes) {
return data.transformTozTreeFormat(setting, simpleNodes);
},
transformToArray: function (nodes) {
return data.transformToArrayFormat(setting, nodes);
},
updateNode: function (node, checkTypeFlag) {
if (!node) return;
var nObj = $$(node, setting);
if (nObj.get(0) && tools.uCanDo(setting)) {
view.setNodeName(setting, node);
view.setNodeTarget(setting, node);
view.setNodeUrl(setting, node);
view.setNodeLineIcos(setting, node);
view.setNodeFontCss(setting, node);
view.setNodeClasses(setting, node);
}
}
};
root.treeTools = zTreeTools;
data.setZTreeTools(setting, zTreeTools);
var children = data.nodeChildren(setting, root);
if (children && children.length > 0) {
view.createNodes(setting, 0, children, null, -1);
} else if (setting.async.enable && setting.async.url && setting.async.url !== '') {
view.asyncNode(setting);
}
return zTreeTools;
}
};
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);
\ No newline at end of file
!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:{},nodeClasses:{},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"},render:{name:null,title:null},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<d.length&&0==o.length&&(l=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(o=tools.getNodeMainDom(l).id),0<o.length)switch(a=data.getNodeCache(n,o),r){case"switchNode":data.nodeIsParent(n,a)&&(tools.eqs(e.type,"click")||tools.eqs(e.type,"dblclick")&&tools.apply(n.view.dblClickExpand,[n.treeId,a],n.view.dblClickExpand))?i=handler.onSwitchNode:r="";break;case"clickNode":i=handler.onClickNode}switch(d){case"mousedown":s=handler.onZTreeMousedown;break;case"mouseup":s=handler.onZTreeMouseup;break;case"dblclick":s=handler.onZTreeDblclick;break;case"contextmenu":s=handler.onZTreeContextmenu}return{stop:!1,node:a,nodeEventType:r,nodeEventCallback:i,treeEventType:d,treeEventCallback:s}},_initNode=function(e,t,n,o,a,r,d){if(n){var i=data.getRoot(e),s=data.nodeChildren(e,n);n.level=t,n.tId=e.treeId+"_"+ ++i.zId,n.parentTId=o?o.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open;var l=data.nodeIsParent(e,n);tools.isArray(s)?(data.nodeIsParent(e,n,!0),n.zAsync=!0):(l=data.nodeIsParent(e,n,l),n.open=!(!l||e.async.enable)&&n.open,n.zAsync=!l),n.isFirstNode=a,n.isLastNode=r,n.getParentNode=function(){return data.getNodeCache(e,n.parentTId)},n.getPreNode=function(){return data.getPreNode(e,n)},n.getNextNode=function(){return data.getNextNode(e,n)},n.getIndex=function(){return data.getNodeIndex(e,n)},n.getPath=function(){return data.getNodePath(e,n)},n.isAjaxing=!1,data.fixPIdKeyValue(e,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(e,t){data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=t},getNodeCacheId:function(e){return e.substring(e.lastIndexOf("_")+1)},addAfterA:function(e){_init.afterA.push(e)},addBeforeA:function(e){_init.beforeA.push(e)},addInnerAfterA:function(e){_init.innerAfterA.push(e)},addInnerBeforeA:function(e){_init.innerBeforeA.push(e)},addInitBind:function(e){_init.bind.push(e)},addInitUnBind:function(e){_init.unbind.push(e)},addInitCache:function(e){_init.caches.push(e)},addInitNode:function(e){_init.nodes.push(e)},addInitProxy:function(e,t){t?_init.proxys.splice(0,0,e):_init.proxys.push(e)},addInitRoot:function(e){_init.roots.push(e)},addNodesData:function(e,t,n,o){var a,r=data.nodeChildren(e,t);r?n>=r.length&&(n=-1):(r=data.nodeChildren(e,t,[]),n=-1),0<r.length&&0===n?(r[0].isFirstNode=!1,view.setNodeLineIcos(e,r[0])):0<r.length&&n<0&&(r[r.length-1].isLastNode=!1,view.setNodeLineIcos(e,r[r.length-1])),data.nodeIsParent(e,t,!0),n<0?data.nodeChildren(e,t,r.concat(o)):(a=[n,0].concat(o),r.splice.apply(r,a))},addSelectedNode:function(e,t){var n=data.getRoot(e);data.isSelectedNode(e,t)||n.curSelectedList.push(t)},addCreatedNode:function(e,t){(e.callback.onNodeCreated||e.view.addDiyDom)&&data.getRoot(e).createdNodes.push(t)},addZTreeTools:function(e){_init.zTreeTools.push(e)},exSetting:function(e){$.extend(!0,_setting,e)},fixPIdKeyValue:function(e,t){e.data.simpleData.enable&&(t[e.data.simpleData.pIdKey]=t.parentTId?t.getParentNode()[e.data.simpleData.idKey]:e.data.simpleData.rootPId)},getAfterA:function(e,t,n){for(var o=0,a=_init.afterA.length;o<a;o++)_init.afterA[o].apply(this,arguments)},getBeforeA:function(e,t,n){for(var o=0,a=_init.beforeA.length;o<a;o++)_init.beforeA[o].apply(this,arguments)},getInnerAfterA:function(e,t,n){for(var o=0,a=_init.innerAfterA.length;o<a;o++)_init.innerAfterA[o].apply(this,arguments)},getInnerBeforeA:function(e,t,n){for(var o=0,a=_init.innerBeforeA.length;o<a;o++)_init.innerBeforeA[o].apply(this,arguments)},getCache:function(e){return caches[e.treeId]},getNodeIndex:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length-1;a<=r;a++)if(o[a]===t)return a;return-1},getNextNode:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length-1;a<=r;a++)if(o[a]===t)return a==r?null:o[a+1];return null},getNodeByParam:function(e,t,n,o){if(!t||!n)return null;for(var a=0,r=t.length;a<r;a++){var d=t[a];if(d[n]==o)return t[a];var i=data.nodeChildren(e,d),s=data.getNodeByParam(e,i,n,o);if(s)return s}return null},getNodeCache:function(e,t){if(!t)return null;var n=caches[e.treeId].nodes[data.getNodeCacheId(t)];return n||null},getNodePath:function(e,t){return t?((n=t.parentTId?t.getParentNode().getPath():[])&&n.push(t),n):null;var n},getNodes:function(e){return data.nodeChildren(e,data.getRoot(e))},getNodesByParam:function(e,t,n,o){if(!t||!n)return[];for(var a=[],r=0,d=t.length;r<d;r++){var i=t[r];i[n]==o&&a.push(i);var s=data.nodeChildren(e,i);a=a.concat(data.getNodesByParam(e,s,n,o))}return a},getNodesByParamFuzzy:function(e,t,n,o){if(!t||!n)return[];var a=[];o=o.toLowerCase();for(var r=0,d=t.length;r<d;r++){var i=t[r];"string"==typeof i[n]&&-1<t[r][n].toLowerCase().indexOf(o)&&a.push(i);var s=data.nodeChildren(e,i);a=a.concat(data.getNodesByParamFuzzy(e,s,n,o))}return a},getNodesByFilter:function(e,t,n,o,a){if(!t)return o?null:[];for(var r=o?null:[],d=0,i=t.length;d<i;d++){var s=t[d];if(tools.apply(n,[s,a],!1)){if(o)return s;r.push(s)}var l=data.nodeChildren(e,s),c=data.getNodesByFilter(e,l,n,o,a);if(o&&c)return c;r=o?c:r.concat(c)}return r},getPreNode:function(e,t){if(!t)return null;for(var n=t.parentTId?t.getParentNode():data.getRoot(e),o=data.nodeChildren(e,n),a=0,r=o.length;a<r;a++)if(o[a]===t)return 0==a?null:o[a-1];return null},getRoot:function(e){return e?roots[e.treeId]:null},getRoots:function(){return roots},getSetting:function(e){return settings[e]},getSettings:function(){return settings},getZTreeTools:function(e){var t=this.getRoot(this.getSetting(e));return t?t.treeTools:null},initCache:function(e){for(var t=0,n=_init.caches.length;t<n;t++)_init.caches[t].apply(this,arguments)},initNode:function(e,t,n,o,a,r){for(var d=0,i=_init.nodes.length;d<i;d++)_init.nodes[d].apply(this,arguments)},initRoot:function(e){for(var t=0,n=_init.roots.length;t<n;t++)_init.roots[t].apply(this,arguments)},isSelectedNode:function(e,t){for(var n=data.getRoot(e),o=0,a=n.curSelectedList.length;o<a;o++)if(t===n.curSelectedList[o])return!0;return!1},nodeChildren:function(e,t,n){if(!t)return null;var o=e.data.key.children;return void 0!==n&&(t[o]=n),t[o]},nodeIsParent:function(e,t,n){if(!t)return!1;var o=e.data.key.isParent;return void 0!==n?("string"==typeof n&&(n=tools.eqs(n,"true")),n=!!n,t[o]=n):"string"==typeof t[o]?t[o]=tools.eqs(t[o],"true"):t[o]=!!t[o],t[o]},nodeName:function(e,t,n){var o=e.data.key.name;void 0!==n&&(t[o]=n);var a=""+t[o];return"function"==typeof e.data.render.name?e.data.render.name.call(this,a,t):a},nodeTitle:function(e,t){var n=""+t[""===e.data.key.title?e.data.key.name:e.data.key.title];return"function"==typeof e.data.render.title?e.data.render.title.call(this,n,t):n},removeNodeCache:function(e,t){var n=data.nodeChildren(e,t);if(n)for(var o=0,a=n.length;o<a;o++)data.removeNodeCache(e,n[o]);data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=null},removeSelectedNode:function(e,t){for(var n=data.getRoot(e),o=0,a=n.curSelectedList.length;o<a;o++)t!==n.curSelectedList[o]&&data.getNodeCache(e,n.curSelectedList[o].tId)||(n.curSelectedList.splice(o,1),e.treeObj.trigger(consts.event.UNSELECTED,[e.treeId,t]),o--,a--)},setCache:function(e,t){caches[e.treeId]=t},setRoot:function(e,t){roots[e.treeId]=t},setZTreeTools:function(e,t){for(var n=0,o=_init.zTreeTools.length;n<o;n++)_init.zTreeTools[n].apply(this,arguments)},transformToArrayFormat:function(n,e){if(!e)return[];var o=[];if(tools.isArray(e))for(var t=0,a=e.length;t<a;t++){r(e[t])}else r(e);return o;function r(e){o.push(e);var t=data.nodeChildren(n,e);t&&(o=o.concat(data.transformToArrayFormat(n,t)))}},transformTozTreeFormat:function(e,t){var n,o,a=e.data.simpleData.idKey,r=e.data.simpleData.pIdKey;if(!a||""==a||!t)return[];if(tools.isArray(t)){var d=[],i={};for(n=0,o=t.length;n<o;n++)i[t[n][a]]=t[n];for(n=0,o=t.length;n<o;n++){var s=i[t[n][r]];if(s&&t[n][a]!=t[n][r]){var l=data.nodeChildren(e,s);(l=l||data.nodeChildren(e,s,[])).push(t[n])}else d.push(t[n])}return d}return[t]}},event={bindEvent:function(e){for(var t=0,n=_init.bind.length;t<n;t++)_init.bind[t].apply(this,arguments)},unbindEvent:function(e){for(var t=0,n=_init.unbind.length;t<n;t++)_init.unbind[t].apply(this,arguments)},bindTree:function(e){var t={treeId:e.treeId},n=e.treeObj;e.view.txtSelectedEnable||n.bind("selectstart",handler.onSelectStart).css({"-moz-user-select":"-moz-none"}),n.bind("click",t,event.proxy),n.bind("dblclick",t,event.proxy),n.bind("mouseover",t,event.proxy),n.bind("mouseout",t,event.proxy),n.bind("mousedown",t,event.proxy),n.bind("mouseup",t,event.proxy),n.bind("contextmenu",t,event.proxy)},unbindTree:function(e){e.treeObj.unbind("selectstart",handler.onSelectStart).unbind("click",event.proxy).unbind("dblclick",event.proxy).unbind("mouseover",event.proxy).unbind("mouseout",event.proxy).unbind("mousedown",event.proxy).unbind("mouseup",event.proxy).unbind("contextmenu",event.proxy)},doProxy:function(e){for(var t=[],n=0,o=_init.proxys.length;n<o;n++){var a=_init.proxys[n].apply(this,arguments);if(t.push(a),a.stop)break}return t},proxy:function(e){var t=data.getSetting(e.data.treeId);if(!tools.uCanDo(t,e))return!0;for(var n=event.doProxy(e),o=!0,a=0,r=n.length;a<r;a++){var d=n[a];d.nodeEventCallback&&(o=d.nodeEventCallback.apply(d,[e,d.node])&&o),d.treeEventCallback&&(o=d.treeEventCallback.apply(d,[e,d.node])&&o)}return o}},handler={onSwitchNode:function(e,t){var n=data.getSetting(e.data.treeId);if(t.open){if(0==tools.apply(n.callback.beforeCollapse,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}else{if(0==tools.apply(n.callback.beforeExpand,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}return!0},onClickNode:function(e,t){var n=data.getSetting(e.data.treeId),o=n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&data.isSelectedNode(n,t)?0:n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&n.view.selectedMulti?2:1;return 0==tools.apply(n.callback.beforeClick,[n.treeId,t,o],!0)||(0==o?view.cancelPreSelectedNode(n,t):view.selectNode(n,t,2==o),n.treeObj.trigger(consts.event.CLICK,[e,n.treeId,t,o])),!0},onZTreeMousedown:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseDown,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseDown,[e,n.treeId,t]),!0},onZTreeMouseup:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseUp,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseUp,[e,n.treeId,t]),!0},onZTreeDblclick:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeDblClick,[n.treeId,t],!0)&&tools.apply(n.callback.onDblClick,[e,n.treeId,t]),!0},onZTreeContextmenu:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeRightClick,[n.treeId,t],!0)&&tools.apply(n.callback.onRightClick,[e,n.treeId,t]),"function"!=typeof n.callback.onRightClick},onSelectStart:function(e){var t=e.originalEvent.srcElement.nodeName.toLowerCase();return"input"===t||"textarea"===t}},tools={apply:function(e,t,n){return"function"==typeof e?e.apply(zt,t||[]):n},canAsync:function(e,t){var n=data.nodeChildren(e,t),o=data.nodeIsParent(e,t);return e.async.enable&&t&&o&&!(t.zAsync||n&&0<n.length)},clone:function(e){if(null===e)return null;var t=tools.isArray(e)?[]:{};for(var n in e)t[n]=e[n]instanceof Date?new Date(e[n].getTime()):"object"==typeof e[n]?tools.clone(e[n]):e[n];return t},eqs:function(e,t){return e.toLowerCase()===t.toLowerCase()},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},isElement:function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},$:function(e,t,n){return t&&"string"!=typeof t&&(n=t,t=""),"string"==typeof e?$(e,n?n.treeObj.get(0).ownerDocument:null):$("#"+e.tId+t,n?n.treeObj:null)},getMDom:function(e,t,n){if(!t)return null;for(;t&&t.id!==e.treeId;){for(var o=0,a=n.length;t.tagName&&o<a;o++)if(tools.eqs(t.tagName,n[o].tagName)&&null!==t.getAttribute(n[o].attrName))return t;t=t.parentNode}return null},getNodeMainDom:function(e){return $(e).parent("li").get(0)||$(e).parentsUntil("li").parent().get(0)},isChildOrSelf:function(e,t){return 0<$(e).closest("#"+t).length},uCanDo:function(e,t){return!0}},view={addNodes:function(e,t,n,o,a){var r=data.nodeIsParent(e,t);if(!e.data.keep.leaf||!t||r)if(tools.isArray(o)||(o=[o]),e.data.simpleData.enable&&(o=data.transformTozTreeFormat(e,o)),t){var d=$$(t,consts.id.SWITCH,e),i=$$(t,consts.id.ICON,e),s=$$(t,consts.id.UL,e);t.open||(view.replaceSwitchClass(t,d,consts.folder.CLOSE),view.replaceIcoClass(t,i,consts.folder.CLOSE),t.open=!1,s.css({display:"none"})),data.addNodesData(e,t,n,o),view.createNodes(e,t.level+1,o,t,n),a||view.expandCollapseParentNode(e,t,!0)}else data.addNodesData(e,data.getRoot(e),n,o),view.createNodes(e,0,o,null,n)},appendNodes:function(e,t,n,o,a,r,d){if(!n)return[];var i,s,l=[],c=o||data.getRoot(e),u=data.nodeChildren(e,c);(!u||a>=u.length-n.length)&&(a=-1);for(var p=0,f=n.length;p<f;p++){var g=n[p];r&&(i=(0===a||u.length==n.length)&&0==p,s=a<0&&p==n.length-1,data.initNode(e,t,g,o,i,s,d),data.addNodeCache(e,g));var v=data.nodeIsParent(e,g),N=[],h=data.nodeChildren(e,g);h&&0<h.length&&(N=view.appendNodes(e,t+1,h,g,-1,r,d&&g.open)),d&&(view.makeDOMNodeMainBefore(l,e,g),view.makeDOMNodeLine(l,e,g),data.getBeforeA(e,g,l),view.makeDOMNodeNameBefore(l,e,g),data.getInnerBeforeA(e,g,l),view.makeDOMNodeIcon(l,e,g),data.getInnerAfterA(e,g,l),view.makeDOMNodeNameAfter(l,e,g),data.getAfterA(e,g,l),v&&g.open&&view.makeUlHtml(e,g,l,N.join("")),view.makeDOMNodeMainAfter(l,e,g),data.addCreatedNode(e,g))}return l},appendParentULDom:function(e,t){var n=[],o=$$(t,e);!o.get(0)&&t.parentTId&&(view.appendParentULDom(e,t.getParentNode()),o=$$(t,e));var a=$$(t,consts.id.UL,e);a.get(0)&&a.remove();var r=data.nodeChildren(e,t),d=view.appendNodes(e,t.level+1,r,t,-1,!1,!0);view.makeUlHtml(e,t,n,d.join("")),o.append(n.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l,isParent=data.nodeIsParent(setting,node);if(node&&!isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"",class:consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={},autoParam=tools.apply(setting.async.autoParam,[setting.treeId,node],setting.async.autoParam);for(i=0,l=autoParam.length;node&&i<l;i++){var pKey=autoParam[i].split("="),spKey=pKey;1<pKey.length&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}var otherParam=tools.apply(setting.async.otherParam,[setting.treeId,node],setting.async.otherParam);if(tools.isArray(otherParam))for(i=0,l=otherParam.length;i<l;i+=2)tmpParam[otherParam[i]]=otherParam[i+1];else for(var p in otherParam)tmpParam[p]=otherParam[p];var _tmpV=data.getRoot(setting)._ver;return $.ajax({contentType:setting.async.contentType,cache:!1,type:setting.async.type,url:tools.apply(setting.async.url,[setting.treeId,node],setting.async.url),data:-1<setting.async.contentType.indexOf("application/json")?JSON.stringify(tmpParam):tmpParam,dataType:setting.async.dataType,headers:setting.async.headers,xhrFields:setting.async.xhrFields,success:function(msg){if(_tmpV==data.getRoot(setting)._ver){var newNodes=[];try{newNodes=msg&&0!=msg.length?"string"==typeof msg?eval("("+msg+")"):msg:[]}catch(e){newNodes=msg}node&&(node.isAjaxing=null,node.zAsync=!0),view.setNodeLineIcos(setting,node),newNodes&&""!==newNodes?(newNodes=tools.apply(setting.async.dataFilter,[setting.treeId,node,newNodes],newNodes),view.addNodes(setting,node,-1,newNodes?tools.clone(newNodes):[],!!isSilent)):view.addNodes(setting,node,-1,[],!!isSilent),setting.treeObj.trigger(consts.event.ASYNC_SUCCESS,[setting.treeId,node,msg]),tools.apply(callback)}},error:function(e,t,n){_tmpV==data.getRoot(setting)._ver&&(node&&(node.isAjaxing=null),view.setNodeLineIcos(setting,node),setting.treeObj.trigger(consts.event.ASYNC_ERROR,[setting.treeId,node,e,t,n]))}}),!0},cancelPreSelectedNode:function(e,t,n){var o,a,r=data.getRoot(e).curSelectedList;for(o=r.length-1;0<=o;o--)if(t===(a=r[o])||!t&&(!n||n!==a)){if($$(a,consts.id.A,e).removeClass(consts.node.CURSELECTED),t){data.removeSelectedNode(e,t);break}r.splice(o,1),e.treeObj.trigger(consts.event.UNSELECTED,[e.treeId,a])}},createNodeCallback:function(e){if(e.callback.onNodeCreated||e.view.addDiyDom)for(var t=data.getRoot(e);0<t.createdNodes.length;){var n=t.createdNodes.shift();tools.apply(e.view.addDiyDom,[e.treeId,n]),e.callback.onNodeCreated&&e.treeObj.trigger(consts.event.NODECREATED,[e.treeId,n])}},createNodes:function(e,t,n,o,a){if(n&&0!=n.length){var r=data.getRoot(e),d=!o||o.open||!!$$(data.nodeChildren(e,o)[0],e).get(0);r.createdNodes=[];var i,s,l=view.appendNodes(e,t,n,o,a,!0,d);if(o){var c=$$(o,consts.id.UL,e);c.get(0)&&(i=c)}else i=e.treeObj;i&&(0<=a&&(s=i.children()[a]),0<=a&&s?$(s).before(l.join("")):i.append(l.join(""))),view.createNodeCallback(e)}},destroy:function(e){e&&(data.initCache(e),data.initRoot(e),event.unbindTree(e),event.unbindEvent(e),e.treeObj.empty(),delete settings[e.treeId])},expandCollapseNode:function(e,t,n,o,a){var r,d=data.getRoot(e);if(t){var i=data.nodeChildren(e,t),s=data.nodeIsParent(e,t);if(d.expandTriggerFlag&&(r=a,a=function(){r&&r(),t.open?e.treeObj.trigger(consts.event.EXPAND,[e.treeId,t]):e.treeObj.trigger(consts.event.COLLAPSE,[e.treeId,t])},d.expandTriggerFlag=!1),!t.open&&s&&(!$$(t,consts.id.UL,e).get(0)||i&&0<i.length&&!$$(i[0],e).get(0))&&(view.appendParentULDom(e,t),view.createNodeCallback(e)),t.open!=n){var l=$$(t,consts.id.UL,e),c=$$(t,consts.id.SWITCH,e),u=$$(t,consts.id.ICON,e);s?(t.open=!t.open,t.iconOpen&&t.iconClose&&u.attr("style",view.makeNodeIcoStyle(e,t)),t.open?(view.replaceSwitchClass(t,c,consts.folder.OPEN),view.replaceIcoClass(t,u,consts.folder.OPEN),0==o||""==e.view.expandSpeed?(l.show(),tools.apply(a,[])):i&&0<i.length?l.slideDown(e.view.expandSpeed,a):(l.show(),tools.apply(a,[]))):(view.replaceSwitchClass(t,c,consts.folder.CLOSE),view.replaceIcoClass(t,u,consts.folder.CLOSE),0!=o&&""!=e.view.expandSpeed&&i&&0<i.length?l.slideUp(e.view.expandSpeed,a):(l.hide(),tools.apply(a,[])))):tools.apply(a,[])}else tools.apply(a,[])}else tools.apply(a,[])},expandCollapseParentNode:function(e,t,n,o,a){t&&(t.parentTId?(view.expandCollapseNode(e,t,n,o),t.parentTId&&view.expandCollapseParentNode(e,t.getParentNode(),n,o,a)):view.expandCollapseNode(e,t,n,o,a))},expandCollapseSonNode:function(e,t,n,o,a){var r=data.getRoot(e),d=t?data.nodeChildren(e,t):data.nodeChildren(e,r),i=!t&&o,s=data.getRoot(e).expandTriggerFlag;if(data.getRoot(e).expandTriggerFlag=!1,d)for(var l=0,c=d.length;l<c;l++)d[l]&&view.expandCollapseSonNode(e,d[l],n,i);data.getRoot(e).expandTriggerFlag=s,view.expandCollapseNode(e,t,n,o,a)},isSelectedNode:function(e,t){if(!t)return!1;var n,o=data.getRoot(e).curSelectedList;for(n=o.length-1;0<=n;n--)if(t===o[n])return!0;return!1},makeDOMNodeIcon:function(e,t,n){var o=data.nodeName(t,n),a=t.view.nameIsHTML?o:o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.push("<span id='",n.tId,consts.id.ICON,"' title='' treeNode",consts.id.ICON," class='",view.makeNodeIcoClass(t,n),"' style='",view.makeNodeIcoStyle(t,n),"'></span><span id='",n.tId,consts.id.SPAN,"' class='",consts.className.NAME,"'>",a,"</span>")},makeDOMNodeLine:function(e,t,n){e.push("<span id='",n.tId,consts.id.SWITCH,"' title='' class='",view.makeNodeLineClass(t,n),"' treeNode",consts.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(e,t,n){e.push("</li>")},makeDOMNodeMainBefore:function(e,t,n){e.push("<li id='",n.tId,"' class='",consts.className.LEVEL,n.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(e,t,n){e.push("</a>")},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("<a id='",n.tId,consts.id.A,"' class='",consts.className.LEVEL,n.level,d.add?" "+d.add.join(" "):"","' treeNode",consts.id.A,n.click?' onclick="'+n.click+'"':"",null!=a&&0<a.length?" href='"+a+"'":""," target='",view.makeNodeTarget(n),"' style='",i.join(""),"'"),tools.apply(t.view.showTitle,[t.treeId,n],t.view.showTitle)&&o&&e.push("title='",o.replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"'"),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("<ul id='",t.tId,consts.id.UL,"' class='",consts.className.LEVEL,t.level," ",view.makeUlLineClass(e,t),"' style='display:",t.open?"block":"none","'>"),n.push(o),n.push("</ul>")},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;o<a;o++)data.removeNodeCache(e,n[o]);if(data.removeSelectedNode(e),delete t[e.data.key.children],e.data.keep.parent)$$(t,consts.id.UL,e).empty();else{data.nodeIsParent(e,t,!1),t.open=!1;var r=$$(t,consts.id.SWITCH,e),d=$$(t,consts.id.ICON,e);view.replaceSwitchClass(t,r,consts.folder.DOCU),view.replaceIcoClass(t,d,consts.folder.DOCU),$$(t,consts.id.UL,e).remove()}}}},scrollIntoView:function(e,t){if(t)if("undefined"!=typeof Element&&"undefined"!=typeof HTMLElement)Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(n){"use strict";function e(e,t){return{start:e,length:t,end:e+t}}function t(e,t){return!1===n||t.start<e.end&&e.start<t.end?Math.max(e.end-t.length,Math.min(t.start,e.start)):(e.start+e.end-t.length)/2}function a(n,o){return{x:n,y:o,translate:function(e,t){return a(n+e,o+t)}}}function o(e,t){for(;e;)t=t.translate(e.offsetLeft,e.offsetTop),e=e.offsetParent;return t}for(var r,d=o(this,a(0,0)),i=a(this.offsetWidth,this.offsetHeight),s=this.parentNode;s instanceof HTMLElement;)r=o(s,a(s.clientLeft,s.clientTop)),s.scrollLeft=t(e(d.x-r.x,i.x),e(s.scrollLeft,s.clientWidth)),s.scrollTop=t(e(d.y-r.y,i.y),e(s.scrollTop,s.clientHeight)),d=d.translate(-s.scrollLeft,-s.scrollTop),s=s.parentNode}),t.scrollIntoViewIfNeeded();else{var n=e.treeObj.get(0).getBoundingClientRect(),o=t.getBoundingClientRect();(o.top<n.top||o.bottom>n.bottom||o.right>n.right||o.left<n.left)&&t.scrollIntoView()}},setFirstNode:function(e,t){var n=data.nodeChildren(e,t);0<n.length&&(n[0].isFirstNode=!0)},setLastNode:function(e,t){var n=data.nodeChildren(e,t);0<n.length&&(n[n.length-1].isLastNode=!0)},removeNode:function(e,t){var n=data.getRoot(e),o=t.parentTId?t.getParentNode():n;if(t.isFirstNode=!1,t.isLastNode=!1,t.getPreNode=function(){return null},t.getNextNode=function(){return null},data.getNodeCache(e,t.tId)){$$(t,e).remove(),data.removeNodeCache(e,t),data.removeSelectedNode(e,t);for(var a=data.nodeChildren(e,o),r=0,d=a.length;r<d;r++)if(a[r].tId==t.tId){a.splice(r,1);break}view.setFirstNode(e,o),view.setLastNode(e,o);var i,s,l,c=a.length;if(e.data.keep.parent||0!=c){if(e.view.showLine&&0<c){var u=a[c-1];if(i=$$(u,consts.id.UL,e),s=$$(u,consts.id.SWITCH,e),l=$$(u,consts.id.ICON,e),o==n)if(1==a.length)view.replaceSwitchClass(u,s,consts.line.ROOT);else{var p=$$(a[0],consts.id.SWITCH,e);view.replaceSwitchClass(a[0],p,consts.line.ROOTS),view.replaceSwitchClass(u,s,consts.line.BOTTOM)}else view.replaceSwitchClass(u,s,consts.line.BOTTOM);i.removeClass(consts.line.LINE)}}else data.nodeIsParent(e,o,!1),o.open=!1,delete o[e.data.key.children],i=$$(o,consts.id.UL,e),s=$$(o,consts.id.SWITCH,e),l=$$(o,consts.id.ICON,e),view.replaceSwitchClass(o,s,consts.folder.DOCU),view.replaceIcoClass(o,l,consts.folder.DOCU),i.css("display","none")}},replaceIcoClass:function(e,t,n){if(t&&!e.isAjaxing){var o=t.attr("class");if(null!=o){var a=o.split("_");switch(n){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:a[a.length-1]=n}t.attr("class",a.join("_"))}}},replaceSwitchClass:function(e,t,n){if(t){var o=t.attr("class");if(null!=o){var a=o.split("_");switch(n){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:a[0]=view.makeNodeLineClassEx(e)+n;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:a[1]=n}t.attr("class",a.join("_")),n!==consts.folder.DOCU?t.removeAttr("disabled"):t.attr("disabled","disabled")}}},selectNode:function(e,t,n){n||view.cancelPreSelectedNode(e,null,t),$$(t,consts.id.A,e).addClass(consts.node.CURSELECTED),data.addSelectedNode(e,t),e.treeObj.trigger(consts.event.SELECTED,[e.treeId,t])},setNodeFontCss:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeFontCss(e,t);o&&n.css(o)},setNodeClasses:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeClasses(e,t);"add"in o&&o.add.length&&n.addClass(o.add.join(" ")),"remove"in o&&o.remove.length&&n.removeClass(o.remove.join(" "))},setNodeLineIcos:function(e,t){if(t){var n=$$(t,consts.id.SWITCH,e),o=$$(t,consts.id.UL,e),a=$$(t,consts.id.ICON,e),r=view.makeUlLineClass(e,t);0==r.length?o.removeClass(consts.line.LINE):o.addClass(r),n.attr("class",view.makeNodeLineClass(e,t)),data.nodeIsParent(e,t)?n.removeAttr("disabled"):n.attr("disabled","disabled"),a.removeAttr("style"),a.attr("style",view.makeNodeIcoStyle(e,t)),a.attr("class",view.makeNodeIcoClass(e,t))}},setNodeName:function(e,t){var n=data.nodeTitle(e,t),o=$$(t,consts.id.SPAN,e);o.empty(),e.view.nameIsHTML?o.html(data.nodeName(e,t)):o.text(data.nodeName(e,t)),tools.apply(e.view.showTitle,[e.treeId,t],e.view.showTitle)&&$$(t,consts.id.A,e).attr("title",n||"")},setNodeTarget:function(e,t){$$(t,consts.id.A,e).attr("target",view.makeNodeTarget(t))},setNodeUrl:function(e,t){var n=$$(t,consts.id.A,e),o=view.makeNodeUrl(e,t);null==o||0==o.length?n.removeAttr("href"):n.attr("href",o)},switchNode:function(e,t){if(t.open||!tools.canAsync(e,t))view.expandCollapseNode(e,t,!t.open);else if(e.async.enable){if(!view.asyncNode(e,t))return void view.expandCollapseNode(e,t,!t.open)}else t&&view.expandCollapseNode(e,t,!t.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(e){var t=data.getZTreeTools(e);return t||null},destroy:function(e){if(e&&0<e.length)view.destroy(data.getSetting(e));else for(var t in settings)view.destroy(settings[t])},init:function(e,t,n){var s=tools.clone(_setting);$.extend(!0,s,t),s.treeId=e.attr("id"),s.treeObj=e,s.treeObj.empty(),settings[s.treeId]=s,void 0===document.body.style.maxHeight&&(s.view.expandSpeed=""),data.initRoot(s);var o=data.getRoot(s);n=n?tools.clone(tools.isArray(n)?n:[n]):[],s.data.simpleData.enable?data.nodeChildren(s,o,data.transformTozTreeFormat(s,n)):data.nodeChildren(s,o,n),data.initCache(s),event.unbindTree(s),event.bindTree(s),event.unbindEvent(s),event.bindEvent(s);var r={setting:s,addNodes:function(e,t,n,o){e=e||null;var a=data.nodeIsParent(s,e);if(e&&!a&&s.data.keep.leaf)return null;var r=parseInt(t,10);if(t=isNaN(r)?(o=!!n,n=t,-1):r,!n)return null;var d=tools.clone(tools.isArray(n)?n:[n]);function i(){view.addNodes(s,e,t,d,1==o)}return tools.canAsync(s,e)?view.asyncNode(s,e,o,i):i(),d},cancelSelectedNode:function(e){view.cancelPreSelectedNode(s,e)},destroy:function(){view.destroy(s)},expandAll:function(e){return e=!!e,view.expandCollapseSonNode(s,null,e,!0),e},expandNode:function(t,e,n,o,a){return t&&data.nodeIsParent(s,t)?(!0!==e&&!1!==e&&(e=!t.open),(a=!!a)&&e&&0==tools.apply(s.callback.beforeExpand,[s.treeId,t],!0)||a&&!e&&0==tools.apply(s.callback.beforeCollapse,[s.treeId,t],!0)?null:(e&&t.parentTId&&view.expandCollapseParentNode(s,t.getParentNode(),e,!1),e!==t.open||n?(data.getRoot(s).expandTriggerFlag=a,!tools.canAsync(s,t)&&n?view.expandCollapseSonNode(s,t,e,!0,r):(t.open=!e,view.switchNode(this.setting,t),r()),e):null)):null;function r(){var e=$$(t,s).get(0);e&&!1!==o&&view.scrollIntoView(s,e)}},getNodes:function(){return data.getNodes(s)},getNodeByParam:function(e,t,n){return e?data.getNodeByParam(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodeByTId:function(e){return data.getNodeCache(s,e)},getNodesByParam:function(e,t,n){return e?data.getNodesByParam(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodesByParamFuzzy:function(e,t,n){return e?data.getNodesByParamFuzzy(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t):null},getNodesByFilter:function(e,t,n,o){return t=!!t,e&&"function"==typeof e?data.getNodesByFilter(s,n?data.nodeChildren(s,n):data.getNodes(s),e,t,o):t?null:[]},getNodeIndex:function(e){if(!e)return null;for(var t=e.parentTId?e.getParentNode():data.getRoot(s),n=data.nodeChildren(s,t),o=0,a=n.length;o<a;o++)if(n[o]==e)return o;return-1},getSelectedNodes:function(){for(var e=[],t=data.getRoot(s).curSelectedList,n=0,o=t.length;n<o;n++)e.push(t[n]);return e},isSelectedNode:function(e){return data.isSelectedNode(s,e)},reAsyncChildNodesPromise:function(n,o,a){return new Promise(function(e,t){try{r.reAsyncChildNodes(n,o,a,function(){e(n)})}catch(e){t(e)}})},reAsyncChildNodes:function(e,t,n,o){if(this.setting.async.enable){var a=!e;if(a&&(e=data.getRoot(s)),"refresh"==t){for(var r=data.nodeChildren(s,e),d=0,i=r?r.length:0;d<i;d++)data.removeNodeCache(s,r[d]);if(data.removeSelectedNode(s),data.nodeChildren(s,e,[]),a)this.setting.treeObj.empty();else $$(e,consts.id.UL,s).empty()}view.asyncNode(this.setting,a?null:e,!!n,o)}},refresh:function(){this.setting.treeObj.empty();var e=data.getRoot(s),t=data.nodeChildren(s,e);data.initRoot(s),data.nodeChildren(s,e,t),data.initCache(s),view.createNodes(s,0,data.nodeChildren(s,e),null,-1)},removeChildNodes:function(e){if(!e)return null;var t=data.nodeChildren(s,e);return view.removeChildNodes(s,e),t||null},removeNode:function(e,t){e&&((t=!!t)&&0==tools.apply(s.callback.beforeRemove,[s.treeId,e],!0)||(view.removeNode(s,e),t&&this.setting.treeObj.trigger(consts.event.REMOVE,[s.treeId,e])))},selectNode:function(t,e,n){if(t&&tools.uCanDo(s)){if(e=s.view.selectedMulti&&e,t.parentTId)view.expandCollapseParentNode(s,t.getParentNode(),!0,!1,function(){if(n)return;var e=$$(t,s).get(0);view.scrollIntoView(s,e)});else if(!n)try{$$(t,s).focus().blur()}catch(e){}view.selectNode(s,t,e)}},transformTozTreeNodes:function(e){return data.transformTozTreeFormat(s,e)},transformToArray:function(e){return data.transformToArrayFormat(s,e)},updateNode:function(e,t){e&&$$(e,s).get(0)&&tools.uCanDo(s)&&(view.setNodeName(s,e),view.setNodeTarget(s,e),view.setNodeUrl(s,e),view.setNodeLineIcos(s,e),view.setNodeFontCss(s,e),view.setNodeClasses(s,e))}};o.treeTools=r,data.setZTreeTools(s,r);var a=data.nodeChildren(s,o);return a&&0<a.length?view.createNodes(s,0,a,null,-1):s.async.enable&&s.async.url&&""!==s.async.url&&view.asyncNode(s),r}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(jQuery);
\ No newline at end of file
/*
* JQuery zTree excheck
* v3.5.46
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of excheck
var _consts = {
event: {
CHECK: "ztree_check"
},
id: {
CHECK: "_check"
},
checkbox: {
STYLE: "checkbox",
DEFAULT: "chk",
DISABLED: "disable",
FALSE: "false",
TRUE: "true",
FULL: "full",
PART: "part",
FOCUS: "focus"
},
radio: {
STYLE: "radio",
TYPE_ALL: "all",
TYPE_LEVEL: "level"
}
},
//default setting of excheck
_setting = {
check: {
enable: false,
autoCheckTrigger: false,
chkStyle: _consts.checkbox.STYLE,
nocheckInherit: false,
chkDisabledInherit: false,
radioType: _consts.radio.TYPE_LEVEL,
chkboxType: {
"Y": "ps",
"N": "ps"
}
},
data: {
key: {
checked: "checked"
}
},
callback: {
beforeCheck: null,
onCheck: null
}
},
//default root of excheck
_initRoot = function (setting) {
var r = data.getRoot(setting);
r.radioCheckedList = [];
},
//default cache of excheck
_initCache = function (treeId) {
},
//default bind event of excheck
_bindEvent = function (setting) {
var o = setting.treeObj,
c = consts.event;
o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
event.srcEvent = srcEvent;
tools.apply(setting.callback.onCheck, [event, treeId, node]);
});
},
_unbindEvent = function (setting) {
var o = setting.treeObj,
c = consts.event;
o.unbind(c.CHECK);
},
//default event proxy of excheck
_eventProxy = function (e) {
var target = e.target,
setting = data.getSetting(e.data.treeId),
tId = "", node = null,
nodeEventType = "", treeEventType = "",
nodeEventCallback = null, treeEventCallback = null;
if (tools.eqs(e.type, "mouseover")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode" + consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "mouseoverCheck";
}
} else if (tools.eqs(e.type, "mouseout")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode" + consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "mouseoutCheck";
}
} else if (tools.eqs(e.type, "click")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode" + consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "checkNode";
}
}
if (tId.length > 0) {
node = data.getNodeCache(setting, tId);
switch (nodeEventType) {
case "checkNode" :
nodeEventCallback = _handler.onCheckNode;
break;
case "mouseoverCheck" :
nodeEventCallback = _handler.onMouseoverCheck;
break;
case "mouseoutCheck" :
nodeEventCallback = _handler.onMouseoutCheck;
break;
}
}
var proxyResult = {
stop: nodeEventType === "checkNode",
node: node,
nodeEventType: nodeEventType,
nodeEventCallback: nodeEventCallback,
treeEventType: treeEventType,
treeEventCallback: treeEventCallback
};
return proxyResult
},
//default init node of excheck
_initNode = function (setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return;
var checked = data.nodeChecked(setting, n);
n.checkedOld = checked;
if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
n.halfCheck = !!n.halfCheck;
n.check_Child_State = -1;
n.check_Focus = false;
n.getCheckStatus = function () {
return data.getCheckStatus(setting, n);
};
if (setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL && checked) {
var r = data.getRoot(setting);
r.radioCheckedList.push(n);
}
},
//add dom for check
_beforeA = function (setting, node, html) {
if (setting.check.enable) {
data.makeChkFlag(setting, node);
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true ? " style='display:none;'" : ""), "></span>");
}
},
//update zTreeObj, add method of check
_zTreeTools = function (setting, zTreeTools) {
zTreeTools.checkNode = function (node, checked, checkTypeFlag, callbackFlag) {
var nodeChecked = data.nodeChecked(setting, node);
if (node.chkDisabled === true) return;
if (checked !== true && checked !== false) {
checked = !nodeChecked;
}
callbackFlag = !!callbackFlag;
if (nodeChecked === checked && !checkTypeFlag) {
return;
} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
return;
}
if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
data.nodeChecked(setting, node, checked);
var checkObj = $$(node, consts.id.CHECK, this.setting);
if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
view.setChkClass(this.setting, checkObj, node);
view.repairParentChkClassWithSelf(this.setting, node);
if (callbackFlag) {
this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
}
}
}
zTreeTools.checkAllNodes = function (checked) {
view.repairAllChk(this.setting, !!checked);
}
zTreeTools.getCheckedNodes = function (checked) {
checked = (checked !== false);
var children = data.nodeChildren(setting, data.getRoot(this.setting));
return data.getTreeCheckedNodes(this.setting, children, checked);
}
zTreeTools.getChangeCheckedNodes = function () {
var children = data.nodeChildren(setting, data.getRoot(this.setting));
return data.getTreeChangeCheckedNodes(this.setting, children);
}
zTreeTools.setChkDisabled = function (node, disabled, inheritParent, inheritChildren) {
disabled = !!disabled;
inheritParent = !!inheritParent;
inheritChildren = !!inheritChildren;
view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
}
var _updateNode = zTreeTools.updateNode;
zTreeTools.updateNode = function (node, checkTypeFlag) {
if (_updateNode) _updateNode.apply(zTreeTools, arguments);
if (!node || !this.setting.check.enable) return;
var nObj = $$(node, this.setting);
if (nObj.get(0) && tools.uCanDo(this.setting)) {
var checkObj = $$(node, consts.id.CHECK, this.setting);
if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
view.setChkClass(this.setting, checkObj, node);
view.repairParentChkClassWithSelf(this.setting, node);
}
}
},
//method of operate data
_data = {
getRadioCheckedList: function (setting) {
var checkedList = data.getRoot(setting).radioCheckedList;
for (var i = 0, j = checkedList.length; i < j; i++) {
if (!data.getNodeCache(setting, checkedList[i].tId)) {
checkedList.splice(i, 1);
i--;
j--;
}
}
return checkedList;
},
getCheckStatus: function (setting, node) {
if (!setting.check.enable || node.nocheck || node.chkDisabled) return null;
var checked = data.nodeChecked(setting, node),
r = {
checked: checked,
half: node.halfCheck ? node.halfCheck : (setting.check.chkStyle == consts.radio.STYLE ? (node.check_Child_State === 2) : (checked ? (node.check_Child_State > -1 && node.check_Child_State < 2) : (node.check_Child_State > 0)))
};
return r;
},
getTreeCheckedNodes: function (setting, nodes, checked, results) {
if (!nodes) return [];
var onlyOne = (checked && setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL);
results = !results ? [] : results;
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
var children = data.nodeChildren(setting, node);
var nodeChecked = data.nodeChecked(setting, node);
if (node.nocheck !== true && node.chkDisabled !== true && nodeChecked == checked) {
results.push(node);
if (onlyOne) {
break;
}
}
data.getTreeCheckedNodes(setting, children, checked, results);
if (onlyOne && results.length > 0) {
break;
}
}
return results;
},
getTreeChangeCheckedNodes: function (setting, nodes, results) {
if (!nodes) return [];
results = !results ? [] : results;
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
var children = data.nodeChildren(setting, node);
var nodeChecked = data.nodeChecked(setting, node);
if (node.nocheck !== true && node.chkDisabled !== true && nodeChecked != node.checkedOld) {
results.push(node);
}
data.getTreeChangeCheckedNodes(setting, children, results);
}
return results;
},
makeChkFlag: function (setting, node) {
if (!node) return;
var chkFlag = -1;
var children = data.nodeChildren(setting, node);
if (children) {
for (var i = 0, l = children.length; i < l; i++) {
var cNode = children[i];
var nodeChecked = data.nodeChecked(setting, cNode);
var tmp = -1;
if (setting.check.chkStyle == consts.radio.STYLE) {
if (cNode.nocheck === true || cNode.chkDisabled === true) {
tmp = cNode.check_Child_State;
} else if (cNode.halfCheck === true) {
tmp = 2;
} else if (nodeChecked) {
tmp = 2;
} else {
tmp = cNode.check_Child_State > 0 ? 2 : 0;
}
if (tmp == 2) {
chkFlag = 2;
break;
} else if (tmp == 0) {
chkFlag = 0;
}
} else if (setting.check.chkStyle == consts.checkbox.STYLE) {
if (cNode.nocheck === true || cNode.chkDisabled === true) {
tmp = cNode.check_Child_State;
} else if (cNode.halfCheck === true) {
tmp = 1;
} else if (nodeChecked) {
tmp = (cNode.check_Child_State === -1 || cNode.check_Child_State === 2) ? 2 : 1;
} else {
tmp = (cNode.check_Child_State > 0) ? 1 : 0;
}
if (tmp === 1) {
chkFlag = 1;
break;
} else if (tmp === 2 && chkFlag > -1 && i > 0 && tmp !== chkFlag) {
chkFlag = 1;
break;
} else if (chkFlag === 2 && tmp > -1 && tmp < 2) {
chkFlag = 1;
break;
} else if (tmp > -1) {
chkFlag = tmp;
}
}
}
}
node.check_Child_State = chkFlag;
}
},
//method of event proxy
_event = {},
//method of event handler
_handler = {
onCheckNode: function (event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeCheck, [setting.treeId, node], true) == false) return true;
var nodeChecked = data.nodeChecked(setting, node);
data.nodeChecked(setting, node, !nodeChecked);
view.checkNodeRelation(setting, node);
var checkObj = $$(node, consts.id.CHECK, setting);
view.setChkClass(setting, checkObj, node);
view.repairParentChkClassWithSelf(setting, node);
setting.treeObj.trigger(consts.event.CHECK, [event, setting.treeId, node]);
return true;
},
onMouseoverCheck: function (event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId),
checkObj = $$(node, consts.id.CHECK, setting);
node.check_Focus = true;
view.setChkClass(setting, checkObj, node);
return true;
},
onMouseoutCheck: function (event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId),
checkObj = $$(node, consts.id.CHECK, setting);
node.check_Focus = false;
view.setChkClass(setting, checkObj, node);
return true;
}
},
//method of tools for zTree
_tools = {},
//method of operate ztree dom
_view = {
checkNodeRelation: function (setting, node) {
var pNode, i, l,
r = consts.radio;
var nodeChecked = data.nodeChecked(setting, node);
if (setting.check.chkStyle == r.STYLE) {
var checkedList = data.getRadioCheckedList(setting);
if (nodeChecked) {
if (setting.check.radioType == r.TYPE_ALL) {
for (i = checkedList.length - 1; i >= 0; i--) {
pNode = checkedList[i];
var pNodeChecked = data.nodeChecked(setting, pNode);
if (pNodeChecked && pNode != node) {
data.nodeChecked(setting, pNode, false);
checkedList.splice(i, 1);
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
if (pNode.parentTId != node.parentTId) {
view.repairParentChkClassWithSelf(setting, pNode);
}
}
}
checkedList.push(node);
} else {
var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
var children = data.nodeChildren(setting, parentNode);
for (i = 0, l = children.length; i < l; i++) {
pNode = children[i];
var pNodeChecked = data.nodeChecked(setting, pNode);
if (pNodeChecked && pNode != node) {
data.nodeChecked(setting, pNode, false);
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
}
}
}
} else if (setting.check.radioType == r.TYPE_ALL) {
for (i = 0, l = checkedList.length; i < l; i++) {
if (node == checkedList[i]) {
checkedList.splice(i, 1);
break;
}
}
}
} else {
var children = data.nodeChildren(setting, node);
if (nodeChecked && (!children || children.length == 0 || setting.check.chkboxType.Y.indexOf("s") > -1)) {
view.setSonNodeCheckBox(setting, node, true);
}
if (!nodeChecked && (!children || children.length == 0 || setting.check.chkboxType.N.indexOf("s") > -1)) {
view.setSonNodeCheckBox(setting, node, false);
}
if (nodeChecked && setting.check.chkboxType.Y.indexOf("p") > -1) {
view.setParentNodeCheckBox(setting, node, true);
}
if (!nodeChecked && setting.check.chkboxType.N.indexOf("p") > -1) {
view.setParentNodeCheckBox(setting, node, false);
}
}
},
makeChkClass: function (setting, node) {
var c = consts.checkbox, r = consts.radio,
fullStyle = "";
var nodeChecked = data.nodeChecked(setting, node);
if (node.chkDisabled === true) {
fullStyle = c.DISABLED;
} else if (node.halfCheck) {
fullStyle = c.PART;
} else if (setting.check.chkStyle == r.STYLE) {
fullStyle = (node.check_Child_State < 1) ? c.FULL : c.PART;
} else {
fullStyle = nodeChecked ? ((node.check_Child_State === 2 || node.check_Child_State === -1) ? c.FULL : c.PART) : ((node.check_Child_State < 1) ? c.FULL : c.PART);
}
var chkName = setting.check.chkStyle + "_" + (nodeChecked ? c.TRUE : c.FALSE) + "_" + fullStyle;
chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName;
return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName;
},
repairAllChk: function (setting, checked) {
if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {
var root = data.getRoot(setting);
var children = data.nodeChildren(setting, root);
for (var i = 0, l = children.length; i < l; i++) {
var node = children[i];
if (node.nocheck !== true && node.chkDisabled !== true) {
data.nodeChecked(setting, node, checked);
}
view.setSonNodeCheckBox(setting, node, checked);
}
}
},
repairChkClass: function (setting, node) {
if (!node) return;
data.makeChkFlag(setting, node);
if (node.nocheck !== true) {
var checkObj = $$(node, consts.id.CHECK, setting);
view.setChkClass(setting, checkObj, node);
}
},
repairParentChkClass: function (setting, node) {
if (!node || !node.parentTId) return;
var pNode = node.getParentNode();
view.repairChkClass(setting, pNode);
view.repairParentChkClass(setting, pNode);
},
repairParentChkClassWithSelf: function (setting, node) {
if (!node) return;
var children = data.nodeChildren(setting, node);
if (children && children.length > 0) {
view.repairParentChkClass(setting, children[0]);
} else {
view.repairParentChkClass(setting, node);
}
},
repairSonChkDisabled: function (setting, node, chkDisabled, inherit) {
if (!node) return;
if (node.chkDisabled != chkDisabled) {
node.chkDisabled = chkDisabled;
}
view.repairChkClass(setting, node);
var children = data.nodeChildren(setting, node);
if (children && inherit) {
for (var i = 0, l = children.length; i < l; i++) {
var sNode = children[i];
view.repairSonChkDisabled(setting, sNode, chkDisabled, inherit);
}
}
},
repairParentChkDisabled: function (setting, node, chkDisabled, inherit) {
if (!node) return;
if (node.chkDisabled != chkDisabled && inherit) {
node.chkDisabled = chkDisabled;
}
view.repairChkClass(setting, node);
view.repairParentChkDisabled(setting, node.getParentNode(), chkDisabled, inherit);
},
setChkClass: function (setting, obj, node) {
if (!obj) return;
if (node.nocheck === true) {
obj.hide();
} else {
obj.show();
}
obj.attr('class', view.makeChkClass(setting, node));
},
setParentNodeCheckBox: function (setting, node, value, srcNode) {
var checkObj = $$(node, consts.id.CHECK, setting);
if (!srcNode) srcNode = node;
data.makeChkFlag(setting, node);
if (node.nocheck !== true && node.chkDisabled !== true) {
data.nodeChecked(setting, node, value);
view.setChkClass(setting, checkObj, node);
if (setting.check.autoCheckTrigger && node != srcNode) {
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
}
}
if (node.parentTId) {
var pSign = true;
if (!value) {
var pNodes = data.nodeChildren(setting, node.getParentNode());
for (var i = 0, l = pNodes.length; i < l; i++) {
var pNode = pNodes[i];
var nodeChecked = data.nodeChecked(setting, pNode);
if ((pNode.nocheck !== true && pNode.chkDisabled !== true && nodeChecked)
|| ((pNode.nocheck === true || pNode.chkDisabled === true) && pNode.check_Child_State > 0)) {
pSign = false;
break;
}
}
}
if (pSign) {
view.setParentNodeCheckBox(setting, node.getParentNode(), value, srcNode);
}
}
},
setSonNodeCheckBox: function (setting, node, value, srcNode) {
if (!node) return;
var checkObj = $$(node, consts.id.CHECK, setting);
if (!srcNode) srcNode = node;
var hasDisable = false;
var children = data.nodeChildren(setting, node);
if (children) {
for (var i = 0, l = children.length; i < l; i++) {
var sNode = children[i];
view.setSonNodeCheckBox(setting, sNode, value, srcNode);
if (sNode.chkDisabled === true) hasDisable = true;
}
}
if (node != data.getRoot(setting) && node.chkDisabled !== true) {
if (hasDisable && node.nocheck !== true) {
data.makeChkFlag(setting, node);
}
if (node.nocheck !== true && node.chkDisabled !== true) {
data.nodeChecked(setting, node, value);
if (!hasDisable) node.check_Child_State = (children && children.length > 0) ? (value ? 2 : 0) : -1;
} else {
node.check_Child_State = -1;
}
view.setChkClass(setting, checkObj, node);
if (setting.check.autoCheckTrigger && node != srcNode && node.nocheck !== true && node.chkDisabled !== true) {
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
}
}
}
},
_z = {
tools: _tools,
view: _view,
event: _event,
data: _data
};
$.extend(true, $.fn.zTree.consts, _consts);
$.extend(true, $.fn.zTree._z, _z);
var zt = $.fn.zTree,
tools = zt._z.tools,
consts = zt.consts,
view = zt._z.view,
data = zt._z.data,
event = zt._z.event,
$$ = tools.$;
data.nodeChecked = function (setting, node, newChecked) {
if (!node) {
return false;
}
var key = setting.data.key.checked;
if (typeof newChecked !== 'undefined') {
if (typeof newChecked === "string") {
newChecked = tools.eqs(newChecked, "true");
}
newChecked = !!newChecked;
node[key] = newChecked;
} else if (typeof node[key] == "string"){
node[key] = tools.eqs(node[key], "true");
} else {
node[key] = !!node[key];
}
return node[key];
};
data.exSetting(_setting);
data.addInitBind(_bindEvent);
data.addInitUnBind(_unbindEvent);
data.addInitCache(_initCache);
data.addInitNode(_initNode);
data.addInitProxy(_eventProxy, true);
data.addInitRoot(_initRoot);
data.addBeforeA(_beforeA);
data.addZTreeTools(_zTreeTools);
var _createNodes = view.createNodes;
view.createNodes = function (setting, level, nodes, parentNode, index) {
if (_createNodes) _createNodes.apply(view, arguments);
if (!nodes) return;
view.repairParentChkClassWithSelf(setting, parentNode);
}
var _removeNode = view.removeNode;
view.removeNode = function (setting, node) {
var parentNode = node.getParentNode();
if (_removeNode) _removeNode.apply(view, arguments);
if (!node || !parentNode) return;
view.repairChkClass(setting, parentNode);
view.repairParentChkClass(setting, parentNode);
}
var _appendNodes = view.appendNodes;
view.appendNodes = function (setting, level, nodes, parentNode, index, initFlag, openFlag) {
var html = "";
if (_appendNodes) {
html = _appendNodes.apply(view, arguments);
}
if (parentNode) {
data.makeChkFlag(setting, parentNode);
}
return html;
}
})(jQuery);
\ No newline at end of file
!function(e){var t={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},c={check:{enable:!1,autoCheckTrigger:!1,chkStyle:t.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:t.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},r={onCheckNode:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId);if(0==o.apply(c.callback.beforeCheck,[c.treeId,t],!0))return!0;var h=C.nodeChecked(c,t);C.nodeChecked(c,t,!h),l.checkNodeRelation(c,t);var a=f(t,s.id.CHECK,c);return l.setChkClass(c,a,t),l.repairParentChkClassWithSelf(c,t),c.treeObj.trigger(s.event.CHECK,[e,c.treeId,t]),!0},onMouseoverCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!0,l.setChkClass(c,h,t),!0},onMouseoutCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!1,l.setChkClass(c,h,t),!0}},h={tools:{},view:{checkNodeRelation:function(e,t){var c,h,a,n=s.radio,i=C.nodeChecked(e,t);if(e.check.chkStyle==n.STYLE){var r=C.getRadioCheckedList(e);if(i)if(e.check.radioType==n.TYPE_ALL){for(h=r.length-1;0<=h;h--){c=r[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),r.splice(h,1),l.setChkClass(e,f(c,s.id.CHECK,e),c),c.parentTId!=t.parentTId&&l.repairParentChkClassWithSelf(e,c))}r.push(t)}else{var o=t.parentTId?t.getParentNode():C.getRoot(e);for(h=0,a=(d=C.nodeChildren(e,o)).length;h<a;h++){c=d[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),l.setChkClass(e,f(c,s.id.CHECK,e),c))}}else if(e.check.radioType==n.TYPE_ALL)for(h=0,a=r.length;h<a;h++)if(t==r[h]){r.splice(h,1);break}}else{var d=C.nodeChildren(e,t);i&&(!d||0==d.length||-1<e.check.chkboxType.Y.indexOf("s"))&&l.setSonNodeCheckBox(e,t,!0),i||d&&0!=d.length&&!(-1<e.check.chkboxType.N.indexOf("s"))||l.setSonNodeCheckBox(e,t,!1),i&&-1<e.check.chkboxType.Y.indexOf("p")&&l.setParentNodeCheckBox(e,t,!0),!i&&-1<e.check.chkboxType.N.indexOf("p")&&l.setParentNodeCheckBox(e,t,!1)}},makeChkClass:function(e,t){var c=s.checkbox,h=s.radio,a="",n=C.nodeChecked(e,t);a=!0===t.chkDisabled?c.DISABLED:t.halfCheck?c.PART:e.check.chkStyle==h.STYLE?t.check_Child_State<1?c.FULL:c.PART:n?2===t.check_Child_State||-1===t.check_Child_State?c.FULL:c.PART:t.check_Child_State<1?c.FULL:c.PART;var i=e.check.chkStyle+"_"+(n?c.TRUE:c.FALSE)+"_"+a;return i=t.check_Focus&&!0!==t.chkDisabled?i+"_"+c.FOCUS:i,s.className.BUTTON+" "+c.DEFAULT+" "+i},repairAllChk:function(e,t){if(e.check.enable&&e.check.chkStyle===s.checkbox.STYLE)for(var c=C.getRoot(e),h=C.nodeChildren(e,c),a=0,n=h.length;a<n;a++){var i=h[a];!0!==i.nocheck&&!0!==i.chkDisabled&&C.nodeChecked(e,i,t),l.setSonNodeCheckBox(e,i,t)}},repairChkClass:function(e,t){if(t&&(C.makeChkFlag(e,t),!0!==t.nocheck)){var c=f(t,s.id.CHECK,e);l.setChkClass(e,c,t)}},repairParentChkClass:function(e,t){if(t&&t.parentTId){var c=t.getParentNode();l.repairChkClass(e,c),l.repairParentChkClass(e,c)}},repairParentChkClassWithSelf:function(e,t){if(t){var c=C.nodeChildren(e,t);c&&0<c.length?l.repairParentChkClass(e,c[0]):l.repairParentChkClass(e,t)}},repairSonChkDisabled:function(e,t,c,h){if(t){t.chkDisabled!=c&&(t.chkDisabled=c),l.repairChkClass(e,t);var a=C.nodeChildren(e,t);if(a&&h)for(var n=0,i=a.length;n<i;n++){var r=a[n];l.repairSonChkDisabled(e,r,c,h)}}},repairParentChkDisabled:function(e,t,c,h){t&&(t.chkDisabled!=c&&h&&(t.chkDisabled=c),l.repairChkClass(e,t),l.repairParentChkDisabled(e,t.getParentNode(),c,h))},setChkClass:function(e,t,c){t&&(!0===c.nocheck?t.hide():t.show(),t.attr("class",l.makeChkClass(e,c)))},setParentNodeCheckBox:function(e,t,c,h){var a=f(t,s.id.CHECK,e);if(h=h||t,C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled&&(C.nodeChecked(e,t,c),l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t])),t.parentTId){var n=!0;if(!c)for(var i=C.nodeChildren(e,t.getParentNode()),r=0,o=i.length;r<o;r++){var d=i[r],k=C.nodeChecked(e,d);if(!0!==d.nocheck&&!0!==d.chkDisabled&&k||(!0===d.nocheck||!0===d.chkDisabled)&&0<d.check_Child_State){n=!1;break}}n&&l.setParentNodeCheckBox(e,t.getParentNode(),c,h)}},setSonNodeCheckBox:function(e,t,c,h){if(t){var a=f(t,s.id.CHECK,e);h=h||t;var n=!1,i=C.nodeChildren(e,t);if(i)for(var r=0,o=i.length;r<o;r++){var d=i[r];l.setSonNodeCheckBox(e,d,c,h),!0===d.chkDisabled&&(n=!0)}t!=C.getRoot(e)&&!0!==t.chkDisabled&&(n&&!0!==t.nocheck&&C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled?(C.nodeChecked(e,t,c),n||(t.check_Child_State=i&&0<i.length?c?2:0:-1)):t.check_Child_State=-1,l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&!0!==t.nocheck&&!0!==t.chkDisabled&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t]))}}},event:{},data:{getRadioCheckedList:function(e){for(var t=C.getRoot(e).radioCheckedList,c=0,h=t.length;c<h;c++)C.getNodeCache(e,t[c].tId)||(t.splice(c,1),c--,h--);return t},getCheckStatus:function(e,t){if(!e.check.enable||t.nocheck||t.chkDisabled)return null;var c=C.nodeChecked(e,t);return{checked:c,half:t.halfCheck?t.halfCheck:e.check.chkStyle==s.radio.STYLE?2===t.check_Child_State:c?-1<t.check_Child_State&&t.check_Child_State<2:0<t.check_Child_State}},getTreeCheckedNodes:function(e,t,c,h){if(!t)return[];var a=c&&e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL;h=h||[];for(var n=0,i=t.length;n<i;n++){var r=t[n],o=C.nodeChildren(e,r),d=C.nodeChecked(e,r);if(!0!==r.nocheck&&!0!==r.chkDisabled&&d==c&&(h.push(r),a))break;if(C.getTreeCheckedNodes(e,o,c,h),a&&0<h.length)break}return h},getTreeChangeCheckedNodes:function(e,t,c){if(!t)return[];c=c||[];for(var h=0,a=t.length;h<a;h++){var n=t[h],i=C.nodeChildren(e,n),r=C.nodeChecked(e,n);!0!==n.nocheck&&!0!==n.chkDisabled&&r!=n.checkedOld&&c.push(n),C.getTreeChangeCheckedNodes(e,i,c)}return c},makeChkFlag:function(e,t){if(t){var c=-1,h=C.nodeChildren(e,t);if(h)for(var a=0,n=h.length;a<n;a++){var i=h[a],r=C.nodeChecked(e,i),o=-1;if(e.check.chkStyle==s.radio.STYLE){if(2==(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck||r||0<i.check_Child_State?2:0)){c=2;break}0==o&&(c=0)}else if(e.check.chkStyle==s.checkbox.STYLE){if(1===(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck?1:r?-1===i.check_Child_State||2===i.check_Child_State?2:1:0<i.check_Child_State?1:0)){c=1;break}if(2===o&&-1<c&&0<a&&o!==c){c=1;break}if(2===c&&-1<o&&o<2){c=1;break}-1<o&&(c=o)}}t.check_Child_State=c}}}};e.extend(!0,e.fn.zTree.consts,t),e.extend(!0,e.fn.zTree._z,h);var a=e.fn.zTree,o=a._z.tools,s=a.consts,l=a._z.view,C=a._z.data,f=(a._z.event,o.$);C.nodeChecked=function(e,t,c){if(!t)return!1;var h=e.data.key.checked;return void 0!==c?("string"==typeof c&&(c=o.eqs(c,"true")),c=!!c,t[h]=c):"string"==typeof t[h]?t[h]=o.eqs(t[h],"true"):t[h]=!!t[h],t[h]},C.exSetting(c),C.addInitBind(function(a){var e=a.treeObj,t=s.event;e.bind(t.CHECK,function(e,t,c,h){e.srcEvent=t,o.apply(a.callback.onCheck,[e,c,h])})}),C.addInitUnBind(function(e){var t=e.treeObj,c=s.event;t.unbind(c.CHECK)}),C.addInitCache(function(e){}),C.addInitNode(function(e,t,c,h,a,n,i){if(c){var r=C.nodeChecked(e,c);if(c.checkedOld=r,"string"==typeof c.nocheck&&(c.nocheck=o.eqs(c.nocheck,"true")),c.nocheck=!!c.nocheck||e.check.nocheckInherit&&h&&!!h.nocheck,"string"==typeof c.chkDisabled&&(c.chkDisabled=o.eqs(c.chkDisabled,"true")),c.chkDisabled=!!c.chkDisabled||e.check.chkDisabledInherit&&h&&!!h.chkDisabled,"string"==typeof c.halfCheck&&(c.halfCheck=o.eqs(c.halfCheck,"true")),c.halfCheck=!!c.halfCheck,c.check_Child_State=-1,c.check_Focus=!1,c.getCheckStatus=function(){return C.getCheckStatus(e,c)},e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL&&r)C.getRoot(e).radioCheckedList.push(c)}}),C.addInitProxy(function(e){var t=e.target,c=C.getSetting(e.data.treeId),h="",a=null,n="",i=null;if(o.eqs(e.type,"mouseover")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoverCheck"):o.eqs(e.type,"mouseout")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoutCheck"):o.eqs(e.type,"click")&&c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="checkNode"),0<h.length)switch(a=C.getNodeCache(c,h),n){case"checkNode":i=r.onCheckNode;break;case"mouseoverCheck":i=r.onMouseoverCheck;break;case"mouseoutCheck":i=r.onMouseoutCheck}return{stop:"checkNode"===n,node:a,nodeEventType:n,nodeEventCallback:i,treeEventType:"",treeEventCallback:null}},!0),C.addInitRoot(function(e){C.getRoot(e).radioCheckedList=[]}),C.addBeforeA(function(e,t,c){e.check.enable&&(C.makeChkFlag(e,t),c.push("<span ID='",t.tId,s.id.CHECK,"' class='",l.makeChkClass(e,t),"' treeNode",s.id.CHECK,!0===t.nocheck?" style='display:none;'":"","></span>"))}),C.addZTreeTools(function(i,h){h.checkNode=function(e,t,c,h){var a=C.nodeChecked(i,e);if(!0!==e.chkDisabled&&(!0!==t&&!1!==t&&(t=!a),h=!!h,(a!==t||c)&&(!h||0!=o.apply(this.setting.callback.beforeCheck,[this.setting.treeId,e],!0))&&o.uCanDo(this.setting)&&this.setting.check.enable&&!0!==e.nocheck)){C.nodeChecked(i,e,t);var n=f(e,s.id.CHECK,this.setting);!c&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,n,e),l.repairParentChkClassWithSelf(this.setting,e),h&&this.setting.treeObj.trigger(s.event.CHECK,[null,this.setting.treeId,e])}},h.checkAllNodes=function(e){l.repairAllChk(this.setting,!!e)},h.getCheckedNodes=function(e){e=!1!==e;var t=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeCheckedNodes(this.setting,t,e)},h.getChangeCheckedNodes=function(){var e=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeChangeCheckedNodes(this.setting,e)},h.setChkDisabled=function(e,t,c,h){t=!!t,c=!!c,h=!!h,l.repairSonChkDisabled(this.setting,e,t,h),l.repairParentChkDisabled(this.setting,e.getParentNode(),t,c)};var a=h.updateNode;h.updateNode=function(e,t){if((a&&a.apply(h,arguments),e&&this.setting.check.enable)&&(f(e,this.setting).get(0)&&o.uCanDo(this.setting))){var c=f(e,s.id.CHECK,this.setting);1!=t&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,c,e),l.repairParentChkClassWithSelf(this.setting,e)}}});var n=l.createNodes;l.createNodes=function(e,t,c,h,a){n&&n.apply(l,arguments),c&&l.repairParentChkClassWithSelf(e,h)};var i=l.removeNode;l.removeNode=function(e,t){var c=t.getParentNode();i&&i.apply(l,arguments),t&&c&&(l.repairChkClass(e,c),l.repairParentChkClass(e,c))};var d=l.appendNodes;l.appendNodes=function(e,t,c,h,a,n,i){var r="";return d&&(r=d.apply(l,arguments)),h&&C.makeChkFlag(e,h),r}}(jQuery);
\ No newline at end of file
/*
* JQuery zTree exedit
* v3.5.46
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of exedit
var _consts = {
event: {
DRAG: "ztree_drag",
DROP: "ztree_drop",
RENAME: "ztree_rename",
DRAGMOVE: "ztree_dragmove"
},
id: {
EDIT: "_edit",
INPUT: "_input",
REMOVE: "_remove"
},
move: {
TYPE_INNER: "inner",
TYPE_PREV: "prev",
TYPE_NEXT: "next"
},
node: {
CURSELECTED_EDIT: "curSelectedNode_Edit",
TMPTARGET_TREE: "tmpTargetzTree",
TMPTARGET_NODE: "tmpTargetNode"
}
},
//default setting of exedit
_setting = {
edit: {
enable: false,
editNameSelectAll: false,
showRemoveBtn: true,
showRenameBtn: true,
removeTitle: "remove",
renameTitle: "rename",
drag: {
autoExpandTrigger: false,
isCopy: true,
isMove: true,
prev: true,
next: true,
inner: true,
minMoveSize: 5,
borderMax: 10,
borderMin: -5,
maxShowNodeNum: 5,
autoOpenTime: 500
}
},
view: {
addHoverDom: null,
removeHoverDom: null
},
callback: {
beforeDrag: null,
beforeDragOpen: null,
beforeDrop: null,
beforeEditName: null,
beforeRename: null,
onDrag: null,
onDragMove: null,
onDrop: null,
onRename: null
}
},
//default root of exedit
_initRoot = function (setting) {
var r = data.getRoot(setting), rs = data.getRoots();
r.curEditNode = null;
r.curEditInput = null;
r.curHoverNode = null;
r.dragFlag = 0;
r.dragNodeShowBefore = [];
r.dragMaskList = new Array();
rs.showHoverDom = true;
},
//default cache of exedit
_initCache = function (treeId) {
},
//default bind event of exedit
_bindEvent = function (setting) {
var o = setting.treeObj;
var c = consts.event;
o.bind(c.RENAME, function (event, treeId, treeNode, isCancel) {
tools.apply(setting.callback.onRename, [event, treeId, treeNode, isCancel]);
});
o.bind(c.DRAG, function (event, srcEvent, treeId, treeNodes) {
tools.apply(setting.callback.onDrag, [srcEvent, treeId, treeNodes]);
});
o.bind(c.DRAGMOVE, function (event, srcEvent, treeId, treeNodes) {
tools.apply(setting.callback.onDragMove, [srcEvent, treeId, treeNodes]);
});
o.bind(c.DROP, function (event, srcEvent, treeId, treeNodes, targetNode, moveType, isCopy) {
tools.apply(setting.callback.onDrop, [srcEvent, treeId, treeNodes, targetNode, moveType, isCopy]);
});
},
_unbindEvent = function (setting) {
var o = setting.treeObj;
var c = consts.event;
o.unbind(c.RENAME);
o.unbind(c.DRAG);
o.unbind(c.DRAGMOVE);
o.unbind(c.DROP);
},
//default event proxy of exedit
_eventProxy = function (e) {
var target = e.target,
setting = data.getSetting(e.data.treeId),
relatedTarget = e.relatedTarget,
tId = "", node = null,
nodeEventType = "", treeEventType = "",
nodeEventCallback = null, treeEventCallback = null,
tmp = null;
if (tools.eqs(e.type, "mouseover")) {
tmp = tools.getMDom(setting, target, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "hoverOverNode";
}
} else if (tools.eqs(e.type, "mouseout")) {
tmp = tools.getMDom(setting, relatedTarget, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (!tmp) {
tId = "remove";
nodeEventType = "hoverOutNode";
}
} else if (tools.eqs(e.type, "mousedown")) {
tmp = tools.getMDom(setting, target, [{tagName: "a", attrName: "treeNode" + consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "mousedownNode";
}
}
if (tId.length > 0) {
node = data.getNodeCache(setting, tId);
switch (nodeEventType) {
case "mousedownNode" :
nodeEventCallback = _handler.onMousedownNode;
break;
case "hoverOverNode" :
nodeEventCallback = _handler.onHoverOverNode;
break;
case "hoverOutNode" :
nodeEventCallback = _handler.onHoverOutNode;
break;
}
}
var proxyResult = {
stop: false,
node: node,
nodeEventType: nodeEventType,
nodeEventCallback: nodeEventCallback,
treeEventType: treeEventType,
treeEventCallback: treeEventCallback
};
return proxyResult
},
//default init node of exedit
_initNode = function (setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return;
n.isHover = false;
n.editNameFlag = false;
},
//update zTreeObj, add method of edit
_zTreeTools = function (setting, zTreeTools) {
zTreeTools.cancelEditName = function (newName) {
var root = data.getRoot(this.setting);
if (!root.curEditNode) return;
view.cancelCurEditNode(this.setting, newName ? newName : null, true);
}
zTreeTools.copyNode = function (targetNode, node, moveType, isSilent) {
if (!node) return null;
var isParent = data.nodeIsParent(setting, targetNode);
if (targetNode && !isParent && this.setting.data.keep.leaf && moveType === consts.move.TYPE_INNER) return null;
var _this = this,
newNode = tools.clone(node);
if (!targetNode) {
targetNode = null;
moveType = consts.move.TYPE_INNER;
}
if (moveType == consts.move.TYPE_INNER) {
function copyCallback() {
view.addNodes(_this.setting, targetNode, -1, [newNode], isSilent);
}
if (tools.canAsync(this.setting, targetNode)) {
view.asyncNode(this.setting, targetNode, isSilent, copyCallback);
} else {
copyCallback();
}
} else {
view.addNodes(this.setting, targetNode.parentNode, -1, [newNode], isSilent);
view.moveNode(this.setting, targetNode, newNode, moveType, false, isSilent);
}
return newNode;
}
zTreeTools.editName = function (node) {
if (!node || !node.tId || node !== data.getNodeCache(this.setting, node.tId)) return;
if (node.parentTId) view.expandCollapseParentNode(this.setting, node.getParentNode(), true);
view.editNode(this.setting, node)
}
zTreeTools.moveNode = function (targetNode, node, moveType, isSilent) {
if (!node) return node;
var isParent = data.nodeIsParent(setting, targetNode);
if (targetNode && !isParent && this.setting.data.keep.leaf && moveType === consts.move.TYPE_INNER) {
return null;
} else if (targetNode && ((node.parentTId == targetNode.tId && moveType == consts.move.TYPE_INNER) || $$(node, this.setting).find("#" + targetNode.tId).length > 0)) {
return null;
} else if (!targetNode) {
targetNode = null;
}
var _this = this;
function moveCallback() {
view.moveNode(_this.setting, targetNode, node, moveType, false, isSilent);
}
if (tools.canAsync(this.setting, targetNode) && moveType === consts.move.TYPE_INNER) {
view.asyncNode(this.setting, targetNode, isSilent, moveCallback);
} else {
moveCallback();
}
return node;
}
zTreeTools.setEditable = function (editable) {
this.setting.edit.enable = editable;
return this.refresh();
}
},
//method of operate data
_data = {
setSonNodeLevel: function (setting, parentNode, node) {
if (!node) return;
var children = data.nodeChildren(setting, node);
node.level = (parentNode) ? parentNode.level + 1 : 0;
if (!children) return;
for (var i = 0, l = children.length; i < l; i++) {
if (children[i]) data.setSonNodeLevel(setting, node, children[i]);
}
}
},
//method of event proxy
_event = {},
//method of event handler
_handler = {
onHoverOverNode: function (event, node) {
var setting = data.getSetting(event.data.treeId),
root = data.getRoot(setting);
if (root.curHoverNode != node) {
_handler.onHoverOutNode(event);
}
root.curHoverNode = node;
view.addHoverDom(setting, node);
},
onHoverOutNode: function (event, node) {
var setting = data.getSetting(event.data.treeId),
root = data.getRoot(setting);
if (root.curHoverNode && !data.isSelectedNode(setting, root.curHoverNode)) {
view.removeTreeDom(setting, root.curHoverNode);
root.curHoverNode = null;
}
},
onMousedownNode: function (eventMouseDown, _node) {
var i, l,
setting = data.getSetting(eventMouseDown.data.treeId),
root = data.getRoot(setting), roots = data.getRoots();
//right click can't drag & drop
if (eventMouseDown.button == 2 || !setting.edit.enable || (!setting.edit.drag.isCopy && !setting.edit.drag.isMove)) return true;
//input of edit node name can't drag & drop
var target = eventMouseDown.target,
_nodes = data.getRoot(setting).curSelectedList,
nodes = [];
if (!data.isSelectedNode(setting, _node)) {
nodes = [_node];
} else {
for (i = 0, l = _nodes.length; i < l; i++) {
if (_nodes[i].editNameFlag && tools.eqs(target.tagName, "input") && target.getAttribute("treeNode" + consts.id.INPUT) !== null) {
return true;
}
nodes.push(_nodes[i]);
if (nodes[0].parentTId !== _nodes[i].parentTId) {
nodes = [_node];
break;
}
}
}
view.editNodeBlur = true;
view.cancelCurEditNode(setting);
var doc = $(setting.treeObj.get(0).ownerDocument),
body = $(setting.treeObj.get(0).ownerDocument.body), curNode, tmpArrow, tmpTarget,
isOtherTree = false,
targetSetting = setting,
sourceSetting = setting,
preNode, nextNode,
preTmpTargetNodeId = null,
preTmpMoveType = null,
tmpTargetNodeId = null,
moveType = consts.move.TYPE_INNER,
mouseDownX = eventMouseDown.clientX,
mouseDownY = eventMouseDown.clientY,
startTime = (new Date()).getTime();
if (tools.uCanDo(setting)) {
doc.bind("mousemove", _docMouseMove);
}
function _docMouseMove(event) {
//avoid start drag after click node
if (root.dragFlag == 0 && Math.abs(mouseDownX - event.clientX) < setting.edit.drag.minMoveSize
&& Math.abs(mouseDownY - event.clientY) < setting.edit.drag.minMoveSize) {
return true;
}
var i, l, tmpNode, tmpDom, tmpNodes;
body.css("cursor", "pointer");
if (root.dragFlag == 0) {
if (tools.apply(setting.callback.beforeDrag, [setting.treeId, nodes], true) == false) {
_docMouseUp(event);
return true;
}
for (i = 0, l = nodes.length; i < l; i++) {
if (i == 0) {
root.dragNodeShowBefore = [];
}
tmpNode = nodes[i];
if (data.nodeIsParent(setting, tmpNode) && tmpNode.open) {
view.expandCollapseNode(setting, tmpNode, !tmpNode.open);
root.dragNodeShowBefore[tmpNode.tId] = true;
} else {
root.dragNodeShowBefore[tmpNode.tId] = false;
}
}
root.dragFlag = 1;
roots.showHoverDom = false;
tools.showIfameMask(setting, true);
//sort
var isOrder = true, lastIndex = -1;
if (nodes.length > 1) {
var pNodes = nodes[0].parentTId ? data.nodeChildren(setting, nodes[0].getParentNode()) : data.getNodes(setting);
tmpNodes = [];
for (i = 0, l = pNodes.length; i < l; i++) {
if (root.dragNodeShowBefore[pNodes[i].tId] !== undefined) {
if (isOrder && lastIndex > -1 && (lastIndex + 1) !== i) {
isOrder = false;
}
tmpNodes.push(pNodes[i]);
lastIndex = i;
}
if (nodes.length === tmpNodes.length) {
nodes = tmpNodes;
break;
}
}
}
if (isOrder) {
preNode = nodes[0].getPreNode();
nextNode = nodes[nodes.length - 1].getNextNode();
}
//set node in selected
curNode = $$("<ul class='zTreeDragUL'></ul>", setting);
for (i = 0, l = nodes.length; i < l; i++) {
tmpNode = nodes[i];
tmpNode.editNameFlag = false;
view.selectNode(setting, tmpNode, i > 0);
view.removeTreeDom(setting, tmpNode);
if (i > setting.edit.drag.maxShowNodeNum - 1) {
continue;
}
tmpDom = $$("<li id='" + tmpNode.tId + "_tmp'></li>", setting);
tmpDom.append($$(tmpNode, consts.id.A, setting).clone());
tmpDom.css("padding", "0");
tmpDom.children("#" + tmpNode.tId + consts.id.A).removeClass(consts.node.CURSELECTED);
curNode.append(tmpDom);
if (i == setting.edit.drag.maxShowNodeNum - 1) {
tmpDom = $$("<li id='" + tmpNode.tId + "_moretmp'><a> ... </a></li>", setting);
curNode.append(tmpDom);
}
}
curNode.attr("id", nodes[0].tId + consts.id.UL + "_tmp");
curNode.addClass(setting.treeObj.attr("class"));
curNode.appendTo(body);
tmpArrow = $$("<span class='tmpzTreeMove_arrow'></span>", setting);
tmpArrow.attr("id", "zTreeMove_arrow_tmp");
tmpArrow.appendTo(body);
setting.treeObj.trigger(consts.event.DRAG, [event, setting.treeId, nodes]);
}
if (root.dragFlag == 1) {
if (tmpTarget && tmpArrow.attr("id") == event.target.id && tmpTargetNodeId && (event.clientX + doc.scrollLeft() + 2) > ($("#" + tmpTargetNodeId + consts.id.A, tmpTarget).offset().left)) {
var xT = $("#" + tmpTargetNodeId + consts.id.A, tmpTarget);
event.target = (xT.length > 0) ? xT.get(0) : event.target;
} else if (tmpTarget) {
tmpTarget.removeClass(consts.node.TMPTARGET_TREE);
if (tmpTargetNodeId) $("#" + tmpTargetNodeId + consts.id.A, tmpTarget).removeClass(consts.node.TMPTARGET_NODE + "_" + consts.move.TYPE_PREV)
.removeClass(consts.node.TMPTARGET_NODE + "_" + _consts.move.TYPE_NEXT).removeClass(consts.node.TMPTARGET_NODE + "_" + _consts.move.TYPE_INNER);
}
tmpTarget = null;
tmpTargetNodeId = null;
//judge drag & drop in multi ztree
isOtherTree = false;
targetSetting = setting;
var settings = data.getSettings();
for (var s in settings) {
if (settings[s].treeId && settings[s].edit.enable && settings[s].treeId != setting.treeId
&& (event.target.id == settings[s].treeId || $(event.target).parents("#" + settings[s].treeId).length > 0)) {
isOtherTree = true;
targetSetting = settings[s];
}
}
var docScrollTop = doc.scrollTop(),
docScrollLeft = doc.scrollLeft(),
treeOffset = targetSetting.treeObj.offset(),
scrollHeight = targetSetting.treeObj.get(0).scrollHeight,
scrollWidth = targetSetting.treeObj.get(0).scrollWidth,
dTop = (event.clientY + docScrollTop - treeOffset.top),
dBottom = (targetSetting.treeObj.height() + treeOffset.top - event.clientY - docScrollTop),
dLeft = (event.clientX + docScrollLeft - treeOffset.left),
dRight = (targetSetting.treeObj.width() + treeOffset.left - event.clientX - docScrollLeft),
isTop = (dTop < setting.edit.drag.borderMax && dTop > setting.edit.drag.borderMin),
isBottom = (dBottom < setting.edit.drag.borderMax && dBottom > setting.edit.drag.borderMin),
isLeft = (dLeft < setting.edit.drag.borderMax && dLeft > setting.edit.drag.borderMin),
isRight = (dRight < setting.edit.drag.borderMax && dRight > setting.edit.drag.borderMin),
isTreeInner = dTop > setting.edit.drag.borderMin && dBottom > setting.edit.drag.borderMin && dLeft > setting.edit.drag.borderMin && dRight > setting.edit.drag.borderMin,
isTreeTop = (isTop && targetSetting.treeObj.scrollTop() <= 0),
isTreeBottom = (isBottom && (targetSetting.treeObj.scrollTop() + targetSetting.treeObj.height() + 10) >= scrollHeight),
isTreeLeft = (isLeft && targetSetting.treeObj.scrollLeft() <= 0),
isTreeRight = (isRight && (targetSetting.treeObj.scrollLeft() + targetSetting.treeObj.width() + 10) >= scrollWidth);
if (event.target && tools.isChildOrSelf(event.target, targetSetting.treeId)) {
//get node <li> dom
var targetObj = event.target;
while (targetObj && targetObj.tagName && !tools.eqs(targetObj.tagName, "li") && targetObj.id != targetSetting.treeId) {
targetObj = targetObj.parentNode;
}
var canMove = true;
//don't move to self or children of self
for (i = 0, l = nodes.length; i < l; i++) {
tmpNode = nodes[i];
if (targetObj.id === tmpNode.tId) {
canMove = false;
break;
} else if ($$(tmpNode, setting).find("#" + targetObj.id).length > 0) {
canMove = false;
break;
}
}
if (canMove && event.target && tools.isChildOrSelf(event.target, targetObj.id + consts.id.A)) {
tmpTarget = $(targetObj);
tmpTargetNodeId = targetObj.id;
}
}
//the mouse must be in zTree
tmpNode = nodes[0];
if (isTreeInner && tools.isChildOrSelf(event.target, targetSetting.treeId)) {
//judge mouse move in root of ztree
if (!tmpTarget && (event.target.id == targetSetting.treeId || isTreeTop || isTreeBottom || isTreeLeft || isTreeRight) && (isOtherTree || (!isOtherTree && tmpNode.parentTId))) {
tmpTarget = targetSetting.treeObj;
}
//auto scroll top
if (isTop) {
targetSetting.treeObj.scrollTop(targetSetting.treeObj.scrollTop() - 10);
} else if (isBottom) {
targetSetting.treeObj.scrollTop(targetSetting.treeObj.scrollTop() + 10);
}
if (isLeft) {
targetSetting.treeObj.scrollLeft(targetSetting.treeObj.scrollLeft() - 10);
} else if (isRight) {
targetSetting.treeObj.scrollLeft(targetSetting.treeObj.scrollLeft() + 10);
}
//auto scroll left
if (tmpTarget && tmpTarget != targetSetting.treeObj && tmpTarget.offset().left < targetSetting.treeObj.offset().left) {
targetSetting.treeObj.scrollLeft(targetSetting.treeObj.scrollLeft() + tmpTarget.offset().left - targetSetting.treeObj.offset().left);
}
}
curNode.css({
"top": (event.clientY + docScrollTop + 3) + "px",
"left": (event.clientX + docScrollLeft + 3) + "px"
});
var dX = 0;
var dY = 0;
if (tmpTarget && tmpTarget.attr("id") != targetSetting.treeId) {
var tmpTargetNode = tmpTargetNodeId == null ? null : data.getNodeCache(targetSetting, tmpTargetNodeId),
isCopy = ((event.ctrlKey || event.metaKey) && setting.edit.drag.isMove && setting.edit.drag.isCopy) || (!setting.edit.drag.isMove && setting.edit.drag.isCopy),
isPrev = !!(preNode && tmpTargetNodeId === preNode.tId),
isNext = !!(nextNode && tmpTargetNodeId === nextNode.tId),
isInner = (tmpNode.parentTId && tmpNode.parentTId == tmpTargetNodeId),
canPrev = (isCopy || !isNext) && tools.apply(targetSetting.edit.drag.prev, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.prev),
canNext = (isCopy || !isPrev) && tools.apply(targetSetting.edit.drag.next, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.next),
canInner = (isCopy || !isInner) && !(targetSetting.data.keep.leaf && !data.nodeIsParent(setting, tmpTargetNode)) && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.inner);
function clearMove() {
tmpTarget = null;
tmpTargetNodeId = "";
moveType = consts.move.TYPE_INNER;
tmpArrow.css({
"display": "none"
});
if (window.zTreeMoveTimer) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null
}
}
if (!canPrev && !canNext && !canInner) {
clearMove();
} else {
var tmpTargetA = $("#" + tmpTargetNodeId + consts.id.A, tmpTarget),
tmpNextA = tmpTargetNode.isLastNode ? null : $("#" + tmpTargetNode.getNextNode().tId + consts.id.A, tmpTarget.next()),
tmpTop = tmpTargetA.offset().top,
tmpLeft = tmpTargetA.offset().left,
prevPercent = canPrev ? (canInner ? 0.25 : (canNext ? 0.5 : 1)) : -1,
nextPercent = canNext ? (canInner ? 0.75 : (canPrev ? 0.5 : 0)) : -1,
dY_percent = (event.clientY + docScrollTop - tmpTop) / tmpTargetA.height();
if ((prevPercent == 1 || dY_percent <= prevPercent && dY_percent >= -.2) && canPrev) {
dX = 1 - tmpArrow.width();
dY = tmpTop - tmpArrow.height() / 2;
moveType = consts.move.TYPE_PREV;
} else if ((nextPercent == 0 || dY_percent >= nextPercent && dY_percent <= 1.2) && canNext) {
dX = 1 - tmpArrow.width();
dY = (tmpNextA == null || (data.nodeIsParent(setting, tmpTargetNode) && tmpTargetNode.open)) ? (tmpTop + tmpTargetA.height() - tmpArrow.height() / 2) : (tmpNextA.offset().top - tmpArrow.height() / 2);
moveType = consts.move.TYPE_NEXT;
} else if (canInner) {
dX = 5 - tmpArrow.width();
dY = tmpTop;
moveType = consts.move.TYPE_INNER;
} else {
clearMove();
}
if (tmpTarget) {
tmpArrow.css({
"display": "block",
"top": dY + "px",
"left": (tmpLeft + dX) + "px"
});
tmpTargetA.addClass(consts.node.TMPTARGET_NODE + "_" + moveType);
if (preTmpTargetNodeId != tmpTargetNodeId || preTmpMoveType != moveType) {
startTime = (new Date()).getTime();
}
if (tmpTargetNode && data.nodeIsParent(setting, tmpTargetNode) && moveType == consts.move.TYPE_INNER) {
var startTimer = true;
if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId !== tmpTargetNode.tId) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null;
} else if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId === tmpTargetNode.tId) {
startTimer = false;
}
if (startTimer) {
window.zTreeMoveTimer = setTimeout(function () {
if (moveType != consts.move.TYPE_INNER) return;
if (tmpTargetNode && data.nodeIsParent(setting, tmpTargetNode) && !tmpTargetNode.open && (new Date()).getTime() - startTime > targetSetting.edit.drag.autoOpenTime
&& tools.apply(targetSetting.callback.beforeDragOpen, [targetSetting.treeId, tmpTargetNode], true)) {
view.switchNode(targetSetting, tmpTargetNode);
if (targetSetting.edit.drag.autoExpandTrigger) {
targetSetting.treeObj.trigger(consts.event.EXPAND, [targetSetting.treeId, tmpTargetNode]);
}
}
}, targetSetting.edit.drag.autoOpenTime + 50);
window.zTreeMoveTargetNodeTId = tmpTargetNode.tId;
}
}
}
}
} else {
moveType = consts.move.TYPE_INNER;
if (tmpTarget && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, null], !!targetSetting.edit.drag.inner)) {
tmpTarget.addClass(consts.node.TMPTARGET_TREE);
} else {
tmpTarget = null;
}
tmpArrow.css({
"display": "none"
});
if (window.zTreeMoveTimer) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null;
}
}
preTmpTargetNodeId = tmpTargetNodeId;
preTmpMoveType = moveType;
setting.treeObj.trigger(consts.event.DRAGMOVE, [event, setting.treeId, nodes]);
}
return false;
}
doc.bind("mouseup", _docMouseUp);
function _docMouseUp(event) {
if (window.zTreeMoveTimer) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null;
}
preTmpTargetNodeId = null;
preTmpMoveType = null;
doc.unbind("mousemove", _docMouseMove);
doc.unbind("mouseup", _docMouseUp);
doc.unbind("selectstart", _docSelect);
body.css("cursor", "");
if (tmpTarget) {
tmpTarget.removeClass(consts.node.TMPTARGET_TREE);
if (tmpTargetNodeId) $("#" + tmpTargetNodeId + consts.id.A, tmpTarget).removeClass(consts.node.TMPTARGET_NODE + "_" + consts.move.TYPE_PREV)
.removeClass(consts.node.TMPTARGET_NODE + "_" + _consts.move.TYPE_NEXT).removeClass(consts.node.TMPTARGET_NODE + "_" + _consts.move.TYPE_INNER);
}
tools.showIfameMask(setting, false);
roots.showHoverDom = true;
if (root.dragFlag == 0) return;
root.dragFlag = 0;
var i, l, tmpNode;
for (i = 0, l = nodes.length; i < l; i++) {
tmpNode = nodes[i];
if (data.nodeIsParent(setting, tmpNode) && root.dragNodeShowBefore[tmpNode.tId] && !tmpNode.open) {
view.expandCollapseNode(setting, tmpNode, !tmpNode.open);
delete root.dragNodeShowBefore[tmpNode.tId];
}
}
if (curNode) curNode.remove();
if (tmpArrow) tmpArrow.remove();
var isCopy = ((event.ctrlKey || event.metaKey) && setting.edit.drag.isMove && setting.edit.drag.isCopy) || (!setting.edit.drag.isMove && setting.edit.drag.isCopy);
if (!isCopy && tmpTarget && tmpTargetNodeId && nodes[0].parentTId && tmpTargetNodeId == nodes[0].parentTId && moveType == consts.move.TYPE_INNER) {
tmpTarget = null;
}
if (tmpTarget) {
var dragTargetNode = tmpTargetNodeId == null ? null : data.getNodeCache(targetSetting, tmpTargetNodeId);
if (tools.apply(setting.callback.beforeDrop, [targetSetting.treeId, nodes, dragTargetNode, moveType, isCopy], true) == false) {
view.selectNodes(sourceSetting, nodes);
return;
}
var newNodes = isCopy ? tools.clone(nodes) : nodes;
function dropCallback() {
if (isOtherTree) {
if (!isCopy) {
for (var i = 0, l = nodes.length; i < l; i++) {
view.removeNode(setting, nodes[i]);
}
}
if (moveType == consts.move.TYPE_INNER) {
view.addNodes(targetSetting, dragTargetNode, -1, newNodes);
} else {
view.addNodes(targetSetting, dragTargetNode.getParentNode(), moveType == consts.move.TYPE_PREV ? dragTargetNode.getIndex() : dragTargetNode.getIndex() + 1, newNodes);
}
} else {
if (isCopy && moveType == consts.move.TYPE_INNER) {
view.addNodes(targetSetting, dragTargetNode, -1, newNodes);
} else if (isCopy) {
view.addNodes(targetSetting, dragTargetNode.getParentNode(), moveType == consts.move.TYPE_PREV ? dragTargetNode.getIndex() : dragTargetNode.getIndex() + 1, newNodes);
} else {
if (moveType != consts.move.TYPE_NEXT) {
for (i = 0, l = newNodes.length; i < l; i++) {
view.moveNode(targetSetting, dragTargetNode, newNodes[i], moveType, false);
}
} else {
for (i = -1, l = newNodes.length - 1; i < l; l--) {
view.moveNode(targetSetting, dragTargetNode, newNodes[l], moveType, false);
}
}
}
}
view.selectNodes(targetSetting, newNodes);
var a = $$(newNodes[0], setting).get(0);
view.scrollIntoView(setting, a);
setting.treeObj.trigger(consts.event.DROP, [event, targetSetting.treeId, newNodes, dragTargetNode, moveType, isCopy]);
}
if (moveType == consts.move.TYPE_INNER && tools.canAsync(targetSetting, dragTargetNode)) {
view.asyncNode(targetSetting, dragTargetNode, false, dropCallback);
} else {
dropCallback();
}
} else {
view.selectNodes(sourceSetting, nodes);
setting.treeObj.trigger(consts.event.DROP, [event, setting.treeId, nodes, null, null, null]);
}
}
doc.bind("selectstart", _docSelect);
function _docSelect() {
return false;
}
// 2018-03-30 FireFox has fixed this issue.
//Avoid FireFox's Bug
//If zTree Div CSS set 'overflow', so drag node outside of zTree, and event.target is error.
// if(eventMouseDown.preventDefault) {
// eventMouseDown.preventDefault();
// }
return true;
}
},
//method of tools for zTree
_tools = {
getAbs: function (obj) {
var oRect = obj.getBoundingClientRect(),
scrollTop = document.body.scrollTop + document.documentElement.scrollTop,
scrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;
return [oRect.left + scrollLeft, oRect.top + scrollTop];
},
inputFocus: function (inputObj) {
if (inputObj.get(0)) {
inputObj.focus();
tools.setCursorPosition(inputObj.get(0), inputObj.val().length);
}
},
inputSelect: function (inputObj) {
if (inputObj.get(0)) {
inputObj.focus();
inputObj.select();
}
},
setCursorPosition: function (obj, pos) {
if (obj.setSelectionRange) {
obj.focus();
obj.setSelectionRange(pos, pos);
} else if (obj.createTextRange) {
var range = obj.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
},
showIfameMask: function (setting, showSign) {
var root = data.getRoot(setting);
//clear full mask
while (root.dragMaskList.length > 0) {
root.dragMaskList[0].remove();
root.dragMaskList.shift();
}
if (showSign) {
//show mask
var iframeList = $$("iframe", setting);
for (var i = 0, l = iframeList.length; i < l; i++) {
var obj = iframeList.get(i),
r = tools.getAbs(obj),
dragMask = $$("<div id='zTreeMask_" + i + "' class='zTreeMask' style='top:" + r[1] + "px; left:" + r[0] + "px; width:" + obj.offsetWidth + "px; height:" + obj.offsetHeight + "px;'></div>", setting);
dragMask.appendTo($$("body", setting));
root.dragMaskList.push(dragMask);
}
}
}
},
//method of operate ztree dom
_view = {
addEditBtn: function (setting, node) {
if (node.editNameFlag || $$(node, consts.id.EDIT, setting).length > 0) {
return;
}
if (!tools.apply(setting.edit.showRenameBtn, [setting.treeId, node], setting.edit.showRenameBtn)) {
return;
}
var aObj = $$(node, consts.id.A, setting),
editStr = "<span class='" + consts.className.BUTTON + " edit' id='" + node.tId + consts.id.EDIT + "' title='" + tools.apply(setting.edit.renameTitle, [setting.treeId, node], setting.edit.renameTitle) + "' treeNode" + consts.id.EDIT + " style='display:none;'></span>";
aObj.append(editStr);
$$(node, consts.id.EDIT, setting).bind('click',
function () {
if (!tools.uCanDo(setting) || tools.apply(setting.callback.beforeEditName, [setting.treeId, node], true) == false) return false;
view.editNode(setting, node);
return false;
}
).show();
},
addRemoveBtn: function (setting, node) {
if (node.editNameFlag || $$(node, consts.id.REMOVE, setting).length > 0) {
return;
}
if (!tools.apply(setting.edit.showRemoveBtn, [setting.treeId, node], setting.edit.showRemoveBtn)) {
return;
}
var aObj = $$(node, consts.id.A, setting),
removeStr = "<span class='" + consts.className.BUTTON + " remove' id='" + node.tId + consts.id.REMOVE + "' title='" + tools.apply(setting.edit.removeTitle, [setting.treeId, node], setting.edit.removeTitle) + "' treeNode" + consts.id.REMOVE + " style='display:none;'></span>";
aObj.append(removeStr);
$$(node, consts.id.REMOVE, setting).bind('click',
function () {
if (!tools.uCanDo(setting) || tools.apply(setting.callback.beforeRemove, [setting.treeId, node], true) == false) return false;
view.removeNode(setting, node);
setting.treeObj.trigger(consts.event.REMOVE, [setting.treeId, node]);
return false;
}
).bind('mousedown',
function (eventMouseDown) {
return true;
}
).show();
},
addHoverDom: function (setting, node) {
if (data.getRoots().showHoverDom) {
node.isHover = true;
if (setting.edit.enable) {
view.addEditBtn(setting, node);
view.addRemoveBtn(setting, node);
}
tools.apply(setting.view.addHoverDom, [setting.treeId, node]);
}
},
cancelCurEditNode: function (setting, forceName, isCancel) {
var root = data.getRoot(setting),
node = root.curEditNode;
if (node) {
var inputObj = root.curEditInput,
newName = forceName ? forceName : (isCancel ? data.nodeName(setting, node) : inputObj.val());
if (tools.apply(setting.callback.beforeRename, [setting.treeId, node, newName, isCancel], true) === false) {
return false;
}
data.nodeName(setting, node, newName);
var aObj = $$(node, consts.id.A, setting);
aObj.removeClass(consts.node.CURSELECTED_EDIT);
inputObj.unbind();
view.setNodeName(setting, node);
node.editNameFlag = false;
root.curEditNode = null;
root.curEditInput = null;
view.selectNode(setting, node, false);
setting.treeObj.trigger(consts.event.RENAME, [setting.treeId, node, isCancel]);
}
root.noSelection = true;
return true;
},
editNode: function (setting, node) {
var root = data.getRoot(setting);
view.editNodeBlur = false;
if (data.isSelectedNode(setting, node) && root.curEditNode == node && node.editNameFlag) {
setTimeout(function () {
tools.inputFocus(root.curEditInput);
}, 0);
return;
}
node.editNameFlag = true;
view.removeTreeDom(setting, node);
view.cancelCurEditNode(setting);
view.selectNode(setting, node, false);
$$(node, consts.id.SPAN, setting).html("<input type=text class='rename' id='" + node.tId + consts.id.INPUT + "' treeNode" + consts.id.INPUT + " >");
var inputObj = $$(node, consts.id.INPUT, setting);
inputObj.attr("value", data.nodeName(setting, node));
if (setting.edit.editNameSelectAll) {
tools.inputSelect(inputObj);
} else {
tools.inputFocus(inputObj);
}
inputObj.bind('blur', function (event) {
if (!view.editNodeBlur) {
view.cancelCurEditNode(setting);
}
}).bind('keydown', function (event) {
if (event.keyCode == "13") {
view.editNodeBlur = true;
view.cancelCurEditNode(setting);
} else if (event.keyCode == "27") {
view.cancelCurEditNode(setting, null, true);
}
}).bind('click', function (event) {
return false;
}).bind('dblclick', function (event) {
return false;
});
$$(node, consts.id.A, setting).addClass(consts.node.CURSELECTED_EDIT);
root.curEditInput = inputObj;
root.noSelection = false;
root.curEditNode = node;
},
moveNode: function (setting, targetNode, node, moveType, animateFlag, isSilent) {
var root = data.getRoot(setting);
if (targetNode == node) return;
if (setting.data.keep.leaf && targetNode && !data.nodeIsParent(setting, targetNode) && moveType == consts.move.TYPE_INNER) return;
var oldParentNode = (node.parentTId ? node.getParentNode() : root),
targetNodeIsRoot = (targetNode === null || targetNode == root);
if (targetNodeIsRoot && targetNode === null) targetNode = root;
if (targetNodeIsRoot) moveType = consts.move.TYPE_INNER;
var targetParentNode = (targetNode.parentTId ? targetNode.getParentNode() : root);
if (moveType != consts.move.TYPE_PREV && moveType != consts.move.TYPE_NEXT) {
moveType = consts.move.TYPE_INNER;
}
if (moveType == consts.move.TYPE_INNER) {
if (targetNodeIsRoot) {
//parentTId of root node is null
node.parentTId = null;
} else {
if (!data.nodeIsParent(setting, targetNode)) {
data.nodeIsParent(setting, targetNode, true);
targetNode.open = !!targetNode.open;
view.setNodeLineIcos(setting, targetNode);
}
node.parentTId = targetNode.tId;
}
}
//move node Dom
var targetObj, target_ulObj;
if (targetNodeIsRoot) {
targetObj = setting.treeObj;
target_ulObj = targetObj;
} else {
if (!isSilent && moveType == consts.move.TYPE_INNER) {
view.expandCollapseNode(setting, targetNode, true, false);
} else if (!isSilent) {
view.expandCollapseNode(setting, targetNode.getParentNode(), true, false);
}
targetObj = $$(targetNode, setting);
target_ulObj = $$(targetNode, consts.id.UL, setting);
if (!!targetObj.get(0) && !target_ulObj.get(0)) {
var ulstr = [];
view.makeUlHtml(setting, targetNode, ulstr, '');
targetObj.append(ulstr.join(''));
}
target_ulObj = $$(targetNode, consts.id.UL, setting);
}
var nodeDom = $$(node, setting);
if (!nodeDom.get(0)) {
nodeDom = view.appendNodes(setting, node.level, [node], null, -1, false, true).join('');
} else if (!targetObj.get(0)) {
nodeDom.remove();
}
if (target_ulObj.get(0) && moveType == consts.move.TYPE_INNER) {
target_ulObj.append(nodeDom);
} else if (targetObj.get(0) && moveType == consts.move.TYPE_PREV) {
targetObj.before(nodeDom);
} else if (targetObj.get(0) && moveType == consts.move.TYPE_NEXT) {
targetObj.after(nodeDom);
}
//repair the data after move
var i, l,
tmpSrcIndex = -1,
tmpTargetIndex = 0,
oldNeighbor = null,
newNeighbor = null,
oldLevel = node.level;
var oldChildren = data.nodeChildren(setting, oldParentNode);
var targetParentChildren = data.nodeChildren(setting, targetParentNode);
var targetChildren = data.nodeChildren(setting, targetNode);
if (node.isFirstNode) {
tmpSrcIndex = 0;
if (oldChildren.length > 1) {
oldNeighbor = oldChildren[1];
oldNeighbor.isFirstNode = true;
}
} else if (node.isLastNode) {
tmpSrcIndex = oldChildren.length - 1;
oldNeighbor = oldChildren[tmpSrcIndex - 1];
oldNeighbor.isLastNode = true;
} else {
for (i = 0, l = oldChildren.length; i < l; i++) {
if (oldChildren[i].tId == node.tId) {
tmpSrcIndex = i;
break;
}
}
}
if (tmpSrcIndex >= 0) {
oldChildren.splice(tmpSrcIndex, 1);
}
if (moveType != consts.move.TYPE_INNER) {
for (i = 0, l = targetParentChildren.length; i < l; i++) {
if (targetParentChildren[i].tId == targetNode.tId) tmpTargetIndex = i;
}
}
if (moveType == consts.move.TYPE_INNER) {
if (!targetChildren) {
targetChildren = data.nodeChildren(setting, targetNode, []);
}
if (targetChildren.length > 0) {
newNeighbor = targetChildren[targetChildren.length - 1];
newNeighbor.isLastNode = false;
}
targetChildren.splice(targetChildren.length, 0, node);
node.isLastNode = true;
node.isFirstNode = (targetChildren.length == 1);
} else if (targetNode.isFirstNode && moveType == consts.move.TYPE_PREV) {
targetParentChildren.splice(tmpTargetIndex, 0, node);
newNeighbor = targetNode;
newNeighbor.isFirstNode = false;
node.parentTId = targetNode.parentTId;
node.isFirstNode = true;
node.isLastNode = false;
} else if (targetNode.isLastNode && moveType == consts.move.TYPE_NEXT) {
targetParentChildren.splice(tmpTargetIndex + 1, 0, node);
newNeighbor = targetNode;
newNeighbor.isLastNode = false;
node.parentTId = targetNode.parentTId;
node.isFirstNode = false;
node.isLastNode = true;
} else {
if (moveType == consts.move.TYPE_PREV) {
targetParentChildren.splice(tmpTargetIndex, 0, node);
} else {
targetParentChildren.splice(tmpTargetIndex + 1, 0, node);
}
node.parentTId = targetNode.parentTId;
node.isFirstNode = false;
node.isLastNode = false;
}
data.fixPIdKeyValue(setting, node);
data.setSonNodeLevel(setting, node.getParentNode(), node);
//repair node what been moved
view.setNodeLineIcos(setting, node);
view.repairNodeLevelClass(setting, node, oldLevel);
//repair node's old parentNode dom
if (!setting.data.keep.parent && oldChildren.length < 1) {
//old parentNode has no child nodes
data.nodeIsParent(setting, oldParentNode, false);
oldParentNode.open = false;
var tmp_ulObj = $$(oldParentNode, consts.id.UL, setting),
tmp_switchObj = $$(oldParentNode, consts.id.SWITCH, setting),
tmp_icoObj = $$(oldParentNode, consts.id.ICON, setting);
view.replaceSwitchClass(oldParentNode, tmp_switchObj, consts.folder.DOCU);
view.replaceIcoClass(oldParentNode, tmp_icoObj, consts.folder.DOCU);
tmp_ulObj.css("display", "none");
} else if (oldNeighbor) {
//old neigbor node
view.setNodeLineIcos(setting, oldNeighbor);
}
//new neigbor node
if (newNeighbor) {
view.setNodeLineIcos(setting, newNeighbor);
}
//repair checkbox / radio
if (!!setting.check && setting.check.enable && view.repairChkClass) {
view.repairChkClass(setting, oldParentNode);
view.repairParentChkClassWithSelf(setting, oldParentNode);
if (oldParentNode != node.parent)
view.repairParentChkClassWithSelf(setting, node);
}
//expand parents after move
if (!isSilent) {
view.expandCollapseParentNode(setting, node.getParentNode(), true, animateFlag);
}
},
removeEditBtn: function (setting, node) {
$$(node, consts.id.EDIT, setting).unbind().remove();
},
removeRemoveBtn: function (setting, node) {
$$(node, consts.id.REMOVE, setting).unbind().remove();
},
removeTreeDom: function (setting, node) {
node.isHover = false;
view.removeEditBtn(setting, node);
view.removeRemoveBtn(setting, node);
tools.apply(setting.view.removeHoverDom, [setting.treeId, node]);
},
repairNodeLevelClass: function (setting, node, oldLevel) {
if (oldLevel === node.level) return;
var liObj = $$(node, setting),
aObj = $$(node, consts.id.A, setting),
ulObj = $$(node, consts.id.UL, setting),
oldClass = consts.className.LEVEL + oldLevel,
newClass = consts.className.LEVEL + node.level;
liObj.removeClass(oldClass);
liObj.addClass(newClass);
aObj.removeClass(oldClass);
aObj.addClass(newClass);
ulObj.removeClass(oldClass);
ulObj.addClass(newClass);
},
selectNodes: function (setting, nodes) {
for (var i = 0, l = nodes.length; i < l; i++) {
view.selectNode(setting, nodes[i], i > 0);
}
}
},
_z = {
tools: _tools,
view: _view,
event: _event,
data: _data
};
$.extend(true, $.fn.zTree.consts, _consts);
$.extend(true, $.fn.zTree._z, _z);
var zt = $.fn.zTree,
tools = zt._z.tools,
consts = zt.consts,
view = zt._z.view,
data = zt._z.data,
event = zt._z.event,
$$ = tools.$;
data.exSetting(_setting);
data.addInitBind(_bindEvent);
data.addInitUnBind(_unbindEvent);
data.addInitCache(_initCache);
data.addInitNode(_initNode);
data.addInitProxy(_eventProxy);
data.addInitRoot(_initRoot);
data.addZTreeTools(_zTreeTools);
var _cancelPreSelectedNode = view.cancelPreSelectedNode;
view.cancelPreSelectedNode = function (setting, node) {
var list = data.getRoot(setting).curSelectedList;
for (var i = 0, j = list.length; i < j; i++) {
if (!node || node === list[i]) {
view.removeTreeDom(setting, list[i]);
if (node) break;
}
}
if (_cancelPreSelectedNode) _cancelPreSelectedNode.apply(view, arguments);
}
var _createNodes = view.createNodes;
view.createNodes = function (setting, level, nodes, parentNode, index) {
if (_createNodes) {
_createNodes.apply(view, arguments);
}
if (!nodes) return;
if (view.repairParentChkClassWithSelf) {
view.repairParentChkClassWithSelf(setting, parentNode);
}
}
var _makeNodeUrl = view.makeNodeUrl;
view.makeNodeUrl = function (setting, node) {
return setting.edit.enable ? null : (_makeNodeUrl.apply(view, arguments));
}
var _removeNode = view.removeNode;
view.removeNode = function (setting, node) {
var root = data.getRoot(setting);
if (root.curEditNode === node) root.curEditNode = null;
if (_removeNode) {
_removeNode.apply(view, arguments);
}
}
var _selectNode = view.selectNode;
view.selectNode = function (setting, node, addFlag) {
var root = data.getRoot(setting);
if (data.isSelectedNode(setting, node) && root.curEditNode == node && node.editNameFlag) {
return false;
}
if (_selectNode) _selectNode.apply(view, arguments);
view.addHoverDom(setting, node);
return true;
}
var _uCanDo = tools.uCanDo;
tools.uCanDo = function (setting, e) {
var root = data.getRoot(setting);
if (e && (tools.eqs(e.type, "mouseover") || tools.eqs(e.type, "mouseout") || tools.eqs(e.type, "mousedown") || tools.eqs(e.type, "mouseup"))) {
return true;
}
if (root.curEditNode) {
view.editNodeBlur = false;
root.curEditInput.focus();
}
return (!root.curEditNode) && (_uCanDo ? _uCanDo.apply(view, arguments) : true);
}
})(jQuery);
\ No newline at end of file
!function(fe){var Ee={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},s={onHoverOverNode:function(e,t){var o=Re.getSetting(e.data.treeId),d=Re.getRoot(o);d.curHoverNode!=t&&s.onHoverOutNode(e),d.curHoverNode=t,be.addHoverDom(o,t)},onHoverOutNode:function(e,t){var o=Re.getSetting(e.data.treeId),d=Re.getRoot(o);d.curHoverNode&&!Re.isSelectedNode(o,d.curHoverNode)&&(be.removeTreeDom(o,d.curHoverNode),d.curHoverNode=null)},onMousedownNode:function(e,t){var o,d,Z=Re.getSetting(e.data.treeId),$=Re.getRoot(Z),J=Re.getRoots();if(2==e.button||!Z.edit.enable||!Z.edit.drag.isCopy&&!Z.edit.drag.isMove)return!0;var r=e.target,n=Re.getRoot(Z).curSelectedList,ee=[];if(Re.isSelectedNode(Z,t))for(o=0,d=n.length;o<d;o++){if(n[o].editNameFlag&&Ie.eqs(r.tagName,"input")&&null!==r.getAttribute("treeNode"+he.id.INPUT))return!0;if(ee.push(n[o]),ee[0].parentTId!==n[o].parentTId){ee=[t];break}}else ee=[t];be.editNodeBlur=!0,be.cancelCurEditNode(Z);var te,oe,de,re,ne,ae=fe(Z.treeObj.get(0).ownerDocument),ie=fe(Z.treeObj.get(0).ownerDocument.body),le=!1,se=Z,l=Z,ce=null,Ne=null,ue=null,ge=he.move.TYPE_INNER,ve=e.clientX,me=e.clientY,pe=(new Date).getTime();function s(e){if(0==$.dragFlag&&Math.abs(ve-e.clientX)<Z.edit.drag.minMoveSize&&Math.abs(me-e.clientY)<Z.edit.drag.minMoveSize)return!0;var t,o,d,r,n;if(ie.css("cursor","pointer"),0==$.dragFlag){if(0==Ie.apply(Z.callback.beforeDrag,[Z.treeId,ee],!0))return Te(e),!0;for(t=0,o=ee.length;t<o;t++)0==t&&($.dragNodeShowBefore=[]),d=ee[t],Re.nodeIsParent(Z,d)&&d.open?(be.expandCollapseNode(Z,d,!d.open),$.dragNodeShowBefore[d.tId]=!0):$.dragNodeShowBefore[d.tId]=!1;$.dragFlag=1,J.showHoverDom=!1,Ie.showIfameMask(Z,!0);var a=!0,i=-1;if(1<ee.length){var l=ee[0].parentTId?Re.nodeChildren(Z,ee[0].getParentNode()):Re.getNodes(Z);for(n=[],t=0,o=l.length;t<o;t++)if(void 0!==$.dragNodeShowBefore[l[t].tId]&&(a&&-1<i&&i+1!==t&&(a=!1),n.push(l[t]),i=t),ee.length===n.length){ee=n;break}}for(a&&(re=ee[0].getPreNode(),ne=ee[ee.length-1].getNextNode()),te=Pe("<ul class='zTreeDragUL'></ul>",Z),t=0,o=ee.length;t<o;t++)(d=ee[t]).editNameFlag=!1,be.selectNode(Z,d,0<t),be.removeTreeDom(Z,d),t>Z.edit.drag.maxShowNodeNum-1||((r=Pe("<li id='"+d.tId+"_tmp'></li>",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("<li id='"+d.tId+"_moretmp'><a> ... </a></li>",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("<span class='tmpzTreeMove_arrow'></span>",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=0<s.length?s.get(0):e.target}else 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));ue=de=null,le=!1,se=Z;var c=Re.getSettings();for(var N in c)c[N].treeId&&c[N].edit.enable&&c[N].treeId!=Z.treeId&&(e.target.id==c[N].treeId||0<fe(e.target).parents("#"+c[N].treeId).length)&&(le=!0,se=c[N]);var u=ae.scrollTop(),g=ae.scrollLeft(),v=se.treeObj.offset(),m=se.treeObj.get(0).scrollHeight,p=se.treeObj.get(0).scrollWidth,T=e.clientY+u-v.top,f=se.treeObj.height()+v.top-e.clientY-u,E=e.clientX+g-v.left,I=se.treeObj.width()+v.left-e.clientX-g,h=T<Z.edit.drag.borderMax&&T>Z.edit.drag.borderMin,b=f<Z.edit.drag.borderMax&&f>Z.edit.drag.borderMin,R=E<Z.edit.drag.borderMax&&E>Z.edit.drag.borderMin,P=I<Z.edit.drag.borderMax&&I>Z.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;t<o;t++){if(d=ee[t],D.id===d.tId){y=!1;break}if(0<Pe(d,Z).find("#"+D.id).length){y=!1;break}}y&&e.target&&Ie.isChildOrSelf(e.target,D.id+he.id.A)&&(de=fe(D),ue=D.id)}d=ee[0],C&&Ie.isChildOrSelf(e.target,se.treeId)&&(!de&&(e.target.id==se.treeId||w||M||_||O)&&(le||!le&&d.parentTId)&&(de=se.treeObj),h?se.treeObj.scrollTop(se.treeObj.scrollTop()-10):b&&se.treeObj.scrollTop(se.treeObj.scrollTop()+10),R?se.treeObj.scrollLeft(se.treeObj.scrollLeft()-10):P&&se.treeObj.scrollLeft(se.treeObj.scrollLeft()+10),de&&de!=se.treeObj&&de.offset().left<se.treeObj.offset().left&&se.treeObj.scrollLeft(se.treeObj.scrollLeft()+de.offset().left-se.treeObj.offset().left)),te.css({top:e.clientY+u+3+"px",left:e.clientX+g+3+"px"});var k=0,S=0;if(de&&de.attr("id")!=se.treeId){var A=null==ue?null:Re.getNodeCache(se,ue),L=(e.ctrlKey||e.metaKey)&&Z.edit.drag.isMove&&Z.edit.drag.isCopy||!Z.edit.drag.isMove&&Z.edit.drag.isCopy,Y=!(!re||ue!==re.tId),x=!(!ne||ue!==ne.tId),j=d.parentTId&&d.parentTId==ue,z=(L||!x)&&Ie.apply(se.edit.drag.prev,[se.treeId,ee,A],!!se.edit.drag.prev),B=(L||!Y)&&Ie.apply(se.edit.drag.next,[se.treeId,ee,A],!!se.edit.drag.next),H=(L||!j)&&!(se.data.keep.leaf&&!Re.nodeIsParent(Z,A))&&Ie.apply(se.edit.drag.inner,[se.treeId,ee,A],!!se.edit.drag.inner);function F(){de=null,ue="",ge=he.move.TYPE_INNER,oe.css({display:"none"}),window.zTreeMoveTimer&&(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null)}if(z||B||H){var V=fe("#"+ue+he.id.A,de),U=A.isLastNode?null:fe("#"+A.getNextNode().tId+he.id.A,de.next()),G=V.offset().top,X=V.offset().left,q=z?H?.25:B?.5:1:-1,W=B?H?.75:z?.5:0:-1,K=(e.clientY+u-G)/V.height();if((1==q||K<=q&&-.2<=K)&&z?(k=1-oe.width(),S=G-oe.height()/2,ge=he.move.TYPE_PREV):(0==W||W<=K&&K<=1.2)&&B?(k=1-oe.width(),S=null==U||Re.nodeIsParent(Z,A)&&A.open?G+V.height()-oe.height()/2:U.offset().top-oe.height()/2,ge=he.move.TYPE_NEXT):H?(k=5-oe.width(),S=G,ge=he.move.TYPE_INNER):F(),de&&(oe.css({display:"block",top:S+"px",left:X+k+"px"}),V.addClass(he.node.TMPTARGET_NODE+"_"+ge),ce==ue&&Ne==ge||(pe=(new Date).getTime()),A&&Re.nodeIsParent(Z,A)&&ge==he.move.TYPE_INNER)){var Q=!0;window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==A.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===A.tId&&(Q=!1),Q&&(window.zTreeMoveTimer=setTimeout(function(){ge==he.move.TYPE_INNER&&A&&Re.nodeIsParent(Z,A)&&!A.open&&(new Date).getTime()-pe>se.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<t;e++)o=ee[e],Re.nodeIsParent(Z,o)&&$.dragNodeShowBefore[o.tId]&&!o.open&&(be.expandCollapseNode(Z,o,!o.open),delete $.dragNodeShowBefore[o.tId]);te&&te.remove(),oe&&oe.remove();var r=(d.ctrlKey||d.metaKey)&&Z.edit.drag.isMove&&Z.edit.drag.isCopy||!Z.edit.drag.isMove&&Z.edit.drag.isCopy;if(!r&&de&&ue&&ee[0].parentTId&&ue==ee[0].parentTId&&ge==he.move.TYPE_INNER&&(de=null),de){var n=null==ue?null:Re.getNodeCache(se,ue);if(0==Ie.apply(Z.callback.beforeDrop,[se.treeId,ee,n,ge,r],!0))return void be.selectNodes(l,ee);var a=r?Ie.clone(ee):ee;function i(){if(le){if(!r)for(var e=0,t=ee.length;e<t;e++)be.removeNode(Z,ee[e]);ge==he.move.TYPE_INNER?be.addNodes(se,n,-1,a):be.addNodes(se,n.getParentNode(),ge==he.move.TYPE_PREV?n.getIndex():n.getIndex()+1,a)}else if(r&&ge==he.move.TYPE_INNER)be.addNodes(se,n,-1,a);else if(r)be.addNodes(se,n.getParentNode(),ge==he.move.TYPE_PREV?n.getIndex():n.getIndex()+1,a);else if(ge!=he.move.TYPE_NEXT)for(e=0,t=a.length;e<t;e++)be.moveNode(se,n,a[e],ge,!1);else for(e=-1,t=a.length-1;e<t;t--)be.moveNode(se,n,a[t],ge,!1);be.selectNodes(se,a);var o=Pe(a[0],Z).get(0);be.scrollIntoView(Z,o),Z.treeObj.trigger(he.event.DROP,[d,se.treeId,a,n,ge,r])}ge==he.move.TYPE_INNER&&Ie.canAsync(se,n)?be.asyncNode(se,n,!1,i):i()}else be.selectNodes(l,ee),Z.treeObj.trigger(he.event.DROP,[d,Z.treeId,ee,null,null,null])}}function c(){return!1}return Ie.uCanDo(Z)&&ae.bind("mousemove",s),ae.bind("mouseup",Te),ae.bind("selectstart",c),!0}},e={tools:{getAbs:function(e){var t=e.getBoundingClientRect(),o=document.body.scrollTop+document.documentElement.scrollTop,d=document.body.scrollLeft+document.documentElement.scrollLeft;return[t.left+d,t.top+o]},inputFocus:function(e){e.get(0)&&(e.focus(),Ie.setCursorPosition(e.get(0),e.val().length))},inputSelect:function(e){e.get(0)&&(e.focus(),e.select())},setCursorPosition:function(e,t){if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,t);else if(e.createTextRange){var o=e.createTextRange();o.collapse(!0),o.moveEnd("character",t),o.moveStart("character",t),o.select()}},showIfameMask:function(e,t){for(var o=Re.getRoot(e);0<o.dragMaskList.length;)o.dragMaskList[0].remove(),o.dragMaskList.shift();if(t)for(var d=Pe("iframe",e),r=0,n=d.length;r<n;r++){var a=d.get(r),i=Ie.getAbs(a),l=Pe("<div id='zTreeMask_"+r+"' class='zTreeMask' style='top:"+i[1]+"px; left:"+i[0]+"px; width:"+a.offsetWidth+"px; height:"+a.offsetHeight+"px;'></div>",e);l.appendTo(Pe("body",e)),o.dragMaskList.push(l)}}},view:{addEditBtn:function(e,t){if(!(t.editNameFlag||0<Pe(t,he.id.EDIT,e).length)&&Ie.apply(e.edit.showRenameBtn,[e.treeId,t],e.edit.showRenameBtn)){var o=Pe(t,he.id.A,e),d="<span class='"+he.className.BUTTON+" edit' id='"+t.tId+he.id.EDIT+"' title='"+Ie.apply(e.edit.renameTitle,[e.treeId,t],e.edit.renameTitle)+"' treeNode"+he.id.EDIT+" style='display:none;'></span>";o.append(d),Pe(t,he.id.EDIT,e).bind("click",function(){return Ie.uCanDo(e)&&0!=Ie.apply(e.callback.beforeEditName,[e.treeId,t],!0)&&be.editNode(e,t),!1}).show()}},addRemoveBtn:function(e,t){if(!(t.editNameFlag||0<Pe(t,he.id.REMOVE,e).length)&&Ie.apply(e.edit.showRemoveBtn,[e.treeId,t],e.edit.showRemoveBtn)){var o=Pe(t,he.id.A,e),d="<span class='"+he.className.BUTTON+" remove' id='"+t.tId+he.id.REMOVE+"' title='"+Ie.apply(e.edit.removeTitle,[e.treeId,t],e.edit.removeTitle)+"' treeNode"+he.id.REMOVE+" style='display:none;'></span>";o.append(d),Pe(t,he.id.REMOVE,e).bind("click",function(){return Ie.uCanDo(e)&&0!=Ie.apply(e.callback.beforeRemove,[e.treeId,t],!0)&&(be.removeNode(e,t),e.treeObj.trigger(he.event.REMOVE,[e.treeId,t])),!1}).bind("mousedown",function(e){return!0}).show()}},addHoverDom:function(e,t){Re.getRoots().showHoverDom&&(t.isHover=!0,e.edit.enable&&(be.addEditBtn(e,t),be.addRemoveBtn(e,t)),Ie.apply(e.view.addHoverDom,[e.treeId,t]))},cancelCurEditNode:function(e,t,o){var d=Re.getRoot(e),r=d.curEditNode;if(r){var n=d.curEditInput,a=t||(o?Re.nodeName(e,r):n.val());if(!1===Ie.apply(e.callback.beforeRename,[e.treeId,r,a,o],!0))return!1;Re.nodeName(e,r,a),Pe(r,he.id.A,e).removeClass(he.node.CURSELECTED_EDIT),n.unbind(),be.setNodeName(e,r),r.editNameFlag=!1,d.curEditNode=null,d.curEditInput=null,be.selectNode(e,r,!1),e.treeObj.trigger(he.event.RENAME,[e.treeId,r,o])}return d.noSelection=!0},editNode:function(t,e){var o=Re.getRoot(t);if(be.editNodeBlur=!1,Re.isSelectedNode(t,e)&&o.curEditNode==e&&e.editNameFlag)setTimeout(function(){Ie.inputFocus(o.curEditInput)},0);else{e.editNameFlag=!0,be.removeTreeDom(t,e),be.cancelCurEditNode(t),be.selectNode(t,e,!1),Pe(e,he.id.SPAN,t).html("<input type=text class='rename' id='"+e.tId+he.id.INPUT+"' treeNode"+he.id.INPUT+" >");var d=Pe(e,he.id.INPUT,t);d.attr("value",Re.nodeName(t,e)),t.edit.editNameSelectAll?Ie.inputSelect(d):Ie.inputFocus(d),d.bind("blur",function(e){be.editNodeBlur||be.cancelCurEditNode(t)}).bind("keydown",function(e){"13"==e.keyCode?(be.editNodeBlur=!0,be.cancelCurEditNode(t)):"27"==e.keyCode&&be.cancelCurEditNode(t,null,!0)}).bind("click",function(e){return!1}).bind("dblclick",function(e){return!1}),Pe(e,he.id.A,t).addClass(he.node.CURSELECTED_EDIT),o.curEditInput=d,o.noSelection=!1,o.curEditNode=e}},moveNode:function(e,t,o,d,r,n){var a=Re.getRoot(e);if(t!=o&&(!e.data.keep.leaf||!t||Re.nodeIsParent(e,t)||d!=he.move.TYPE_INNER)){var i=o.parentTId?o.getParentNode():a,l=null===t||t==a;l&&null===t&&(t=a),l&&(d=he.move.TYPE_INNER);var s,c,N=t.parentTId?t.getParentNode():a;if(d!=he.move.TYPE_PREV&&d!=he.move.TYPE_NEXT&&(d=he.move.TYPE_INNER),d==he.move.TYPE_INNER&&(l?o.parentTId=null:(Re.nodeIsParent(e,t)||(Re.nodeIsParent(e,t,!0),t.open=!!t.open,be.setNodeLineIcos(e,t)),o.parentTId=t.tId)),l)c=s=e.treeObj;else{if(n||d!=he.move.TYPE_INNER?n||be.expandCollapseNode(e,t.getParentNode(),!0,!1):be.expandCollapseNode(e,t,!0,!1),s=Pe(t,e),c=Pe(t,he.id.UL,e),s.get(0)&&!c.get(0)){var u=[];be.makeUlHtml(e,t,u,""),s.append(u.join(""))}c=Pe(t,he.id.UL,e)}var g=Pe(o,e);g.get(0)?s.get(0)||g.remove():g=be.appendNodes(e,o.level,[o],null,-1,!1,!0).join(""),c.get(0)&&d==he.move.TYPE_INNER?c.append(g):s.get(0)&&d==he.move.TYPE_PREV?s.before(g):s.get(0)&&d==he.move.TYPE_NEXT&&s.after(g);var v,m,p=-1,T=0,f=null,E=null,I=o.level,h=Re.nodeChildren(e,i),b=Re.nodeChildren(e,N),R=Re.nodeChildren(e,t);if(o.isFirstNode)p=0,1<h.length&&((f=h[1]).isFirstNode=!0);else if(o.isLastNode)(f=h[(p=h.length-1)-1]).isLastNode=!0;else for(v=0,m=h.length;v<m;v++)if(h[v].tId==o.tId){p=v;break}if(0<=p&&h.splice(p,1),d!=he.move.TYPE_INNER)for(v=0,m=b.length;v<m;v++)b[v].tId==t.tId&&(T=v);if(d==he.move.TYPE_INNER?(0<(R=R||Re.nodeChildren(e,t,[])).length&&((E=R[R.length-1]).isLastNode=!1),R.splice(R.length,0,o),o.isLastNode=!0,o.isFirstNode=1==R.length):t.isFirstNode&&d==he.move.TYPE_PREV?(b.splice(T,0,o),(E=t).isFirstNode=!1,o.parentTId=t.parentTId,o.isFirstNode=!0,o.isLastNode=!1):t.isLastNode&&d==he.move.TYPE_NEXT?(b.splice(T+1,0,o),(E=t).isLastNode=!1,o.parentTId=t.parentTId,o.isFirstNode=!1,o.isLastNode=!0):(d==he.move.TYPE_PREV?b.splice(T,0,o):b.splice(T+1,0,o),o.parentTId=t.parentTId,o.isFirstNode=!1,o.isLastNode=!1),Re.fixPIdKeyValue(e,o),Re.setSonNodeLevel(e,o.getParentNode(),o),be.setNodeLineIcos(e,o),be.repairNodeLevelClass(e,o,I),!e.data.keep.parent&&h.length<1){Re.nodeIsParent(e,i,!1),i.open=!1;var P=Pe(i,he.id.UL,e),C=Pe(i,he.id.SWITCH,e),w=Pe(i,he.id.ICON,e);be.replaceSwitchClass(i,C,he.folder.DOCU),be.replaceIcoClass(i,w,he.folder.DOCU),P.css("display","none")}else f&&be.setNodeLineIcos(e,f);E&&be.setNodeLineIcos(e,E),e.check&&e.check.enable&&be.repairChkClass&&(be.repairChkClass(e,i),be.repairParentChkClassWithSelf(e,i),i!=o.parent&&be.repairParentChkClassWithSelf(e,o)),n||be.expandCollapseParentNode(e,o.getParentNode(),!0,r)}},removeEditBtn:function(e,t){Pe(t,he.id.EDIT,e).unbind().remove()},removeRemoveBtn:function(e,t){Pe(t,he.id.REMOVE,e).unbind().remove()},removeTreeDom:function(e,t){t.isHover=!1,be.removeEditBtn(e,t),be.removeRemoveBtn(e,t),Ie.apply(e.view.removeHoverDom,[e.treeId,t])},repairNodeLevelClass:function(e,t,o){if(o!==t.level){var d=Pe(t,e),r=Pe(t,he.id.A,e),n=Pe(t,he.id.UL,e),a=he.className.LEVEL+o,i=he.className.LEVEL+t.level;d.removeClass(a),d.addClass(i),r.removeClass(a),r.addClass(i),n.removeClass(a),n.addClass(i)}},selectNodes:function(e,t){for(var o=0,d=t.length;o<d;o++)be.selectNode(e,t[o],0<o)}},event:{},data:{setSonNodeLevel:function(e,t,o){if(o){var d=Re.nodeChildren(e,o);if(o.level=t?t.level+1:0,d)for(var r=0,n=d.length;r<n;r++)d[r]&&Re.setSonNodeLevel(e,o,d[r])}}}};fe.extend(!0,fe.fn.zTree.consts,Ee),fe.extend(!0,fe.fn.zTree._z,e);var t=fe.fn.zTree,Ie=t._z.tools,he=t.consts,be=t._z.view,Re=t._z.data,Pe=(t._z.event,Ie.$);Re.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5,maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}}),Re.addInitBind(function(i){var e=i.treeObj,t=he.event;e.bind(t.RENAME,function(e,t,o,d){Ie.apply(i.callback.onRename,[e,t,o,d])}),e.bind(t.DRAG,function(e,t,o,d){Ie.apply(i.callback.onDrag,[t,o,d])}),e.bind(t.DRAGMOVE,function(e,t,o,d){Ie.apply(i.callback.onDragMove,[t,o,d])}),e.bind(t.DROP,function(e,t,o,d,r,n,a){Ie.apply(i.callback.onDrop,[t,o,d,r,n,a])})}),Re.addInitUnBind(function(e){var t=e.treeObj,o=he.event;t.unbind(o.RENAME),t.unbind(o.DRAG),t.unbind(o.DRAGMOVE),t.unbind(o.DROP)}),Re.addInitCache(function(e){}),Re.addInitNode(function(e,t,o,d,r,n,a){o&&(o.isHover=!1,o.editNameFlag=!1)}),Re.addInitProxy(function(e){var t=e.target,o=Re.getSetting(e.data.treeId),d=e.relatedTarget,r="",n=null,a="",i=null,l=null;if(Ie.eqs(e.type,"mouseover")?(l=Ie.getMDom(o,t,[{tagName:"a",attrName:"treeNode"+he.id.A}]))&&(r=Ie.getNodeMainDom(l).id,a="hoverOverNode"):Ie.eqs(e.type,"mouseout")?(l=Ie.getMDom(o,d,[{tagName:"a",attrName:"treeNode"+he.id.A}]))||(r="remove",a="hoverOutNode"):Ie.eqs(e.type,"mousedown")&&(l=Ie.getMDom(o,t,[{tagName:"a",attrName:"treeNode"+he.id.A}]))&&(r=Ie.getNodeMainDom(l).id,a="mousedownNode"),0<r.length)switch(n=Re.getNodeCache(o,r),a){case"mousedownNode":i=s.onMousedownNode;break;case"hoverOverNode":i=s.onHoverOverNode;break;case"hoverOutNode":i=s.onHoverOutNode}return{stop:!1,node:n,nodeEventType:a,nodeEventCallback:i,treeEventType:"",treeEventCallback:null}}),Re.addInitRoot(function(e){var t=Re.getRoot(e),o=Re.getRoots();t.curEditNode=null,t.curEditInput=null,t.curHoverNode=null,t.dragFlag=0,t.dragNodeShowBefore=[],t.dragMaskList=new Array,o.showHoverDom=!0}),Re.addZTreeTools(function(l,e){e.cancelEditName=function(e){Re.getRoot(this.setting).curEditNode&&be.cancelCurEditNode(this.setting,e||null,!0)},e.copyNode=function(e,t,o,d){if(!t)return null;var r=Re.nodeIsParent(l,e);if(e&&!r&&this.setting.data.keep.leaf&&o===he.move.TYPE_INNER)return null;var n=this,a=Ie.clone(t);if(e||(e=null,o=he.move.TYPE_INNER),o==he.move.TYPE_INNER){function i(){be.addNodes(n.setting,e,-1,[a],d)}Ie.canAsync(this.setting,e)?be.asyncNode(this.setting,e,d,i):i()}else be.addNodes(this.setting,e.parentNode,-1,[a],d),be.moveNode(this.setting,e,a,o,!1,d);return a},e.editName=function(e){e&&e.tId&&e===Re.getNodeCache(this.setting,e.tId)&&(e.parentTId&&be.expandCollapseParentNode(this.setting,e.getParentNode(),!0),be.editNode(this.setting,e))},e.moveNode=function(e,t,o,d){if(!t)return t;var r=Re.nodeIsParent(l,e);if(e&&!r&&this.setting.data.keep.leaf&&o===he.move.TYPE_INNER)return null;if(e&&(t.parentTId==e.tId&&o==he.move.TYPE_INNER||0<Pe(t,this.setting).find("#"+e.tId).length))return null;e=e||null;var n=this;function a(){be.moveNode(n.setting,e,t,o,!1,d)}return Ie.canAsync(this.setting,e)&&o===he.move.TYPE_INNER?be.asyncNode(this.setting,e,d,a):a(),t},e.setEditable=function(e){return this.setting.edit.enable=e,this.refresh()}});var n=be.cancelPreSelectedNode;be.cancelPreSelectedNode=function(e,t){for(var o=Re.getRoot(e).curSelectedList,d=0,r=o.length;d<r&&(t&&t!==o[d]||(be.removeTreeDom(e,o[d]),!t));d++);n&&n.apply(be,arguments)};var a=be.createNodes;be.createNodes=function(e,t,o,d,r){a&&a.apply(be,arguments),o&&be.repairParentChkClassWithSelf&&be.repairParentChkClassWithSelf(e,d)};var o=be.makeNodeUrl;be.makeNodeUrl=function(e,t){return e.edit.enable?null:o.apply(be,arguments)};var d=be.removeNode;be.removeNode=function(e,t){var o=Re.getRoot(e);o.curEditNode===t&&(o.curEditNode=null),d&&d.apply(be,arguments)};var r=be.selectNode;be.selectNode=function(e,t,o){var d=Re.getRoot(e);return(!Re.isSelectedNode(e,t)||d.curEditNode!=t||!t.editNameFlag)&&(r&&r.apply(be,arguments),be.addHoverDom(e,t),!0)};var i=Ie.uCanDo;Ie.uCanDo=function(e,t){var o=Re.getRoot(e);return!(!t||!(Ie.eqs(t.type,"mouseover")||Ie.eqs(t.type,"mouseout")||Ie.eqs(t.type,"mousedown")||Ie.eqs(t.type,"mouseup")))||(o.curEditNode&&(be.editNodeBlur=!1,o.curEditInput.focus()),!o.curEditNode&&(!i||i.apply(be,arguments)))}}(jQuery);
\ No newline at end of file
/*
* JQuery zTree exHideNodes
* v3.5.46
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
(function ($) {
var _setting = {
data: {
key: {
isHidden: "isHidden"
}
}
};
//default init node of exLib
var _initNode = function (setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
var isHidden = data.isHidden(setting, n);
data.isHidden(setting, n, isHidden);
data.initHideForExCheck(setting, n);
},
//add dom for check
_beforeA = function (setting, node, html) {
},
//update zTreeObj, add method of exLib
_zTreeTools = function (setting, zTreeTools) {
zTreeTools.showNodes = function (nodes, options) {
view.showNodes(setting, nodes, options);
}
zTreeTools.showNode = function (node, options) {
if (!node) {
return;
}
view.showNodes(setting, [node], options);
}
zTreeTools.hideNodes = function (nodes, options) {
view.hideNodes(setting, nodes, options);
}
zTreeTools.hideNode = function (node, options) {
if (!node) {
return;
}
view.hideNodes(setting, [node], options);
}
var _checkNode = zTreeTools.checkNode;
if (_checkNode) {
zTreeTools.checkNode = function (node, checked, checkTypeFlag, callbackFlag) {
if (!!node && !!data.isHidden(setting, node)) {
return;
}
_checkNode.apply(zTreeTools, arguments);
}
}
},
//method of operate data
_data = {
initHideForExCheck: function (setting, n) {
var isHidden = data.isHidden(setting, n);
if (isHidden && setting.check && setting.check.enable) {
if (typeof n._nocheck == "undefined") {
n._nocheck = !!n.nocheck
n.nocheck = true;
}
n.check_Child_State = -1;
if (view.repairParentChkClassWithSelf) {
view.repairParentChkClassWithSelf(setting, n);
}
}
},
initShowForExCheck: function (setting, n) {
var isHidden = data.isHidden(setting, n);
if (!isHidden && setting.check && setting.check.enable) {
if (typeof n._nocheck != "undefined") {
n.nocheck = n._nocheck;
delete n._nocheck;
}
if (view.setChkClass) {
var checkObj = $$(n, consts.id.CHECK, setting);
view.setChkClass(setting, checkObj, n);
}
if (view.repairParentChkClassWithSelf) {
view.repairParentChkClassWithSelf(setting, n);
}
}
}
},
//method of operate ztree dom
_view = {
clearOldFirstNode: function (setting, node) {
var n = node.getNextNode();
while (!!n) {
if (n.isFirstNode) {
n.isFirstNode = false;
view.setNodeLineIcos(setting, n);
break;
}
if (n.isLastNode) {
break;
}
n = n.getNextNode();
}
},
clearOldLastNode: function (setting, node, openFlag) {
var n = node.getPreNode();
while (!!n) {
if (n.isLastNode) {
n.isLastNode = false;
if (openFlag) {
view.setNodeLineIcos(setting, n);
}
break;
}
if (n.isFirstNode) {
break;
}
n = n.getPreNode();
}
},
makeDOMNodeMainBefore: function (html, setting, node) {
var isHidden = data.isHidden(setting, node);
html.push("<li ", (isHidden ? "style='display:none;' " : ""), "id='", node.tId, "' class='", consts.className.LEVEL, node.level, "' tabindex='0' hidefocus='true' treenode>");
},
showNode: function (setting, node, options) {
data.isHidden(setting, node, false);
data.initShowForExCheck(setting, node);
$$(node, setting).show();
},
showNodes: function (setting, nodes, options) {
if (!nodes || nodes.length == 0) {
return;
}
var pList = {}, i, j;
for (i = 0, j = nodes.length; i < j; i++) {
var n = nodes[i];
if (!pList[n.parentTId]) {
var pn = n.getParentNode();
pList[n.parentTId] = (pn === null) ? data.getRoot(setting) : n.getParentNode();
}
view.showNode(setting, n, options);
}
for (var tId in pList) {
var children = data.nodeChildren(setting, pList[tId]);
view.setFirstNodeForShow(setting, children);
view.setLastNodeForShow(setting, children);
}
},
hideNode: function (setting, node, options) {
data.isHidden(setting, node, true);
node.isFirstNode = false;
node.isLastNode = false;
data.initHideForExCheck(setting, node);
view.cancelPreSelectedNode(setting, node);
$$(node, setting).hide();
},
hideNodes: function (setting, nodes, options) {
if (!nodes || nodes.length == 0) {
return;
}
var pList = {}, i, j;
for (i = 0, j = nodes.length; i < j; i++) {
var n = nodes[i];
if ((n.isFirstNode || n.isLastNode) && !pList[n.parentTId]) {
var pn = n.getParentNode();
pList[n.parentTId] = (pn === null) ? data.getRoot(setting) : n.getParentNode();
}
view.hideNode(setting, n, options);
}
for (var tId in pList) {
var children = data.nodeChildren(setting, pList[tId]);
view.setFirstNodeForHide(setting, children);
view.setLastNodeForHide(setting, children);
}
},
setFirstNode: function (setting, parentNode) {
var children = data.nodeChildren(setting, parentNode);
var isHidden = data.isHidden(setting, children[0], false);
if (children.length > 0 && !isHidden) {
children[0].isFirstNode = true;
} else if (children.length > 0) {
view.setFirstNodeForHide(setting, children);
}
},
setLastNode: function (setting, parentNode) {
var children = data.nodeChildren(setting, parentNode);
var isHidden = data.isHidden(setting, children[0]);
if (children.length > 0 && !isHidden) {
children[children.length - 1].isLastNode = true;
} else if (children.length > 0) {
view.setLastNodeForHide(setting, children);
}
},
setFirstNodeForHide: function (setting, nodes) {
var n, i, j;
for (i = 0, j = nodes.length; i < j; i++) {
n = nodes[i];
if (n.isFirstNode) {
break;
}
var isHidden = data.isHidden(setting, n);
if (!isHidden && !n.isFirstNode) {
n.isFirstNode = true;
view.setNodeLineIcos(setting, n);
break;
} else {
n = null;
}
}
return n;
},
setFirstNodeForShow: function (setting, nodes) {
var n, i, j, first, old;
for (i = 0, j = nodes.length; i < j; i++) {
n = nodes[i];
var isHidden = data.isHidden(setting, n);
if (!first && !isHidden && n.isFirstNode) {
first = n;
break;
} else if (!first && !isHidden && !n.isFirstNode) {
n.isFirstNode = true;
first = n;
view.setNodeLineIcos(setting, n);
} else if (first && n.isFirstNode) {
n.isFirstNode = false;
old = n;
view.setNodeLineIcos(setting, n);
break;
} else {
n = null;
}
}
return {"new": first, "old": old};
},
setLastNodeForHide: function (setting, nodes) {
var n, i;
for (i = nodes.length - 1; i >= 0; i--) {
n = nodes[i];
if (n.isLastNode) {
break;
}
var isHidden = data.isHidden(setting, n);
if (!isHidden && !n.isLastNode) {
n.isLastNode = true;
view.setNodeLineIcos(setting, n);
break;
} else {
n = null;
}
}
return n;
},
setLastNodeForShow: function (setting, nodes) {
var n, i, j, last, old;
for (i = nodes.length - 1; i >= 0; i--) {
n = nodes[i];
var isHidden = data.isHidden(setting, n);
if (!last && !isHidden && n.isLastNode) {
last = n;
break;
} else if (!last && !isHidden && !n.isLastNode) {
n.isLastNode = true;
last = n;
view.setNodeLineIcos(setting, n);
} else if (last && n.isLastNode) {
n.isLastNode = false;
old = n;
view.setNodeLineIcos(setting, n);
break;
} else {
n = null;
}
}
return {"new": last, "old": old};
}
},
_z = {
view: _view,
data: _data
};
$.extend(true, $.fn.zTree._z, _z);
var zt = $.fn.zTree,
tools = zt._z.tools,
consts = zt.consts,
view = zt._z.view,
data = zt._z.data,
event = zt._z.event,
$$ = tools.$;
data.isHidden = function (setting, node, newIsHidden) {
if (!node) {
return false;
}
var key = setting.data.key.isHidden;
if (typeof newIsHidden !== 'undefined') {
if (typeof newIsHidden === "string") {
newIsHidden = tools.eqs(newIsHidden, "true");
}
newIsHidden = !!newIsHidden;
node[key] = newIsHidden;
} else if (typeof node[key] == "string"){
node[key] = tools.eqs(node[key], "true");
} else {
node[key] = !!node[key];
}
return node[key];
};
data.exSetting(_setting);
data.addInitNode(_initNode);
data.addBeforeA(_beforeA);
data.addZTreeTools(_zTreeTools);
// Override method in core
var _dInitNode = data.initNode;
data.initNode = function (setting, level, node, parentNode, isFirstNode, isLastNode, openFlag) {
var tmpPNode = (parentNode) ? parentNode : data.getRoot(setting),
children = tmpPNode[setting.data.key.children];
data.tmpHideFirstNode = view.setFirstNodeForHide(setting, children);
data.tmpHideLastNode = view.setLastNodeForHide(setting, children);
if (openFlag) {
view.setNodeLineIcos(setting, data.tmpHideFirstNode);
view.setNodeLineIcos(setting, data.tmpHideLastNode);
}
isFirstNode = (data.tmpHideFirstNode === node);
isLastNode = (data.tmpHideLastNode === node);
if (_dInitNode) _dInitNode.apply(data, arguments);
if (openFlag && isLastNode) {
view.clearOldLastNode(setting, node, openFlag);
}
};
var _makeChkFlag = data.makeChkFlag;
if (!!_makeChkFlag) {
data.makeChkFlag = function (setting, node) {
if (!!node && !!data.isHidden(setting, node)) {
return;
}
_makeChkFlag.apply(data, arguments);
}
}
var _getTreeCheckedNodes = data.getTreeCheckedNodes;
if (!!_getTreeCheckedNodes) {
data.getTreeCheckedNodes = function (setting, nodes, checked, results) {
if (!!nodes && nodes.length > 0) {
var p = nodes[0].getParentNode();
if (!!p && !!data.isHidden(setting, p)) {
return [];
}
}
return _getTreeCheckedNodes.apply(data, arguments);
}
}
var _getTreeChangeCheckedNodes = data.getTreeChangeCheckedNodes;
if (!!_getTreeChangeCheckedNodes) {
data.getTreeChangeCheckedNodes = function (setting, nodes, results) {
if (!!nodes && nodes.length > 0) {
var p = nodes[0].getParentNode();
if (!!p && !!data.isHidden(setting, p)) {
return [];
}
}
return _getTreeChangeCheckedNodes.apply(data, arguments);
}
}
var _expandCollapseSonNode = view.expandCollapseSonNode;
if (!!_expandCollapseSonNode) {
view.expandCollapseSonNode = function (setting, node, expandFlag, animateFlag, callback) {
if (!!node && !!data.isHidden(setting, node)) {
return;
}
_expandCollapseSonNode.apply(view, arguments);
}
}
var _setSonNodeCheckBox = view.setSonNodeCheckBox;
if (!!_setSonNodeCheckBox) {
view.setSonNodeCheckBox = function (setting, node, value, srcNode) {
if (!!node && !!data.isHidden(setting, node)) {
return;
}
_setSonNodeCheckBox.apply(view, arguments);
}
}
var _repairParentChkClassWithSelf = view.repairParentChkClassWithSelf;
if (!!_repairParentChkClassWithSelf) {
view.repairParentChkClassWithSelf = function (setting, node) {
if (!!node && !!data.isHidden(setting, node)) {
return;
}
_repairParentChkClassWithSelf.apply(view, arguments);
}
}
})(jQuery);
\ No newline at end of file
!function(e){var i={view:{clearOldFirstNode:function(e,i){for(var o=i.getNextNode();o;){if(o.isFirstNode){o.isFirstNode=!1,c.setNodeLineIcos(e,o);break}if(o.isLastNode)break;o=o.getNextNode()}},clearOldLastNode:function(e,i,o){for(var d=i.getPreNode();d;){if(d.isLastNode){d.isLastNode=!1,o&&c.setNodeLineIcos(e,d);break}if(d.isFirstNode)break;d=d.getPreNode()}},makeDOMNodeMainBefore:function(e,i,o){var d=h.isHidden(i,o);e.push("<li ",d?"style='display:none;' ":"","id='",o.tId,"' class='",n.className.LEVEL,o.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(e,i,o){h.isHidden(e,i,!1),h.initShowForExCheck(e,i),d(i,e).show()},showNodes:function(e,i,o){if(i&&0!=i.length){var d,t,n={};for(d=0,t=i.length;d<t;d++){var s=i[d];if(!n[s.parentTId]){var r=s.getParentNode();n[s.parentTId]=null===r?h.getRoot(e):s.getParentNode()}c.showNode(e,s,o)}for(var a in n){var N=h.nodeChildren(e,n[a]);c.setFirstNodeForShow(e,N),c.setLastNodeForShow(e,N)}}},hideNode:function(e,i,o){h.isHidden(e,i,!0),i.isFirstNode=!1,i.isLastNode=!1,h.initHideForExCheck(e,i),c.cancelPreSelectedNode(e,i),d(i,e).hide()},hideNodes:function(e,i,o){if(i&&0!=i.length){var d,t,n={};for(d=0,t=i.length;d<t;d++){var s=i[d];if((s.isFirstNode||s.isLastNode)&&!n[s.parentTId]){var r=s.getParentNode();n[s.parentTId]=null===r?h.getRoot(e):s.getParentNode()}c.hideNode(e,s,o)}for(var a in n){var N=h.nodeChildren(e,n[a]);c.setFirstNodeForHide(e,N),c.setLastNodeForHide(e,N)}}},setFirstNode:function(e,i){var o=h.nodeChildren(e,i),d=h.isHidden(e,o[0],!1);0<o.length&&!d?o[0].isFirstNode=!0:0<o.length&&c.setFirstNodeForHide(e,o)},setLastNode:function(e,i){var o=h.nodeChildren(e,i),d=h.isHidden(e,o[0]);0<o.length&&!d?o[o.length-1].isLastNode=!0:0<o.length&&c.setLastNodeForHide(e,o)},setFirstNodeForHide:function(e,i){var o,d,t;for(d=0,t=i.length;d<t&&!(o=i[d]).isFirstNode;d++){if(!h.isHidden(e,o)&&!o.isFirstNode){o.isFirstNode=!0,c.setNodeLineIcos(e,o);break}o=null}return o},setFirstNodeForShow:function(e,i){var o,d,t,n,s;for(d=0,t=i.length;d<t;d++){o=i[d];var r=h.isHidden(e,o);if(!n&&!r&&o.isFirstNode){n=o;break}if(n||r||o.isFirstNode){if(n&&o.isFirstNode){o.isFirstNode=!1,s=o,c.setNodeLineIcos(e,o);break}o=null}else o.isFirstNode=!0,n=o,c.setNodeLineIcos(e,o)}return{new:n,old:s}},setLastNodeForHide:function(e,i){var o,d;for(d=i.length-1;0<=d&&!(o=i[d]).isLastNode;d--){if(!h.isHidden(e,o)&&!o.isLastNode){o.isLastNode=!0,c.setNodeLineIcos(e,o);break}o=null}return o},setLastNodeForShow:function(e,i){var o,d,t,n;for(d=i.length-1;0<=d;d--){o=i[d];var s=h.isHidden(e,o);if(!t&&!s&&o.isLastNode){t=o;break}if(t||s||o.isLastNode){if(t&&o.isLastNode){o.isLastNode=!1,n=o,c.setNodeLineIcos(e,o);break}o=null}else o.isLastNode=!0,t=o,c.setNodeLineIcos(e,o)}return{new:t,old:n}}},data:{initHideForExCheck:function(e,i){h.isHidden(e,i)&&e.check&&e.check.enable&&(void 0===i._nocheck&&(i._nocheck=!!i.nocheck,i.nocheck=!0),i.check_Child_State=-1,c.repairParentChkClassWithSelf&&c.repairParentChkClassWithSelf(e,i))},initShowForExCheck:function(e,i){if(!h.isHidden(e,i)&&e.check&&e.check.enable){if(void 0!==i._nocheck&&(i.nocheck=i._nocheck,delete i._nocheck),c.setChkClass){var o=d(i,n.id.CHECK,e);c.setChkClass(e,o,i)}c.repairParentChkClassWithSelf&&c.repairParentChkClassWithSelf(e,i)}}}};e.extend(!0,e.fn.zTree._z,i);var o=e.fn.zTree,t=o._z.tools,n=o.consts,c=o._z.view,h=o._z.data,d=(o._z.event,t.$);h.isHidden=function(e,i,o){if(!i)return!1;var d=e.data.key.isHidden;return void 0!==o?("string"==typeof o&&(o=t.eqs(o,"true")),o=!!o,i[d]=o):"string"==typeof i[d]?i[d]=t.eqs(i[d],"true"):i[d]=!!i[d],i[d]},h.exSetting({data:{key:{isHidden:"isHidden"}}}),h.addInitNode(function(e,i,o,d,t,n,s){var r=h.isHidden(e,o);h.isHidden(e,o,r),h.initHideForExCheck(e,o)}),h.addBeforeA(function(e,i,o){}),h.addZTreeTools(function(t,n){n.showNodes=function(e,i){c.showNodes(t,e,i)},n.showNode=function(e,i){e&&c.showNodes(t,[e],i)},n.hideNodes=function(e,i){c.hideNodes(t,e,i)},n.hideNode=function(e,i){e&&c.hideNodes(t,[e],i)};var s=n.checkNode;s&&(n.checkNode=function(e,i,o,d){e&&h.isHidden(t,e)||s.apply(n,arguments)})});var a=h.initNode;h.initNode=function(e,i,o,d,t,n,s){var r=(d||h.getRoot(e))[e.data.key.children];h.tmpHideFirstNode=c.setFirstNodeForHide(e,r),h.tmpHideLastNode=c.setLastNodeForHide(e,r),s&&(c.setNodeLineIcos(e,h.tmpHideFirstNode),c.setNodeLineIcos(e,h.tmpHideLastNode)),t=h.tmpHideFirstNode===o,n=h.tmpHideLastNode===o,a&&a.apply(h,arguments),s&&n&&c.clearOldLastNode(e,o,s)};var s=h.makeChkFlag;s&&(h.makeChkFlag=function(e,i){i&&h.isHidden(e,i)||s.apply(h,arguments)});var r=h.getTreeCheckedNodes;r&&(h.getTreeCheckedNodes=function(e,i,o,d){if(i&&0<i.length){var t=i[0].getParentNode();if(t&&h.isHidden(e,t))return[]}return r.apply(h,arguments)});var N=h.getTreeChangeCheckedNodes;N&&(h.getTreeChangeCheckedNodes=function(e,i,o){if(i&&0<i.length){var d=i[0].getParentNode();if(d&&h.isHidden(e,d))return[]}return N.apply(h,arguments)});var l=c.expandCollapseSonNode;l&&(c.expandCollapseSonNode=function(e,i,o,d,t){i&&h.isHidden(e,i)||l.apply(c,arguments)});var f=c.setSonNodeCheckBox;f&&(c.setSonNodeCheckBox=function(e,i,o,d){i&&h.isHidden(e,i)||f.apply(c,arguments)});var u=c.repairParentChkClassWithSelf;u&&(c.repairParentChkClassWithSelf=function(e,i){i&&h.isHidden(e,i)||u.apply(c,arguments)})}(jQuery);
\ No newline at end of file
=ZTree v3.x (JQuery Tree插件) 更新日志=
<font color="red">为了更好的优化及扩展zTree, 因此决定升级为v3.x,并且对之前的v2.x不兼容,会有很多结构上的修改,对此深感无奈与抱歉,请大家谅解。</font>
<font color="red">
具体修改内容可参考:
* [http://www.treejs.cn/v3/api.php zTree v3.x API 文档]
* [http://www.treejs.cn/v3/demo.php#_101 zTree v3.x Demo 演示]
* [http://www.treejs.cn/v3/faq.php#_101 zTree v3.x 常见问题]
</font>
*2020.11.21* v3.5.46
* Add 'onClick' handler only if it's not empty Thanks @afilippov1985
*2020.11.03* v3.5.45
* Support attribute('name' & 'title') dynamic rendering using custom function Thanks @imyuyu
*2020.04.29* v3.5.44
* update TypeScript type definition Thanks @bseddon
*2020.04.04* v3.5.43
* 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
*2020.03.02* v3.5.42
* add demo 'super/keyboard_navigation.html' Thanks @bseddon
*2020.01.19* v3.5.42
* merge PullRequest(fixed 'HTMLElement undefined' error) Thanks @ChangJin0520
* merge PullRequest(Add TypeScript type definition) Thanks @Itroads
* fixed awesomeStyle Thanks @Jermyk93
*2020.01.06* v3.5.41
* [修改] 修正 API
*2019.10.11* v3.5.41
* [修改] 从 源码中 移除 个人邮箱
*2019.01.18* v3.5.40
* [修改] fuzzySearch.js Thanks @yigger
*2019.01.17* v3.5.39
* [修改] data.nodeChecked & data.isHidden & data.nodeIsParent 的 返回值规范为 boolean Thanks @xinhochen & @田biubiu & @FelixFly
*2019.01.08* v3.5.38
* [修改] data.nodeChecked & data.isHidden 的 返回值规范为 boolean Thanks @xinhochen
*2018.12.10* v3.5.37
* [修改] fuzzySearch.js & Demo Thanks @SadWood & @JerryWang24
*2018.08.21* v3.5.37
* [修改] 替换 scrollIntoViewIfNeeded 方法 Thanks @jocki84
* [修改] 部分 API 文字错误
*2018.06.26* v3.5.36
* [增加] setting.async.headers & setting.async.xhrFields
*2018.04.24* v3.5.35
* [增加] Demo:模糊搜索(Fuzzy Search) Thanks @bigablecat
*2018.03.30* v3.5.35
* [修改] 关闭拖拽方法内的 eventMouseDown.preventDefault(); 避免影响 zTree 外部的事件 Thanks @heyusysu
*2018.02.12* v3.5.34
* [修改] nodeChecked 方法内的错误 Thanks @勇哥
*2018.01.30* v3.5.33
* [修改] nodeIsParent 方法内的错误 Thanks @netmou
*2018.01.06* v3.5.32
* [修改] setting.async.autoParam / otherParam 支持 function
* [修改] isParent / isHidden 允许自定义属性名称 setting.data.key.isParent / isHidden
*2017.12.28* v3.5.31
* [修改] 初始化节点数据的规则,支持 treeNode { name: "Node2", children: []}, 情况下自动设置为 isParent = true
*2017.11.11* v3.5.30
* [修改] scrollIntoViewIfNeeded 方法对 IE7 的兼容
*2017.06.23* v3.5.29
* [修改] 拖拽操作后 body.css("cursor", "auto"); 修改为 body.css("cursor", "");(感谢 Jim)
*2017.06.19* v3.5.29
* [增加] reAsyncChildNodesPromise(parentNode, reloadType, isSilent) 方法支持 ES6 Promise
* [修改] reAsyncChildNodes 方法增加 callback 参数
*2017.01.20* v3.5.28
* [修改] scrollIntoViewIfNeeded 方法对 IE8 的兼容
*2016.12.27* v3.5.27
* [修改] addNodes 方法设置 index 参数后,导致 treeNode.isLastNode 错误
*2016.11.03* v3.5.26
* [修改] 使用 scrollIntoViewIfNeeded 替代 scrollIntoView,兼容各种浏览器
*2016.09.27* v3.5.25
* [修改] ajax 异步加载支持 contentType = 'application/json'
*2016.06.06* v3.5.24
* [修改] selectNode 方法中 某些情况下,isSilent 参数无效
* [修改] 数据中 id = 'length'时, 导致 transformTozTreeFormat() 方法异常
*2016.04.08* v3.5.23
* [修改] expandCollapseNode 方法被 gulp 压缩后,在 IE8 上会导致溢出
*2016.04.06* v3.5.23
* [修改] 替换 arguments.callee 避免 'use strict' 严格模式下报错
*2016.04.01* v3.5.23
* [修改] selectNode 方法 增加 isSilent 参数,可以禁止 选中节点时,自动滚动到视图
*2016.03.01* v3.5.22
* [修改] metro Demo 的样式错误
* [修改] 增加 <a> 的 padding 后, 导致 setting.edit.drag.inner 无效
*2016.02.17* v3.5.21
* [修改] zTree js 文件名 (为了便于发布到 https://cdnjs.com/)
*2016.01.20* v3.5.20
* [修改] checkAllNodes() 方法不处理 (chkDisabled = true) 的父节点的子节点的 bug
*2015.12.04* v3.5.19.3
* [修改] 为避免定位节点时抢焦点, 使用 scrollIntoView 方法替换之前的 focus 方法(对于IE6等旧浏览器仍然使用 focus方法)
*2015.11.15* v3.5.19.2
* [增加] 给节点名称的 span 标签增加 class,便于用户设置 css
*2015.10.26* v3.5.19.1
* [修改] addNodes 新方法 导致 拖拽节点时报错
* [增加] treeNode.getIndex 方法,可以快速获取 节点在 子节点中的位置
* [增加] treeNode.getPath 方法,可以快速获取 节点的所有父节点
*2015.10.22* v3.5.19
* [修改] addNodes 方法支持直接添加新节点到任意位置 addNodes(parentNode, index, newNodes, isSilent)
* [修改] selectstart 事件未解绑导致的内存泄漏
*2015.08.26* v3.5.18
* [修改] onSelected/onUnSelected 回调参数,由 (event, treeId, node) 修改为 (treeId, node);另外 删除 已选择的节点时,也会触发 onUnSelected 回调
* [增加] Allow nodes to specify their own icon using an 'icon' property of the 'setting.data.key'
* [增加] metro 风格 demo
* [增加] awesome 风格 demo
* [增加] 回调 onSelected / onUnSelected
*2015.02.15* v3.5.17
* [修改] excheck 扩展中 removeClass 与 jQueryUI 1.9 冲突的问题,目前放弃 removeClass 方法
* [修改] 优化 exhide 扩展包初始化效率,避免数据多时 ie8 假死的 bug(感谢:https://github.com/sarxos)
* [修改] 若干 Demo & API 的小错误
* [修改] 异步加载 低版本 IE 缓存严重的问题
* [修改] 在 onRename 回调中使用 updateNode 方法无效的问题
*2014.03.09* v3.5.16
* [增加] onDragMove 回调,便于控制 zTree 节点与其他 DOM 的拖拽操作。(感谢 yumi301)
* [增加] 针对 Mac 系统 Cmd 键的支持, Cmd 键 + 左键 也可以多选节点
* [修改] 使用 destory 方法销毁树以后,依然可以从 getZTreeObj 方法中获取到 zTree 对象的 bug。
* [修改] onCheck 回调的 event,恢复为 zTree 自身的 event 事件,同时利用 srcEvent 传递原始 event 对象。(感谢 yumi301)
* [修改] 拖拽多个节点时,超出 maxShowNodeNum 设置个数的节点会失去 被选择状态的 bug
* [修改] excheck & exedit 扩展包的 zTree 方法中 setting 数据错误导致 checkNode、updateNode 等方法操作 radio 失效的 bug
* [修改] 不加载 exedit 扩展包时,使用 removeNode 方法无法触发 beforeRemove 和 onRemove 回调的 bug
*2013.10.19* v3.5.15
* [增加] setting.view.txtSelectedEnable 属性,满足部分项目中客户对于可以选择节点文本信息的强烈欲望。
* [修改] exhide 扩展包导致操作子节点后 isLastNode 属性异常 的bug
* [修改] 使用 cancelEditName 方法时,beforeRename & onRename 的 isCancel 始终为 false 的bug
* [修改] 编辑状态, beforeRename 回调 return false 时,提示信息导致 input 失去焦点后, 当树再次得到焦点时,让 input 自动获取焦点
* [修改] 判断拖拽到节点的 <a> 标签中自定义的无 id 组件判断错误的bug
* [修改] async_edit.html demo 中 添加按钮 显示的 bug
* [修改] 当没有开启异步加载模式下,对于没有子节点的父节点,即使设置 open=true 在初始化时也不会设置为展开状态的bug (对于异步加载模式下依然会强行设置为折叠状态)
*2013.06.28* v3.5.14
* [修改] 拖拽节点时 iframe 遮罩异常的bug
* [修改] 清空子节点后重新添加子节点无法显示的bug
*2013.06.02* v3.5.13
* [增加] beforeRename & onRename 增加 isCancel 参数,可以监控用户 ESC 取消编辑的事件
* [修改] 初始化时 radioType="all", 父节点未展开 且 子节点有被勾选,点击其他 radio 时,不会取消勾选该子节点的bug
* [修改] 多棵树拖拽时,拖拽无效后会导致目标书已选择的节点清空的 bug。
* [修改] 多棵树拖拽时,会触发 addHoverDom 的bug。
* [修改] 多棵树拖拽时,由于 beforeDrog 或 prev / inner / next 返回 false 后未触发原始节点的 addHoverDom 的bug
* [修改] 异步加载时,对于未加载子节点的父节点使用 expandNode 方法时, sonSign 设置为 true后,导致异步加载的节点无法正常显示的bug
* [修改] 一次性加载全部数据,如果父节点 A 未展开,但下一级的父节点 A1 设置了 open=true 的时候,使用 expandAll 方法导致 A1 的下一级父节点出现重复的 bug
* [修改] 增加对 iframe 的支持,可以只在主页面加载 zTree 的 js,在 iframe 内创建树 [https://github.com/zTree/zTree_v3/issues/7 Issue Info]
* [修改] 引入 exhide 扩展包 导致页面上同时加载多棵树时,根节点 的 连接线图标出现异常 的 bug [http://tieba.baidu.com/p/2277416574]
* [修改] excheck & exedit 扩展包中事件代理获取节点 tId 的方法,保证适当修改 DOM 结构也能得到 tId
*2013.03.11* v3.5.12
* [修改] 由于 jquery 1.9 中移除 event.srcElement 导致的 js 报错的bug。
* [修改] 在异步加载模式下,使用 moveNode 方法,且 moveType != "inner" 时,也会导致 targetNode 自动加载子节点的 bug
* [修改] 对已经显示的节点(nocheck=true)使用 showNodes 或 showNode 方法后,导致勾选框出现的bug。
* [修改] 对已经隐藏的节点(nocheck=false)使用 hideNodes 或 hideNode 方法后,导致勾选框消失的bug。
* [修改] getNodesByParamFuzzy 支持 大小写模糊。
* [修改] className 结构,提取 _consts.className.BUTTON / LEVEL / ICO_LOADING / SWITCH,便于快速修改 css 冲突。
例如:与 WordPress 产生冲突后,直接修改 core 中的 "button" 和 "level" 即可。 Issue: https://github.com/zTree/zTree_v3/issues/2
*2013.01.28* v3.5.02
* [增加] setting.check.chkDisabledInherit 属性,用于设置 chkDisabled 在初始化时子节点是否可以继承父节点的 chkDisabled 属性
* [删除] 内部 noSel 方法,使用 selectstart事件 和 "-moz-user-select"样式 处理禁止 节点文字被选择的功能
* [修改] 不兼容 jQuery 1.9 的bug
* [修改] onDrop 的触发规则,保证异步加载模式下,可以在延迟加载结束后触发,避免 onDrop 中被拖拽的节点是已经更新后的数据。
* [修改] setChkDisabled 方法,增加 inheritParent, inheritChildren 参数设置是否让父子节点继承 disabled
* [修改] 异步加载时 拼接参数的方法,由 string 修改为 json 对象
* [修正] 1-2-3 3级节点时,如果 2级节点 全部设置为 nocheck 或 chkDisabled后,勾选3级节点时,1级节点的半勾选状态错误的 bug
* [修改] Demo: checkbox_nocheck.html & checkbox_chkDisabled.html;
* [修改] Demo: edit_super.html,增加 showRenameBtn & showRemoveBtn 的演示
* [修改] Demo: asyncForAll, 将 post 修改为 get;为了避免由于 IE10 的 bug 造成的客户端 以及 服务端崩溃
IE10 ajax Post 无法提交参数的bug (http://bugs.jquery.com/ticket/12790)
*2012.12.21* v3.5.01
* [优化] clone 方法
* [修正] 对于初始化无 children 属性的父节点进行 reAsyncChildNodes 操作时出错的 bug
* [修正] beforeRename 回调中使用 cancelEditName 方法后,再 return false 导致无法重新进行编辑的 bug
* [修正] exedit 扩展包让 setting.data.key.url 失效的 bug
* [修正] setting.check.autoCheckTrigger 设置为 true 时,onCheck 回调缺少 event 参数的 bug
* [修正] singlepath.html Demo 中的 bug
*2012.11.20* v3.5
* [优化] 原先的 clone 方法 (特别感谢:愚人码头)
* [修改] 隐藏父节点后,使用 expandAll 方法导致 父节点展开的 bug
* [修改] 使用 jQuery v1.7 以上时,设置 zTree 容器 ul 隐藏(visibility: hidden;)后, 调用 selectNode 导致 IE 浏览器报错 Can't move focus 的 bug
* [修改] 正在异步加载时,执行 destory 或 init 方法后,异步加载的节点影响新树的 bug
* [修改] 方法 reAsyncChildNodes 在 refresh 的时候未清空内部 cache 导致内存泄露 的 bug
* [修改] 批量节点拖拽到其他父节点内(inner)时,导致顺序反转 的 bug
* [修改] 对于 使用 html格式的 节点无法触发 双击事件 的 bug
* [修改] onCheck 回调中的 event ,保证与触发事件中的 event 一致
* [修改] 异步加载时,在 onNodeCreated 中执行 selectNode 后,导致节点折叠的 bug
* [修改] API 中 dataFilter 的参数名称 childNodes -> responseData
* [修改] API 中 iconSkin 的 举例内容
* [修改] API 中 chkDisabled 的说明
* [修改] Demo 中 index.html 内的 loadReady 重复绑定问题
*2012.09.03* v3.4
* [增加] Demo —— OutLook 样式的左侧菜单
* [增加] 清空 zTree 的方法 $.fn.zTree.destory(treeId) & zTree.destory()
* [修改] core核心文件内 _eventProxy 方法中获取 tId 的方法,提高 DOM 的灵活性
* [修改] 初始化时 多层父节点的 checkbox 半选状态计算错误的 bug
* [修改] 同时选中父、子节点后,利用 getSelectedNodes 获取选中节点并利用 removeNode 删除时报错的 bug
* [修改] treeNode.chkDisabled / nocheck 属性,支持字符串格式的 "false"/"true"
* [修改] 异步加载模式下无法利用 server 返回 xml 并且 在 dataFilter 中继续处理的 bug
* [修改] title 只允许设置为 string 类型值的问题。 修正后允许设置为 number 类型的值
* [修改] zId 计数规则 & Cache 保存,减少 IE9 的 bug 造成的内存泄漏
* [修改] API 页面搜索功能导致 IE 崩溃的 bug
*2012.07.16* v3.3
* [增加] 扩展库 exhide -- 节点隐藏功能
* [修改] getNodesByFilter 方法,添加 invokeParam 自定义参数
* [修改] 拖拽中测试代码未删除,导致出现黄颜色的 iframe 遮罩层的 bug
* [修改] 延迟加载方法 对于使用 expandAll 进行全部展开时,导致 onNodeCreated 回调 和 addDiyDom 方法触发过早的 bug
* [修改] 使用 moveNode 移动尚未生成 DOM 的节点时,视图会出现异常的 bug
* [修改] 删除节点后,相关节点的 isFirstNode 属性未重置的 bug
* [修改] getPreNode(),getNextNode() 方法在对于特殊情况时计算错误的 bug
* [修改] 设置 title 之后,如果重新将 title 内容设置为空后,会导致无法更新 title 的 bug
* [修改] 针对 setting.check.chkStyle=="radio" && setting.check.radioType=="all" 的情况时,getTreeCheckedNodes方法优化,找到一个结果就 break
* [修改] zTreeObj.getCheckedNodes(false) 在 radioType = "all" 时计算错误的 bug
* [修改] 完善 API 中 beforeDrop / onDrop 的关于 treeId 的说明
*2012.05.13* v3.2
* [增加] setting.data.key.url 允许修改 treeNode.url 属性
* [增加] getNodesByFilter(filter, isSingle) 方法
* [增加] "与其他 DOM 拖拽互动" 的 Demo (http://www.treejs.cn/v3/demo.php#_511)
* [增加] "异步加载模式下全部展开" 的 Demo (http://www.treejs.cn/v3/demo.php#_512)
* [修改] 代码结构,将 addNodes、removeNode、removeChildNodes 方法 和 beforeRemove、onRemove 回调 转移到 core 内
* [修改] IE7的环境下无子节点的父节点反复展开出现多余空行的 bug
* [修改] 异步加载时,如果出现网络异常等,会导致 图标显示错误的 bug
* [修改] dataFilter中 return null 导致异常 的 bug
* [修改] removeChildNodes 方法清空子节点后,无法正常添加节点的 bug
* [修改] moveNode 后节点中的自定义元素的事件丢失的 bug
* [修改] moveNode 方法中设置 isSilent = true 时,如果移动到已展开的 父节点后,出现异常的 bug
* [修改] onClick/onDrag/onDrop 回调中 event 不是原始 event 的 bug
* [修改] onDrop 回调中 当拖拽无效时,无法获得 treeNodes 的 bug
* [修改] onDrop 无法判断拖拽是 移动还是复制的问题
* [修改] 未开启异步加载模式时,拖拽节点到子节点为空的父节点内时 出现异常 的 bug
* [修改] 拖拽过程中,反复在 父节点图标上划动时,会出现停顿的 bug
(需要css 结构—— button -> span.button)
* [修改] 拖拽操作时箭头 与 targetNode 背景之间的细节现实问题,便于用户拖拽时更容易区分 prev、next 和 inner 操作
* [修改] 拖拽操作时IE6/7 下 在 节点<a> 右侧 10px 内会导致 targetNode = root 的 bug
* [修改] 编辑模式下 默认的编辑按钮、删除按钮点击后,如果相应的 before 回调 return false 时会触发 onClick 回调的 bug
*2012.02.14* v3.1
* [增加] ajax 的参数 setting.async.contentType ,让提交参数适用于 json 数据提交 (主要适用于 .Net 的开发)。
* [增加] setting.edit.editNameSelectAll, 用于设定编辑节点名称时初次显示 input 后 text 内容为全选
* [修改] 异步加载 规则,不再仅仅依靠父节点的子节点数来判定,增加内部属性 zAsync,保证默认状态下父节点及时无子节点也只能异步加载一次,除非使用 reAsyncChildNodes 方法强行控制异步加载。
* [修改] 放大浏览器后导致 界面出现多余连接线的bug (需要更新:icon 图标和 css )
* [修改] 在编辑状态,如果节点名超过编辑框宽度,左右键在框内不起作用的bug(IE 6 7 8 出现)
CSS 中 filter:alpha(opacity=80) 造成的,应该是 ie 的 bug,需要更新 css 文件
* [修改] title 设置后,如果属性不存在,则默认为 title 为空,便于数据容错和用户灵活使用
* [修改] editName 方法如果针对尚未展开的 父节点,会导致该父节点自动展开的 bug
* [修改] title 中存在标签时导致 title 显示异常的bug(例如:蓝色字22%"'`<input/>`)
*2012.01.10* v3.0
* [增加] setting.check.autoCheckTrigger 默认值 false,可以设置联动选中时是否触发事件回调函数
* [增加] setting.callback.beforeEditName 回调函数,以保证用户可以捕获点击编辑按钮的事件
* [增加] treeNode.chkDisabled 属性,显示 checkbox 但是用户无法修改 checkbox 状态,并且该 checkbox 会影响父节点的 checkbox 的半选状态
* [增加] setting.check.nocheckInherit 属性,用户设置子节点继承 nocheck 属性,用于批量初始化节点,不适用于已经显示的节点
* [增加] setting.edit.drag.autoExpandTrigger 默认值 false,可以设置自动展开、折叠操作时是否触发事件回调函数
* [增加] setting.view.nameIsHTML 默认值 false,允许用户对 name 设置 DOM 对象
* [增加] treeNode.click 属性的说明文档
* [增加] treeObj.setChkDisabled 方法用于设置 checkbox / radio disabled 状态
* [增加] treeNode.halfCheck 属性,用于强制设定节点的半选状态
* [修改] 异步加载 & 编辑功能 共存时,拖拽节点 或 增加节点 导致 ie 上报错的 bug (apply 方法引起)
* [修改] zTreeStyle 样式冲突
* [修改] setting.data.key.title 默认值设置为 "",初始化时自动赋值为 setting.data.key.name 这样可避免希望 title 与 name 一致的用户反复设置参数
* [修改] 点击叶子节点的连接线会触发 expand 事件的 bug
* [修改] IE 下 点击叶子节点连线会出现虚线框的 bug
* [修改] updateNode 导致 checkbox 半选状态错误的 bug
* [修改] checkNode 方法实现 toggle 操作, 取消 expandAll 方法的 toggle 操作
* [修改] zTree 内鼠标移动会抢页面上 input 内的焦点的 bug
* [修改] beforeRename / onRename 的触发方式——即使名称内容未改变也会触发,便于用户配合 beforeEditName 捕获编辑状态的结束,赋予用户更多调整规则的权利
* [修改] 与 easyUI 共存时无法拖拽的bug
* [修改] beforeRename 在 Firefox 下如果利用 alert,会触发两次的 bug
* [修改] checkNode/expandNode/removeNode 方法,默认不触发回调函数,恢复 v2.6 的默认状态,同时增加 callbackFlag 参数,设置为 true 时,可以触发回调函数
* [修改] IE9下“根据参数查找节点”的Demo 报错:行14 重新声明常量属性(Demo 自身的问题,定义了history变量)
* [修改] 初始化 zTree 时 onNodeCreated 事件回调函数中无法 用 getZTreeObj 获取 zTree 对象的 bug
* [修改] setting.edit.drag.prev / next / inner 参数,增加被拖拽的节点集合
* [修改] 异步加载模式下,otherParam 使用Array数组会出错的 bug。例如: ["id", "1", "name", "test"]
* [修改] FireFox 下多棵树拖拽异常的 bug
* [修改] exedit 中调用 excheck库的方法时没有进行容错处理,导致如果只加入 exedit 而没有 excheck的时候,会出现 js 错误
* [修改] 显示 checkbox 的 zTree 在编辑模式下,移动节点不会更新父节点半选状态的 bug
* [修改] treeNode.childs --> children; treeObject.removeChilds --> removeChildNodes; setting.data.key.childs --> children(英文不好惹的祸!抱歉了!)
* [修改] onRemove 回调中得到的 treeNode 还可以查找 preNode、nextNode 的bug。 修正后,getPreNode 和 getNextNode 都返回 null; 为了便于查找父节点,getParentNode 仍保留
* [修改] 简单数据模式下,如果 id 与 pId 的值相同会导致该节点无法正常加载的 bug
* [修改] 移动或删除中间节点会导致最后一个节点连接线图标变小的 bug
*2011.09.05* v3.0 beta
* [修改] zTree 的 js 代码架构全面修改,并且拆分
* [修改] zTree 的 css 样式全面修改,对浏览器可以更好地兼容,同时解决了以前1个像素差的问题
* [优化] 采用延迟加载技术,一次性加载大数据量的节点性能飞速提升
* [增加] 支持多节点同时选中、拖拽
* [增加] checkNode、checkAllNodes 等多种方法
* [增加] IE6 自动取消动画展开、折叠的功能
* [修正] 异步加载 & 编辑模式 能够更完美的共存
* [修正] setting 配置更加合理,并且增加了若干项配置参数
* [修正] treeNode 节点数据的属性更加合理,并且增加了一些方法
* [修正] 拖拽操作更加灵活方便,更容易制定自己的规则
* [修正] 其他若干修改,详细对比请参考 url:[http://www.treejs.cn/v3/faq.php#_101 zTree v3.0 常见问题]
{
"name": "@ztree/ztree_v3",
"description": "zTree is a multi-functional 'tree plug-ins.' based on jQuery. The main advantages of zTree includes excellent performance, flexible configuration, and the combination of multiple functions.",
"version": "3.5.46",
"homepage": "http://www.treejs.cn/v3/main.php",
"author": "zTree (https://github.com/zTree)",
"licenses": [
{
"type": "MIT",
"url": "http://www.treejs.cn/v3/main.php#_license"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/zTree/zTree_v3.git"
},
"dependencies": {
"jquery": ">=1.4.4"
},
"engines": {
"node": ">=0.10.0"
},
"keywords": [
"tree",
"jquery",
"plug-in",
"plugin",
"ztree",
"html",
"node"
],
"typings": "index.d.ts"
}
......@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = config.https?"https://192.168.9.233:20070":"http://192.168.9.233:20080"; // 测试环境url
baseUrl = config.https?"https://192.168.9.233:20070":"http://192.168.9.245:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
......
......@@ -26,7 +26,7 @@ export default {
url = "/vchans?vchan_type=vfile";
break;
}
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params);
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`
},
getFxStream(devuid, refid) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流
......
This diff could not be displayed because it is too large.
<template>
<div>
<el-dialog
title="视频源配置修改"
top="12vh"
:visible.sync="setvisible"
width="906px"
:before-close="handleClose"
>
<moveTask ref="movetask"></moveTask>
<div>
<!-- 外层内容 -->
<div class="leftBox">
<el-input
class="search-input"
prefix-icon="el-icon-search"
placeholder="请输入内容"
v-model="searchText"
>
</el-input>
<div class="">
</div>
<div class="treeBox">
<el-tree
:props="props"
:load="loadNode"
lazy
:node-key="props.id"
show-checkbox
@node-click="vchanClick"
ref="tree"
@check="handleCheckChange"
:filter-node-method="filterNode"
:render-content="renderContent"
></el-tree>
</div>
</div>
<div class="rightBox">
<div class="imgBox">
<videoplay ref="video" :playurl="play_url"></videoplay>
</div>
<div class="tableBox">
<el-table height="286" :data="tableData" border width="300">
<el-table-column align="center" prop="name" label="视频源名称">
<template slot-scope="scope">
<div @click="rowclick(scope.row)">
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="视频状态">
<template slot-scope="scope">
<div v-html="statusFormatter(scope.row)"></div>
</template>
</el-table-column>
<el-table-column
align="center"
width="136"
prop="operation"
label="视频操作"
>
<template slot-scope="scope">
<el-tooltip
content="迁移"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="icon-fanxing-qianyi moveIcon"
@click="moveFun(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip
content="删除"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
:class="{'el-icon-delete':true, 'delIcon':true,'nodel': scope.row.enableStatus == 5?true:false}"
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div style="clear: both;"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="editsubTask">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import videoplay from "../public/videoPlay";
import moveTask from "./moveSubTask";
var jsond = require("./treedata.json")
export default {
data() {
return {
tableData: [],
play_url: "",
user_unid: "",
formData: {},
editData: {},
taskData: {},
moveTaskData: [],
searchText:"",
setvisible: false,
props: {
id: "vchan_refid",
label: "name",
children: "zones",
disabled: "disabled",
isLeaf: "leaf"
},
sessionData: {},
data: [],
defaultProps: {
children: "children",
label: "label",
id: "vchan_refid"
}
};
},
props: {
pedittype: {
type: String,
default: "add"
}
},
watch: {
parentData(val) {
// this.sessionData = JSON.parse(JSON.stringify(val));
// this.editData = val;
},
searchText(val){
this.$refs.tree.filter(val);
}
},
components: {
videoplay,
moveTask
},
mounted() {
console.log(this.setvisible);
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showModal(val) {
this.taskData = val;
this.tableData = [];
this.setvisible = true;
this.$store.commit("setocxstate", 1);
this.editData = val;
this.$api.task.getSubTask(val.task_id).then(res => {
let ary = [];
let data = res.list_data;
for (let i in data) {
if (data[i].vchan) {
data[i].vchan.subtask_id = data[i].subtask_id;
data[i].vchan.refid = data[i].vchan.vchan_refid;
data[i].vchan.name = data[i].vchan.vchan_name;
data[i].vchan.running_status = data[i].running_status;
data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.enableStatus = data[i].enableStatus;
} else {
data.vchan = {
subtask_id: data[i].subtask_id,
refid: "",
vchan_name: data[i].subtask_name,
name: data[i].subtask_name,
running_status: data[i].running_status,
play_url: data[i].rtsp_url,
enableStatus: data[i].enableStatus
};
}
ary.push(data[i].vchan);
}
this.tableData = ary;
this.checkvckan();
});
},
statusFormatter(row) {
let data = row.enableStatus;
if (data == 2) {
return "<span class='runningbox statusbox'>工作中</span>";
} else if (data == 1) {
return "<span class='nomoralbox statusbox'>部署中</span>";
} else if (data == 3) {
return "<span class='pausebox statusbox'>暂停中</span>";
} else if (data == 4) {
return "<span class='pausebox statusbox'>已暂停</span>";
} else if (data == 5) {
return "<span class='deletebox statusbox'>删除中</span>";
} else if (data == 6) {
return "<span class='deletebox statusbox'>已删除</span>";
} else if (data == 7) {
return "<span class='pausebox statusbox'>启动中</span>";
} else if (data == 0) {
return "<span class='nomoralbox statusbox'>未部署</span>";
} else {
// return "<span class='errorbox statusbox'>异常</span>";
return "<span class='nomoralbox statusbox'>部署中</span>";
}
},
handleCheckChange(data, node) {
console.log(data);
let staus = false;
if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_refid == data.vchan_refid) {
this.delFun(i, this.tableData[i], "tree");
staus = true;
break;
}
}
}
if (data.leaf && !staus) {
// this.editsubTask(data);
this.tableData.push(data);
staus = false;
}
},
editTask(data) {
// let data = this.taskData;
this.$api.task.editTask(data, data.task_id).then(res => {
this.$emit("refresh");
});
},
editsubTask() {
let status = true;
let subData = [];
this.tableData.map(e => {
let vchan = e;
let data = {
is_dome: false,
subtask_name: vchan.name,
vchan: {
vchan_refid: vchan.refid || vchan.vchan_refid,
vchan_duid: vchan.duid || vchan.vchan_duid,
vdev_unid: this.dev_unid,
vchan_name: vchan.name
},
assign_to: {
id: this.taskData.plate_type,
flag: 1
}
};
subData.push(data);
});
console.log(subData);
this.$api.task
.addSubtaskList(this.editData.task_id, subData)
.then(res => {
if (res && !res.ecode && res.length > 0) {
this.$message({
message: "添加成功",
type: "success"
});
this.setvisible = false;
let subname ="";
res.map(ele => {
subname += ele.subtaskName+";"
});
let taskname = this.taskData.task_name;
this.$logs.oplogs(res,'serv_task',`${taskname}添加视频源${subname}`);
this.$emit("refresh");
} else {
if (res.length == 0) {
this.setvisible = false; //未添加新任务
} else {
this.$message.error(res.enote);
}
}
});
},
playVideo(data) {
console.log("b", data);
},
delFun(index, data, action = "tree") {
if (data.enableStatus == 5) {
return;
}
this.$store.commit("setocxstate", 0);
this.$confirm("删除视频源, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (!data.subtask_id) {
this.tableData.forEach((ele, i) => {
if (ele.vchan_refid == data.vchan_refid) {
this.tableData.splice(i, 1);
this.checkvckan();
}
});
return;
}
this.$api.task
.deleteSubTask(this.editData.task_id, data.subtask_id)
.then(res => {
if (res.ecode == "200") {
this.$message({
type: "success",
message: "删除成功!"
});
this.tableData.splice(index, 1);
this.checkvckan();
this.$store.commit("setocxstate", 1);
} else {
this.$message({
type: "error",
message: res.enote
});
}
let taskname = this.taskData.task_name;
debugger
console.log(data)
this.$logs.oplogs(res,'serv_task',`${taskname}删除视频源${data.vchan_name}`);
});
if (action != "tree") {
setTimeout(() => {
this.checkvckan();
}, 0);
}
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
this.checkvckan();
this.$store.commit("setocxstate", 1);
});
},
append(data) {
const newChild = { id: id++, label: "testtest", children: [] };
if (!data.children) {
this.$set(data, "children", []);
}
data.children.push(newChild);
},
checkvckan() {
this.$refs.tree.setCheckedKeys([]);
let arr = [];
this.tableData.forEach(ele => {
arr.push(ele.vchan_refid);
});
console.log(arr);
this.$refs.tree.setCheckedKeys(arr);
},
rowclick(row) {
//播放视频
// this.vchanClick(row);
// console.log("row", row);
// this.play_url = {
// rtsp_url: row.play_url
// };
// setTimeout(() => {
// this.$refs.video.videoPlay();
// }, 100);
},
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([
{
dev_unid: this.dev_unid,
refid: "",
name: "外部设备",
leaf: false,
disabled: true
},
{
dev_unid: this.dev_unid,
refid: "",
name: "内部设备",
leaf: false,
disabled: true
},
{
dev_unid: this.dev_unid,
refid: "",
name: "短视频",
leaf: false,
disabled: true
}
]);
}
if (node.level === 1) {
// http请求
let params = {
offset: 0,
limit: ""
};
this.$api.device
.getDevtree(this.dev_unid, node.data.name, params)
.then(data => {
// let node = require('../../assets/js/vchan_struct')
let vchans = data.vchan_struct || data.list_data;
for (let i in vchans) {
const vchan = vchans[i];
vchan.leaf =
vchan.typea == 1 ||
vchan.vchan_type == "camera" ||
Boolean(vchan.vchan_refid);
vchan.disabled = !vchan.leaf;
vchan.name =
vchan.name || vchan.org_name || vchan.vchan_name || "未命名";
vchan.leafNode = vchan.typea
? "extern"
: vchan.vchan_type === "vfile"
? "vfile"
: "camera";
if (vchan.leaf) {
vchan.childs = "";
}
vchan.vchan_refid = vchan.refid || vchan.vchan_refid;
}
resolve(vchans);
this.checkvckan();
});
return;
}
for (let i in node.data.childs) {
const element = node.data.childs[i];
// console.log(element.childs)
// element.leaf = (element.typea == 1&&element.childs&&element.childs.length < 1)|| element.vchan_type == "camera" ;
element.leaf = element.typea == 1 || element.vchan_type == "camera" ;
element.disabled = !element.leaf;
element.name =
element.name || element.org_name || element.vchan_name || "未命名";
element.leafNode = element.typea
? "extern"
: element.vchan_type === "vfile"
? "vfile"
: "camera";
}
if (!node.data.childs.length) {
this.$message({
type: "info",
message: "该组织下没有像机"
});
}
setTimeout(() => {
this.checkvckan();
}, 10);
return resolve(node.data.childs);
},
renderContent(h, { node, data, store }) {
return (
<span class="custom-tree-node">
<el-tooltip
popper-class="tasktip"
effect="dark"
content={node.label}
placement="top-start"
>
<span>{node.label}</span>
</el-tooltip>
</span>
);
},
vchanClick(node) {
if (!node.refid && !node.vchan_refid) {
return;
}
try {
window.clearTimeout(this.timeout1);
window.clearTimeout(this.timeout2);
} catch (err) {
console.log(err);
}
// var e = e || window.event;
this.play_url = "";
// if (this.testIe.isIe) {
try {
let video_ocx = document.getElementById("VionVideo");
let stopRes = video_ocx.StopPlaySip(0);
let stopRtspRes = video_ocx.StopPlay(0);
console.log("视频新建任务,停止sip播放返回值:", stopRes);
console.log("视频新建任务,停止rtsp播放返回值:", stopRtspRes);
} catch (err) {
console.log("视频新建任务,停止异常:", err.message);
}
// 判断播放sip or rtsp
if (node.leafNode === "camera" || node.leafNode === "vfile") {
if (node.video_url) {
if (node.leafNode === "vfile") {
debugger;
this.play_url = {
rtsp_url: node.video_url
};
} else {
this.play_url = {
rtsp_url: node.video_url
};
}
console.log("playURL:", JSON.stringify(this.play_url));
setTimeout(() => {
this.$refs.video.videoPlay();
}, 0);
} else {
alert("播放地址不存在!");
}
} else {
this.getSipSetting(node.refid);
}
// } else {
// this.getSendingCount = 1;
// this.isNeedRewriteIsSending = true;
// this.currentVchan = node.refid || node.vchan_refid;
// }
},
getSipSetting: function(refid) {
if (this.dev_unid) {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then(res => {
if (!res.ecode) {
console.log("获取sip配置返回:", JSON.stringify(res));
this.play_url = res;
this.play_url.devId = refid;
console.log("playUrl", JSON.stringify(res));
for (let attr of Object.keys(this.play_url)) {
if (this.play_url[attr] === "") {
setTimeout(() => {
this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!",
type: "error"
});
}, 0);
return;
}
}
setTimeout(() => {
this.$refs.video.videoPlay();
}, 100);
} else {
this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!",
type: "error"
});
}
});
} else {
console.log("运维ID获取失败");
this.$message({
type: "warning",
message: "运维ID获取失败"
});
}
},
remove(node, data) {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
},
handleNodeClick(data) {
console.log(data);
},
handleClose() {
let video_ocx = document.getElementById("VionVideo");
try {
let stopRes = video_ocx.StopPlaySip(0);
let stopRtspRes = video_ocx.StopPlay(0);
this.setvisible = false;
this.$store.commit("setocxstate", 0);
this.$refs.tree.setCheckedKeys([]);
} catch (error) {
this.setvisible = false;
console.log(error);
}
},
save() {
this.setvisible = false;
this.$emit("refresh");
},
moveFun(index, row) {
this.$refs.movetask.initMoveTask(row, this.taskData);
}
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
}
};
</script>
<style scoped="scoped" lang="scss">
.bofangIcon {
cursor: pointer;
color: #cccccc;
font-size: 16px;
margin-left: 26px;
}
.moveIcon {
cursor: pointer;
color: #34b3a2;
font-size: 16px;
}
.delIcon {
cursor: pointer;
color: #f2365a;
font-size: 16px;
}
.leftBox {
width: 233px;
height: 630px;
border: 1px solid rgba(229, 229, 229, 1);
float: left;
overflow: auto;
}
.titles {
height: 30px;
line-height: 30px;
padding-left: 13px;
background: $title-backgroud;
font-size: 14px;
color: $title-color;
}
.treeBox {
padding: 6px;
width:1000px
// overflow: auto;
}
.rightBox {
float: left;
width: 599px;
overflow: hidden;
}
.imgBox {
width: 587px;
height: 330px;
border: 1px solid #444444;
margin-bottom: 14px;
}
.search-input{
width: 90%;
margin: 10px 5%;
}
</style>
......@@ -11,17 +11,23 @@
<div>
<!-- 外层内容 -->
<div class="leftBox">
<el-input
<!-- <el-input
class="search-input"
prefix-icon="el-icon-search"
placeholder="请输入内容"
v-model="searchText"
>
</el-input>
<div class="">
</div>
</el-input> -->
<input
type="text"
id="key"
value=""
class="empty"
placeholder="请输入关键字"
/>
<div class=""></div>
<div class="treeBox">
<el-tree
<!-- <el-tree
:props="props"
:load="loadNode"
lazy
......@@ -32,7 +38,17 @@
@check="handleCheckChange"
:filter-node-method="filterNode"
:render-content="renderContent"
></el-tree>
></el-tree> -->
<!-- <tree
:setting="treesetting"
:nodes="nodes"
@onClick="onClick"
@onCheck="onCheck"
@onCreated="handleCreated"
@onExpand="onExpand"
@onAsyncSuccess="onAsyncSuccess"
/> -->
<div id="treeDemo" class="ztree"></div>
</div>
</div>
<div class="rightBox">
......@@ -79,7 +95,11 @@
:visible-arrow="false"
>
<span
:class="{'el-icon-delete':true, 'delIcon':true,'nodel': scope.row.enableStatus == 5?true:false}"
:class="{
'el-icon-delete': true,
delIcon: true,
nodel: scope.row.enableStatus == 5 ? true : false,
}"
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
......@@ -88,7 +108,7 @@
</el-table>
</div>
</div>
<div style="clear: both;"></div>
<div style="clear: both"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
......@@ -100,70 +120,259 @@
<script>
import videoplay from "../public/videoPlay";
import moveTask from "./moveSubTask";
var jsond = require("./treedata.json")
export default {
data() {
return {
setting: {
async: {
enable: true,
type: "get",
dataFilter: this.filterNode,
url: this.getUrl,
otherParam: ["offset", "0", "limit", ""],
},
check: {
enable: true,
},
data: {
key: {
children: "childs",
id: "vchan_refid",
},
simpleData: {
enable: true,
},
},
view: {
expandSpeed: "",
showIcon: false,
},
callback: {
// beforeExpand: beforeExpand,
onClick: this.vchanClick,
beforeClick: this.beforeClick,
onAsyncSuccess: this.onAsyncSuccess,
onCheck: this.checkNode,
onExpand: this.onExpand,
beforeCheck: this.beforeCheck,
// onAsyncError: onAsyncError
},
},
tableData: [],
zNodes: [
{
name: "外部设备",
id: "0",
count: 500,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "内部设备",
id: "1",
count: 1000,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
{
name: "短视频",
id: "2",
count: 2000,
times: 1,
isParent: true,
dev_unid: this.dev_unid,
},
],
nodes: [
{
dev_unid: this.dev_unid,
id: 0,
refid: "",
name: "外部设备",
leaf: false,
disabled: true,
isParent: true,
children: [],
},
{
dev_unid: this.dev_unid,
refid: "",
id: 1,
name: "内部设备",
leaf: false,
isParent: true,
disabled: true,
children: [],
},
{
dev_unid: this.dev_unid,
refid: "",
id: 2,
name: "短视频",
leaf: false,
isParent: true,
disabled: true,
children: [],
},
],
play_url: "",
user_unid: "",
formData: {},
editData: {},
taskData: {},
moveTaskData: [],
searchText:"",
searchText: "",
setvisible: false,
props: {
id: "vchan_refid",
label: "name",
children: "zones",
disabled: "disabled",
isLeaf: "leaf"
isLeaf: "leaf",
},
sessionData: {},
data: [],
defaultProps: {
children: "children",
label: "label",
id: "vchan_refid"
}
id: "vchan_refid",
},
};
},
props: {
pedittype: {
type: String,
default: "add"
}
default: "add",
},
},
watch: {
parentData(val) {
// this.sessionData = JSON.parse(JSON.stringify(val));
// this.editData = val;
},
searchText(val){
this.$refs.tree.filter(val);
}
searchText(val) {
this.$refs.tree.filter(val);
},
},
components: {
videoplay,
moveTask
},
mounted() {
console.log(this.setvisible);
moveTask,
},
mounted() {},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
beforeCheck(treeId, treeNode) {
if (treeNode.refid || treeNode.vchan_refid) {
let staus = false;
if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_refid == treeNode.vchan_refid) {
staus = true;
break;
}
}
}
if (!staus) {
// this.editsubTask(data);
this.tableData.push(treeNode);
staus = false;
}
} else {
return false;
}
},
checkNode(event, treeId, treeNode) {
//勾选节点
if (!treeNode.checked) {
if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_refid == treeNode.vchan_refid) {
this.delFun(i, this.tableData[i], "tree");
break;
}
}
}
}
},
getUrl(treeId, treeNode) {
if (treeNode.level === 0) {
// http请求
let params = {
offset: 0,
limit: "",
};
return this.$api.device.getDevtree(
this.dev_unid,
treeNode.name,
params
);
}
},
onAsyncSuccess(event, treeId, treeNode, msg) {
// this.checkvckan()
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
let arr = [];
setTimeout(() => {
this.tableData.forEach((ele) => {
var id = zTree.getNodeByTId(ele.vchan_refid);
if (id) {
id.chkDisabled = true;
zTree.checkNode(id, true, false, function () {});
}
});
}, 1000);
// zTree.checkNode();
},
onExpand(ev, treeid, treenode) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
this.tableData.forEach((ele) => {
// var id = zTree.getNodeByTId(ele.refid);
var nodes = zTree.getNodesByFilter(function (node) {
return node.vchan_refid == ele.vchan_refid;
}, true);
debugger;
if (nodes) {
nodes.checktype = true;
zTree.checkNode(nodes, true, false, function () {});
}
});
},
filterNode(treeId, parentNode, childNodes) {
var treenode = null;
if (!childNodes) return null;
if (parentNode.name === "短视频") {
var nodes = [];
childNodes.list_data.map((ele) => {
ele.name = ele.vchan_name;
nodes.push(ele);
});
treenode = nodes;
} else if (parentNode.name === "内部设备") {
let vchans = childNodes.vchan_struct || childNodes.list_data;
treenode = this.buildvchantree(vchans);
} else {
treenode = childNodes.vchan_struct;
}
return treenode;
},
buildvchantree(datas) {
for (let i in datas) {
datas[i].name =
datas[i].name || datas[i].org_name || datas[i].vchan_name || "未命名";
if (datas[i].childs) {
datas[i].childs = this.buildvchantree(datas[i].childs);
}
}
return datas;
},
showModal(val) {
this.taskData = val;
this.tableData = [];
this.setvisible = true;
this.$store.commit("setocxstate", 1);
this.editData = val;
this.$api.task.getSubTask(val.task_id).then(res => {
this.$api.task.getSubTask(val.task_id).then((res) => {
let ary = [];
let data = res.list_data;
for (let i in data) {
......@@ -183,7 +392,7 @@ export default {
name: data[i].subtask_name,
running_status: data[i].running_status,
play_url: data[i].rtsp_url,
enableStatus: data[i].enableStatus
enableStatus: data[i].enableStatus,
};
}
ary.push(data[i].vchan);
......@@ -191,6 +400,12 @@ export default {
this.tableData = ary;
this.checkvckan();
});
var _this = this;
var ztree = null;
setTimeout(() => {
ztree = $.fn.zTree.init($("#treeDemo"), _this.setting, _this.zNodes);
fuzzySearch("treeDemo", "#key", null, true); //初始化模糊搜索方法
}, 10);
},
statusFormatter(row) {
let data = row.enableStatus;
......@@ -216,12 +431,11 @@ export default {
}
},
handleCheckChange(data, node) {
console.log(data);
let staus = false;
if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_refid == data.vchan_refid) {
this.delFun(i, this.tableData[i], "tree");
this.delFun(i, this.tableData[i], "tree");
staus = true;
break;
}
......@@ -235,14 +449,14 @@ export default {
},
editTask(data) {
// let data = this.taskData;
this.$api.task.editTask(data, data.task_id).then(res => {
this.$api.task.editTask(data, data.task_id).then((res) => {
this.$emit("refresh");
});
},
editsubTask() {
let status = true;
let subData = [];
this.tableData.map(e => {
this.tableData.map((e) => {
let vchan = e;
let data = {
is_dome: false,
......@@ -251,31 +465,35 @@ export default {
vchan_refid: vchan.refid || vchan.vchan_refid,
vchan_duid: vchan.duid || vchan.vchan_duid,
vdev_unid: this.dev_unid,
vchan_name: vchan.name
vchan_name: vchan.name,
},
assign_to: {
id: this.taskData.plate_type,
flag: 1
}
flag: 1,
},
};
subData.push(data);
});
console.log(subData);
this.$api.task
.addSubtaskList(this.editData.task_id, subData)
.then(res => {
.then((res) => {
if (res && !res.ecode && res.length > 0) {
this.$message({
message: "添加成功",
type: "success"
type: "success",
});
this.setvisible = false;
let subname ="";
res.map(ele => {
subname += ele.subtaskName+";"
let subname = "";
res.map((ele) => {
subname += ele.subtaskName + ";";
});
let taskname = this.taskData.task_name;
this.$logs.oplogs(res,'serv_task',`${taskname}添加视频源${subname}`);
let taskname = this.taskData.task_name;
this.$logs.oplogs(
res,
"serv_task",
`${taskname}添加视频源${subname}`
);
this.$emit("refresh");
} else {
if (res.length == 0) {
......@@ -284,12 +502,8 @@ export default {
this.$message.error(res.enote);
}
}
});
},
playVideo(data) {
console.log("b", data);
},
delFun(index, data, action = "tree") {
if (data.enableStatus == 5) {
return;
......@@ -298,7 +512,7 @@ export default {
this.$confirm("删除视频源, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
type: "warning",
})
.then(() => {
if (!data.subtask_id) {
......@@ -312,11 +526,11 @@ export default {
}
this.$api.task
.deleteSubTask(this.editData.task_id, data.subtask_id)
.then(res => {
.then((res) => {
if (res.ecode == "200") {
this.$message({
type: "success",
message: "删除成功!"
message: "删除成功!",
});
this.tableData.splice(index, 1);
this.checkvckan();
......@@ -324,13 +538,15 @@ export default {
} else {
this.$message({
type: "error",
message: res.enote
message: res.enote,
});
}
let taskname = this.taskData.task_name;
debugger
console.log(data)
this.$logs.oplogs(res,'serv_task',`${taskname}删除视频源${data.vchan_name}`);
let taskname = this.taskData.task_name;
this.$logs.oplogs(
res,
"serv_task",
`${taskname}删除视频源${data.vchan_name}`
);
});
if (action != "tree") {
setTimeout(() => {
......@@ -341,7 +557,7 @@ export default {
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
message: "已取消删除",
});
this.checkvckan();
this.$store.commit("setocxstate", 1);
......@@ -356,13 +572,19 @@ export default {
},
checkvckan() {
this.$refs.tree.setCheckedKeys([]);
let arr = [];
this.tableData.forEach(ele => {
arr.push(ele.vchan_refid);
// this.$refs.tree.setCheckedKeys([]);
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.checkAllNodes(false);
this.tableData.forEach((ele) => {
// var id = zTree.getNodeByTId(ele.refid);
var nodes = zTree.getNodesByFilter(function (node) {
return node.vchan_refid == ele.vchan_refid;
}, true);
if (nodes) {
nodes.checktype = true;
zTree.checkNode(nodes, true, false, function () {});
}
});
console.log(arr);
this.$refs.tree.setCheckedKeys(arr);
},
rowclick(row) {
//播放视频
......@@ -375,109 +597,18 @@ export default {
// this.$refs.video.videoPlay();
// }, 100);
},
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([
{
dev_unid: this.dev_unid,
refid: "",
name: "外部设备",
leaf: false,
disabled: true
},
{
dev_unid: this.dev_unid,
refid: "",
name: "内部设备",
leaf: false,
disabled: true
},
{
dev_unid: this.dev_unid,
refid: "",
name: "短视频",
leaf: false,
disabled: true
}
]);
}
if (node.level === 1) {
// http请求
let params = {
offset: 0,
limit: ""
};
this.$api.device
.getDevtree(this.dev_unid, node.data.name, params)
.then(data => {
let vchans = data.vchan_struct || data.list_data;
for (let i in vchans) {
const vchan = vchans[i];
vchan.leaf =
vchan.typea == 1 ||
vchan.vchan_type == "camera" ||
Boolean(vchan.vchan_refid);
vchan.disabled = !vchan.leaf;
vchan.name =
vchan.name || vchan.org_name || vchan.vchan_name || "未命名";
vchan.leafNode = vchan.typea
? "extern"
: vchan.vchan_type === "vfile"
? "vfile"
: "camera";
if (vchan.leaf) {
vchan.childs = "";
}
vchan.vchan_refid = vchan.refid || vchan.vchan_refid;
}
resolve(vchans);
this.checkvckan();
});
return;
}
for (let i in node.data.childs) {
const element = node.data.childs[i];
// console.log(element.childs)
// element.leaf = (element.typea == 1&&element.childs&&element.childs.length < 1)|| element.vchan_type == "camera" ;
element.leaf = element.typea == 1 || element.vchan_type == "camera" ;
element.disabled = !element.leaf;
element.name =
element.name || element.org_name || element.vchan_name || "未命名";
element.leafNode = element.typea
? "extern"
: element.vchan_type === "vfile"
? "vfile"
: "camera";
}
if (!node.data.childs.length) {
this.$message({
type: "info",
message: "该组织下没有像机"
});
}
setTimeout(() => {
this.checkvckan();
}, 10);
return resolve(node.data.childs);
},
renderContent(h, { node, data, store }) {
return (
<span class="custom-tree-node">
<el-tooltip
popper-class="tasktip"
effect="dark"
content={node.label}
placement="top-start"
>
<span>{node.label}</span>
</el-tooltip>
</span>
);
getData() {
let tdata = require("../../assets/js/vchan_struct.json");
this.nodes = [];
},
vchanClick(node) {
if (!node.refid && !node.vchan_refid) {
return;
beforeClick(treeId, treeNode, clickFlag) {
let status = true;
if (!treeNode.refid && !treeNode.vchan_refid) {
status = false;
}
return status;
},
vchanClick(event, treeId, node) {
try {
window.clearTimeout(this.timeout1);
window.clearTimeout(this.timeout2);
......@@ -497,16 +628,17 @@ export default {
console.log("视频新建任务,停止异常:", err.message);
}
// 判断播放sip or rtsp
if (node.leafNode === "camera" || node.leafNode === "vfile") {
debugger;
if (node.vchan_type === "camera" || node.vchan_type === "vfile") {
if (node.video_url) {
if (node.leafNode === "vfile") {
if (node.vchan_type === "vfile") {
debugger;
this.play_url = {
rtsp_url: node.video_url
rtsp_url: node.video_url,
};
} else {
this.play_url = {
rtsp_url: node.video_url
rtsp_url: node.video_url,
};
}
......@@ -527,9 +659,9 @@ export default {
// }
},
getSipSetting: function(refid) {
getSipSetting: function (refid) {
if (this.dev_unid) {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then(res => {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then((res) => {
if (!res.ecode) {
console.log("获取sip配置返回:", JSON.stringify(res));
this.play_url = res;
......@@ -540,7 +672,7 @@ export default {
setTimeout(() => {
this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!",
type: "error"
type: "error",
});
}, 0);
return;
......@@ -552,7 +684,7 @@ export default {
} else {
this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!",
type: "error"
type: "error",
});
}
});
......@@ -560,19 +692,16 @@ export default {
console.log("运维ID获取失败");
this.$message({
type: "warning",
message: "运维ID获取失败"
message: "运维ID获取失败",
});
}
},
remove(node, data) {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1);
},
handleNodeClick(data) {
console.log(data);
},
handleClose() {
let video_ocx = document.getElementById("VionVideo");
try {
......@@ -592,11 +721,12 @@ export default {
},
moveFun(index, row) {
this.$refs.movetask.initMoveTask(row, this.taskData);
}
},
},
created() {
this.user_unid = window.sessionStorage.getItem("user_unid");
}
// this.getData();
},
};
</script>
......@@ -634,9 +764,16 @@ export default {
}
.treeBox {
padding: 6px;
width:1000px
width: 1000px;
// overflow: auto;
}
.empty {
height: 30px;
width: 97%;
border-radius: 0;
border: 1px solid #ccc;
margin: 2px;
}
.rightBox {
float: left;
width: 599px;
......@@ -648,7 +785,7 @@ export default {
border: 1px solid #444444;
margin-bottom: 14px;
}
.search-input{
.search-input {
width: 90%;
margin: 10px 5%;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!