diff --git a/dashboard-ui/thirdparty/autoNumeric.js b/dashboard-ui/thirdparty/autonumeric/autoNumeric.js similarity index 99% rename from dashboard-ui/thirdparty/autoNumeric.js rename to dashboard-ui/thirdparty/autonumeric/autoNumeric.js index 272e04f43e..b57495f68f 100644 --- a/dashboard-ui/thirdparty/autoNumeric.js +++ b/dashboard-ui/thirdparty/autonumeric/autoNumeric.js @@ -851,7 +851,7 @@ * value must be enclosed in quotes and use the period for the decimal point * value must be larger than vMin */ - vMax: '999999999.99', + vMax: '9999999999999.99', /** minimum possible value * value must be enclosed in quotes and use the period for the decimal point * value must be smaller than vMax diff --git a/dashboard-ui/thirdparty/autonumeric/autoNumeric.min.js b/dashboard-ui/thirdparty/autonumeric/autoNumeric.min.js new file mode 100644 index 0000000000..2c812deb5e --- /dev/null +++ b/dashboard-ui/thirdparty/autonumeric/autoNumeric.min.js @@ -0,0 +1,109 @@ +(function (f) { + function m(b, a, c) { void 0 === b.selectionStart ? (b.focus(), b = b.createTextRange(), b.collapse(!0), b.moveEnd("character", c), b.moveStart("character", a), b.select()) : (b.selectionStart = a, b.selectionEnd = c) } function C(b, a) { f.each(a, function (c, d) { "function" === typeof d ? a[c] = d(b, a, c) : "function" === typeof b.autoNumeric[d] && (a[c] = b.autoNumeric[d](b, a, c)) }) } function p(b, a) { "string" === typeof b[a] && (b[a] *= 1) } function x(b, a) { + C(b, a); a.oEvent = null; a.tagList = "B CAPTION CITE CODE DD DEL DIV DFN DT EM H1 H2 H3 H4 H5 H6 INS KDB LABEL LI OUTPUT P Q S SAMPLE SPAN STRONG TD TH U VAR".split(" "); + var c = a.vMax.toString().split("."), d = a.vMin || 0 === a.vMin ? a.vMin.toString().split(".") : []; p(a, "vMax"); p(a, "vMin"); p(a, "mDec"); a.allowLeading = !0; a.aNeg = 0 > a.vMin ? "-" : ""; c[0] = c[0].replace("-", ""); d[0] = d[0].replace("-", ""); a.mInt = Math.max(c[0].length, d[0].length, 1); if (null === a.mDec) { var e = 0, g = 0; c[1] && (e = c[1].length); d[1] && (g = d[1].length); a.mDec = Math.max(e, g) } null === a.altDec && 0 < a.mDec && ("." === a.aDec && "," !== a.aSep ? a.altDec = "," : "," === a.aDec && "." !== a.aSep && (a.altDec = ".")); c = a.aNeg ? "([-\\" + a.aNeg + "]?)" : "(-?)"; + a.aNegRegAutoStrip = c; a.skipFirstAutoStrip = RegExp(c + "[^-" + (a.aNeg ? "\\" + a.aNeg : "") + "\\" + a.aDec + "\\d].*?(\\d|\\" + a.aDec + "\\d)"); a.skipLastAutoStrip = RegExp("(\\d\\" + a.aDec + "?)[^\\" + a.aDec + "\\d]\\D*$"); a.allowedAutoStrip = RegExp("[^" + ("-" + a.aNum + "\\" + a.aDec) + "]", "gi"); a.numRegAutoStrip = RegExp(c + "(?:\\" + a.aDec + "?(\\d+\\" + a.aDec + "\\d+)|(\\d*(?:\\" + a.aDec + "\\d*)?))"); return a + } function h(b, a, c) { + if (a.aSign) for (; -1 < b.indexOf(a.aSign) ;) b = b.replace(a.aSign, ""); b = b.replace(a.skipFirstAutoStrip, "$1$2"); b = b.replace(a.skipLastAutoStrip, + "$1"); b = b.replace(a.allowedAutoStrip, ""); a.altDec && (b = b.replace(a.altDec, a.aDec)); b = (b = b.match(a.numRegAutoStrip)) ? [b[1], b[2], b[3]].join("") : ""; if (("allow" === a.lZero || "keep" === a.lZero) && "strip" !== c) { var d = [], e = "", d = b.split(a.aDec); -1 !== d[0].indexOf("-") && (e = "-", d[0] = d[0].replace("-", "")); d[0].length > a.mInt && "0" === d[0].charAt(0) && (d[0] = d[0].slice(1)); b = e + d.join(a.aDec) } if (c && "deny" === a.lZero || c && "allow" === a.lZero && !1 === a.allowLeading) a = "^" + a.aNegRegAutoStrip + "0*(\\d" + ("leading" === c ? ")" : "|$)"), a = RegExp(a), + b = b.replace(a, "$1$2"); return b + } function q(b, a, c) { a = a.split(","); "set" === c || "focusout" === c ? (b = b.replace("-", ""), b = a[0] + b + a[1]) : "get" !== c && "focusin" !== c && "pageLoad" !== c || b.charAt(0) !== a[0] || (b = b.replace(a[0], "-"), b = b.replace(a[1], "")); return b } function y(b, a, c) { if (a && c) { var d = b.split(a); d[1] && d[1].length > c && (0 < c ? (d[1] = d[1].substring(0, c), b = d.join(a)) : b = d[0]) } return b } function s(b, a, c) { a && "." !== a && (b = b.replace(a, ".")); c && "-" !== c && (b = b.replace(c, "-")); b.match(/\d/) || (b += "0"); return b } function z(b, a) { + var c = + b.indexOf("."), d = +b; -1 !== c && (1E-6 > d && -1 < d ? (b = +b, 1E-6 > b && 0 < b && (b = (b + 10).toString(), b = b.substring(1)), 0 > b && -1 < b && (b = (b - 10).toString(), b = "-" + b.substring(2)), b = b.toString()) : (c = b.split("."), void 0 !== c[1] && (0 === +c[1] ? b = c[0] : (c[1] = c[1].replace(/0*$/, ""), b = c.join("."))))); return "keep" === a.lZero ? b : b.replace(/^0*(\d)/, "$1") + } function A(b, a, c) { c && "-" !== c && (b = b.replace("-", c)); a && "." !== a && (b = b.replace(".", a)); return b } function t(b, a) { + b = h(b, a); b = y(b, a.aDec, a.mDec); b = s(b, a.aDec, a.aNeg); var c = +b; "set" === a.oEvent && + (c < a.vMin || c > a.vMax) && f.error("The value (" + c + ") from the 'set' method falls outside of the vMin / vMax range"); return c >= a.vMin && c <= a.vMax + } function r(b, a, c) { return "" === b || b === a.aNeg ? "zero" === a.wEmpty ? b + "0" : "sign" === a.wEmpty || c ? b + a.aSign : b : null } function u(b, a) { + b = h(b, a); var c = b.replace(",", "."), d = r(b, a, !0); if (null !== d) return d; var d = "", d = 2 === a.dGroup ? /(\d)((\d)(\d{2}?)+)$/ : 4 === a.dGroup ? /(\d)((\d{4}?)+)$/ : /(\d)((\d{3}?)+)$/, e = b.split(a.aDec); a.altDec && 1 === e.length && (e = b.split(a.altDec)); var g = e[0]; + if (a.aSep) for (; d.test(g) ;) g = g.replace(d, "$1" + a.aSep + "$2"); 0 !== a.mDec && 1 < e.length ? (e[1].length > a.mDec && (e[1] = e[1].substring(0, a.mDec)), b = g + a.aDec + e[1]) : b = g; a.aSign && (d = -1 !== b.indexOf(a.aNeg), b = b.replace(a.aNeg, ""), b = "p" === a.pSign ? a.aSign + b : b + a.aSign, d && (b = a.aNeg + b)); "set" === a.oEvent && 0 > c && null !== a.nBracket && (b = q(b, a.nBracket, a.oEvent)); return b + } function v(b, a) { + b = "" === b ? "0" : b.toString(); p(a, "mDec"); var c = "", d = 0, e = "", g = "boolean" === typeof a.aPad || null === a.aPad ? a.aPad ? a.mDec : 0 : +a.aPad, n = function (a) { + a = + a.replace(0 === g ? /(\.[1-9]*)0*$/ : 1 === g ? /(\.\d[1-9]*)0*$/ : RegExp("(\\.\\d{" + g + "}[1-9]*)0*$"), "$1"); 0 === g && (a = a.replace(/\.$/, "")); return a + }; "-" === b.charAt(0) && (e = "-", b = b.replace("-", "")); b.match(/^\d/) || (b = "0" + b); "-" === e && 0 === +b && (e = ""); if (0 < +b && "keep" !== a.lZero || 0 < b.length && "allow" === a.lZero) b = b.replace(/^0*(\d)/, "$1"); var d = b.lastIndexOf("."), f = b.length - 1 - (-1 === d ? b.length - 1 : d); if (f <= a.mDec) { + c = b; if (f < g) for (-1 === d && (c += ".") ; f < g;) n = "000000".substring(0, g - f), c += n, f += n.length; else f > g ? c = n(c) : 0 === f && 0 === + g && (c = c.replace(/\.$/, "")); return e + c + } var c = d + a.mDec, d = +b.charAt(c + 1), f = b.substring(0, c + 1).split(""), h = "." === b.charAt(c) ? b.charAt(c - 1) % 2 : b.charAt(c) % 2; if (4 < d && "S" === a.mRound || 4 < d && "A" === a.mRound && "" === e || 5 < d && "A" === a.mRound && "-" === e || 5 < d && "s" === a.mRound || 5 < d && "a" === a.mRound && "" === e || 4 < d && "a" === a.mRound && "-" === e || 5 < d && "B" === a.mRound || 5 === d && "B" === a.mRound && 1 === h || 0 < d && "C" === a.mRound && "" === e || 0 < d && "F" === a.mRound && "-" === e || 0 < d && "U" === a.mRound) for (d = f.length - 1; 0 <= d; d -= 1) if ("." !== f[d]) { + f[d] = +f[d] + 1; if (10 > + f[d]) break; 0 < d && (f[d] = "0") + } f = f.slice(0, c + 1); c = n(f.join("")); return 0 === +c ? c : e + c + } function B(b, a) { this.settings = a; this.that = b; this.$that = f(b); this.formatted = !1; this.settingsClone = x(this.$that, this.settings); this.value = b.value } function l(b) { "string" === typeof b && (b = b.replace(/\[/g, "\\[").replace(/\]/g, "\\]"), b = "#" + b.replace(/(:|\.)/g, "\\$1")); return f(b) } function k(b, a, c) { var d = b.data("autoNumeric"); d || (d = {}, b.data("autoNumeric", d)); var e = d.holder; if (void 0 === e && a || c) e = new B(b.get(0), a), d.holder = e; return e } + B.prototype = { + init: function (b) { + this.value = this.that.value; this.settingsClone = x(this.$that, this.settings); this.ctrlKey = b.ctrlKey; this.cmdKey = b.metaKey; this.shiftKey = b.shiftKey; var a = this.that, c = {}; if (void 0 === a.selectionStart) { a.focus(); var d = document.selection.createRange(); c.length = d.text.length; d.moveStart("character", -a.value.length); c.end = d.text.length; c.start = c.end - c.length } else c.start = a.selectionStart, c.end = a.selectionEnd, c.length = c.end - c.start; this.selection = c; if ("keydown" === b.type || "keyup" === + b.type) this.kdCode = b.keyCode; this.which = b.which; this.formatted = this.processed = !1 + }, setSelection: function (b, a, c) { b = Math.max(b, 0); a = Math.min(a, this.that.value.length); this.selection = { start: b, end: a, length: a - b }; (void 0 === c || c) && m(this.that, b, a) }, setPosition: function (b, a) { this.setSelection(b, b, a) }, getBeforeAfter: function () { var b = this.value, a = b.substring(0, this.selection.start), b = b.substring(this.selection.end, b.length); return [a, b] }, getBeforeAfterStriped: function () { + var b = this.getBeforeAfter(); b[0] = h(b[0], + this.settingsClone); b[1] = h(b[1], this.settingsClone); return b + }, normalizeParts: function (b, a) { var c = this.settingsClone; a = h(a, c); var d = a.match(/^\d/) ? !0 : "leading"; b = h(b, c, d); "" !== b && b !== c.aNeg || "deny" !== c.lZero || "" < a && (a = a.replace(/^0*(\d)/, "$1")); d = b + a; if (c.aDec) { var e = d.match(RegExp("^" + c.aNegRegAutoStrip + "\\" + c.aDec)); e && (b = b.replace(e[1], e[1] + "0"), d = b + a) } "zero" !== c.wEmpty || d !== c.aNeg && "" !== d || (b += "0"); return [b, a] }, setValueParts: function (b, a) { + var c = this.settingsClone, d = this.normalizeParts(b, a), e = d.join(""), + d = d[0].length; return t(e, c) ? (e = y(e, c.aDec, c.mDec), d > e.length && (d = e.length), this.value = e, this.setPosition(d, !1), !0) : !1 + }, signPosition: function () { var b = this.settingsClone, a = b.aSign, c = this.that; if (a) { a = a.length; if ("p" === b.pSign) return b.aNeg && c.value && c.value.charAt(0) === b.aNeg ? [1, a + 1] : [0, a]; b = c.value.length; return [b - a, b] } return [1E3, -1] }, expandSelectionOnSign: function (b) { + var a = this.signPosition(), c = this.selection; c.start < a[1] && c.end > a[0] && ((c.start < a[0] || c.end > a[1]) && this.value.substring(Math.max(c.start, + a[0]), Math.min(c.end, a[1])).match(/^\s*$/) ? c.start < a[0] ? this.setSelection(c.start, a[0], b) : this.setSelection(a[1], c.end, b) : this.setSelection(Math.min(c.start, a[0]), Math.max(c.end, a[1]), b)) + }, checkPaste: function () { + if (void 0 !== this.valuePartsBeforePaste) { + var b = this.getBeforeAfter(), a = this.valuePartsBeforePaste; delete this.valuePartsBeforePaste; b[0] = b[0].substr(0, a[0].length) + h(b[0].substr(a[0].length), this.settingsClone); this.setValueParts(b[0], b[1]) || (this.value = a.join(""), this.setPosition(a[0].length, + !1)) + } + }, skipAllways: function (b) { + var a = this.kdCode, c = this.which, d = this.ctrlKey, e = this.cmdKey, f = this.shiftKey; if ((d || e) && "keyup" === b.type && void 0 !== this.valuePartsBeforePaste || f && 45 === a) return this.checkPaste(), !1; if (112 <= a && 123 >= a || 91 <= a && 93 >= a || 9 <= a && 31 >= a || 8 > a && (0 === c || c === a) || 144 === a || 145 === a || 45 === a || (d || e) && 65 === a) return !0; if ((d || e) && (67 === a || 86 === a || 88 === a)) { + "keydown" === b.type && this.expandSelectionOnSign(); if (86 === a || 45 === a) "keydown" === b.type || "keypress" === b.type ? void 0 === this.valuePartsBeforePaste && + (this.valuePartsBeforePaste = this.getBeforeAfter()) : this.checkPaste(); return "keydown" === b.type || "keypress" === b.type || 67 === a + } return d || e ? !0 : 37 === a || 39 === a ? (c = this.settingsClone.aSep, d = this.selection.start, e = this.that.value, "keydown" === b.type && c && !this.shiftKey && (37 === a && e.charAt(d - 2) === c ? this.setPosition(d - 1) : 39 === a && e.charAt(d + 1) === c && this.setPosition(d + 1)), !0) : 34 <= a && 40 >= a ? !0 : !1 + }, processAllways: function () { + var b; return 8 === this.kdCode || 46 === this.kdCode ? (this.selection.length ? (this.expandSelectionOnSign(!1), + b = this.getBeforeAfterStriped()) : (b = this.getBeforeAfterStriped(), 8 === this.kdCode ? b[0] = b[0].substring(0, b[0].length - 1) : b[1] = b[1].substring(1, b[1].length)), this.setValueParts(b[0], b[1]), !0) : !1 + }, processKeypress: function () { + var b = this.settingsClone, a = String.fromCharCode(this.which), c = this.getBeforeAfterStriped(), d = c[0], c = c[1]; if (a === b.aDec || b.altDec && a === b.altDec || ("." === a || "," === a) && 110 === this.kdCode) { + if (!b.mDec || !b.aDec || b.aNeg && -1 < c.indexOf(b.aNeg) || -1 < d.indexOf(b.aDec) || 0 < c.indexOf(b.aDec)) return !0; + 0 === c.indexOf(b.aDec) && (c = c.substr(1)); this.setValueParts(d + b.aDec, c); return !0 + } if ("-" === a || "+" === a) { if (!b.aNeg) return !0; "" === d && -1 < c.indexOf(b.aNeg) && (d = b.aNeg, c = c.substring(1, c.length)); d = d.charAt(0) === b.aNeg ? d.substring(1, d.length) : "-" === a ? b.aNeg + d : d; this.setValueParts(d, c); return !0 } "0" <= a && "9" >= a && (b.aNeg && "" === d && -1 < c.indexOf(b.aNeg) && (d = b.aNeg, c = c.substring(1, c.length)), 0 >= b.vMax && b.vMin < b.vMax && -1 === this.value.indexOf(b.aNeg) && "0" !== a && (d = b.aNeg + d), this.setValueParts(d + a, c)); return !0 + }, formatQuick: function () { + var b = + this.settingsClone, a = this.getBeforeAfterStriped(), c = this.value; if (("" === b.aSep || "" !== b.aSep && -1 === c.indexOf(b.aSep)) && ("" === b.aSign || "" !== b.aSign && -1 === c.indexOf(b.aSign))) { var d = [], e = "", d = c.split(b.aDec); -1 < d[0].indexOf("-") && (e = "-", d[0] = d[0].replace("-", ""), a[0] = a[0].replace("-", "")); d[0].length > b.mInt && "0" === a[0].charAt(0) && (a[0] = a[0].slice(1)); a[0] = e + a[0] } c = u(this.value, this.settingsClone); d = c.length; if (c) { + a = a[0].split(""); e = 0; for (e; e < a.length; e += 1) a[e].match("\\d") || (a[e] = "\\" + a[e]); a = RegExp("^.*?" + + a.join(".*?")); (a = c.match(a)) ? (d = a[0].length, (0 === d && c.charAt(0) !== b.aNeg || 1 === d && c.charAt(0) === b.aNeg) && b.aSign && "p" === b.pSign && (d = this.settingsClone.aSign.length + ("-" === c.charAt(0) ? 1 : 0))) : b.aSign && "s" === b.pSign && (d -= b.aSign.length) + } this.that.value = c; this.setPosition(d); this.formatted = !0 + } + }; var w = { + init: function (b) { + return this.each(function () { + var a = f(this), c = a.data("autoNumeric"), d = a.data(); if ("object" !== typeof c) { + c = f.extend({}, { + aNum: "0123456789", aSep: ",", dGroup: "3", aDec: ".", altDec: null, aSign: "", pSign: "p", + vMax: "9999999999999.99", vMin: "0.00", mDec: null, mRound: "S", aPad: !0, nBracket: null, wEmpty: "empty", lZero: "allow", aForm: !0, onSomeEvent: function () { } + }, d, b); if (c.aDec === c.aSep) return f.error("autoNumeric will not function properly when the decimal character aDec: '" + c.aDec + "' and thousand separator aSep: '" + c.aSep + "' are the same character"), this; a.data("autoNumeric", c) + } else return this; c.lastSetValue = ""; c.runOnce = !1; var e = k(a, c); if (-1 === f.inArray(a.prop("tagName"), c.tagList) && "INPUT" !== a.prop("tagName")) return f.error("The <" + + a.prop("tagName") + "> is not supported by autoNumeric()"), this; !1 === c.runOnce && c.aForm && (a.is("input[type=text], input[type=hidden], input:not([type])") && (d = !0, "" === a[0].value && "empty" === c.wEmpty && (a[0].value = "", d = !1), "" === a[0].value && "sign" === c.wEmpty && (a[0].value = c.aSign, d = !1), d && a.autoNumeric("set", a.val())), -1 !== f.inArray(a.prop("tagName"), c.tagList) && "" !== a.text() && a.autoNumeric("set", a.text())); c.runOnce = !0; a.is("input[type=text], input[type=hidden], input:not([type])") && (a.on("keydown.autoNumeric", + function (b) { e = k(a); if (e.settings.aDec === e.settings.aSep) return f.error("autoNumeric will not function properly when the decimal character aDec: '" + e.settings.aDec + "' and thousand separator aSep: '" + e.settings.aSep + "' are the same character"), this; if (e.that.readOnly) return e.processed = !0; e.init(b); e.settings.oEvent = "keydown"; if (e.skipAllways(b)) return e.processed = !0; if (e.processAllways()) return e.processed = !0, e.formatQuick(), b.preventDefault(), !1; e.formatted = !1; return !0 }), a.on("keypress.autoNumeric", + function (b) { var c = k(a), d = c.processed; c.init(b); c.settings.oEvent = "keypress"; if (c.skipAllways(b)) return !0; if (d) return b.preventDefault(), !1; if (c.processAllways() || c.processKeypress()) return c.formatQuick(), b.preventDefault(), !1; c.formatted = !1 }), a.on("keyup.autoNumeric", function (b) { + var c = k(a); c.init(b); c.settings.oEvent = "keyup"; b = c.skipAllways(b); c.kdCode = 0; delete c.valuePartsBeforePaste; a[0].value === c.settings.aSign && ("s" === c.settings.pSign ? m(this, 0, 0) : m(this, c.settings.aSign.length, c.settings.aSign.length)); + if (b || "" === this.value) return !0; c.formatted || c.formatQuick() + }), a.on("focusin.autoNumeric", function () { var b = k(a); b.settingsClone.oEvent = "focusin"; if (null !== b.settingsClone.nBracket) { var c = a.val(); a.val(q(c, b.settingsClone.nBracket, b.settingsClone.oEvent)) } b.inVal = a.val(); c = r(b.inVal, b.settingsClone, !0); null !== c && (a.val(c), "s" === b.settings.pSign ? m(this, 0, 0) : m(this, b.settings.aSign.length, b.settings.aSign.length)) }), a.on("focusout.autoNumeric", function () { + var b = k(a), c = b.settingsClone, d = a.val(), e = d; b.settingsClone.oEvent = + "focusout"; var f = ""; "allow" === c.lZero && (c.allowLeading = !1, f = "leading"); "" !== d && (d = h(d, c, f), null === r(d, c) && t(d, c, a[0]) ? (d = s(d, c.aDec, c.aNeg), d = v(d, c), d = A(d, c.aDec, c.aNeg)) : d = ""); f = r(d, c, !1); null === f && (f = u(d, c)); f !== e && a.val(f); f !== b.inVal && (a.change(), delete b.inVal); null !== c.nBracket && 0 > a.autoNumeric("get") && (b.settingsClone.oEvent = "focusout", a.val(q(a.val(), c.nBracket, c.oEvent))) + })) + }) + }, destroy: function () { return f(this).each(function () { var b = f(this); b.off(".autoNumeric"); b.removeData("autoNumeric") }) }, + update: function (b) { + return f(this).each(function () { + var a = l(f(this)), c = a.data("autoNumeric"); if ("object" !== typeof c) return f.error("You must initialize autoNumeric('init', {options}) prior to calling the 'update' method"), this; var d = a.autoNumeric("get"), c = f.extend(c, b); k(a, c, !0); if (c.aDec === c.aSep) return f.error("autoNumeric will not function properly when the decimal character aDec: '" + c.aDec + "' and thousand separator aSep: '" + c.aSep + "' are the same character"), this; a.data("autoNumeric", c); if ("" !== + a.val() || "" !== a.text()) return a.autoNumeric("set", d) + }) + }, set: function (b) { + return f(this).each(function () { + var a = l(f(this)), c = a.data("autoNumeric"), d = b.toString(), e = b.toString(); if ("object" !== typeof c) return f.error("You must initialize autoNumeric('init', {options}) prior to calling the 'set' method"), this; e !== a.attr("value") && e !== a.text() || !1 !== c.runOnce || (d = d.replace(",", ".")); e !== a.attr("value") && "INPUT" === a.prop("tagName") && !1 === c.runOnce && (d = h(d, c)); if (!f.isNumeric(+d)) return ""; d = z(d, c); c.oEvent = + "set"; c.lastSetValue = d; d.toString(); "" !== d && (d = v(d, c)); d = A(d, c.aDec, c.aNeg); t(d, c) || (d = v("", c)); d = u(d, c); if (a.is("input[type=text], input[type=hidden], input:not([type])")) return a.val(d); if (-1 !== f.inArray(a.prop("tagName"), c.tagList)) return a.text(d); f.error("The <" + a.prop("tagName") + "> is not supported by autoNumeric()"); return !1 + }) + }, get: function () { + var b = l(f(this)), a = b.data("autoNumeric"); if ("object" !== typeof a) return f.error("You must initialize autoNumeric('init', {options}) prior to calling the 'get' method"), + this; a.oEvent = "get"; var c = ""; if (b.is("input[type=text], input[type=hidden], input:not([type])")) c = b.eq(0).val(); else if (-1 !== f.inArray(b.prop("tagName"), a.tagList)) c = b.eq(0).text(); else return f.error("The <" + b.prop("tagName") + "> is not supported by autoNumeric()"), !1; if ("" === c && "empty" === a.wEmpty || c === a.aSign && ("sign" === a.wEmpty || "empty" === a.wEmpty)) return ""; null !== a.nBracket && "" !== c && (c = q(c, a.nBracket, a.oEvent)); if (a.runOnce || !1 === a.aForm) c = h(c, a); c = s(c, a.aDec, a.aNeg); 0 === +c && "keep" !== a.lZero && + (c = "0"); return "keep" === a.lZero ? c : c = z(c, a) + }, getString: function () { + var b = !1, a = l(f(this)).serialize().split("&"), c = 0; for (c; c < a.length; c += 1) { var d = a[c].split("="); "object" === typeof f('*[name="' + decodeURIComponent(d[0]) + '"]').data("autoNumeric") && null !== d[1] && void 0 !== f('*[name="' + decodeURIComponent(d[0]) + '"]').data("autoNumeric") && (d[1] = f('input[name="' + decodeURIComponent(d[0]) + '"]').autoNumeric("get"), a[c] = d.join("="), b = !0) } if (!0 === b) return a.join("&"); f.error("You must initialize autoNumeric('init', {options}) prior to calling the 'getString' method"); + return this + }, getArray: function () { var b = !1, a = l(f(this)).serializeArray(); f.each(a, function (a, d) { "object" === typeof f('*[name="' + decodeURIComponent(d.name) + '"]').data("autoNumeric") && ("" !== d.value && void 0 !== f('*[name="' + decodeURIComponent(d.name) + '"]').data("autoNumeric") && (d.value = f('input[name="' + decodeURIComponent(d.name) + '"]').autoNumeric("get").toString()), b = !0) }); if (!0 === b) return a; f.error("You must initialize autoNumeric('init', {options}) prior to calling the 'getArray' method"); return this }, + getSettings: function () { return l(f(this)).eq(0).data("autoNumeric") } + }; f.fn.autoNumeric = function (b) { if (w[b]) return w[b].apply(this, Array.prototype.slice.call(arguments, 1)); if ("object" === typeof b || !b) return w.init.apply(this, arguments); f.error('Method "' + b + '" is not supported by autoNumeric()') } +})(jQuery); \ No newline at end of file diff --git a/dashboard-ui/thirdparty/jstree1.0/jquery.jstree.min.js b/dashboard-ui/thirdparty/jstree1.0/jquery.jstree.min.js new file mode 100644 index 0000000000..b9349634e3 --- /dev/null +++ b/dashboard-ui/thirdparty/jstree1.0/jquery.jstree.min.js @@ -0,0 +1,831 @@ +(function () { + if (!jQuery || !jQuery.jstree) { + var r = !1, s = !1, t = !1; (function (b) { + b.vakata = {}; b.vakata.css = { + get_css: function (a, b, c) { a = a.toLowerCase(); var e = c.cssRules || c.rules, d = 0; do { if (e.length && d > e.length + 5) break; if (e[d].selectorText && e[d].selectorText.toLowerCase() == a) return !0 === b ? (c.removeRule && c.removeRule(d), c.deleteRule && c.deleteRule(d), !0) : e[d] } while (e[++d]); return !1 }, add_css: function (a, c) { if (b.jstree.css.get_css(a, !1, c)) return !1; c.insertRule ? c.insertRule(a + " { }", 0) : c.addRule(a, null, 0); return b.vakata.css.get_css(a) }, + remove_css: function (a, c) { return b.vakata.css.get_css(a, !0, c) }, add_sheet: function (a) { + var c = !1, e = !0; if (a.str) return a.title && (c = b("style[id='" + a.title + "-stylesheet']")[0]), c ? e = !1 : (c = document.createElement("style"), c.setAttribute("type", "text/css"), a.title && c.setAttribute("id", a.title + "-stylesheet")), c.styleSheet ? e ? (document.getElementsByTagName("head")[0].appendChild(c), c.styleSheet.cssText = a.str) : c.styleSheet.cssText = c.styleSheet.cssText + " " + a.str : (c.appendChild(document.createTextNode(a.str)), document.getElementsByTagName("head")[0].appendChild(c)), + c.sheet || c.styleSheet; if (a.url) if (document.createStyleSheet) try { document.createStyleSheet(a.url) } catch (d) { } else return c = document.createElement("link"), c.rel = "stylesheet", c.type = "text/css", c.media = "all", c.href = a.url, document.getElementsByTagName("head")[0].appendChild(c), c.styleSheet + } + }; var a = [], c = -1, d = {}, e = {}; b.fn.jstree = function (f) { + var c = "string" == typeof f, e = Array.prototype.slice.call(arguments, 1), h = this; if (c) { + if ("_" == f.substring(0, 1)) return h; this.each(function () { + var c = a[b.data(this, "jstree_instance_id")], + c = c && b.isFunction(c[f]) ? c[f].apply(c, e) : c; if ("undefined" !== typeof c && (0 === f.indexOf("is_") || !0 !== c && !1 !== c)) return h = c, !1 + }) + } else this.each(function () { + var c = b.data(this, "jstree_instance_id"), g = [], h = f ? b.extend({}, !0, f) : {}, n = b(this), q = !1, u = [], g = g.concat(e); n.data("jstree") && g.push(n.data("jstree")); h = g.length ? b.extend.apply(null, [!0, h].concat(g)) : h; "undefined" !== typeof c && a[c] && a[c].destroy(); c = parseInt(a.push({}), 10) - 1; b.data(this, "jstree_instance_id", c); h.plugins = b.isArray(h.plugins) ? h.plugins : b.jstree.defaults.plugins.slice(); + h.plugins.unshift("core"); h.plugins = h.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g, "$1$2$4").replace(/,,+/g, ",").replace(/,$/, "").split(","); q = b.extend(!0, {}, b.jstree.defaults, h); q.plugins = h.plugins; b.each(d, function (a, f) { -1 === b.inArray(a, q.plugins) ? (q[a] = null, delete q[a]) : u.push(a) }); q.plugins = u; a[c] = new b.jstree._instance(c, b(this).addClass("jstree jstree-" + c), q); b.each(a[c]._get_settings().plugins, function (b, f) { a[c].data[f] = {} }); b.each(a[c]._get_settings().plugins, function (b, f) { + d[f] && + d[f].__init.apply(a[c]) + }); setTimeout(function () { a[c] && a[c].init() }, 0) + }); return h + }; b.jstree = { + defaults: { plugins: [] }, _focused: function () { return a[c] || null }, _reference: function (f) { if (a[f]) return a[f]; var c = b(f); c.length || "string" !== typeof f || (c = b("#" + f)); return c.length ? a[c.closest(".jstree").data("jstree_instance_id")] || null : null }, _instance: function (a, c, e) { + this.data = { core: {} }; this.get_settings = function () { return b.extend(!0, {}, e) }; this._get_settings = function () { return e }; this.get_index = function () { return a }; + this.get_container = function () { return c }; this.get_container_ul = function () { return c.children("ul:eq(0)") }; this._set_settings = function (a) { e = b.extend(!0, {}, e, a) } + }, _fn: {}, plugin: function (a, c) { + c = b.extend({}, { __init: b.noop, __destroy: b.noop, _fn: {}, defaults: !1 }, c); d[a] = c; b.jstree.defaults[a] = c.defaults; b.each(c._fn, function (c, e) { + e.plugin = a; e.old = b.jstree._fn[c]; b.jstree._fn[c] = function () { + var a, f = e, d = Array.prototype.slice.call(arguments); a = new b.Event("before.jstree"); var g = !1; if (!0 !== this.data.core.locked || + "unlock" === c || "is_locked" === c) { + do { if (f && f.plugin && -1 !== b.inArray(f.plugin, this._get_settings().plugins)) break; f = f.old } while (f); if (f) { + if (0 === c.indexOf("_")) a = f.apply(this, d); else { + a = this.get_container().triggerHandler(a, { func: c, inst: this, args: d, plugin: f.plugin }); if (!1 === a) return; "undefined" !== typeof a && (d = a); a = f.apply(b.extend({}, this, { + __callback: function (a) { this.get_container().triggerHandler(c + ".jstree", { inst: this, args: d, rslt: a, rlbk: g }) }, __rollback: function () { return g = this.get_rollback() }, __call_old: function (a) { + return f.old.apply(this, + a ? Array.prototype.slice.call(arguments, 1) : d) + } + }), d) + } return a + } + } + }; b.jstree._fn[c].old = e.old; b.jstree._fn[c].plugin = a + }) + }, rollback: function (f) { f && (b.isArray(f) || (f = [f]), b.each(f, function (b, f) { a[f.i].set_rollback(f.h, f.d) })) } + }; b.jstree._fn = b.jstree._instance.prototype = {}; b(function () { + var a = navigator.userAgent.toLowerCase(), c = (a.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1], e = ".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } "; + if (/msie/.test(a) && 6 == parseInt(c, 10)) { r = !0; try { document.execCommand("BackgroundImageCache", !1, !0) } catch (d) { } e += ".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } " } /msie/.test(a) && + 7 == parseInt(c, 10) && (s = !0, e += ".jstree li a { border-width:0 !important; padding:0px 2px !important; } "); !/compatible/.test(a) && /mozilla/.test(a) && 1.9 > parseFloat(c, 10) && (t = !0, e += ".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "); b.vakata.css.add_sheet({ str: e, title: "jstree" }) + }); b.jstree.plugin("core", { + __init: function () { + this.data.core.locked = !1; this.data.core.to_open = + this.get_settings().core.initially_open; this.data.core.to_load = this.get_settings().core.initially_load + }, defaults: { html_titles: !1, animation: 500, initially_open: [], initially_load: [], open_parents: !0, notify_plugins: !0, rtl: !1, load_open: !1, strings: { loading: "Loading ...", new_node: "New node", multiple_selection: "Multiple selection" } }, _fn: { + init: function () { + this.set_focus(); this._get_settings().core.rtl && this.get_container().addClass("jstree-rtl").css("direction", "rtl"); this.get_container().html(""); this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18; this.get_container().delegate("li > ins", "click.jstree", b.proxy(function (a) { a = b(a.target); this.toggle_node(a) }, this)).bind("mousedown.jstree", b.proxy(function () { this.set_focus() }, this)).bind("dblclick.jstree", function (a) { + if (document.selection && document.selection.empty) document.selection.empty(); else if (window.getSelection) { + a = window.getSelection(); + try { a.removeAllRanges(), a.collapse() } catch (b) { } + } + }); this._get_settings().core.notify_plugins && this.get_container().bind("load_node.jstree", b.proxy(function (a, c) { var e = this._get_node(c.rslt.obj), d = this; -1 === e && (e = this.get_container_ul()); e.length && e.find("li").each(function () { var a = b(this); a.data("jstree") && b.each(a.data("jstree"), function (c, f) { d.data[c] && b.isFunction(d["_" + c + "_notify"]) && d["_" + c + "_notify"].call(d, a, f) }) }) }, this)); this._get_settings().core.load_open && this.get_container().bind("load_node.jstree", + b.proxy(function (a, c) { var e = this._get_node(c.rslt.obj), d = this; -1 === e && (e = this.get_container_ul()); e.length && e.find("li.jstree-open:not(:has(ul))").each(function () { d.load_node(this, b.noop, b.noop) }) }, this)); this.__callback(); this.load_node(-1, function () { this.loaded(); this.reload_nodes() }) + }, destroy: function () { + var f, e = this.get_index(), l = this._get_settings(), h = this; b.each(l.plugins, function (a, b) { try { d[b].__destroy.apply(h) } catch (c) { } }); this.__callback(); if (this.is_focused()) for (f in a) if (a.hasOwnProperty(f) && + f != e) { a[f].set_focus(); break } e === c && (c = -1); this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").addBack().attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig, "") }); b(document).unbind(".jstree-" + e).undelegate(".jstree-" + e); a[e] = null; delete a[e] + }, _core_notify: function (a, b) { b.opened && this.open_node(a, !1, !0) }, lock: function () { + this.data.core.locked = !0; this.get_container().children("ul").addClass("jstree-locked").css("opacity", + "0.7"); this.__callback({}) + }, unlock: function () { this.data.core.locked = !1; this.get_container().children("ul").removeClass("jstree-locked").css("opacity", "1"); this.__callback({}) }, is_locked: function () { return this.data.core.locked }, save_opened: function () { + var a = this; this.data.core.to_open = []; this.get_container_ul().find("li.jstree-open").each(function () { + this.id && a.data.core.to_open.push("#" + this.id.toString().replace(/^#/, "").replace(/\\\//g, "/").replace(/\//g, "\\/").replace(/\\\./g, ".").replace(/\./g, + "\\.").replace(/\:/g, "\\:")) + }); this.__callback(a.data.core.to_open) + }, save_loaded: function () { }, reload_nodes: function (a) { + var c = this, e = !0, d = [], m = []; a || (this.data.core.reopen = !1, this.data.core.refreshing = !0, this.data.core.to_open = b.map(b.makeArray(this.data.core.to_open), function (a) { return "#" + a.toString().replace(/^#/, "").replace(/\\\//g, "/").replace(/\//g, "\\/").replace(/\\\./g, ".").replace(/\./g, "\\.").replace(/\:/g, "\\:") }), this.data.core.to_load = b.map(b.makeArray(this.data.core.to_load), function (a) { + return "#" + + a.toString().replace(/^#/, "").replace(/\\\//g, "/").replace(/\//g, "\\/").replace(/\\\./g, ".").replace(/\./g, "\\.").replace(/\:/g, "\\:") + }), this.data.core.to_open.length && (this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open))); this.data.core.to_load.length && (b.each(this.data.core.to_load, function (a, c) { if ("#" == c) return !0; b(c).length ? d.push(c) : m.push(c) }), d.length && (this.data.core.to_load = m, b.each(d, function (a, b) { + c._is_loaded(b) || (c.load_node(b, function () { c.reload_nodes(!0) }, function () { c.reload_nodes(!0) }), + e = !1) + }))); this.data.core.to_open.length && b.each(this.data.core.to_open, function (a, b) { c.open_node(b, !1, !0) }); e && (this.data.core.reopen && clearTimeout(this.data.core.reopen), this.data.core.reopen = setTimeout(function () { c.__callback({}, c) }, 50), this.data.core.refreshing = !1, this.reopen()) + }, reopen: function () { var a = this; this.data.core.to_open.length && b.each(this.data.core.to_open, function (b, c) { a.open_node(c, !1, !0) }); this.__callback({}) }, refresh: function (a) { + var b = this; this.save_opened(); a || (a = -1); (a = this._get_node(a)) || + (a = -1); -1 !== a ? a.children("UL").remove() : this.get_container_ul().empty(); this.load_node(a, function () { b.__callback({ obj: a }); b.reload_nodes() }) + }, loaded: function () { this.__callback() }, set_focus: function () { if (!this.is_focused()) { var a = b.jstree._focused(); a && a.unset_focus(); this.get_container().addClass("jstree-focused"); c = this.get_index(); this.__callback() } }, is_focused: function () { return c == this.get_index() }, unset_focus: function () { + this.is_focused() && (this.get_container().removeClass("jstree-focused"), c = + -1); this.__callback() + }, _get_node: function (a) { var c = b(a, this.get_container()); if (c.is(".jstree") || -1 == a) return -1; c = c.closest("li", this.get_container()); return c.length ? c : !1 }, _get_next: function (a, b) { a = this._get_node(a); return -1 === a ? this.get_container().find("> ul > li:first-child") : a.length ? b ? 0 < a.nextAll("li").size() ? a.nextAll("li:eq(0)") : !1 : a.hasClass("jstree-open") ? a.find("li:eq(0)") : 0 < a.nextAll("li").size() ? a.nextAll("li:eq(0)") : a.parentsUntil(".jstree", "li").next("li").eq(0) : !1 }, _get_prev: function (a, + b) { a = this._get_node(a); if (-1 === a) return this.get_container().find("> ul > li:last-child"); if (!a.length) return !1; if (b) return 0 < a.prevAll("li").length ? a.prevAll("li:eq(0)") : !1; if (a.prev("li").length) { for (a = a.prev("li").eq(0) ; a.hasClass("jstree-open") ;) a = a.children("ul:eq(0)").children("li:last"); return a } var c = a.parentsUntil(".jstree", "li:eq(0)"); return c.length ? c : !1 }, _get_parent: function (a) { a = this._get_node(a); if (-1 == a || !a.length) return !1; a = a.parentsUntil(".jstree", "li:eq(0)"); return a.length ? a : -1 }, + _get_children: function (a) { a = this._get_node(a); return -1 === a ? this.get_container().children("ul:eq(0)").children("li") : a.length ? a.children("ul:eq(0)").children("li") : !1 }, get_path: function (a, b) { var c = [], e = this; a = this._get_node(a); if (-1 === a || !a || !a.length) return !1; a.parentsUntil(".jstree", "li").each(function () { c.push(b ? this.id : e.get_text(this)) }); c.reverse(); c.push(b ? a.attr("id") : this.get_text(a)); return c }, _get_string: function (a) { return this._get_settings().core.strings[a] || a }, is_open: function (a) { + return (a = + this._get_node(a)) && -1 !== a && a.hasClass("jstree-open") + }, is_closed: function (a) { return (a = this._get_node(a)) && -1 !== a && a.hasClass("jstree-closed") }, is_leaf: function (a) { return (a = this._get_node(a)) && -1 !== a && a.hasClass("jstree-leaf") }, correct_state: function (a) { a = this._get_node(a); if (!a || -1 === a) return !1; a.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(); this.__callback({ obj: a }) }, open_node: function (a, b, c) { + a = this._get_node(a); if (!a.length) return !1; if (!a.hasClass("jstree-closed")) return b && + b.call(), !1; var e = c || r ? 0 : this._get_settings().core.animation, d = this; this._is_loaded(a) ? (this._get_settings().core.open_parents && a.parentsUntil(".jstree", ".jstree-closed").each(function () { d.open_node(this, !1, !0) }), e && a.children("ul").css("display", "none"), a.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"), e ? a.children("ul").stop(!0, !0).slideDown(e, function () { this.style.display = ""; d.after_open(a) }) : d.after_open(a), this.__callback({ obj: a }), b && b.call()) : + (a.children("a").addClass("jstree-loading"), this.load_node(a, function () { d.open_node(a, b, c) }, b)) + }, after_open: function (a) { this.__callback({ obj: a }) }, close_node: function (a, b) { + a = this._get_node(a); var c = b || r ? 0 : this._get_settings().core.animation, e = this; if (!a.length || !a.hasClass("jstree-open")) return !1; c && a.children("ul").attr("style", "display:block !important"); a.removeClass("jstree-open").addClass("jstree-closed"); c ? a.children("ul").stop(!0, !0).slideUp(c, function () { this.style.display = ""; e.after_close(a) }) : + e.after_close(a); this.__callback({ obj: a }) + }, after_close: function (a) { this.__callback({ obj: a }) }, toggle_node: function (a) { a = this._get_node(a); if (a.hasClass("jstree-closed")) return this.open_node(a); if (a.hasClass("jstree-open")) return this.close_node(a) }, open_all: function (a, b, c) { + (a = a ? this._get_node(a) : -1) && -1 !== a || (a = this.get_container_ul()); c ? a = a.find("li.jstree-closed") : (c = a, a = a.is(".jstree-closed") ? a.find("li.jstree-closed").addBack() : a.find("li.jstree-closed")); var e = this; a.each(function () { + var a = this; + e._is_loaded(this) ? e.open_node(this, !1, !b) : e.open_node(this, function () { e.open_all(a, b, c) }, !b) + }); 0 === c.find("li.jstree-closed").length && this.__callback({ obj: c }) + }, close_all: function (a, b) { var c = this; (a = a ? this._get_node(a) : this.get_container()) && -1 !== a || (a = this.get_container_ul()); a.find("li.jstree-open").addBack().each(function () { c.close_node(this, !b) }); this.__callback({ obj: a }) }, clean_node: function (a) { + a = a && -1 != a ? b(a) : this.get_container_ul(); a = a.is("li") ? a.find("li").addBack() : a.find("li"); a.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"); + a.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(); this.__callback({ obj: a }) + }, get_rollback: function () { this.__callback(); return { i: this.get_index(), h: this.get_container().children("ul").clone(!0), d: this.data } }, set_rollback: function (a, b) { this.get_container().empty().append(a); this.data = b; this.__callback() }, load_node: function (a, b, c) { this.__callback({ obj: a }) }, _is_loaded: function (a) { return !0 }, create_node: function (a, c, e, d, m) { + a = this._get_node(a); c = "undefined" === typeof c ? + "last" : c; var k = b("
  • "), p = this._get_settings().core, n; if (-1 !== a && !a.length) return !1; if (!m && !this._is_loaded(a)) return this.load_node(a, function () { this.create_node(a, c, e, d, !0) }), !1; this.__rollback(); "string" === typeof e && (e = { data: e }); e || (e = {}); e.attr && k.attr(e.attr); e.metadata && k.data(e.metadata); e.state && k.addClass("jstree-" + e.state); e.data || (e.data = this._get_string("new_node")); b.isArray(e.data) || (n = e.data, e.data = [], e.data.push(n)); b.each(e.data, function (a, c) { + n = b(""); b.isFunction(c) && (c = c.call(this, + e)); if ("string" == typeof c) n.attr("href", "#")[p.html_titles ? "html" : "text"](c); else c.attr || (c.attr = {}), c.attr.href || (c.attr.href = "#"), n.attr(c.attr)[p.html_titles ? "html" : "text"](c.title), c.language && n.addClass(c.language); n.prepend(" "); !c.icon && e.icon && (c.icon = e.icon); c.icon && (-1 === c.icon.indexOf("/") ? n.children("ins").addClass(c.icon) : n.children("ins").css("background", "url('" + c.icon + "') center center no-repeat")); k.append(n) + }); k.prepend(" "); + -1 === a && (a = this.get_container(), "before" === c && (c = "first"), "after" === c && (c = "last")); switch (c) { + case "before": a.before(k); n = this._get_parent(a); break; case "after": a.after(k); n = this._get_parent(a); break; case "inside": case "first": a.children("ul").length || a.append("