/*
* JQuery zTree core v3.5.26
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-11-03
*/
(function (q) {
var H, I, J, K, L, M, u, r = {}, v = {}, w = {}, N = {
treeId: "",
treeObj: null,
view: {
addDiyDom: null,
autoCancelSelected: !0,
dblClickExpand: !0,
expandSpeed: "fast",
fontCss: {},
nameIsHTML: !1,
selectedMulti: !0,
showIcon: !0,
showLine: !0,
showTitle: !0,
txtSelectedEnable: !1
},
data: {
key: {children: "children", name: "name", title: "", url: "url", icon: "icon"},
simpleData: {enable: !1, idKey: "id", pIdKey: "pId", rootPId: null},
keep: {parent: !1, leaf: !1}
},
async: {
enable: !1, contentType: "application/x-www-form-urlencoded", type: "post", dataType: "text",
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
}
}, x = [function (b) {
var a = b.treeObj, c = f.event;
a.bind(c.NODECREATED, function (a, c, g) {
j.apply(b.callback.onNodeCreated,
[a, c, g])
});
a.bind(c.CLICK, function (a, c, g, l, h) {
j.apply(b.callback.onClick, [c, g, l, h])
});
a.bind(c.EXPAND, function (a, c, g) {
j.apply(b.callback.onExpand, [a, c, g])
});
a.bind(c.COLLAPSE, function (a, c, g) {
j.apply(b.callback.onCollapse, [a, c, g])
});
a.bind(c.ASYNC_SUCCESS, function (a, c, g, l) {
j.apply(b.callback.onAsyncSuccess, [a, c, g, l])
});
a.bind(c.ASYNC_ERROR, function (a, c, g, l, h, f) {
j.apply(b.callback.onAsyncError, [a, c, g, l, h, f])
});
a.bind(c.REMOVE, function (a, c, g) {
j.apply(b.callback.onRemove, [a, c, g])
});
a.bind(c.SELECTED,
function (a, c, g) {
j.apply(b.callback.onSelected, [c, g])
});
a.bind(c.UNSELECTED, function (a, c, g) {
j.apply(b.callback.onUnSelected, [c, g])
})
}], y = [function (b) {
var a = f.event;
b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE).unbind(a.SELECTED).unbind(a.UNSELECTED)
}], z = [function (b) {
var a = h.getCache(b);
a || (a = {}, h.setCache(b, a));
a.nodes = [];
a.doms = []
}], A = [function (b, a, c, d, e, g) {
if (c) {
var l = h.getRoot(b), f = b.data.key.children;
c.level = a;
c.tId = b.treeId + "_" + ++l.zId;
c.parentTId = d ? d.tId : null;
c.open = typeof c.open == "string" ? j.eqs(c.open, "true") : !!c.open;
c[f] && c[f].length > 0 ? (c.isParent = !0, c.zAsync = !0) : (c.isParent = typeof c.isParent == "string" ? j.eqs(c.isParent, "true") : !!c.isParent, c.open = c.isParent && !b.async.enable ? c.open : !1, c.zAsync = !c.isParent);
c.isFirstNode = e;
c.isLastNode = g;
c.getParentNode = function () {
return h.getNodeCache(b, c.parentTId)
};
c.getPreNode = function () {
return h.getPreNode(b, c)
};
c.getNextNode = function () {
return h.getNextNode(b,
c)
};
c.getIndex = function () {
return h.getNodeIndex(b, c)
};
c.getPath = function () {
return h.getNodePath(b, c)
};
c.isAjaxing = !1;
h.fixPIdKeyValue(b, c)
}
}], t = [function (b) {
var a = b.target, c = h.getSetting(b.data.treeId), d = "", e = null, g = "", l = "", i = null, n = null,
k = null;
if (j.eqs(b.type, "mousedown")) l = "mousedown"; else if (j.eqs(b.type, "mouseup")) l = "mouseup"; else if (j.eqs(b.type, "contextmenu")) l = "contextmenu"; else if (j.eqs(b.type, "click"))if (j.eqs(a.tagName, "span") && a.getAttribute("treeNode" + f.id.SWITCH) !== null) d = j.getNodeMainDom(a).id,
g = "switchNode"; else {
if (k = j.getMDom(c, a, [{
tagName: "a",
attrName: "treeNode" + f.id.A
}])) d = j.getNodeMainDom(k).id, g = "clickNode"
} else if (j.eqs(b.type, "dblclick") && (l = "dblclick", k = j.getMDom(c, a, [{
tagName: "a",
attrName: "treeNode" + f.id.A
}]))) d = j.getNodeMainDom(k).id, g = "switchNode";
if (l.length > 0 && d.length == 0 && (k = j.getMDom(c, a, [{
tagName: "a",
attrName: "treeNode" + f.id.A
}]))) d = j.getNodeMainDom(k).id;
if (d.length > 0)switch (e = h.getNodeCache(c, d), g) {
case "switchNode":
e.isParent ? j.eqs(b.type, "click") || j.eqs(b.type, "dblclick") &&
j.apply(c.view.dblClickExpand, [c.treeId, e], c.view.dblClickExpand) ? i = H : g = "" : g = "";
break;
case "clickNode":
i = I
}
switch (l) {
case "mousedown":
n = J;
break;
case "mouseup":
n = K;
break;
case "dblclick":
n = L;
break;
case "contextmenu":
n = M
}
return {stop: !1, node: e, nodeEventType: g, nodeEventCallback: i, treeEventType: l, treeEventCallback: n}
}], B = [function (b) {
var a = h.getRoot(b);
a || (a = {}, h.setRoot(b, a));
a[b.data.key.children] = [];
a.expandTriggerFlag = !1;
a.curSelectedList = [];
a.noSelection = !0;
a.createdNodes = [];
a.zId = 0;
a._ver = (new Date).getTime()
}],
C = [], D = [], E = [], F = [], G = [], h = {
addNodeCache: function (b, a) {
h.getCache(b).nodes[h.getNodeCacheId(a.tId)] = a
}, getNodeCacheId: function (b) {
return b.substring(b.lastIndexOf("_") + 1)
}, addAfterA: function (b) {
D.push(b)
}, addBeforeA: function (b) {
C.push(b)
}, addInnerAfterA: function (b) {
F.push(b)
}, addInnerBeforeA: function (b) {
E.push(b)
}, addInitBind: function (b) {
x.push(b)
}, addInitUnBind: function (b) {
y.push(b)
}, addInitCache: function (b) {
z.push(b)
}, addInitNode: function (b) {
A.push(b)
}, addInitProxy: function (b, a) {
a ? t.splice(0, 0,
b) : t.push(b)
}, addInitRoot: function (b) {
B.push(b)
}, addNodesData: function (b, a, c, d) {
var e = b.data.key.children;
a[e] ? c >= a[e].length && (c = -1) : (a[e] = [], c = -1);
if (a[e].length > 0 && c === 0) a[e][0].isFirstNode = !1, i.setNodeLineIcos(b, a[e][0]); else if (a[e].length > 0 && c < 0) a[e][a[e].length - 1].isLastNode = !1, i.setNodeLineIcos(b, a[e][a[e].length - 1]);
a.isParent = !0;
c < 0 ? a[e] = a[e].concat(d) : (b = [c, 0].concat(d), a[e].splice.apply(a[e], b))
}, addSelectedNode: function (b, a) {
var c = h.getRoot(b);
h.isSelectedNode(b, a) || c.curSelectedList.push(a)
},
addCreatedNode: function (b, a) {
(b.callback.onNodeCreated || b.view.addDiyDom) && h.getRoot(b).createdNodes.push(a)
}, addZTreeTools: function (b) {
G.push(b)
}, exSetting: function (b) {
q.extend(!0, N, b)
}, fixPIdKeyValue: function (b, a) {
b.data.simpleData.enable && (a[b.data.simpleData.pIdKey] = a.parentTId ? a.getParentNode()[b.data.simpleData.idKey] : b.data.simpleData.rootPId)
}, getAfterA: function (b, a, c) {
for (var d = 0, e = D.length; d < e; d++)D[d].apply(this, arguments)
}, getBeforeA: function (b, a, c) {
for (var d = 0, e = C.length; d < e; d++)C[d].apply(this,
arguments)
}, getInnerAfterA: function (b, a, c) {
for (var d = 0, e = F.length; d < e; d++)F[d].apply(this, arguments)
}, getInnerBeforeA: function (b, a, c) {
for (var d = 0, e = E.length; d < e; d++)E[d].apply(this, arguments)
}, getCache: function (b) {
return w[b.treeId]
}, getNodeIndex: function (b, a) {
if (!a)return null;
for (var c = b.data.key.children, d = a.parentTId ? a.getParentNode() : h.getRoot(b), e = 0,
g = d[c].length - 1; e <= g; e++)if (d[c][e] === a)return e;
return -1
}, getNextNode: function (b, a) {
if (!a)return null;
for (var c = b.data.key.children, d = a.parentTId ?
a.getParentNode() : h.getRoot(b), e = 0,
g = d[c].length - 1; e <= g; e++)if (d[c][e] === a)return e == g ? null : d[c][e + 1];
return null
}, getNodeByParam: function (b, a, c, d) {
if (!a || !c)return null;
for (var e = b.data.key.children, g = 0, l = a.length; g < l; g++) {
if (a[g][c] == d)return a[g];
var f = h.getNodeByParam(b, a[g][e], c, d);
if (f)return f
}
return null
}, getNodeCache: function (b, a) {
if (!a)return null;
var c = w[b.treeId].nodes[h.getNodeCacheId(a)];
return c ? c : null
}, getNodeName: function (b, a) {
return "" + a[b.data.key.name]
}, getNodePath: function (b, a) {
if (!a)return null;
var c;
(c = a.parentTId ? a.getParentNode().getPath() : []) && c.push(a);
return c
}, getNodeTitle: function (b, a) {
return "" + a[b.data.key.title === "" ? b.data.key.name : b.data.key.title]
}, getNodes: function (b) {
return h.getRoot(b)[b.data.key.children]
}, getNodesByParam: function (b, a, c, d) {
if (!a || !c)return [];
for (var e = b.data.key.children, g = [], l = 0,
f = a.length; l < f; l++)a[l][c] == d && g.push(a[l]), g = g.concat(h.getNodesByParam(b, a[l][e], c, d));
return g
}, getNodesByParamFuzzy: function (b, a, c, d) {
if (!a || !c)return [];
for (var e = b.data.key.children,
g = [], d = d.toLowerCase(), l = 0,
f = a.length; l < f; l++)typeof a[l][c] == "string" && a[l][c].toLowerCase().indexOf(d) > -1 && g.push(a[l]), g = g.concat(h.getNodesByParamFuzzy(b, a[l][e], c, d));
return g
}, getNodesByFilter: function (b, a, c, d, e) {
if (!a)return d ? null : [];
for (var g = b.data.key.children, f = d ? null : [], i = 0, n = a.length; i < n; i++) {
if (j.apply(c, [a[i], e], !1)) {
if (d)return a[i];
f.push(a[i])
}
var k = h.getNodesByFilter(b, a[i][g], c, d, e);
if (d && k)return k;
f = d ? k : f.concat(k)
}
return f
}, getPreNode: function (b, a) {
if (!a)return null;
for (var c =
b.data.key.children, d = a.parentTId ? a.getParentNode() : h.getRoot(b), e = 0,
g = d[c].length; e < g; e++)if (d[c][e] === a)return e == 0 ? null : d[c][e - 1];
return null
}, getRoot: function (b) {
return b ? v[b.treeId] : null
}, getRoots: function () {
return v
}, getSetting: function (b) {
return r[b]
}, getSettings: function () {
return r
}, getZTreeTools: function (b) {
return (b = this.getRoot(this.getSetting(b))) ? b.treeTools : null
}, initCache: function (b) {
for (var a = 0, c = z.length; a < c; a++)z[a].apply(this, arguments)
}, initNode: function (b, a, c, d, e, g) {
for (var f =
0, h = A.length; f < h; f++)A[f].apply(this, arguments)
}, initRoot: function (b) {
for (var a = 0, c = B.length; a < c; a++)B[a].apply(this, arguments)
}, isSelectedNode: function (b, a) {
for (var c = h.getRoot(b), d = 0,
e = c.curSelectedList.length; d < e; d++)if (a === c.curSelectedList[d])return !0;
return !1
}, removeNodeCache: function (b, a) {
var c = b.data.key.children;
if (a[c])for (var d = 0, e = a[c].length; d < e; d++)h.removeNodeCache(b, a[c][d]);
h.getCache(b).nodes[h.getNodeCacheId(a.tId)] = null
}, removeSelectedNode: function (b, a) {
for (var c = h.getRoot(b),
d = 0,
e = c.curSelectedList.length; d < e; d++)if (a === c.curSelectedList[d] || !h.getNodeCache(b, c.curSelectedList[d].tId)) c.curSelectedList.splice(d, 1), b.treeObj.trigger(f.event.UNSELECTED, [b.treeId, a]), d--, e--
}, setCache: function (b, a) {
w[b.treeId] = a
}, setRoot: function (b, a) {
v[b.treeId] = a
}, setZTreeTools: function (b, a) {
for (var c = 0, d = G.length; c < d; c++)G[c].apply(this, arguments)
}, transformToArrayFormat: function (b, a) {
if (!a)return [];
var c = b.data.key.children, d = [];
if (j.isArray(a))for (var e = 0, g = a.length; e < g; e++)d.push(a[e]),
a[e][c] && (d = d.concat(h.transformToArrayFormat(b, a[e][c]))); else d.push(a), a[c] && (d = d.concat(h.transformToArrayFormat(b, a[c])));
return d
}, transformTozTreeFormat: function (b, a) {
var c, d, e = b.data.simpleData.idKey, g = b.data.simpleData.pIdKey, f = b.data.key.children;
if (!e || e == "" || !a)return [];
if (j.isArray(a)) {
var h = [], i = {};
for (c = 0, d = a.length; c < d; c++)i[a[c][e]] = a[c];
for (c = 0, d = a.length; c < d; c++)i[a[c][g]] && a[c][e] != a[c][g] ? (i[a[c][g]][f] || (i[a[c][g]][f] = []), i[a[c][g]][f].push(a[c])) : h.push(a[c]);
return h
} else return [a]
}
},
m = {
bindEvent: function (b) {
for (var a = 0, c = x.length; a < c; a++)x[a].apply(this, arguments)
}, unbindEvent: function (b) {
for (var a = 0, c = y.length; a < c; a++)y[a].apply(this, arguments)
}, bindTree: function (b) {
var a = {treeId: b.treeId}, c = b.treeObj;
b.view.txtSelectedEnable || c.bind("selectstart", u).css({"-moz-user-select": "-moz-none"});
c.bind("click", a, m.proxy);
c.bind("dblclick", a, m.proxy);
c.bind("mouseover", a, m.proxy);
c.bind("mouseout", a, m.proxy);
c.bind("mousedown", a, m.proxy);
c.bind("mouseup", a, m.proxy);
c.bind("contextmenu",
a, m.proxy)
}, unbindTree: function (b) {
b.treeObj.unbind("selectstart", u).unbind("click", m.proxy).unbind("dblclick", m.proxy).unbind("mouseover", m.proxy).unbind("mouseout", m.proxy).unbind("mousedown", m.proxy).unbind("mouseup", m.proxy).unbind("contextmenu", m.proxy)
}, doProxy: function (b) {
for (var a = [], c = 0, d = t.length; c < d; c++) {
var e = t[c].apply(this, arguments);
a.push(e);
if (e.stop)break
}
return a
}, proxy: function (b) {
var a = h.getSetting(b.data.treeId);
if (!j.uCanDo(a, b))return !0;
for (var a = m.doProxy(b), c = !0, d = 0, e = a.length; d <
e; d++) {
var g = a[d];
g.nodeEventCallback && (c = g.nodeEventCallback.apply(g, [b, g.node]) && c);
g.treeEventCallback && (c = g.treeEventCallback.apply(g, [b, g.node]) && c)
}
return c
}
};
H = function (b, a) {
var c = h.getSetting(b.data.treeId);
if (a.open) {
if (j.apply(c.callback.beforeCollapse, [c.treeId, a], !0) == !1)return !0
} else if (j.apply(c.callback.beforeExpand, [c.treeId, a], !0) == !1)return !0;
h.getRoot(c).expandTriggerFlag = !0;
i.switchNode(c, a);
return !0
};
I = function (b, a) {
var c = h.getSetting(b.data.treeId), d = c.view.autoCancelSelected &&
(b.ctrlKey || b.metaKey) && h.isSelectedNode(c, a) ? 0 : c.view.autoCancelSelected && (b.ctrlKey || b.metaKey) && c.view.selectedMulti ? 2 : 1;
if (j.apply(c.callback.beforeClick, [c.treeId, a, d], !0) == !1)return !0;
d === 0 ? i.cancelPreSelectedNode(c, a) : i.selectNode(c, a, d === 2);
c.treeObj.trigger(f.event.CLICK, [b, c.treeId, a, d]);
return !0
};
J = function (b, a) {
var c = h.getSetting(b.data.treeId);
j.apply(c.callback.beforeMouseDown, [c.treeId, a], !0) && j.apply(c.callback.onMouseDown, [b, c.treeId, a]);
return !0
};
K = function (b, a) {
var c = h.getSetting(b.data.treeId);
j.apply(c.callback.beforeMouseUp, [c.treeId, a], !0) && j.apply(c.callback.onMouseUp, [b, c.treeId, a]);
return !0
};
L = function (b, a) {
var c = h.getSetting(b.data.treeId);
j.apply(c.callback.beforeDblClick, [c.treeId, a], !0) && j.apply(c.callback.onDblClick, [b, c.treeId, a]);
return !0
};
M = function (b, a) {
var c = h.getSetting(b.data.treeId);
j.apply(c.callback.beforeRightClick, [c.treeId, a], !0) && j.apply(c.callback.onRightClick, [b, c.treeId, a]);
return typeof c.callback.onRightClick != "function"
};
u = function (b) {
b = b.originalEvent.srcElement.nodeName.toLowerCase();
return b === "input" || b === "textarea"
};
var j = {
apply: function (b, a, c) {
return typeof b == "function" ? b.apply(O, a ? a : []) : c
}, canAsync: function (b, a) {
var c = b.data.key.children;
return b.async.enable && a && a.isParent && !(a.zAsync || a[c] && a[c].length > 0)
}, clone: function (b) {
if (b === null)return null;
var a = j.isArray(b) ? [] : {}, c;
for (c in b)a[c] = b[c] instanceof Date ? new Date(b[c].getTime()) : typeof b[c] === "object" ? j.clone(b[c]) : b[c];
return a
}, eqs: function (b, a) {
return b.toLowerCase() === a.toLowerCase()
}, isArray: function (b) {
return Object.prototype.toString.apply(b) ===
"[object Array]"
}, $: function (b, a, c) {
a && typeof a != "string" && (c = a, a = "");
return typeof b == "string" ? q(b, c ? c.treeObj.get(0).ownerDocument : null) : q("#" + b.tId + a, c ? c.treeObj : null)
}, getMDom: function (b, a, c) {
if (!a)return null;
for (; a && a.id !== b.treeId;) {
for (var d = 0,
e = c.length; a.tagName && d < e; d++)if (j.eqs(a.tagName, c[d].tagName) && a.getAttribute(c[d].attrName) !== null)return a;
a = a.parentNode
}
return null
}, getNodeMainDom: function (b) {
return q(b).parent("li").get(0) || q(b).parentsUntil("li").parent().get(0)
}, isChildOrSelf: function (b,
a) {
return q(b).closest("#" + a).length > 0
}, uCanDo: function () {
return !0
}
}, i = {
addNodes: function (b, a, c, d, e) {
if (!b.data.keep.leaf || !a || a.isParent)if (j.isArray(d) || (d = [d]), b.data.simpleData.enable && (d = h.transformTozTreeFormat(b, d)), a) {
var g = k(a, f.id.SWITCH, b), l = k(a, f.id.ICON, b), p = k(a, f.id.UL, b);
if (!a.open) i.replaceSwitchClass(a, g, f.folder.CLOSE), i.replaceIcoClass(a, l, f.folder.CLOSE), a.open = !1, p.css({display: "none"});
h.addNodesData(b, a, c, d);
i.createNodes(b, a.level + 1, d, a, c);
e || i.expandCollapseParentNode(b, a,
!0)
} else h.addNodesData(b, h.getRoot(b), c, d), i.createNodes(b, 0, d, null, c)
}, appendNodes: function (b, a, c, d, e, g, f) {
if (!c)return [];
var j = [], n = b.data.key.children, k = (d ? d : h.getRoot(b))[n], m, Q;
if (!k || e >= k.length) e = -1;
for (var s = 0, R = c.length; s < R; s++) {
var o = c[s];
g && (m = (e === 0 || k.length == c.length) && s == 0, Q = e < 0 && s == c.length - 1, h.initNode(b, a, o, d, m, Q, f), h.addNodeCache(b, o));
m = [];
o[n] && o[n].length > 0 && (m = i.appendNodes(b, a + 1, o[n], o, -1, g, f && o.open));
f && (i.makeDOMNodeMainBefore(j, b, o), i.makeDOMNodeLine(j, b, o), h.getBeforeA(b,
o, j), i.makeDOMNodeNameBefore(j, b, o), h.getInnerBeforeA(b, o, j), i.makeDOMNodeIcon(j, b, o), h.getInnerAfterA(b, o, j), i.makeDOMNodeNameAfter(j, b, o), h.getAfterA(b, o, j), o.isParent && o.open && i.makeUlHtml(b, o, j, m.join("")), i.makeDOMNodeMainAfter(j, b, o), h.addCreatedNode(b, o))
}
return j
}, appendParentULDom: function (b, a) {
var c = [], d = k(a, b);
!d.get(0) && a.parentTId && (i.appendParentULDom(b, a.getParentNode()), d = k(a, b));
var e = k(a, f.id.UL, b);
e.get(0) && e.remove();
e = i.appendNodes(b, a.level + 1, a[b.data.key.children], a, -1, !1, !0);
i.makeUlHtml(b, a, c, e.join(""));
d.append(c.join(""))
}, asyncNode: function (b, a, c, d) {
var e, g;
if (a && !a.isParent)return j.apply(d), !1; else if (a && a.isAjaxing)return !1; else if (j.apply(b.callback.beforeAsync, [b.treeId, a], !0) == !1)return j.apply(d), !1;
if (a) a.isAjaxing = !0, k(a, f.id.ICON, b).attr({
style: "",
"class": f.className.BUTTON + " " + f.className.ICO_LOADING
});
var l = {};
for (e = 0, g = b.async.autoParam.length; a && e < g; e++) {
var p = b.async.autoParam[e].split("="), n = p;
p.length > 1 && (n = p[1], p = p[0]);
l[n] = a[p]
}
if (j.isArray(b.async.otherParam))for (e =
0, g = b.async.otherParam.length; e < g; e += 2)l[b.async.otherParam[e]] = b.async.otherParam[e + 1]; else for (var m in b.async.otherParam)l[m] = b.async.otherParam[m];
var P = h.getRoot(b)._ver;
q.ajax({
contentType: b.async.contentType,
cache: !1,
type: b.async.type,
url: j.apply(b.async.url, [b.treeId, a], b.async.url),
data: b.async.contentType.indexOf("application/json") > -1 ? JSON.stringify(l) : l,
dataType: b.async.dataType,
success: function (e) {
if (P == h.getRoot(b)._ver) {
var g = [];
try {
g = !e || e.length == 0 ? [] : typeof e == "string" ? eval("(" +
e + ")") : e
} catch (l) {
g = e
}
if (a) a.isAjaxing = null, a.zAsync = !0;
i.setNodeLineIcos(b, a);
g && g !== "" ? (g = j.apply(b.async.dataFilter, [b.treeId, a, g], g), i.addNodes(b, a, -1, g ? j.clone(g) : [], !!c)) : i.addNodes(b, a, -1, [], !!c);
b.treeObj.trigger(f.event.ASYNC_SUCCESS, [b.treeId, a, e]);
j.apply(d)
}
},
error: function (c, d, e) {
if (P == h.getRoot(b)._ver) {
if (a) a.isAjaxing = null;
i.setNodeLineIcos(b, a);
b.treeObj.trigger(f.event.ASYNC_ERROR, [b.treeId, a, c, d, e])
}
}
});
return !0
}, cancelPreSelectedNode: function (b, a, c) {
var d = h.getRoot(b).curSelectedList,
e, g;
for (e = d.length - 1; e >= 0; e--)if (g = d[e], a === g || !a && (!c || c !== g))if (k(g, f.id.A, b).removeClass(f.node.CURSELECTED), a) {
h.removeSelectedNode(b, a);
break
} else d.splice(e, 1), b.treeObj.trigger(f.event.UNSELECTED, [b.treeId, g])
}, createNodeCallback: function (b) {
if (b.callback.onNodeCreated || b.view.addDiyDom)for (var a = h.getRoot(b); a.createdNodes.length > 0;) {
var c = a.createdNodes.shift();
j.apply(b.view.addDiyDom, [b.treeId, c]);
b.callback.onNodeCreated && b.treeObj.trigger(f.event.NODECREATED, [b.treeId, c])
}
}, createNodes: function (b,
a, c, d, e) {
if (c && c.length != 0) {
var g = h.getRoot(b), l = b.data.key.children, l = !d || d.open || !!k(d[l][0], b).get(0);
g.createdNodes = [];
var a = i.appendNodes(b, a, c, d, e, !0, l), j, n;
d ? (d = k(d, f.id.UL, b), d.get(0) && (j = d)) : j = b.treeObj;
j && (e >= 0 && (n = j.children()[e]), e >= 0 && n ? q(n).before(a.join("")) : j.append(a.join("")));
i.createNodeCallback(b)
}
}, destroy: function (b) {
b && (h.initCache(b), h.initRoot(b), m.unbindTree(b), m.unbindEvent(b), b.treeObj.empty(), delete r[b.treeId])
}, expandCollapseNode: function (b, a, c, d, e) {
var g = h.getRoot(b),
l = b.data.key.children, p;
if (a) {
if (g.expandTriggerFlag) p = e, e = function () {
p && p();
a.open ? b.treeObj.trigger(f.event.EXPAND, [b.treeId, a]) : b.treeObj.trigger(f.event.COLLAPSE, [b.treeId, a])
}, g.expandTriggerFlag = !1;
if (!a.open && a.isParent && (!k(a, f.id.UL, b).get(0) || a[l] && a[l].length > 0 && !k(a[l][0], b).get(0))) i.appendParentULDom(b, a), i.createNodeCallback(b);
if (a.open == c) j.apply(e, []); else {
var c = k(a, f.id.UL, b), g = k(a, f.id.SWITCH, b), n = k(a, f.id.ICON, b);
a.isParent ? (a.open = !a.open, a.iconOpen && a.iconClose && n.attr("style",
i.makeNodeIcoStyle(b, a)), a.open ? (i.replaceSwitchClass(a, g, f.folder.OPEN), i.replaceIcoClass(a, n, f.folder.OPEN), d == !1 || b.view.expandSpeed == "" ? (c.show(), j.apply(e, [])) : a[l] && a[l].length > 0 ? c.slideDown(b.view.expandSpeed, e) : (c.show(), j.apply(e, []))) : (i.replaceSwitchClass(a, g, f.folder.CLOSE), i.replaceIcoClass(a, n, f.folder.CLOSE), d == !1 || b.view.expandSpeed == "" || !(a[l] && a[l].length > 0) ? (c.hide(), j.apply(e, [])) : c.slideUp(b.view.expandSpeed, e))) : j.apply(e, [])
}
} else j.apply(e, [])
}, expandCollapseParentNode: function (b,
a, c, d, e) {
a && (a.parentTId ? (i.expandCollapseNode(b, a, c, d), a.parentTId && i.expandCollapseParentNode(b, a.getParentNode(), c, d, e)) : i.expandCollapseNode(b, a, c, d, e))
}, expandCollapseSonNode: function (b, a, c, d, e) {
var g = h.getRoot(b), f = b.data.key.children, g = a ? a[f] : g[f], f = a ? !1 : d,
j = h.getRoot(b).expandTriggerFlag;
h.getRoot(b).expandTriggerFlag = !1;
if (g)for (var k = 0, m = g.length; k < m; k++)g[k] && i.expandCollapseSonNode(b, g[k], c, f);
h.getRoot(b).expandTriggerFlag = j;
i.expandCollapseNode(b, a, c, d, e)
}, isSelectedNode: function (b,
a) {
if (!a)return !1;
var c = h.getRoot(b).curSelectedList, d;
for (d = c.length - 1; d >= 0; d--)if (a === c[d])return !0;
return !1
}, makeDOMNodeIcon: function (b, a, c) {
var d = h.getNodeName(a, c),
d = a.view.nameIsHTML ? d : d.replace(/&/g, "&").replace(//g, ">");
b.push("", d, "")
}, makeDOMNodeLine: function (b,
a, c) {
b.push("")
}, makeDOMNodeMainAfter: function (b) {
b.push("")
}, makeDOMNodeMainBefore: function (b, a, c) {
b.push("