diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index d5c2ba7f21..4182db4c6c 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -354,16 +354,15 @@ function getTaskKanbanDemoData() /** - * Render user account - * @param {String} userAccount User account + * Render user avatar + * @param {String|{account: string, avatar: string}} user User account or user object * @returns {string} */ -function renderUserAvatar(userAccount) +function renderUserAvatar(user) { - var hue = $.zui.strCode(userAccount) * 43 / 360; - return ('
' - + userAccount[0].toUpperCase() - + '
'); + if(typeof user === 'string') user = {account: user}; + if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account]; + return $('
').avatar({user: user}); } /** @@ -394,8 +393,8 @@ function renderStoryItem(item, $item, col) '#' + item.id + '', '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'story').addClass('kanban-item-story'); @@ -431,8 +430,8 @@ function renderBugItem(item, $item, col) '#' + item.id + '', '', '' + item.pri + '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'bug').addClass('kanban-item-bug'); @@ -467,8 +466,8 @@ function renderTaskItem(item, $item, col) '#' + item.id + '', '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'task').addClass('kanban-item-task'); @@ -490,7 +489,7 @@ addColumnRenderer('task', renderTaskItem); */ function renderColumnCount($count, count, col) { - var text = count + '/' + (!col.maxCount ? '' : ''); + var text = count + '/' + (col.maxCount || ''); $count.html(text + ''); } @@ -524,6 +523,20 @@ function createKanban(kanbanID, data, options) $kanban.kanban($.extend({data: data}, options)); } +/* Overload kanban default options */ +$.extend($.fn.kanban.Constructor.DEFAULTS, +{ + onRender: function() + { + var maxWidth = 0; + $('#kanbans .kanban-board').each(function() + { + maxWidth = Math.max(maxWidth, $(this).outerWidth()); + }); + $('#kanbanContainer').css('min-width', maxWidth + 40); + } +}); + /* Example code: */ $(function() { @@ -532,7 +545,7 @@ $(function() { maxColHeight: 'auto', minColWidth: 240, - dropable: true, + droppable: true, showCount: true, showZeroCount: true, countRender: renderColumnCount diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 1b12366872..3ed12f7cc8 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -48,7 +48,7 @@
-
+
Section
diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 1d99c24589..89fbdeab96 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,3929 +1,37 @@ /*! - * ZUI: ZUI for Zentao - v1.9.2 - 2021-10-15 + * ZUI: ZUI for Zentao - v1.9.2 - 2021-10-26 * http://openzui.com - * GitHub: https://github.com/easysoft/zui.git + * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function (t, e, i) { - "use strict"; - if ("undefined" == typeof t) throw new Error("ZUI requires jQuery"); - t.zui || (t.zui = function (e) { - t.isPlainObject(e) && t.extend(t.zui, e) - }); - var n = {all: -1, left: 0, middle: 1, right: 2}, o = 0; - t.zui({ - uuid: function (t) { - var e = 1e5 * (Date.now() - 1580890015292) + 10 * Math.floor(1e4 * Math.random()) + o++ % 10; - return t ? e : e.toString(36) - }, callEvent: function (t, e, n) { - if ("function" == typeof t) { - n !== i && (t = t.bind(n)); - var o = t(e); - return e && (e.result = o), !(o !== i && !o) - } - return 1 - }, strCode: function (t) { - var e = 0; - if ("string" != typeof t && (t = String(t)), t && t.length) for (var i = 0; i < t.length; ++i) e += (i + 1) * t.charCodeAt(i); - return e - }, getMouseButtonCode: function (t) { - return "number" != typeof t && (t = n[t]), t !== i && null !== t || (t = -1), t - }, defaultLang: "en", clientLang: function () { - var i, n = e.config; - if ("undefined" != typeof n && n.clientLang && (i = n.clientLang), !i) { - var o = t("html").attr("lang"); - i = o ? o : navigator.userLanguage || navigator.userLanguage || t.zui.defaultLang - } - return i.replace("-", "_").toLowerCase() - }, langDataMap: {}, addLangData: function (e, i, n) { - var o = {}; - n && i && e ? (o[i] = {}, o[i][e] = n) : e && i && !n ? (n = i, t.each(n, function (t) { - o[t] = {}, o[t][e] = n[t] - })) : !e || i || n || t.each(n, function (e) { - var i = n[e]; - t.each(i, function (t) { - o[t] || (o[t] = {}), o[t][e] = i[t] - }) - }), t.extend(!0, t.zui.langDataMap, o) - }, getLangData: function (e, i, n) { - if (!arguments.length) return t.extend({}, t.zui.langDataMap); - if (1 === arguments.length) return t.extend({}, t.zui.langDataMap[e]); - if (2 === arguments.length) { - var o = t.zui.langDataMap[e]; - return o ? i ? o[i] : o : {} - } - if (3 === arguments.length) { - i = i || t.zui.clientLang(); - var o = t.zui.langDataMap[e], a = o ? o[i] : {}; - return t.extend(!0, {}, n[i] || n.en || n.zh_cn, a) - } - return null - }, lang: function () { - return arguments.length && t.isPlainObject(arguments[arguments.length - 1]) ? t.zui.addLangData.apply(null, arguments) : t.zui.getLangData.apply(null, arguments) - }, _scrollbarWidth: 0, checkBodyScrollbar: function () { - if (document.body.clientWidth >= e.innerWidth) return 0; - if (!t.zui._scrollbarWidth) { - var i = document.createElement("div"); - i.className = "scrollbar-measure", document.body.appendChild(i), t.zui._scrollbarWidth = i.offsetWidth - i.clientWidth, document.body.removeChild(i) - } - return t.zui._scrollbarWidth - }, fixBodyScrollbar: function () { - if (t.zui.checkBodyScrollbar()) { - var e = t("body"), i = parseInt(e.css("padding-right") || 0, 10); - return t.zui._scrollbarWidth && e.css({ - paddingRight: i + t.zui._scrollbarWidth, - overflowY: "hidden" - }), !0 - } - }, resetBodyScrollbar: function () { - t("body").css({paddingRight: "", overflowY: ""}) - } - }), t.fn.callEvent = function (e, n, o) { - var a = t(this), s = e.indexOf(".zui."), r = s < 0 ? e : e.substring(0, s), l = t.Event(r, n); - if (o === i && s > 0 && (o = a.data(e.substring(s + 1))), o && o.options) { - var h = o.options[r]; - "function" == typeof h && (l.result = t.zui.callEvent(h, l, o)) - } - return a.trigger(l), l - }, t.fn.callComEvent = function (t, e, n) { - n === i || Array.isArray(n) || (n = [n]); - var o, a = this; - a.trigger(e, n); - var s = t.options[e]; - return s && (o = s.apply(t, n)), o - } -}(jQuery, window, void 0), function (t) { - "use strict"; - t.fn.fixOlPd = function (e) { - return e = e || 10, this.each(function () { - var i = t(this); - i.css("paddingLeft", Math.ceil(Math.log10(i.children().length)) * e + 10) - }) - }, t(function () { - t(".ol-pd-fix,.article ol").fixOlPd() - }) -}(jQuery), +function (t) { - "use strict"; - var e = '[data-dismiss="alert"]', i = "zui.alert", n = function (i) { - t(i).on("click", e, this.close) - }; - n.prototype.close = function (e) { - function n() { - s.trigger("closed." + i).remove() - } - - var o = t(this), a = o.attr("data-target"); - a || (a = o.attr("href"), a = a && a.replace(/.*(?=#[^\s]*$)/, "")); - var s = t(a); - e && e.preventDefault(), s.length || (s = o.hasClass("alert") ? o : o.parent()), s.trigger(e = t.Event("close." + i)), e.isDefaultPrevented() || (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one(t.support.transition.end, n).emulateTransitionEnd(150) : n()) - }; - var o = t.fn.alert; - t.fn.alert = function (e) { - return this.each(function () { - var o = t(this), a = o.data(i); - a || o.data(i, a = new n(this)), "string" == typeof e && a[e].call(o) - }) - }, t.fn.alert.Constructor = n, t.fn.alert.noConflict = function () { - return t.fn.alert = o, this - }, t(document).on("click." + i + ".data-api", e, n.prototype.close) -}(window.jQuery), function (t, e) { - "use strict"; - var i = "zui.pager", n = {page: 1, recTotal: 0, recPerPage: 10}, o = { - zh_cn: { - pageOfText: "第 {0} 页", - prev: "上一页", - next: "下一页", - first: "第一页", - last: "最后一页", - "goto": "跳转", - pageOf: "第 {page} 页", - totalPage: "共 {totalPage} 页", - totalCount: "共 {recTotal} 项", - pageSize: "每页 {recPerPage} 项", - itemsRange: "第 {start} ~ {end} 项", - pageOfTotal: "第 {page}/{totalPage} 页" - }, - zh_tw: { - pageOfText: "第 {0} 頁", - prev: "上一頁", - next: "下一頁", - first: "第一頁", - last: "最後一頁", - "goto": "跳轉", - pageOf: "第 {page} 頁", - totalPage: "共 {totalPage} 頁", - totalCount: "共 {recTotal} 項", - pageSize: "每頁 {recPerPage} 項", - itemsRange: "第 {start} ~ {end} 項", - pageOfTotal: "第 {page}/{totalPage} 頁" - }, - en: { - pageOfText: "Page {0}", - prev: "Prev", - next: "Next", - first: "First", - last: "Last", - "goto": "Goto", - pageOf: "Page {page}", - totalPage: "{totalPage} pages", - totalCount: "Total: {recTotal} items", - pageSize: "{recPerPage} per page", - itemsRange: "From {start} to {end}", - pageOfTotal: "Page {page} of {totalPage}" - } - }, a = function (e, n) { - var s = this; - s.name = i, s.$ = t(e), n = s.options = t.extend({}, a.DEFAULTS, this.$.data(), n), s.langName = n.lang || t.zui.clientLang(), s.lang = t.zui.getLangData(i, s.langName, o), s.state = {}, s.set(n.page, n.recTotal, n.recPerPage, !0), s.$.on("click", ".pager-goto-btn", function () { - var e = t(this).closest(".pager-goto"), i = parseInt(e.find(".pager-goto-input").val()); - NaN !== i && s.set(i) - }).on("click", ".pager-item", function () { - var e = t(this).data("page"); - "number" == typeof e && e > 0 && s.set(e) - }).on("click", ".pager-size-menu [data-size]", function () { - var e = t(this).data("size"); - "number" == typeof e && e > 0 && s.set(-1, -1, e) - }) - }; - a.prototype.set = function (e, i, o, a) { - var s = this; - "object" == typeof e && null !== e && (o = e.recPerPage, i = e.recTotal, e = e.page); - var r = s.state; - r || (r = t.extend({}, n)); - var l = t.extend({}, r); - return "number" == typeof o && o > 0 && (r.recPerPage = o), "number" == typeof i && i >= 0 && (r.recTotal = i), "number" == typeof e && e >= 0 && (r.page = e), r.totalPage = r.recTotal && r.recPerPage ? Math.ceil(r.recTotal / r.recPerPage) : 1, r.page = Math.max(0, Math.min(r.page, r.totalPage)), r.pageRecCount = r.recTotal, r.page && r.recTotal && (r.page < r.totalPage ? r.pageRecCount = r.recPerPage : r.page > 1 && (r.pageRecCount = r.recTotal - r.recPerPage * (r.page - 1))), r.skip = r.page > 1 ? (r.page - 1) * r.recPerPage : 0, r.start = r.skip + 1, r.end = r.skip + r.pageRecCount, r.prev = r.page > 1 ? r.page - 1 : 0, r.next = r.page < r.totalPage ? r.page + 1 : 0, s.state = r, a || l.page === r.page && l.recTotal === r.recTotal && l.recPerPage === r.recPerPage || s.$.callComEvent(s, "onPageChange", [r, l]), s.render() - }, a.prototype.createLinkItem = function (i, n, o) { - var a = this; - n === e && (n = i); - var s = t('').attr("href", i ? a.createLink(i, a.state) : "###").html(n); - return o || (s = t("
  • ").append(s).toggleClass("active", i === a.state.page).toggleClass("disabled", !i || i === a.state.page)), s - }, a.prototype.createNavItems = function (t) { - var i = this, n = i.$, o = i.state, a = o.totalPage, s = o.page, r = function (t, o) { - if (t === !1) return void n.append(i.createLinkItem(0, o || i.options.navEllipsisItem)); - o === e && (o = t); - for (var a = t; a <= o; ++a) n.append(i.createLinkItem(a)) - }; - t === e && (t = i.options.maxNavCount || 10), r(1), a > 1 && (a <= t ? r(2, a) : s < t - 2 ? (r(2, t - 2), r(!1), r(a)) : s > a - t + 2 ? (r(!1), r(a - t + 2, a)) : (r(!1), r(s - Math.ceil((t - 4) / 2), s + Math.floor((t - 4) / 2)), r(!1), r(a))) - }, a.prototype.createGoto = function () { - var e = this, i = this.state, - n = t('
    "); - return n - }, a.prototype.createSizeMenu = function () { - var e = this, i = this.state, n = t(''), o = e.options.pageSizeOptions; - "string" == typeof o && (o = o.split(",")); - for (var a = 0; a < o.length; ++a) { - var s = o[a]; - "string" == typeof s && (s = parseInt(s)); - var r = t('
  • ' + s + "
  • ").toggleClass("active", s === i.recPerPage); - n.append(r) - } - return t('
    ').addClass(e.options.menuDirection).append(n) - }, a.prototype.createElement = function (e, i, n) { - var o = this, a = o.createLinkItem.bind(o), s = o.lang; - switch (e) { - case"prev": - return a(n.prev, s.prev); - case"prev_icon": - return a(n.prev, ''); - case"next": - return a(n.next, s.next); - case"next_icon": - return a(n.next, ''); - case"first": - return a(1, s.first); - case"first_icon": - return a(1, ''); - case"last": - return a(n.totalPage, s.last); - case"last_icon": - return a(n.totalPage, ''); - case"space": - case"|": - return t('
  • '); - case"nav": - case"pages": - return void o.createNavItems(); - case"total_text": - return t(('
    ' + s.totalCount + "
    ").format(n)); - case"page_text": - return t(('
    ' + s.pageOf + "
    ").format(n)); - case"total_page_text": - return t(('
    ' + s.totalPage + "
    ").format(n)); - case"page_of_total_text": - return t(('
    ' + s.pageOfTotal + "
    ").format(n)); - case"page_size_text": - return t(('
    ' + s.pageSize + "
    ").format(n)); - case"items_range_text": - return t(('
    ' + s.itemsRange + "
    ").format(n)); - case"goto": - return o.createGoto(); - case"size_menu": - return o.createSizeMenu(); - default: - return t("
  • ").html(e.format(n)) - } - }, a.prototype.createLink = function (i, n) { - i === e && (i = this.state.page), n === e && (n = this.state); - var o = this.options.linkCreator; - return "string" == typeof o ? o.format(t.extend({}, n, {page: i})) : "function" == typeof o ? o(i, n) : "#page=" + i - }, a.prototype.render = function (e) { - var i = this, n = i.state, o = i.options.elementCreator || i.createElement, a = t.isPlainObject(o); - e = e || i.elements || i.options.elements, "string" == typeof e && (e = e.split(",")), i.elements = e, i.$.empty(); - for (var s = 0; s < e.length; ++s) { - var r = t.trim(e[s]), l = a ? o[r] || o : o, h = l.call(i, r, i.$, n); - h === !1 && (h = i.createElement(r, i.$, n)), h instanceof t && ("LI" !== h[0].tagName && (h = t("
  • ").append(h)), i.$.append(h)) - } - var c = null; - return i.$.children("li").each(function () { - var e = t(this), i = !!e.children(".pager-item").length; - c ? c.toggleClass("pager-item-right", !i) : i && e.addClass("pager-item-left"), c = i ? e : null - }), c && c.addClass("pager-item-right"), i.$.callComEvent(i, "onRender", [n]), i - }, a.DEFAULTS = t.extend({ - elements: ["first_icon", "prev_icon", "pages", "next_icon", "last_icon", "page_of_total_text", "items_range_text", "total_text"], - prevIcon: "icon-double-angle-left", - nextIcon: "icon-double-angle-right", - firstIcon: "icon-step-backward", - lastIcon: "icon-step-forward", - navEllipsisItem: '', - maxNavCount: 10, - menuDirection: "dropdown", - pageSizeOptions: [10, 20, 30, 50, 100] - }, n), t.fn.pager = function (e) { - return this.each(function () { - var n = t(this), o = n.data(i), s = "object" == typeof e && e; - o || n.data(i, o = new a(this, s)), "string" == typeof e && o[e]() - }) - }, a.NAME = i, a.LANG = o, t.fn.pager.Constructor = a, t(function () { - t('[data-ride="pager"]').pager() - }) -}(jQuery, void 0), +function (t) { - "use strict"; - var e = "zui.tab", i = function (e) { - this.element = t(e) - }; - i.prototype.show = function () { - var i = this.element, n = i.closest("ul:not(.dropdown-menu)"), o = i.attr("data-target") || i.attr("data-tab"); - if (o || (o = i.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, "")), !i.parent("li").hasClass("active")) { - var a = n.find(".active:last a")[0], s = t.Event("show." + e, {relatedTarget: a}); - if (i.trigger(s), !s.isDefaultPrevented()) { - var r = t(o); - this.activate(i.parent("li"), n), this.activate(r, r.parent(), function () { - i.trigger({type: "shown." + e, relatedTarget: a}) - }) - } - } - }, i.prototype.activate = function (e, i, n) { - function o() { - a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), e.addClass("active"), s ? (e[0].offsetWidth, e.addClass("in")) : e.removeClass("fade"), e.parent(".dropdown-menu") && e.closest("li.dropdown").addClass("active"), n && n() - } - - var a = i.find("> .active"), s = n && t.support.transition && a.hasClass("fade"); - s ? a.one(t.support.transition.end, o).emulateTransitionEnd(150) : o(), a.removeClass("in") - }; - var n = t.fn.tab; - t.fn.tab = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e); - a || o.data(e, a = new i(this)), "string" == typeof n && a[n]() - }) - }, t.fn.tab.Constructor = i, t.fn.tab.noConflict = function () { - return t.fn.tab = n, this - }, t(document).on("click.zui.tab.data-api", '[data-toggle="tab"], [data-tab]', function (e) { - e.preventDefault(), t(this).tab("show") - }) -}(window.jQuery), +function (t) { - "use strict"; - - function e() { - var t = document.createElement("bootstrap"), e = { - WebkitTransition: "webkitTransitionEnd", - MozTransition: "transitionend", - OTransition: "oTransitionEnd otransitionend", - transition: "transitionend" - }; - for (var i in e) if (void 0 !== t.style[i]) return {end: e[i]}; - return !1 - } - - t.fn.emulateTransitionEnd = function (e) { - var i = !1, n = this; - t(this).one("bsTransitionEnd", function () { - i = !0 - }); - var o = function () { - i || t(n).trigger(t.support.transition.end) - }; - return setTimeout(o, e), this - }, t(function () { - t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { - bindType: t.support.transition.end, - delegateType: t.support.transition.end, - handle: function (e) { - if (t(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) - } - }) - }) -}(jQuery), +function (t) { - "use strict"; - var e = "zui.collapse", i = function (e, n) { - this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, n), this.transitioning = null, this.options.parent && (this.$parent = t(this.options.parent)), this.options.toggle && this.toggle() - }; - i.DEFAULTS = {toggle: !0}, i.prototype.dimension = function () { - var t = this.$element.hasClass("width"); - return t ? "width" : "height" - }, i.prototype.show = function () { - if (!this.transitioning && !this.$element.hasClass("in")) { - var i = t.Event("show." + e); - if (this.$element.trigger(i), !i.isDefaultPrevented()) { - var n = this.$parent && this.$parent.find(".in"); - if (n && n.length) { - var o = n.data(e); - if (o && o.transitioning) return; - n.collapse("hide"), o || n.data(e, null) - } - var a = this.dimension(); - this.$element.removeClass("collapse").addClass("collapsing")[a](0), this.transitioning = 1; - var s = function () { - this.$element.removeClass("collapsing").addClass("in")[a]("auto"), this.transitioning = 0, this.$element.trigger("shown." + e) - }; - if (!t.support.transition) return s.call(this); - var r = t.camelCase(["scroll", a].join("-")); - this.$element.one(t.support.transition.end, s.bind(this)).emulateTransitionEnd(350)[a](this.$element[0][r]) - } - } - }, i.prototype.hide = function () { - if (!this.transitioning && this.$element.hasClass("in")) { - var i = t.Event("hide." + e); - if (this.$element.trigger(i), !i.isDefaultPrevented()) { - var n = this.dimension(); - this.$element[n](this.$element[n]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1; - var o = function () { - this.transitioning = 0, this.$element.trigger("hidden." + e).removeClass("collapsing").addClass("collapse") - }; - return t.support.transition ? void this.$element[n](0).one(t.support.transition.end, o.bind(this)).emulateTransitionEnd(350) : o.call(this) - } - } - }, i.prototype.toggle = function () { - this[this.$element.hasClass("in") ? "hide" : "show"]() - }; - var n = t.fn.collapse; - t.fn.collapse = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e), s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof n && n); - a || o.data(e, a = new i(this, s)), "string" == typeof n && a[n]() - }) - }, t.fn.collapse.Constructor = i, t.fn.collapse.noConflict = function () { - return t.fn.collapse = n, this - }, t(document).on("click." + e + ".data-api", "[data-toggle=collapse]", function (i) { - var n, o = t(this), - a = o.attr("data-target") || i.preventDefault() || (n = o.attr("href")) && n.replace(/.*(?=#[^\s]+$)/, ""), - s = t(a), r = s.data(e), l = r ? "toggle" : o.data(), h = o.attr("data-parent"), c = h && t(h); - r && r.transitioning || (c && c.find('[data-toggle=collapse][data-parent="' + h + '"]').not(o).addClass("collapsed"), o[s.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), s.collapse(l) - }) -}(window.jQuery), function (t, e) { - "use strict"; - var i = 1200, n = 992, o = 768, a = e(t), s = function () { - var t = a.width(); - e("html").toggleClass("screen-desktop", t >= n && t < i).toggleClass("screen-desktop-wide", t >= i).toggleClass("screen-tablet", t >= o && t < n).toggleClass("screen-phone", t < o).toggleClass("device-mobile", t < n).toggleClass("device-desktop", t >= n) - }, r = "", l = navigator.userAgent; - l.match(/(iPad|iPhone|iPod)/i) ? r += " os-ios" : l.match(/android/i) ? r += " os-android" : l.match(/Win/i) ? r += " os-windows" : l.match(/Mac/i) ? r += " os-mac" : l.match(/Linux/i) ? r += " os-linux" : l.match(/X11/i) && (r += " os-unix"), "ontouchstart" in document.documentElement && (r += " is-touchable"), e("html").addClass(r), a.resize(s), s() -}(window, jQuery), function (t) { - "use strict"; - var e = { - zh_cn: '您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...', - zh_tw: '您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...', - en: 'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...' - }, i = function () { - for (var t = !1, e = 11; e > 5; e--) if (this.isIE(e)) { - t = e; - break - } - this.ie = t, this.cssHelper() - }; - i.prototype.cssHelper = function () { - var e = this.ie, i = t("html"); - i.toggleClass("ie", e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"), e && i.addClass("ie-" + e).toggleClass("gt-ie-7 gte-ie-8 support-ie", e >= 8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie", e < 8).toggleClass("gt-ie-8 gte-ie-9", e >= 9).toggleClass("lte-ie-8 lt-ie-9", e < 9).toggleClass("gt-ie-9 gte-ie-10", e >= 10).toggleClass("lte-ie-9 lt-ie-10", e < 10).toggleClass("gt-ie-10 gte-ie-11", e >= 11).toggleClass("lte-ie-10 lt-ie-11", e < 11) - }, i.prototype.tip = function (i) { - var n = t("#browseHappyTip"); - n.length || (n = t('
    '), n.prependTo("body")), i || (i = t.zui.getLangData("zui.browser", t.zui.clientLang(), e), "object" == typeof i && (i = i.tip)), n.find(".content").html(i) - }, i.prototype.isIE = function (t) { - if (11 === t) return this.isIE11(); - if (10 === t) return this.isIE10(); - if (!t && (this.isIE11() || this.isIE10())) return !0; - var e = document.createElement("b"); - return e.innerHTML = "", 1 === e.getElementsByTagName("i").length - }, i.prototype.isIE10 = function () { - return navigator.appVersion.indexOf("MSIE 10") !== -1 - }, i.prototype.isIE11 = function () { - var t = navigator.userAgent; - return t.indexOf("Trident") !== -1 && t.indexOf("rv:11") !== -1 - }, t.zui({browser: new i}), t(function () { - t("body").hasClass("disabled-browser-tip") || t.zui.browser.ie && t.zui.browser.ie < 8 && t.zui.browser.tip() - }) -}(jQuery), function (t) { - "use strict"; - var e = 864e5, i = function (t) { - return t instanceof Date || ("number" == typeof t && t < 1e10 && (t *= 1e3), t = new Date(t)), t - }, n = function (t) { - return i(t).getTime() - }, o = function (t, e) { - t = i(t), void 0 === e && (e = "yyyy-MM-dd hh:mm:ss"); - var n = { - "M+": t.getMonth() + 1, - "d+": t.getDate(), - "h+": t.getHours(), - "m+": t.getMinutes(), - "s+": t.getSeconds(), - "q+": Math.floor((t.getMonth() + 3) / 3), - "S+": t.getMilliseconds() - }; - /(y+)/i.test(e) && (e = e.replace(RegExp.$1, (t.getFullYear() + "").substr(4 - RegExp.$1.length))); - for (var o in n) new RegExp("(" + o + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length))); - return e - }, a = function (t, e) { - return t.setTime(t.getTime() + e), t - }, s = function (t, i) { - return a(t, i * e) - }, r = function (t) { - return new Date(i(t).getTime()) - }, l = function (t) { - return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0 - }, h = function (t, e) { - return [31, l(t) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][e] - }, c = function (t) { - return h(t.getFullYear(), t.getMonth()) - }, d = function (t) { - return t.setHours(0), t.setMinutes(0), t.setSeconds(0), t.setMilliseconds(0), t - }, u = function (t, e) { - var i = t.getDate(); - return t.setDate(1), t.setMonth(t.getMonth() + e), t.setDate(Math.min(i, c(t))), t - }, f = function (t, e) { - e = e || 1; - for (var i = new Date(t.getTime()); i.getDay() != e;) i = s(i, -1); - return d(i) - }, p = function (t, e) { - return t.toDateString() === e.toDateString() - }, g = function (t, e) { - var i = f(t), n = s(r(i), 7); - return e >= i && e < n - }, m = function (t, e) { - return t.getFullYear() === e.getFullYear() - }, v = { - formatDate: o, - createDate: i, - date: { - ONEDAY_TICKS: e, - create: i, - getTimestamp: n, - format: o, - addMilliseconds: a, - addDays: s, - cloneDate: r, - isLeapYear: l, - getDaysInMonth: h, - getDaysOfThisMonth: c, - clearTime: d, - addMonths: u, - getLastWeekday: f, - isSameDay: p, - isSameWeek: g, - isSameYear: m - } - }; - t.$ && t.$.zui ? $.zui(v) : t.dateHelper = v.date, t.noDatePrototypeHelper || (Date.ONEDAY_TICKS = e, Date.prototype.format || (Date.prototype.format = function (t) { - return o(this, t) - }), Date.prototype.addMilliseconds || (Date.prototype.addMilliseconds = function (t) { - return a(this, t) - }), Date.prototype.addDays || (Date.prototype.addDays = function (t) { - return s(this, t) - }), Date.prototype.clone || (Date.prototype.clone = function () { - return r(this) - }), Date.isLeapYear || (Date.isLeapYear = function (t) { - return l(t) - }), Date.getDaysInMonth || (Date.getDaysInMonth = function (t, e) { - return h(t, e) - }), Date.prototype.isLeapYear || (Date.prototype.isLeapYear = function () { - return l(this.getFullYear()) - }), Date.prototype.clearTime || (Date.prototype.clearTime = function () { - return d(this) - }), Date.prototype.getDaysInMonth || (Date.prototype.getDaysInMonth = function () { - return c(this) - }), Date.prototype.addMonths || (Date.prototype.addMonths = function (t) { - return u(this, t) - }), Date.prototype.getLastWeekday || (Date.prototype.getLastWeekday = function (t) { - return f(this, t) - }), Date.prototype.isSameDay || (Date.prototype.isSameDay = function (t) { - return p(t, this) - }), Date.prototype.isSameWeek || (Date.prototype.isSameWeek = function (t) { - return g(t, this) - }), Date.prototype.isSameYear || (Date.prototype.isSameYear = function (t) { - return m(this, t) - }), Date.create || (Date.create = function (t) { - return i(t) - }), Date.timestamp || (Date.timestamp = function (t) { - return n(t) - })) -}(window), function () { - "use strict"; - var t = function (t, e) { - if (arguments.length > 1) { - var i; - if (2 == arguments.length && "object" == typeof e) for (var n in e) void 0 !== e[n] && (i = new RegExp("({" + n + "})", "g"), t = t.replace(i, e[n])); else for (var o = 1; o < arguments.length; o++) void 0 !== arguments[o] && (i = new RegExp("({[" + (o - 1) + "]})", "g"), t = t.replace(i, arguments[o])) - } - return t - }, e = function (t) { - if (null !== t) { - var e, i; - return i = /\d*/i, e = t.match(i), e == t - } - return !1 - }, i = {formatString: t, string: {format: t, isNum: e}}; - window.$ && window.$.zui ? $.zui(i) : window.stringHelper = i.string, window.noStringPrototypeHelper || (String.prototype.format || (String.prototype.format = function () { - var e = [].slice.call(arguments); - return e.unshift(this), t.apply(this, e) - }), String.prototype.isNum || (String.prototype.isNum = function () { - return e(this) - }), String.prototype.endsWith || (String.prototype.endsWith = function (t, e) { - return (void 0 === e || e > this.length) && (e = this.length), this.substring(e - t.length, e) === t - }), String.prototype.startsWith || Object.defineProperty(String.prototype, "startsWith", { - value: function (t, e) { - return e = !e || e < 0 ? 0 : +e, this.substring(e, e + t.length) === t - } - }), String.prototype.includes || (String.prototype.includes = function () { - return String.prototype.indexOf.apply(this, arguments) !== -1 - })) -}(),/*! +!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var n={all:-1,left:0,middle:1,right:2},o=0;t.zui({uuid:function(t){var e=1e5*(Date.now()-1580890015292)+10*Math.floor(1e4*Math.random())+o++%10;return t?e:e.toString(36)},callEvent:function(t,e,n){if("function"==typeof t){n!==i&&(t=t.bind(n));var o=t(e);return e&&(e.result=o),!(o!==i&&!o)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,n,o){var a=t(this),s=e.indexOf(".zui."),r=s<0?e:e.substring(0,s),l=t.Event(r,n);if(o===i&&s>0&&(o=a.data(e.substring(s+1))),o&&o.options){var h=o.options[r];"function"==typeof h&&(l.result=t.zui.callEvent(h,l,o))}return a.trigger(l),l},t.fn.callComEvent=function(t,e,n){n===i||Array.isArray(n)||(n=[n]);var o,a=this;a.trigger(e,n);var s=t.options[e];return s&&(o=s.apply(t,n)),o}}(jQuery,window,void 0),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",n=function(i){t(i).on("click",e,this.close)};n.prototype.close=function(e){function n(){s.trigger("closed."+i).remove()}var o=t(this),a=o.attr("data-target");a||(a=o.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,n).emulateTransitionEnd(150):n())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),a=o.data(i);a||o.data(i,a=new n(this)),"string"==typeof e&&a[e].call(o)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click."+i+".data-api",e,n.prototype.close)}(window.jQuery),function(t,e){"use strict";var i="zui.pager",n={page:1,recTotal:0,recPerPage:10},o={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 {page} 页",totalPage:"共 {totalPage} 页",totalCount:"共 {recTotal} 项",pageSize:"每页 {recPerPage} 项",itemsRange:"第 {start} ~ {end} 项",pageOfTotal:"第 {page}/{totalPage} 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 {page} 頁",totalPage:"共 {totalPage} 頁",totalCount:"共 {recTotal} 項",pageSize:"每頁 {recPerPage} 項",itemsRange:"第 {start} ~ {end} 項",pageOfTotal:"第 {page}/{totalPage} 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"From {start} to {end}",pageOfTotal:"Page {page} of {totalPage}"}},a=function(e,n){var s=this;s.name=i,s.$=t(e),n=s.options=t.extend({},a.DEFAULTS,this.$.data(),n),s.langName=n.lang||t.zui.clientLang(),s.lang=t.zui.getLangData(i,s.langName,o),s.state={},s.set(n.page,n.recTotal,n.recPerPage,!0),s.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&s.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&s.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&s.set(-1,-1,e)})};a.prototype.set=function(e,i,o,a){var s=this;"object"==typeof e&&null!==e&&(o=e.recPerPage,i=e.recTotal,e=e.page);var r=s.state;r||(r=t.extend({},n));var l=t.extend({},r);return"number"==typeof o&&o>0&&(r.recPerPage=o),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page').attr("href",i?a.createLink(i,a.state):"###").html(n);return o||(s=t("
  • ").append(s).toggleClass("active",i===a.state.page).toggleClass("disabled",!i||i===a.state.page)),s},a.prototype.createNavItems=function(t){var i=this,n=i.$,o=i.state,a=o.totalPage,s=o.page,r=function(t,o){if(t===!1)return void n.append(i.createLinkItem(0,o||i.options.navEllipsisItem));o===e&&(o=t);for(var a=t;a<=o;++a)n.append(i.createLinkItem(a))};t===e&&(t=i.options.maxNavCount||10),r(1),a>1&&(a<=t?r(2,a):sa-t+2?(r(!1),r(a-t+2,a)):(r(!1),r(s-Math.ceil((t-4)/2),s+Math.floor((t-4)/2)),r(!1),r(a)))},a.prototype.createGoto=function(){var e=this,i=this.state,n=t('
    ");return n},a.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var a=0;a'+s+"
  • ").toggleClass("active",s===i.recPerPage);n.append(r)}return t('
    ').addClass(e.options.menuDirection).append(n)},a.prototype.createElement=function(e,i,n){var o=this,a=o.createLinkItem.bind(o),s=o.lang;switch(e){case"prev":return a(n.prev,s.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,s.next);case"next_icon":return a(n.next,'');case"first":return a(1,s.first);case"first_icon":return a(1,'');case"last":return a(n.totalPage,s.last);case"last_icon":return a(n.totalPage,'');case"space":case"|":return t('
  • ');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('
    '+s.totalCount+"
    ").format(n));case"page_text":return t(('
    '+s.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+s.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+s.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+s.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+s.itemsRange+"
    ").format(n));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("
  • ").html(e.format(n))}},a.prototype.createLink=function(i,n){i===e&&(i=this.state.page),n===e&&(n=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},n,{page:i})):"function"==typeof o?o(i,n):"#page="+i},a.prototype.render=function(e){var i=this,n=i.state,o=i.options.elementCreator||i.createElement,a=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var s=0;s").append(h)),i.$.append(h))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[n]),i},a.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},n),t.fn.pager=function(e){return this.each(function(){var n=t(this),o=n.data(i),s="object"==typeof e&&e;o||n.data(i,o=new a(this,s)),"string"==typeof e&&o[e]()})},a.NAME=i,a.LANG=o,t.fn.pager.Constructor=a,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(o);this.activate(i.parent("li"),n),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),s=n&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var o=t(this),a=o.data(e);a||o.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var o=n.data(e);if(o&&o.transitioning)return;n.collapse("hide"),o||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,s.bind(this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,o.bind(this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var o=t(this),a=o.data(e),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof n&&n);a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,o=t(this),a=o.attr("data-target")||i.preventDefault()||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":o.data(),h=o.attr("data-parent"),c=h&&t(h);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+h+'"]').not(o).addClass("collapsed"),o[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,o=768,a=e(t),s=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=o&&t=n)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),a.resize(s),s()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),n.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t){"use strict";var e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},n=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e},a=function(t,e){return t.setTime(t.getTime()+e),t},s=function(t,i){return a(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},h=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return h(t.getFullYear(),t.getMonth())},d=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},f=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=s(i,-1);return d(i)},p=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=f(t),n=s(r(i),7);return e>=i&&e1){var i;if(2==arguments.length&&"object"==typeof e)for(var n in e)void 0!==e[n]&&(i=new RegExp("({"+n+"})","g"),t=t.replace(i,e[n]));else for(var o=1;othis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*! * jQuery resize event - v1.1 * http://benalman.com/projects/jquery-resize-plugin/ * Copyright (c) 2010 "Cowboy" Ben Alman * MIT & GPL http://benalman.com/about/license/ */ - function (t, e, i) { - "$:nomunge"; - - function n() { - o = e[r](function () { - a.each(function () { - var e = t(this), i = e.width(), n = e.height(), o = t.data(this, h); - i === o.w && n === o.h || e.trigger(l, [o.w = i, o.h = n]) - }), n() - }, s[c]) - } - - var o, a = t([]), s = t.resize = t.extend(t.resize, {}), r = "setTimeout", l = "resize", - h = l + "-special-event", c = "delay", d = "throttleWindow"; - s[c] = 250, s[d] = !0, t.event.special[l] = { - setup: function () { - if (!s[d] && this[r]) return !1; - var e = t(this); - a = a.add(e), t.data(this, h, {w: e.width(), h: e.height()}), 1 === a.length && n() - }, teardown: function () { - if (!s[d] && this[r]) return !1; - var e = t(this); - a = a.not(e), e.removeData(h), a.length || clearTimeout(o) - }, add: function (e) { - function n(e, n, a) { - var s = t(this), r = t.data(this, h) || {}; - r.w = n !== i ? n : s.width(), r.h = a !== i ? a : s.height(), o.apply(this, arguments) - } - - if (!s[d] && this[r]) return !1; - var o; - return "function" == typeof e ? (o = e, n) : (o = e.handler, void (e.handler = n)) - } - } - }(jQuery, this),/*! +function(t,e,i){"$:nomunge";function n(){o=e[r](function(){a.each(function(){var e=t(this),i=e.width(),n=e.height(),o=t.data(this,h);i===o.w&&n===o.h||e.trigger(l,[o.w=i,o.h=n])}),n()},s[c])}var o,a=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",h=l+"-special-event",c="delay",d="throttleWindow";s[c]=250,s[d]=!0,t.event.special[l]={setup:function(){if(!s[d]&&this[r])return!1;var e=t(this);a=a.add(e),t.data(this,h,{w:e.width(),h:e.height()}),1===a.length&&n()},teardown:function(){if(!s[d]&&this[r])return!1;var e=t(this);a=a.not(e),e.removeData(h),a.length||clearTimeout(o)},add:function(e){function n(e,n,a){var s=t(this),r=t.data(this,h)||{};r.w=n!==i?n:s.width(),r.h=a!==i?a:s.height(),o.apply(this,arguments)}if(!s[d]&&this[r])return!1;var o;return"function"==typeof e?(o=e,n):(o=e.handler,void(e.handler=n))}}}(jQuery,this),/*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * Copyright 2006, 2014 Klaus Hartl * Released under the MIT license */ - function (t) { - "function" == typeof define && define.amd ? define(["jquery"], t) : t("object" == typeof exports ? require("jquery") : jQuery) - }(function (t) { - function e(t) { - return r.raw ? t : encodeURIComponent(t) - } - - function i(t) { - return r.raw ? t : decodeURIComponent(t) - } - - function n(t) { - return e(r.json ? JSON.stringify(t) : String(t)) - } - - function o(t) { - 0 === t.indexOf('"') && (t = t.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); - try { - return t = decodeURIComponent(t.replace(s, " ")), r.json ? JSON.parse(t) : t - } catch (e) { - } - } - - function a(t, e) { - var i = r.raw ? t : o(t); - return "function" == typeof e ? e(i) : i - } - - var s = /\+/g, r = t.cookie = function (o, s, l) { - if (void 0 !== s && "function" != typeof s) { - if (l = t.extend({}, r.defaults, l), "number" == typeof l.expires) { - var h = l.expires, c = l.expires = new Date; - c.setTime(+c + 864e5 * h) - } - return document.cookie = [e(o), "=", n(s), l.expires ? "; expires=" + l.expires.toUTCString() : "", l.path ? "; path=" + l.path : "", l.domain ? "; domain=" + l.domain : "", l.secure ? "; secure" : ""].join("") - } - for (var d = o ? void 0 : {}, u = document.cookie ? document.cookie.split("; ") : [], f = 0, p = u.length; f < p; f++) { - var g = u[f].split("="), m = i(g.shift()), v = g.join("="); - if (o && o === m) { - d = a(v, s); - break - } - o || void 0 === (v = a(v)) || (d[m] = v) - } - return d - }; - r.defaults = {}, t.removeCookie = function (e, i) { - return void 0 !== t.cookie(e) && (t.cookie(e, "", t.extend({}, i, {expires: -1})), !t.cookie(e)) - } - }), function (t, e) { - "use strict"; - var i, n, o = "localStorage", a = "page_" + t.location.pathname + t.location.search, s = function () { - this.silence = !0; - try { - o in t && t[o] && t[o].setItem && (this.enable = !0, i = t[o]) - } catch (s) { - } - this.enable || (n = {}, i = { - getLength: function () { - var t = 0; - return e.each(n, function () { - t++ - }), t - }, key: function (t) { - var i, o = 0; - return e.each(n, function (e) { - return o === t ? (i = e, !1) : void o++ - }), i - }, removeItem: function (t) { - delete n[t] - }, getItem: function (t) { - return n[t] - }, setItem: function (t, e) { - n[t] = e - }, clear: function () { - n = {} - } - }), this.storage = i, this.page = this.get(a, {}) - }; - s.prototype.pageSave = function () { - if (e.isEmptyObject(this.page)) this.remove(a); else { - var t, i = []; - for (t in this.page) { - var n = this.page[t]; - null === n && i.push(t) - } - for (t = i.length - 1; t >= 0; t--) delete this.page[i[t]]; - this.set(a, this.page) - } - }, s.prototype.pageRemove = function (t) { - "undefined" != typeof this.page[t] && (this.page[t] = null, this.pageSave()) - }, s.prototype.pageClear = function () { - this.page = {}, this.pageSave() - }, s.prototype.pageGet = function (t, e) { - var i = this.page[t]; - return void 0 === e || null !== i && void 0 !== i ? i : e - }, s.prototype.pageSet = function (t, i) { - e.isPlainObject(t) ? e.extend(!0, this.page, t) : this.page[this.serialize(t)] = i, this.pageSave() - }, s.prototype.check = function () { - if (!this.enable && !this.silence) throw new Error("Browser not support localStorage or enable status been set true."); - return this.enable - }, s.prototype.length = function () { - return this.check() ? i.getLength ? i.getLength() : i.length : 0 - }, s.prototype.removeItem = function (t) { - return i.removeItem(t), this - }, s.prototype.remove = function (t) { - return this.removeItem(t) - }, s.prototype.getItem = function (t) { - return i.getItem(t) - }, s.prototype.get = function (t, e) { - var i = this.deserialize(this.getItem(t)); - return "undefined" != typeof i && null !== i || "undefined" == typeof e ? i : e - }, s.prototype.key = function (t) { - return i.key(t) - }, s.prototype.setItem = function (t, e) { - return i.setItem(t, e), this - }, s.prototype.set = function (t, e) { - return void 0 === e ? this.remove(t) : (this.setItem(t, this.serialize(e)), this) - }, s.prototype.clear = function () { - return i.clear(), this - }, s.prototype.forEach = function (t) { - for (var e = this.length(), n = e - 1; n >= 0; n--) { - var o = i.key(n); - t(o, this.get(o)) - } - return this - }, s.prototype.getAll = function () { - var t = {}; - return this.forEach(function (e, i) { - t[e] = i - }), t - }, s.prototype.serialize = function (t) { - return "string" == typeof t ? t : JSON.stringify(t) - }, s.prototype.deserialize = function (t) { - if ("string" == typeof t) try { - return JSON.parse(t) - } catch (e) { - return t || void 0 - } - }, e.zui({store: new s}) -}(window, jQuery), function (t) { - "use strict"; - var e = "zui.searchBox", i = function (e, n) { - var o = this; - o.name = name, o.$ = t(e), o.options = n = t.extend({}, i.DEFAULTS, o.$.data(), n); - var a = o.$.is(n.inputSelector) ? o.$ : o.$.find(n.inputSelector); - if (a.length) { - var s = function () { - o.changeTimer && (clearTimeout(o.changeTimer), o.changeTimer = null) - }, r = function () { - s(); - var t = o.getSearch(); - if (t !== o.lastValue) { - var e = "" === t; - a.toggleClass("empty", e), o.$.callComEvent(o, "onSearchChange", [t, e]), o.lastValue = t - } - }; - o.$input = a = a.first(), a.on(n.listenEvent, function (t) { - o.changeTimer = setTimeout(function () { - r() - }, n.changeDelay) - }).on("focus", function (t) { - a.addClass("focus"), o.$.callComEvent(o, "onFocus", [t]) - }).on("blur", function (t) { - a.removeClass("focus"), o.$.callComEvent(o, "onBlur", [t]) - }).on("keydown", function (t) { - var e = 0, i = t.which; - 27 === i && n.escToClear ? (this.setSearch("", !0), r(), e = 1) : 13 === i && n.onPressEnter && (r(), o.$.callComEvent(o, "onPressEnter", [t])); - var a = o.$.callComEvent(o, "onKeyDown", [t]); - a === !1 && (e = 1), e && t.preventDefault() - }), o.$.on("click", ".search-clear-btn", function (t) { - o.setSearch("", !0), r(), o.focus(), t.preventDefault() - }), r() - } else console.error("ZUI: search box init error, cannot find search box input element.") - }; - i.DEFAULTS = { - inputSelector: 'input[type="search"],input[type="text"]', - listenEvent: "change input paste", - changeDelay: 500 - }, i.prototype.getSearch = function () { - return this.$input && t.trim(this.$input.val()) - }, i.prototype.setSearch = function (t, e) { - var i = this.$input; - i && (i.val(t), e || i.trigger("change")) - }, i.prototype.focus = function () { - this.$input && this.$input.focus() - }, t.fn.searchBox = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e), s = "object" == typeof n && n; - a || o.data(e, a = new i(this, s)), "string" == typeof n && a[n]() - }) - }, i.NAME = e, t.fn.searchBox.Constructor = i -}(jQuery), function (t, e) { - "use strict"; - var i = "zui.draggable", n = {container: "body", move: !0}, o = 0, a = function (e, i) { - var a = this; - a.$ = t(e), a.id = o++, a.options = t.extend({}, n, a.$.data(), i), a.init() - }; - a.DEFAULTS = n, a.NAME = i, a.prototype.init = function () { - var n, o, a, s, r, l = this, h = l.$, c = "before", d = "drag", u = "finish", f = "." + i + "." + l.id, - p = "mousedown" + f, g = "mouseup" + f, m = "mousemove" + f, v = l.options, y = v.selector, b = v.handle, - w = h, x = "function" == typeof v.move, C = function (t) { - var e = t.pageX, i = t.pageY; - r = !0; - var o = {left: e - a.x, top: i - a.y}; - w.removeClass("drag-ready").addClass("dragging"), v.move && (x ? v.move(o, w) : w.css(o)), v[d] && v[d]({ - event: t, - element: w, - startOffset: a, - pos: o, - offset: {x: e - n.x, y: i - n.y}, - smallOffset: {x: e - s.x, y: i - s.y} - }), s.x = e, s.y = i, v.stopPropagation && t.stopPropagation() - }, _ = function (i) { - if (t(e).off(f), !r) return void w.removeClass("drag-ready"); - var o = {left: i.pageX - a.x, top: i.pageY - a.y}; - w.removeClass("drag-ready dragging"), v.move && (x ? v.move(o, w) : w.css(o)), v[u] && v[u]({ - event: i, - element: w, - startOffset: a, - pos: o, - offset: {x: i.pageX - n.x, y: i.pageY - n.y}, - smallOffset: {x: i.pageX - s.x, y: i.pageY - s.y} - }), i.preventDefault(), v.stopPropagation && i.stopPropagation() - }, k = function (i) { - var l = t.zui.getMouseButtonCode(v.mouseButton); - if (!(l > -1 && i.button !== l)) { - var h = t(this); - if (y && (w = b ? h.closest(y) : h), v[c]) { - var d = v[c]({event: i, element: w}); - if (d === !1) return - } - var u = t(v.container), f = w.offset(); - o = u.offset(), n = {x: i.pageX, y: i.pageY}, a = { - x: i.pageX - f.left + o.left, - y: i.pageY - f.top + o.top - }, s = t.extend({}, n), r = !1, w.addClass("drag-ready"), i.preventDefault(), v.stopPropagation && i.stopPropagation(), t(e).on(m, C).on(g, _) - } - }; - b ? h.on(p, b, k) : y ? h.on(p, y, k) : h.on(p, k) - }, a.prototype.destroy = function () { - var n = "." + i + "." + this.id; - this.$.off(n), t(e).off(n), this.$.data(i, null) - }, t.fn.draggable = function (e) { - return this.each(function () { - var n = t(this), o = n.data(i), s = "object" == typeof e && e; - o || n.data(i, o = new a(this, s)), "string" == typeof e && o[e]() - }) - }, t.fn.draggable.Constructor = a -}(jQuery, document), function (t, e, i) { - "use strict"; - var n = "zui.droppable", - o = {target: ".droppable-target", deviation: 5, sensorOffsetX: 0, sensorOffsetY: 0, dropToClass: "drop-to"}, - a = 0, s = function (e, i) { - var n = this; - n.id = a++, n.$ = t(e), n.options = t.extend({}, o, n.$.data(), i), n.init() - }; - s.DEFAULTS = o, s.NAME = n, s.prototype.trigger = function (e, i) { - return t.zui.callEvent(this.options[e], i, this) - }, s.prototype.init = function () { - var o, a, s, r, l, h, c, d, u, f, p, g, m, v = this, y = v.$, b = v.options, w = b.deviation, - x = "." + n + "." + v.id, C = "mousedown" + x, _ = "mouseup" + x, k = "mousemove" + x, T = b.selector, - S = b.handle, D = b.flex, M = b.container, P = b.canMoveHere, z = b.dropToClass, L = y, F = !1, - I = M ? t(b.container).first() : T ? y : t("body"), $ = function (e) { - if (F && (p = {left: e.pageX, top: e.pageY}, !(i.abs(p.left - d.left) < w && i.abs(p.top - d.top) < w))) { - if (null === s) { - var n = I.css("position"); - "absolute" != n && "relative" != n && "fixed" != n && (h = n, I.css("position", "relative")), s = L.clone().removeClass("drag-from").addClass("drag-shadow").css({ - position: "absolute", - width: L.outerWidth(), - transition: "none" - }).appendTo(I), L.addClass("dragging"), v.trigger("start", { - event: e, - element: L, - shadowElement: s, - targets: o - }) - } - var c = {left: p.left - f.left, top: p.top - f.top}, m = {left: c.left - u.left, top: c.top - u.top}; - s.css(m), t.extend(g, p); - var y = !1; - r = !1, D || o.removeClass(z); - var x = null; - if (o.each(function () { - var e = t(this), i = e.offset(), n = e.outerWidth(), o = e.outerHeight(), - a = i.left + b.sensorOffsetX, s = i.top + b.sensorOffsetY; - if (p.left > a && p.top > s && p.left < a + n && p.top < s + o && (x && x.removeClass(z), x = e, !b.nested)) return !1 - }), x) { - r = !0; - var C = x.data("id"); - L.data("id") != C && (l = !1), (null === a || a.data("id") !== C && !l) && (y = !0), a = x, D && o.removeClass(z), a.addClass(z) - } - D ? null !== a && a.length && (r = !0) : (L.toggleClass("drop-in", r), s.toggleClass("drop-in", r)), P && P(L, a) === !1 || v.trigger("drag", { - event: e, - isIn: r, - target: a, - element: L, - isNew: y, - selfTarget: l, - clickOffset: f, - offset: c, - position: {left: c.left - u.left, top: c.top - u.top}, - mouseOffset: p - }), e.preventDefault() - } - }, A = function (i) { - if (t(e).off(x), clearTimeout(m), F) { - if (F = !1, h && I.css("position", h), null === s) return L.removeClass("drag-from"), void v.trigger("always", { - event: i, - cancel: !0 - }); - r || (a = null); - var n = !0; - p = i ? {left: i.pageX, top: i.pageY} : g; - var c = {left: p.left - f.left, top: p.top - f.top}, d = {left: p.left - g.left, top: p.top - g.top}; - g.left = p.left, g.top = p.top; - var y = { - event: i, - isIn: r, - target: a, - element: L, - isNew: !l && null !== a, - selfTarget: l, - offset: c, - mouseOffset: p, - position: {left: c.left - u.left, top: c.top - u.top}, - lastMouseOffset: g, - moveOffset: d - }; - n = v.trigger("beforeDrop", y), n && r && v.trigger("drop", y), o.removeClass(z), L.removeClass("dragging").removeClass("drag-from"), s.remove(), s = null, v.trigger("finish", y), v.trigger("always", y), i && i.preventDefault() - } - }, E = function (i) { - var n = t.zui.getMouseButtonCode(b.mouseButton); - if (!(n > -1 && i.button !== n)) { - var p = t(this); - T && (L = S ? p.closest(T) : p), L.hasClass("drag-shadow") || b.before && b.before({ - event: i, - element: L - }) === !1 || (F = !0, o = "function" == typeof b.target ? b.target(L, y) : I.find(b.target), a = null, s = null, r = !1, l = !0, h = null, c = L.offset(), u = I.offset(), u.top = u.top - I.scrollTop(), u.left = u.left - I.scrollLeft(), d = { - left: i.pageX, - top: i.pageY - }, g = t.extend({}, d), f = { - left: d.left - c.left, - top: d.top - c.top - }, L.addClass("drag-from"), t(e).on(k, $).on(_, A), m = setTimeout(function () { - t(e).on(C, A) - }, 10), i.preventDefault(), b.stopPropagation && i.stopPropagation()) - } - }; - S ? y.on(C, S, E) : T ? y.on(C, T, E) : y.on(C, E) - }, s.prototype.destroy = function () { - var i = "." + n + "." + this.id; - this.$.off(i), t(e).off(i), this.$.data(n, null) - }, s.prototype.reset = function () { - this.destroy(), this.init() - }, t.fn.droppable = function (e) { - return this.each(function () { - var i = t(this), o = i.data(n), a = "object" == typeof e && e; - o || i.data(n, o = new s(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.droppable.Constructor = s -}(jQuery, document, Math), +function (t, e) { - "use strict"; - - function i(e, i, a) { - return this.each(function () { - var s = t(this), r = s.data(n), l = t.extend({}, o.DEFAULTS, s.data(), "object" == typeof e && e); - r || s.data(n, r = new o(this, l)), "string" == typeof e ? r[e](i, a) : l.show && r.show(i, a) - }) - } - - var n = "zui.modal", o = function (i, o) { - var a = this; - a.options = o, a.$body = t(document.body), a.$element = t(i), a.$backdrop = a.isShown = null, a.scrollbarWidth = 0, o.moveable === e && (a.options.moveable = a.$element.hasClass("modal-moveable")), o.remote && a.$element.find(".modal-content").load(o.remote, function () { - a.$element.trigger("loaded." + n) - }), o.scrollInside && t(window).on("resize." + n, function () { - a.isShown && a.adjustPosition(e, 100) - }) - }; - o.VERSION = "3.2.0", o.TRANSITION_DURATION = 300, o.BACKDROP_TRANSITION_DURATION = 150, o.DEFAULTS = { - backdrop: !0, - keyboard: !0, - show: !0, - position: "fit" - }; - var a = function (e, i) { - var n = t(window); - i.left = Math.max(0, Math.min(i.left, n.width() - e.outerWidth())), i.top = Math.max(0, Math.min(i.top, n.height() - e.outerHeight())), e.css(i) - }; - o.prototype.toggle = function (t, e) { - return this.isShown ? this.hide() : this.show(t, e) - }, o.prototype.adjustPosition = function (i, o) { - var s = this; - if (clearTimeout(s.reposTask), o) return void (s.reposTask = setTimeout(s.adjustPosition.bind(s, i, 0), o)); - var r = s.options; - if (i === e && (i = r.position), i !== e && null !== i) { - "function" == typeof i && (i = i(s)); - var l = s.$element.find(".modal-dialog"), h = t(window).height(), - c = {maxHeight: "initial", overflow: "visible"}, d = l.find(".modal-body").css(c); - if (r.scrollInside && d.length) { - var u = r.headerHeight, f = r.footerHeight, p = l.find(".modal-header"), g = l.find(".modal-footer"); - "number" != typeof u && (u = p.length ? p.outerHeight() : "function" == typeof u ? u(p) : 0), "number" != typeof f && (f = g.length ? g.outerHeight() : "function" == typeof f ? f(g) : 0), c.maxHeight = h - u - f, c.overflow = d[0].scrollHeight > c.maxHeight ? "auto" : "visible", d.css(c) - } - var m = Math.max(0, (h - l.outerHeight()) / 2); - if ("fit" === i ? i = {top: m > 50 ? Math.floor(2 * m / 3) : m} : "center" === i ? i = {top: m} : t.isPlainObject(i) || (i = {top: i}), l.hasClass("modal-moveable")) { - var v = null, y = r.rememberPos; - y && (y === !0 ? v = s.$element.data("modal-pos") : t.zui.store && (v = t.zui.store.pageGet(n + ".rememberPos." + y))), i = t.extend(i, {left: Math.max(0, (t(window).width() - l.outerWidth()) / 2)}, v), "inside" === r.moveable ? a(l, i) : l.css(i) - } else l.css(i) - } - }, o.prototype.setMoveable = function () { - t.fn.draggable || console.error("Moveable modal requires draggable.js."); - var e = this, i = e.options, o = e.$element.find(".modal-dialog").removeClass("modal-dragged"); - o.toggleClass("modal-moveable", !!i.moveable), e.$element.data("modal-moveable-setup") || o.draggable({ - container: e.$element, - handle: ".modal-header", - before: function () { - var t = o.css("margin-top"); - t && "0px" !== t && o.css("top", t).css("margin-top", "").addClass("modal-dragged") - }, - finish: function (o) { - var a = i.rememberPos; - a && (e.$element.data("modal-pos", o.pos), t.zui.store && a !== !0 && t.zui.store.pageSet(n + ".rememberPos." + a, o.pos)) - }, - move: "inside" !== i.moveable || function (t) { - a(o, t) - } - }) - }, o.prototype.show = function (e, i) { - var a = this, s = t.Event("show." + n, {relatedTarget: e}); - a.$element.trigger(s), a.$element.toggleClass("modal-scroll-inside", !!a.options.scrollInside), a.isShown || s.isDefaultPrevented() || (a.isShown = !0, a.options.moveable && a.setMoveable(), a.options.backdrop !== !1 && (a.setScrollbar(), a.$body.addClass("modal-open")), a.escape(), a.$element.on("click.dismiss." + n, '[data-dismiss="modal"]', function (t) { - a.hide(), t.stopPropagation() - }), a.backdrop(function () { - var s = t.support.transition && a.$element.hasClass("fade"); - a.$element.parent().length || a.$element.appendTo(a.$body), a.$element.show().scrollTop(0), s && a.$element[0].offsetWidth, a.$element.addClass("in").attr("aria-hidden", !1), a.adjustPosition(i), a.enforceFocus(); - var r = t.Event("shown." + n, {relatedTarget: e}); - s ? a.$element.find(".modal-dialog").one("bsTransitionEnd", function () { - a.$element.trigger("focus").trigger(r) - }).emulateTransitionEnd(o.TRANSITION_DURATION) : a.$element.trigger("focus").trigger(r) - })) - }, o.prototype.hide = function (e) { - e && e.preventDefault && e.preventDefault(); - var i = this; - e = t.Event("hide." + n), i.$element.trigger(e), i.isShown && !e.isDefaultPrevented() && (i.isShown = !1, i.options.backdrop !== !1 && (i.$body.removeClass("modal-open"), i.resetScrollbar()), i.escape(), t(document).off("focusin." + n), i.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss." + n), t.support.transition && i.$element.hasClass("fade") ? i.$element.one("bsTransitionEnd", i.hideModal.bind(i)).emulateTransitionEnd(o.TRANSITION_DURATION) : i.hideModal()) - }, o.prototype.enforceFocus = function () { - t(document).off("focusin." + n).on("focusin." + n, function (t) { - this.$element[0] === t.target || this.$element.has(t.target).length || this.$element.trigger("focus") - }.bind(this)) - }, o.prototype.escape = function () { - this.isShown && this.options.keyboard ? t(document).on("keydown.dismiss." + n, function (i) { - if (27 == i.which) { - var o = t.Event("escaping." + n), a = this.$element.triggerHandler(o, "esc"); - if (a != e && !a) return; - this.hide() - } - }.bind(this)) : this.isShown || t(document).off("keydown.dismiss." + n) - }, o.prototype.hideModal = function () { - var t = this; - this.$element.hide(), this.backdrop(function () { - t.$element.trigger("hidden." + n) - }) - }, o.prototype.removeBackdrop = function () { - this.$backdrop && this.$backdrop.remove(), this.$backdrop = null - }, o.prototype.backdrop = function (e) { - var i = this, a = this.$element.hasClass("fade") ? "fade" : ""; - if (this.isShown && this.options.backdrop) { - var s = t.support.transition && a; - if (this.$backdrop = t('
  • ').appendTo("body").data(n,i);var s=function(t,i,n){n=n||e[t],"function"==typeof n&&o.on(i+a,n)};s("onShow","show"),s("shown","shown"),s("onHide","hide",function(t){if("iframe"===e.type&&i.$iframeBody){var n=i.$iframeBody.triggerHandler("modalhide"+a,[i]);n===!1&&t.preventDefault()}var o=e.onHide;if(o)return o(t)}),s("hidden","hidden"),s("loaded","loaded"),o.on("shown"+a,function(){i.isShown=!0}).on("hidden"+a,function(){i.isShown=!1}),this.$modal=o,this.$dialog=o.find(".modal-dialog"),e.mergeOptions&&(this.options=e)},r.prototype.show=function(i){var a=this,l=t.extend({},r.DEFAULTS,a.options,{url:a.$trigger?a.$trigger.attr("href")||a.$trigger.attr("data-url")||a.$trigger.data("url"):a.options.url},i),h=a.isShown;l=a.initOptions(l),h||a.init(l);var c=a.$modal,d=c.find(".modal-dialog"),u=l.custom,f=d.find(".modal-body").css("padding","").toggleClass("load-indicator loading",!!h),p=d.find(".modal-header"),g=d.find(".modal-content");c.toggleClass("fade",l.fade).addClass(l.className).toggleClass("modal-loading",!h).toggleClass("modal-scroll-inside",!!l.scrollInside),d.toggleClass("modal-md","md"===l.size).toggleClass("modal-sm","sm"===l.size).toggleClass("modal-lg","lg"===l.size).toggleClass("modal-fullscreen","fullscreen"===l.size),p.toggle(l.showHeader),p.find(".modal-icon").attr("class","modal-icon icon-"+l.icon),p.find(".modal-title-name").text(l.title||""),l.size&&"fullscreen"===l.size&&(l.width="",l.height="");var m=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){a.adjustPosition(l.position)},100)},v=function(t,e){return"undefined"==typeof t&&(t=l.delay),setTimeout(function(){d=c.find(".modal-dialog"),l.width&&"auto"!=l.width&&d.css("width",l.width),l.height&&"auto"!=l.height&&(d.css("height",l.height),"iframe"===l.type&&f.css("height",d.height()-p.outerHeight())),a.adjustPosition(l.position),c.removeClass("modal-loading").removeClass("modal-updating"),h&&f.removeClass("loading"),"iframe"!=l.type&&(f=d.off("resize."+n).find(".modal-body").off("resize."+n),l.scrollInside&&(f=f.children().off("resize."+n)),(f.length?f:d).on("resize."+n,m)),e&&e()},t)};if("custom"===l.type&&u)if("function"==typeof u){var y=u({modal:c,options:l,modalTrigger:a,ready:v});typeof y===s&&(f.html(y),v())}else u instanceof t?(f.html(t("
    ").append(u.clone()).html()),v()):(f.html(u),v());else if(l.url){var b=function(){var t=c.callComEvent(a,"broken");"string"==typeof t&&f.html(t),v()};if(c.attr("ref",l.url),"iframe"===l.type){c.addClass("modal-iframe"),this.firstLoad=!0;var w="iframe-"+l.name;p.detach(),f.detach(),g.empty().append(p).append(f),f.css("padding",0).html(''),l.waittime>0&&(a.waitTimeout=v(l.waittime,b));var x=document.getElementById(w);x.onload=x.onreadystatechange=function(i){var o=!!l.scrollInside;if(a.firstLoad&&c.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){a.firstLoad=!1,l.waittime>0&&clearTimeout(a.waitTimeout);try{c.attr("ref",x.contentWindow.location.href);var s=e.frames[w].$;if(s&&"auto"===l.height&&"fullscreen"!=l.size){var r=s("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",o);a.$iframeBody=r,l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var h=[],d=function(i){c.removeClass("fade");var n=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(n=Math.max(n,f.data("minModalHeight")||0),f.data("minModalHeight",n)),o){var a=l.headerHeight;"number"!=typeof a?a=p.outerHeight():"function"==typeof a&&(a=a(p));var s=t(e).height();n=Math.min(n,s-a)}for(h.length>1&&n===h[0]&&(n=Math.max(n,h[1])),h.push(n);h.length>2;)h.shift();f.css("height",n),l.fade&&c.addClass("fade"),v()};c.callComEvent(a,"loaded",{modalType:"iframe",jQuery:s}),setTimeout(d,100),r.off("resize."+n).on("resize."+n,d),o&&t(e).off("resize."+n).on("resize."+n,d)}else v();var u=l.handleLinkInIframe;u&&s("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||c.addClass("modal-updating")}),l.iframeStyle&&s("head").append("")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?d.parent().empty().append(s):s.filter(".modal-content").length?d.find(".modal-content").replaceWith(s):f.wrapInner(s)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),c.html(i)}c.callComEvent(a,"loaded",{modalType:o}),v(),l.scrollInside&&t(e).off("resize."+n).on("resize."+n,m)},error:b},l.ajaxOptions))}h||c.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var n=this;(t||i)&&n.$modal.on("hidden"+a,function(){"function"==typeof t&&t(),typeof i===s&&i.length&&!n.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i)}),n.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var o=t(this),a=o.data(n),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);return a?void(typeof e==s?a[e](i):l.show&&a.show(i)):(o.data(n,a=new r(l,o)),void o.on((l.trigger||"click")+".toggle."+n,function(e){l=t.extend(l,{url:o.attr("href")||o.attr("data-url")||o.data("url")||l.url}),a.toggle(l),o.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?l.call(n,e,i):n.modalTrigger(e,i)})},t.fn.modal.bs=l;var h=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},c=function(i,o,a){var s=i;if("function"==typeof i){var r=a;a=o,o=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(n).close(o,a)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(s,o,a)},d=function(t,e){e=h(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var o=h(i);o&&o.length&&o.each(function(){t(this).data(n).show(e)})};t.zui({reloadModal:u,closeModal:c,ajustModalPosition:d,adjustModalPosition:d}),t(document).on("click."+n+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),a=null;try{a=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(i.data(n)?i.trigger(".toggle."+n):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+n+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var o=this.options.trigger.split(" "),a=o.length;a--;){var s=o[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var o=n.tip();n.setContent(e),n.options.animation&&o.addClass("fade");var a="function"==typeof n.options.placement?n.options.placement.call(n,o[0],n.$element[0]):n.options.placement,s=/\s?auto?\s?/i,r=s.test(a);r&&(a=a.replace(s,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a),n.options.container?o.appendTo(n.options.container):o.insertAfter(n.$element);var l=n.getPosition(),h=o[0].offsetWidth,c=o[0].offsetHeight;if(r){var d=n.$element.parent(),u=a,f=document.documentElement.scrollTop||document.body.scrollTop,p="body"==n.options.container?window.innerWidth:d.outerWidth(),g="body"==n.options.container?window.innerHeight:d.outerHeight(),m="body"==n.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-f>g?"top":"top"==a&&l.top-f-c<0?"bottom":"right"==a&&l.right+h>p?"left":"left"==a&&l.left-h

    '}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var n=t(this),o=n.data("zui.popover"),a="object"==typeof i&&i;o||n.data("zui.popover",o=new e(this,a)),"string"==typeof i&&o[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(e){t(o).remove(),t(a).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide."+n)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden."+n))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n;try{n=i&&t(i)}catch(o){}return n&&n.length?n:e.parent()}var n="zui.dropdown",o=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+n,this.toggle)};s.prototype.toggle=function(o){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('',a={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},a,r),l.id=r.id||n++;var h=s[l.id];h&&h.destroy(),s[l.id]=l,l.$=t(o.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,d=l.$.find(".messager-actions"),u=function(e){var n=t('", - form: "
    ", - inputs: { - text: "", - textarea: "", - email: "", - select: "", - checkbox: "
    ", - date: "", - time: "", - number: "", - password: "" - } - }, p = { - locale: e.zui && e.zui.clientLang ? e.zui.clientLang() : "en", - backdrop: "static", - animate: !0, - className: null, - closeButton: !0, - show: !0, - container: "body" - }, g = {}; - g.alert = function () { - var t; - if (t = c("alert", ["ok"], ["message", "callback"], arguments), t.callback && "function" != typeof t.callback) throw new Error("alert requires callback property to be a function when provided"); - return t.buttons.ok.callback = t.onEscape = function () { - return "function" != typeof t.callback || t.callback.call(this) - }, g.dialog(t) - }, g.confirm = function () { - var t; - if (t = c("confirm", ["confirm", "cancel"], ["message", "callback"], arguments), t.buttons.cancel.callback = t.onEscape = function () { - return t.callback.call(this, !1) - }, t.buttons.confirm.callback = function () { - return t.callback.call(this, !0) - }, "function" != typeof t.callback) throw new Error("confirm requires a callback"); - return g.dialog(t) - }, g.prompt = function () { - var t, n, o, a, r, l, c; - if (a = e(f.form), n = { - className: "bootbox-prompt", - buttons: d("cancel", "confirm"), - value: "", - inputType: "text" - }, t = u(h(n, arguments, ["title", "callback"]), ["confirm", "cancel"]), l = t.show === i || t.show, t.message = a, t.buttons.cancel.callback = t.onEscape = function () { - return t.callback.call(this, null) - }, t.buttons.confirm.callback = function () { - var i; - switch (t.inputType) { - case"text": - case"textarea": - case"email": - case"select": - case"date": - case"time": - case"number": - case"password": - i = r.val(); - break; - case"checkbox": - var n = r.find("input:checked"); - i = [], s(n, function (t, n) { - i.push(e(n).val()) - }) - } - return t.callback.call(this, i) - }, t.show = !1, !t.title) throw new Error("prompt requires a title"); - if ("function" != typeof t.callback) throw new Error("prompt requires a callback"); - if (!f.inputs[t.inputType]) throw new Error("invalid prompt type"); - switch (r = e(f.inputs[t.inputType]), t.inputType) { - case"text": - case"textarea": - case"email": - case"date": - case"time": - case"number": - case"password": - r.val(t.value); - break; - case"select": - var p = {}; - if (c = t.inputOptions || [], !Array.isArray(c)) throw new Error("Please pass an array of input options"); - if (!c.length) throw new Error("prompt with select requires options"); - s(c, function (t, n) { - var o = r; - if (n.value === i || n.text === i) throw new Error("given options in wrong format"); - n.group && (p[n.group] || (p[n.group] = e("").attr("label", n.group)), o = p[n.group]), o.append("") - }), s(p, function (t, e) { - r.append(e) - }), r.val(t.value); - break; - case"checkbox": - var m = Array.isArray(t.value) ? t.value : [t.value]; - if (c = t.inputOptions || [], !c.length) throw new Error("prompt with checkbox requires options"); - if (!c[0].value || !c[0].text) throw new Error("given options in wrong format"); - r = e("
    "), s(c, function (i, n) { - var o = e(f.inputs[t.inputType]); - o.find("input").attr("value", n.value), o.find("label").append(n.text), s(m, function (t, e) { - e === n.value && o.find("input").prop("checked", !0) - }), r.append(o) - }) - } - return t.placeholder && r.attr("placeholder", t.placeholder), t.pattern && r.attr("pattern", t.pattern), t.maxlength && r.attr("maxlength", t.maxlength), a.append(r), a.on("submit", function (t) { - t.preventDefault(), t.stopPropagation(), o.find(".btn-primary").click() - }), o = g.dialog(t), o.off("shown.zui.modal"), o.on("shown.zui.modal", function () { - r.focus() - }), l === !0 && o.modal("show"), o - }, g.dialog = function (t) { - t = r(t); - var n = e(f.dialog), a = n.find(".modal-dialog"), l = n.find(".modal-body"), h = t.buttons, c = "", - d = {onEscape: t.onEscape}; - if (e.fn.modal === i) throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details."); - if (s(h, function (t, e) { - c += "", d[t] = e.callback - }), l.find(".bootbox-body").html(t.message), t.animate === !0 && n.addClass("fade"), t.className && n.addClass(t.className), "large" === t.size ? a.addClass("modal-lg") : "small" === t.size && a.addClass("modal-sm"), t.title && l.before(f.header), t.closeButton) { - var u = e(f.closeButton); - t.title ? n.find(".modal-header").prepend(u) : u.css("margin-top", "-10px").prependTo(l) - } - return t.title && n.find(".modal-title").html(t.title), c.length && (l.after(f.footer), n.find(".modal-footer").html(c)), n.on("hidden.zui.modal", function (t) { - t.target === this && n.remove() - }), n.on("shown.zui.modal", function () { - n.find(".btn-primary:first").focus() - }), "static" !== t.backdrop && n.on("click.dismiss.zui.modal", function (t) { - n.children(".modal-backdrop").length && (t.currentTarget = n.children(".modal-backdrop").get(0)), t.target === t.currentTarget && n.trigger("escape.close.bb") - }), n.on("escape.close.bb", function (t) { - d.onEscape && o(t, n, d.onEscape) - }), n.on("click", ".modal-footer button", function (t) { - var i = e(this).data("bb-handler"); - o(t, n, d[i]) - }), n.on("click", ".bootbox-close-button", function (t) { - o(t, n, d.onEscape) - }), n.on("keyup", function (t) { - 27 === t.which && n.trigger("escape.close.bb") - }), e(t.container).append(n), n.modal({ - backdrop: !!t.backdrop && "static", - keyboard: !1, - show: !1 - }), t.show && n.modal("show"), n - }, g.setDefaults = function () { - var t = {}; - 2 === arguments.length ? t[arguments[0]] = arguments[1] : t = arguments[0], e.extend(p, t) - }, g.hideAll = function () { - return e(".bootbox").modal("hide"), g - }; - var m = { - en: {OK: "OK", CANCEL: "Cancel", CONFIRM: "Confirm"}, - zh_cn: {OK: "确认", CANCEL: "取消", CONFIRM: "确认"}, - zh_tw: {OK: "確認", CANCEL: "取消", CONFIRM: "確認"} - }; - return g.addLocale = function (t, i) { - return e.each(["OK", "CANCEL", "CONFIRM"], function (t, e) { - if (!i[e]) throw new Error("Please supply a translation for '" + e + "'") - }), m[t] = {OK: i.OK, CANCEL: i.CANCEL, CONFIRM: i.CONFIRM}, g - }, g.removeLocale = function (t) { - return delete m[t], g - }, g.setLocale = function (t) { - return g.setDefaults("locale", t) - }, g.init = function (i) { - return t(i || e) - }, g - }),/*! +!function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}var i=function(e,i){var o=this;this.element=t(e),this.language=(i.language||this.element.data("date-language")||(t.zui&&t.zui.clientLang?t.zui.clientLang().replace("_","-"):"zh-cn")).toLowerCase(),this.lang=t.zui&&t.zui.getLangData?t.zui.getLangData("datetimepicker",this.language,n):n[this.language],this.isRTL=this.lang.rtl||!1,this.formatType=i.formatType||this.element.data("format-type")||"standard",this.format=a.parseFormat(i.format||this.element.data("date-format")||this.lang.format||a.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent(),this.componentReset=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-remove").parent(),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=i.linkField||this.element.data("link-field")||!1,this.linkFormat=a.parseFormat(i.linkFormat||this.element.data("link-format")||a.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=i.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=i.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=i.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=i.initialDate||new Date,this.pickerClass=i.eleClass,this.onlyPickTime=i.maxView<=1,this.pickerId=i.eleId,this._attachEvents(),this.formatViewType="datetime","formatViewType"in i?this.formatViewType=i.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=a.convertViewMode(this.minView),this.maxView=a.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=a.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in i?this.wheelViewModeNavigation=i.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in i?this.wheelViewModeNavigationInverseDirection=i.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in i?this.wheelViewModeNavigationDelay=i.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=a.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in i?this.viewSelect=i.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=a.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=t(a.template).appendTo(this.isInline?this.element:"body").on({click:this.click.bind(this)}),this.wheelViewModeNavigation&&(t.fn.mousewheel?this.picker.on({mousewheel:this.mousewheel.bind(this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),t(document).on("mousedown",function(e){0===t(e.target).closest(".datetimepicker").length&&o.hide()}),this.autoclose=!1,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(i.weekStart||this.element.data("date-weekstart")||this.lang.weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-(1/0),this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}],[this.component,{click:this.show.bind(this)}]],this.componentReset&&this._events.push([this.componentReset,{click:this.reset.bind(this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:this.show.bind(this)}]];for(var t,e,i=0;i=this.startDate&&t<=this.endDate?(this.date=t,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:t,startDate:this.startDate,endDate:this.endDate})},setFormat:function(t){this.format=a.parseFormat(t,this.formatType);var e;this.isInput?e=this.element:this.component&&(e=this.element.find("input")),e&&e.val()&&this.setValue()},setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e):(this.component&&this.element.find("input").val(e),this.element.data("date",e)),this.linkField&&t("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(t){return void 0==t&&(t=this.format),a.formatDate(this.date,t,this.language,this.formatType)},setStartDate:function(t){this.startDate=t||-(1/0),this.startDate!==-(1/0)&&(this.startDate=a.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(t){this.endDate=t||1/0,this.endDate!==1/0&&(this.endDate=a.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this.daysOfWeekDisabled=e||[],Array.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=t.map(this.daysOfWeekDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=0;t("div").each(function(){var i=parseInt(t(this).css("zIndex"),10);i>e&&(e=i)});var i,n,o,a=e+10;this.component?(i=this.component.offset(),o=i.left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition&&"auto-left"!==this.pickerPosition||(o+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),o=i.left);var s=0===this.pickerPosition.indexOf("auto-"),r=s?(i.top+this.picker.outerHeight()>t(window).height()+t(window).scrollTop()?"top":"bottom")+(0===this.pickerPosition.lastIndexOf("-left")?"-left":"-right"):this.pickerPosition;n="top-left"===r||"top-right"===r?i.top-this.picker.outerHeight():i.top+this.height,this.picker.css({top:n,left:o,zIndex:a}).attr("class","datetimepicker dropdown-menu datetimepicker-dropdown-"+r),this.pickerClass&&this.picker.addClass(this.pickerClass),this.pickerId&&this.picker.attr("id",this.pickerId),this.onlyPickTime&&this.picker.addClass("datetimepicker-only-time")}},update:function(){var t,e=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],e=!0):(t=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof t||t instanceof String)&&(t=t.replace(/^\s+|\s+$/g,""))),t||(t=new Date,e=!1),this.date=a.parseDate(t,this.format,this.language,this.formatType),e&&this.setValue(),this.datethis.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var t=this.weekStart,e="";t'+this.lang.daysMin[t++%7]+"";e+="",this.picker.find(".datetimepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+=''+this.lang.monthsShort[e++]+"";this.picker.find(".datetimepicker-months td").html(t)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate),n=i.getUTCFullYear(),o=i.getUTCMonth(),s=i.getUTCDate(),r=i.getUTCHours(),l=i.getUTCMinutes(),h=this.startDate!==-(1/0)?this.startDate.getUTCFullYear():-(1/0),c=this.startDate!==-(1/0)?this.startDate.getUTCMonth():-(1/0),d=this.endDate!==1/0?this.endDate.getUTCFullYear():1/0,u=this.endDate!==1/0?this.endDate.getUTCMonth():1/0,f=new e(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),p=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(this.lang.months[o]+" "+n),"time"==this.formatViewType){var g=r%12?r%12:12,m=(g<10?"0":"")+g,v=(l<10?"0":"")+l,y=this.lang.meridiem[r<12?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(m+":"+v+" "+y.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(m+":"+v+" "+y.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+n),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+n);this.picker.find("tfoot th.today").text(this.lang.today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var b=e(n,o-1,28,0,0,0,0),w=a.getDaysInMonth(b.getUTCFullYear(),b.getUTCMonth());b.setUTCDate(w),b.setUTCDate(w-(b.getUTCDay()-this.weekStart+7)%7);var x=new Date(b);x.setUTCDate(x.getUTCDate()+42),x=x.valueOf();for(var C,_=[];b.valueOf()"),C="",b.getUTCFullYear()n||b.getUTCFullYear()==n&&b.getUTCMonth()>o)&&(C+=" new"),this.todayHighlight&&b.getUTCFullYear()==p.getFullYear()&&b.getUTCMonth()==p.getMonth()&&b.getUTCDate()==p.getDate()&&(C+=" today"),b.valueOf()==f&&(C+=" active"),(b.valueOf()+864e5<=this.startDate||b.valueOf()>this.endDate||t.inArray(b.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(C+=" disabled"),_.push(''+b.getUTCDate()+""),b.getUTCDay()==this.weekEnd&&_.push(""),b.setUTCDate(b.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(_.join("")),_=[];for(var k="",T="",S="",D=0;D<24;D++){var M=e(n,o,s,D);C="",M.valueOf()+36e5<=this.startDate||M.valueOf()>this.endDate?C+=" disabled":r==D&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=D<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=S&&(""!=S&&_.push(""),_.push('
    '+T.toUpperCase()+"")),S=T,k=D%12?D%12:12,_.push(''+k+""),23==D&&_.push("
    ")):(k=D+":00",_.push(''+k+""))}this.picker.find(".datetimepicker-hours td").html(_.join("")),_=[],k="",T="",S="";for(var D=0;D<60;D+=this.minuteStep){var M=e(n,o,s,r,D,0);C="",M.valueOf()this.endDate?C+=" disabled":Math.floor(l/this.minuteStep)==Math.floor(D/this.minuteStep)&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=r<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=S&&(""!=S&&_.push(""),_.push('
    '+T.toUpperCase()+"")),S=T,k=r%12?r%12:12,_.push(''+k+":"+(D<10?"0"+D:D)+""),59==D&&_.push("
    ")):(k=D+":00",_.push(''+r+":"+(D<10?"0"+D:D)+""))}this.picker.find(".datetimepicker-minutes td").html(_.join(""));var P=this.date.getUTCFullYear(),z=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");P==n&&z.eq(this.date.getUTCMonth()).addClass("active"),(nd)&&z.addClass("disabled"),n==h&&z.slice(0,c).addClass("disabled"),n==d&&z.slice(u+1).addClass("disabled"),_="",n=10*parseInt(n/10,10);var L=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(var D=-1;D<11;D++)_+='d?" disabled":"")+'">'+n+"",n+=1;L.html(_),this.place()}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),n=t.getUTCDate(),o=t.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&n<=this.startDate.getUTCDate()&&o<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&n>=this.endDate.getUTCDate()&&o>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&n<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&n>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var e=t.originalEvent,i=e.wheelDelta,n=i>0?1:0===i?0:-1;this.wheelViewModeNavigationInverseDirection&&(n=-n),this.showMode(n),setTimeout(function(){this.wheelPause=!1}.bind(this),this.wheelViewModeNavigationDelay)}},click:function(i){i.stopPropagation(),i.preventDefault();var n=t(i.target).closest("span, td, th, legend");if(1==n.length){if(n.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var o=a.modes[this.viewMode].navStep*("prev"==n[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,o);break;case 1:this.viewDate=this.moveDate(this.viewDate,o);break;case 2:this.viewDate=this.moveMonth(this.viewDate,o);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,o)}this.fill();break;case"today":var s=new Date;s=e(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),0),sthis.endDate&&(s=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(s),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!n.is(".disabled")){var r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCDate(),c=this.viewDate.getUTCHours(),d=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(n.is(".month")?(this.viewDate.setUTCDate(1),l=n.parent().find("span").index(n),h=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(l),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".year")?(this.viewDate.setUTCDate(1),r=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(r),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".hour")?(c=parseInt(n.text(),10)||0,(n.hasClass("hour_am")||n.hasClass("hour_pm"))&&(12==c&&n.hasClass("hour_am")?c=0:12!=c&&n.hasClass("hour_pm")&&(c+=12)),this.viewDate.setUTCHours(c),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".minute")&&(d=parseInt(n.text().substr(n.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(d),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(e(r,l,h,c,d,u,0))),0!=this.viewMode){var f=this.viewMode;this.showMode(-1),this.fill(),f==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(n.is(".day")&&!n.is(".disabled")){var h=parseInt(n.text(),10)||1,r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),c=this.viewDate.getUTCHours(),d=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();n.is(".old")?0===l?(l=11,r-=1):l-=1:n.is(".new")&&(11==l?(l=0,r+=1):l+=1),this.viewDate.setUTCFullYear(r),this.viewDate.setUTCMonth(l,h),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(e(r,l,h,c,d,u,0));var f=this.viewMode;this.showMode(-1),this.fill(),f==this.viewMode&&this.autoclose&&this.hide()}}}},_setDate:function(t,e){e&&"date"!=e||(this.date=t),e&&"view"!=e||(this.viewDate=t),this.fill(),this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose&&(!e||"date"==e)),this.element.trigger({type:"changeDate",date:this.date}),null===t&&(this.date=this.viewDate)},moveMinute:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+e*this.minuteStep),i},moveHour:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCHours(i.getUTCHours()+e),i},moveDate:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i},moveMonth:function(t,e){if(!e)return t;var i,n,o=new Date(t.valueOf()),a=o.getUTCDate(),s=o.getUTCMonth(),r=Math.abs(e);if(e=e>0?1:-1,1==r)n=e==-1?function(){return o.getUTCMonth()==s}:function(){return o.getUTCMonth()!=i},i=s+e,o.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var l=0;l=this.startDate&&t<=this.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27==t.keyCode&&this.show());var e,i,n,o=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,e),n=this.moveDate(this.viewDate,e)):1==viewMode?(i=this.moveHour(this.date,e),n=this.moveHour(this.viewDate,e)):0==viewMode&&(i=this.moveMinute(this.date,e),n=this.moveMinute(this.viewDate,e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,7*e),n=this.moveDate(this.viewDate,7*e)):1==viewMode?this.showMeridian?(i=this.moveHour(this.date,6*e),n=this.moveHour(this.viewDate,6*e)):(i=this.moveHour(this.date,4*e),n=this.moveHour(this.viewDate,4*e)):0==viewMode&&(i=this.moveMinute(this.date,4*e),n=this.moveMinute(this.viewDate,4*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 13:if(0!=this.viewMode){var a=this.viewMode;this.showMode(-1),this.fill(),a==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();t.preventDefault();break;case 9:this.hide()}if(o){var s;this.isInput?s=this.element:this.component&&(s=this.element.find("input")),s&&s.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(t){if(t){var e=Math.max(0,Math.min(a.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:e}),this.viewMode=e)}this.picker.find(">div").hide().filter(".datetimepicker-"+a.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(t){this._setDate(null,"date")}},t.fn.datetimepicker=function(e){var n=Array.apply(null,arguments);return n.shift(),this.each(function(){var o=t(this),a=o.data("datetimepicker"),s="object"==typeof e&&e;a||o.data("datetimepicker",a=new i(this,t.extend({},t.fn.datetimepicker.defaults,o.data(),s))),"string"==typeof e&&"function"==typeof a[e]&&a[e].apply(a,n)})},t.fn.datetimepicker.defaults={pickerPosition:"auto-right"},t.fn.datetimepicker.Constructor=i;var n=t.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"},"zh-cn":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},"zh-tw":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]}},o=function(e){var i=n[e];return i||(i=t.zui&&t.zui.getLangData?n[e]=t.zui.getLangData("datetimepicker",this.language,n):n.en),i},a={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,a.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},getDefaultFormat:function(t,e){if("standard"==t)return"input"==e?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==t)return"input"==e?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(t){if("standard"==t)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==t)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(t,e){var i=t.replace(this.validParts(e),"\0").split("\0"),n=t.match(this.validParts(e));if(!i||!i.length||!n||0==n.length)throw new Error("Invalid date format.");return{separators:i,parts:n}},parseDate:function(n,a,s,r){if(n instanceof Date){var l=new Date(n.valueOf()-6e4*n.getTimezoneOffset());return l.setMilliseconds(0),l}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd hh:ii",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd hh:ii:ss",r)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(n)){var h,c,d=/([-+]\d+)([dmwy])/,u=n.match(/([-+]\d+)([dmwy])/g);n=new Date;for(var f=0;f',contTemplate:'',footTemplate:''};a.template='
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+""+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+"
    ",t.fn.datetimepicker.DPGlobal=a,t.fn.datetimepicker.noConflict=function(){return t.fn.datetimepicker=old,this},t(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(e){ +var i=t(this);i.data("datetimepicker")||(e.preventDefault(),i.datetimepicker("show"))}),t(function(){t('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery),/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */ +function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function n(t){var i=e.zui&&e.zui.getLangData?e.zui.getLangData("bootbox",p.locale,m):m[p.locale];return i?i[t]:m.en[t]}function o(t,e,i){t.stopPropagation(),t.preventDefault();var n="function"==typeof i&&i.call(e,t)===!1;n||e.modal("hide")}function a(t){var e,i=0;for(e in t)i++;return i}function s(t,i){var n=0;e.each(t,function(t,e){i(t,e,n++)})}function r(t){var i,n;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},p,t),t.buttons||(t.buttons={}),i=t.buttons,n=a(i),s(i,function(t,o,a){if("function"==typeof o&&(o=i[t]={callback:o}),"object"!==e.type(o))throw new Error("button with key "+t+" must be an object");o.label||(o.label=t),o.className||(2===n&&("ok"===t||"confirm"===t)||1===n?o.className="btn-primary":o.className="btn-default")}),t}function l(t,e){var i=t.length,n={};if(i<1||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(n[e[0]]=t[0],n[e[1]]=t[1]):n=t[0],n}function h(t,i,n){return e.extend(!0,{},t,l(i,n))}function c(t,e,i,n){var o={className:"bootbox-"+t,buttons:d.apply(null,e)};return u(h(o,n,i),e)}function d(){for(var t={},e=0,i=arguments.length;e
    ",header:"",footer:"",closeButton:"",form:"
    ",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
    ",date:"",time:"",number:"",password:""}},p={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if(t=c("alert",["ok"],["message","callback"],arguments),t.callback&&"function"!=typeof t.callback)throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return"function"!=typeof t.callback||t.callback.call(this)},g.dialog(t)},g.confirm=function(){var t;if(t=c("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},"function"!=typeof t.callback)throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,n,o,a,r,l,c;if(a=e(f.form),n={className:"bootbox-prompt",buttons:d("cancel","confirm"),value:"",inputType:"text"},t=u(h(n,arguments,["title","callback"]),["confirm","cancel"]),l=t.show===i||t.show,t.message=a,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=r.val();break;case"checkbox":var n=r.find("input:checked");i=[],s(n,function(t,n){i.push(e(n).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if("function"!=typeof t.callback)throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(f.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":r.val(t.value);break;case"select":var p={};if(c=t.inputOptions||[],!Array.isArray(c))throw new Error("Please pass an array of input options");if(!c.length)throw new Error("prompt with select requires options");s(c,function(t,n){var o=r;if(n.value===i||n.text===i)throw new Error("given options in wrong format");n.group&&(p[n.group]||(p[n.group]=e("").attr("label",n.group)),o=p[n.group]),o.append("")}),s(p,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=Array.isArray(t.value)?t.value:[t.value];if(c=t.inputOptions||[],!c.length)throw new Error("prompt with checkbox requires options");if(!c[0].value||!c[0].text)throw new Error("given options in wrong format");r=e("
    "),s(c,function(i,n){var o=e(f.inputs[t.inputType]);o.find("input").attr("value",n.value),o.find("label").append(n.text),s(m,function(t,e){e===n.value&&o.find("input").prop("checked",!0)}),r.append(o)})}return t.placeholder&&r.attr("placeholder",t.placeholder),t.pattern&&r.attr("pattern",t.pattern),t.maxlength&&r.attr("maxlength",t.maxlength),a.append(r),a.on("submit",function(t){t.preventDefault(),t.stopPropagation(),o.find(".btn-primary").click()}),o=g.dialog(t),o.off("shown.zui.modal"),o.on("shown.zui.modal",function(){r.focus()}),l===!0&&o.modal("show"),o},g.dialog=function(t){t=r(t);var n=e(f.dialog),a=n.find(".modal-dialog"),l=n.find(".modal-body"),h=t.buttons,c="",d={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(s(h,function(t,e){c+="",d[t]=e.callback}),l.find(".bootbox-body").html(t.message),t.animate===!0&&n.addClass("fade"),t.className&&n.addClass(t.className),"large"===t.size?a.addClass("modal-lg"):"small"===t.size&&a.addClass("modal-sm"),t.title&&l.before(f.header),t.closeButton){var u=e(f.closeButton);t.title?n.find(".modal-header").prepend(u):u.css("margin-top","-10px").prependTo(l)}return t.title&&n.find(".modal-title").html(t.title),c.length&&(l.after(f.footer),n.find(".modal-footer").html(c)),n.on("hidden.zui.modal",function(t){t.target===this&&n.remove()}),n.on("shown.zui.modal",function(){n.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&n.on("click.dismiss.zui.modal",function(t){n.children(".modal-backdrop").length&&(t.currentTarget=n.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&n.trigger("escape.close.bb")}),n.on("escape.close.bb",function(t){d.onEscape&&o(t,n,d.onEscape)}),n.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");o(t,n,d[i])}),n.on("click",".bootbox-close-button",function(t){o(t,n,d.onEscape)}),n.on("keyup",function(t){27===t.which&&n.trigger("escape.close.bb")}),e(t.container).append(n),n.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&n.modal("show"),n},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(p,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),/*! Chosen, a Select Box Enhancer for jQuery and Prototype by Patrick Filler for Harvest, http://getharvest.com @@ -3933,804 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ - function () { - var t, e, i, n, o, a = {}.hasOwnProperty, s = function (t, e) { - function i() { - this.constructor = t - } - - for (var n in e) a.call(e, n) && (t[n] = e[n]); - return i.prototype = e.prototype, t.prototype = new i, t.__super__ = e.prototype, t - }, r = { - zh_cn: {no_results_text: "没有找到"}, - zh_tw: {no_results_text: "沒有找到"}, - en: {no_results_text: "No results match"} - }, l = {}; - n = function () { - function e() { - this.options_index = 0, this.parsed = [] - } - - return e.prototype.add_node = function (t) { - return "OPTGROUP" === t.nodeName.toUpperCase() ? this.add_group(t) : this.add_option(t) - }, e.prototype.add_group = function (e) { - var i, n, o, a, s, r; - for (i = this.parsed.length, this.parsed.push({ - array_index: i, - group: !0, - label: this.escapeExpression(e.label), - children: 0, - disabled: e.disabled, - title: e.title, - search_keys: t.trim(e.getAttribute("data-keys") || "").replace(/,/g, " ") - }), s = e.childNodes, r = [], o = 0, a = s.length; o < a; o++) n = s[o], r.push(this.add_option(n, i, e.disabled)); - return r - }, e.prototype.add_option = function (e, i, n) { - if ("OPTION" === e.nodeName.toUpperCase()) return "" !== e.text ? (null != i && (this.parsed[i].children += 1), this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - value: e.value, - text: e.text, - title: e.title, - html: e.innerHTML, - selected: e.selected, - disabled: n === !0 ? n : e.disabled, - group_array_index: i, - classes: e.className, - style: e.style.cssText, - data: e.getAttribute("data-data"), - search_keys: (t.trim(e.getAttribute("data-keys") || "") + e.value).replace(/,/, " ") - })) : this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - empty: !0 - }), this.options_index += 1 - }, e.prototype.escapeExpression = function (t) { - var e, i; - return null == t || t === !1 ? "" : /[\&\<\>\"\'\`]/.test(t) ? (e = { - "<": "<", - ">": ">", - '"': """, - "'": "'", - "`": "`" - }, i = /&(?!\w+;)|[\<\>\"\'\`]/g, t.replace(i, function (t) { - return e[t] || "&" - })) : t - }, e - }(), n.select_to_array = function (t) { - var e, i, o, a, s; - for (i = new n, s = t.childNodes, o = 0, a = s.length; o < a; o++) e = s[o], i.add_node(e); - return i.parsed - }, e = function () { - function e(i, n) { - if (this.form_field = i, this.options = t.extend({}, l, null != n ? n : {}), e.browser_is_supported()) { - var o = this.options.lang || t.zui.clientLang ? t.zui.clientLang() : "en", - a = t.zui.clientLang ? t.zui.clientLang() : "en"; - t.isPlainObject(o) ? this.lang = t.zui.getLangData ? t.zui.getLangData("chosen", a, r) : t.extend(o, r.en, r[a]) : this.lang = t.zui.getLangData ? t.zui.getLangData("chosen", o, r) : r[o || a] || r.en, this.is_multiple = this.form_field.multiple, this.set_default_text(), this.set_default_values(), this.setup(), this.set_up_html(), this.register_observers() - } - } - - return e.prototype.set_default_values = function () { - var t = this, e = t.options; - t.click_test_action = function (e) { - return t.test_active_click(e) - }, t.activate_action = function (e) { - return t.activate_field(e) - }, t.active_field = !1, t.mouse_on_container = !1, t.results_showing = !1, t.result_highlighted = null, t.allow_single_deselect = null != e.allow_single_deselect && null != this.form_field.options[0] && "" === t.form_field.options[0].text && e.allow_single_deselect, t.disable_search_threshold = e.disable_search_threshold || 0, t.disable_search = e.disable_search || !1, t.enable_split_word_search = null == e.enable_split_word_search || e.enable_split_word_search, t.group_search = null == e.group_search || e.group_search, t.search_contains = e.search_contains || !1, t.single_backstroke_delete = null == e.single_backstroke_delete || e.single_backstroke_delete, t.max_selected_options = e.max_selected_options || 1 / 0, t.drop_direction = e.drop_direction || "auto", t.drop_item_height = void 0 !== e.drop_item_height ? e.drop_item_height : 25, t.max_drop_height = void 0 !== e.max_drop_height ? e.max_drop_height : 240, t.middle_highlight = e.middle_highlight, t.compact_search = e.compact_search || !1, t.inherit_select_classes = e.inherit_select_classes || !1, t.display_selected_options = null == e.display_selected_options || e.display_selected_options, t.sort_value_splitter = e.sort_value_spliter || e.sort_value_splitter || ",", t.sort_field = e.sort_field; - var i = e.max_drop_width; - return "string" == typeof i && i.indexOf("px") === i.length - 2 && (i = parseInt(i.substring(0, i.length - 2))), t.max_drop_width = i, t.display_disabled_options = null == e.display_disabled_options || e.display_disabled_options - }, e.prototype.set_default_text = function () { - return this.form_field.getAttribute("data-placeholder") ? this.default_text = this.form_field.getAttribute("data-placeholder") : this.is_multiple ? this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || e.default_multiple_text : this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || e.default_single_text, this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || this.lang.no_results_text || e.default_no_result_text - }, e.prototype.mouse_enter = function () { - return this.mouse_on_container = !0 - }, e.prototype.mouse_leave = function () { - return this.mouse_on_container = !1 - }, e.prototype.input_focus = function (t) { - var e = this; - if (this.is_multiple) { - if (!this.active_field) return setTimeout(function () { - return e.container_mousedown() - }, 50) - } else if (!this.active_field) return this.activate_field() - }, e.prototype.input_blur = function (t) { - var e = this; - if (!this.mouse_on_container) return this.active_field = !1, setTimeout(function () { - return e.blur_test() - }, 100) - }, e.prototype.results_option_build = function (e) { - var i, n, o, a, s; - i = "", s = this.results_data; - var r = e && e.first ? [] : null; - for (o = 0, a = s.length; o < a; o++) n = s[o], i += n.group ? this.result_add_group(n) : this.result_add_option(n), r && n.selected && r.push(n); - if (r) { - var l, h; - if (this.sort_field && this.is_multiple) { - l = t(this.sort_field); - var c = l.val(); - if (h = "string" == typeof c && c.length ? c.split(this.sort_value_splitter) : [], h.length) { - var d = {}; - for (o = 0; o < h.length; ++o) d[h[o]] = o; - r.sort(function (t, e) { - var i = d[t.value], n = d[e.value]; - return void 0 === i && (i = 0), void 0 === n && (n = 0), i - n - }) - } - } - for (h = [], o = 0; o < r.length; ++o) n = r[o], this.is_multiple ? (this.choice_build(n), h.push(n.value)) : this.single_set_selected_text(n.text); - l && l.length && l.val(h.join(this.sort_value_splitter)) - } - return i - }, e.prototype.result_add_option = function (t) { - var e, i; - return t.search_match && this.include_option_in_results(t) ? (e = [], t.disabled || t.selected && this.is_multiple || e.push("active-result"), !t.disabled || t.selected && this.is_multiple || e.push("disabled-result"), t.selected && e.push("result-selected"), null != t.group_array_index && e.push("group-option"), "" !== t.classes && e.push(t.classes), i = document.createElement("li"), i.className = e.join(" "), i.style.cssText = t.style, i.title = t.title, i.setAttribute("data-option-array-index", t.array_index), i.setAttribute("data-data", t.data), i.innerHTML = t.search_text, this.outerHTML(i)) : "" - }, e.prototype.result_add_group = function (t) { - var e; - return (t.search_match || t.group_match) && t.active_options > 0 ? (e = document.createElement("li"), e.className = "group-result", e.title = t.title, e.innerHTML = t.search_text, this.outerHTML(e)) : "" - }, e.prototype.results_update_field = function () { - this.set_default_text(), this.is_multiple || this.results_reset_cleanup(), this.result_clear_highlight(), this.results_build(), this.results_showing && (this.winnow_results(), this.autoResizeDrop()) - }, e.prototype.reset_single_select_options = function () { - var t, e, i, n, o; - for (n = this.results_data, o = [], e = 0, i = n.length; e < i; e++) t = n[e], t.selected ? o.push(t.selected = !1) : o.push(void 0); - return o - }, e.prototype.results_toggle = function () { - return this.results_showing ? this.results_hide() : this.results_show() - }, e.prototype.results_search = function (t) { - return this.results_showing ? this.winnow_results(1) : this.results_show() - }, e.prototype.winnow_results = function (t) { - var e, i, n, o, a, s, r, l, h, c, d, u, f; - for (this.no_results_clear(), a = 0, r = this.get_search_text(), e = r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), o = this.search_contains ? "" : "^", n = new RegExp(o + e, "i"), c = new RegExp(e, "i"), f = this.results_data, d = 0, u = f.length; d < u; d++) i = f[d], i.search_match = !1, s = null, this.include_option_in_results(i) && (i.group && (i.group_match = !1, i.active_options = 0), null != i.group_array_index && this.results_data[i.group_array_index] && (s = this.results_data[i.group_array_index], 0 === s.active_options && s.search_match && (a += 1), s.active_options += 1), i.group && !this.group_search || (i.search_text = i.group ? i.label : i.html, i.search_keys_match = this.search_string_match(i.search_keys, n), i.search_text_match = this.search_string_match(i.search_text, n), i.search_match = i.search_text_match || i.search_keys_match, i.search_match && !i.group && (a += 1), i.search_match ? (i.search_text_match && i.search_text.length ? (l = i.search_text.search(c), h = i.search_text.substr(0, l + r.length) + "" + i.search_text.substr(l + r.length), i.search_text = h.substr(0, l) + "" + h.substr(l)) : i.search_keys_match && i.search_keys.length && (l = i.search_keys.search(c), h = i.search_keys.substr(0, l + r.length) + "" + i.search_keys.substr(l + r.length), i.search_text += '  ' + h.substr(0, l) + "" + h.substr(l) + ""), null != s && (s.group_match = !0)) : null != i.group_array_index && this.results_data[i.group_array_index].search_match && (i.search_match = !0))); - return this.result_clear_highlight(), a < 1 && r.length ? (this.update_results_content(""), this.no_results(r)) : (this.update_results_content(this.results_option_build()), this.winnow_results_set_highlight(t)) - }, e.prototype.search_string_match = function (t, e) { - var i, n, o, a; - if (e.test(t)) return !0; - if (this.enable_split_word_search && (t.indexOf(" ") >= 0 || 0 === t.indexOf("[")) && (n = t.replace(/\[|\]/g, "").split(" "), n.length)) for (o = 0, a = n.length; o < a; o++) if (i = n[o], e.test(i)) return !0 - }, e.prototype.choices_count = function () { - var t, e, i, n; - if (null != this.selected_option_count) return this.selected_option_count; - for (this.selected_option_count = 0, n = this.form_field.options, e = 0, i = n.length; e < i; e++) t = n[e], t.selected && "" != t.value && (this.selected_option_count += 1); - return this.selected_option_count - }, e.prototype.choices_click = function (t) { - if (t.preventDefault(), !this.results_showing && !this.is_disabled) return this.results_show() - }, e.prototype.keyup_checker = function (t) { - var e, i; - switch (e = null != (i = t.which) ? i : t.keyCode, this.search_field_scale(), e) { - case 8: - if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) return this.keydown_backstroke(); - if (!this.pending_backstroke) return this.result_clear_highlight(), this.results_search(); - break; - case 13: - if (t.preventDefault(), this.results_showing) return this.result_select(t); - break; - case 27: - return this.results_showing && this.results_hide(), !0; - case 9: - case 38: - case 40: - case 16: - case 91: - case 17: - break; - default: - return this.results_search() - } - }, e.prototype.clipboard_event_checker = function (t) { - var e = this; - return setTimeout(function () { - return e.results_search() - }, 50) - }, e.prototype.container_width = function () { - return null != this.options.width ? this.options.width : this.form_field && this.form_field.classList && this.form_field.classList.contains("form-control") ? "100%" : "" + this.form_field.offsetWidth + "px" - }, e.prototype.include_option_in_results = function (t) { - return !(this.is_multiple && !this.display_selected_options && t.selected) && (!(!this.display_disabled_options && t.disabled) && !t.empty) - }, e.prototype.search_results_touchstart = function (t) { - return this.touch_started = !0, this.search_results_mouseover(t) - }, e.prototype.search_results_touchmove = function (t) { - return this.touch_started = !1, this.search_results_mouseout(t) - }, e.prototype.search_results_touchend = function (t) { - if (this.touch_started) return this.search_results_mouseup(t) - }, e.prototype.outerHTML = function (t) { - var e; - return t.outerHTML ? t.outerHTML : (e = document.createElement("div"), e.appendChild(t), e.innerHTML) - }, e.browser_is_supported = function () { - return "Microsoft Internet Explorer" === window.navigator.appName ? document.documentMode >= 8 : !/iP(od|hone)/i.test(window.navigator.userAgent) && (!/Android/i.test(window.navigator.userAgent) || !/Mobile/i.test(window.navigator.userAgent)) - }, e.default_multiple_text = "", e.default_single_text = "", e.default_no_result_text = "No results match", e - }(), t = jQuery, t.fn.extend({ - chosen: function (n) { - return e.browser_is_supported() ? this.each(function (e) { - var o = t(this), a = o.data("chosen"); - "destroy" === n && a ? a.destroy() : a || o.data("chosen", new i(this, t.extend({}, o.data(), n))) - }) : this - } - }), i = function (e) { - function i() { - return o = i.__super__.constructor.apply(this, arguments) - } - - return s(i, e), i.prototype.setup = function () { - return this.form_field_jq = t(this.form_field), this.current_selectedIndex = this.form_field.selectedIndex, this.is_rtl = this.form_field_jq.hasClass("chosen-rtl") - }, i.prototype.set_up_html = function () { - var e, i; - e = ["chosen-container"], e.push("chosen-container-" + (this.is_multiple ? "multi" : "single")), this.inherit_select_classes && this.form_field.className && e.push(this.form_field.className), this.is_rtl && e.push("chosen-rtl"); - var n = this.form_field.getAttribute("data-css-class"); - return n && e.push(n), i = { - "class": e.join(" "), - style: "width: " + this.container_width() + ";", - title: this.form_field.title - }, this.form_field.id.length && (i.id = this.form_field.id.replace(/[^\w]/g, "_") + "_chosen"), this.container = t("
    ", i), this.is_multiple ? this.container.html('
      ') : (this.container.html('' + this.default_text + '
        '), this.compact_search ? this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")) : this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")), this.options.highlight_selected !== !1 && this.container.addClass("chosen-highlight-selected")), this.form_field_jq.hide().after(this.container), this.dropdown = this.container.find("div.chosen-drop").first(), this.search_field = this.container.find("input").first(), this.search_results = this.container.find("ul.chosen-results").first(), this.search_field_scale(), this.search_no_results = this.container.find("li.no-results").first(), this.is_multiple ? (this.search_choices = this.container.find("ul.chosen-choices").first(), this.search_container = this.container.find("li.search-field").first()) : (this.search_container = this.container.find("div.chosen-search").first(), this.selected_item = this.container.find(".chosen-single").first()), this.options.drop_width && this.dropdown.css("width", this.options.drop_width).addClass("chosen-drop-size-limited"), this.max_drop_width && this.dropdown.addClass("chosen-auto-max-width"), this.options.no_wrap && this.dropdown.addClass("chosen-no-wrap"), this.results_build(), this.set_tab_index(), this.set_label_behavior(), this.form_field_jq.trigger("chosen:ready", {chosen: this}) - }, i.prototype.register_observers = function () { - var t = this; - return this.container.bind("mousedown.chosen", function (e) { - t.container_mousedown(e) - }), this.container.bind("mouseup.chosen", function (e) { - t.container_mouseup(e) - }), this.container.bind("mouseenter.chosen", function (e) { - t.mouse_enter(e) - }), this.container.bind("mouseleave.chosen", function (e) { - t.mouse_leave(e) - }), this.search_results.bind("mouseup.chosen", function (e) { - t.search_results_mouseup(e) - }), this.search_results.bind("mouseover.chosen", function (e) { - t.search_results_mouseover(e) - }), this.search_results.bind("mouseout.chosen", function (e) { - t.search_results_mouseout(e) - }), this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen", function (e) { - t.search_results_mousewheel(e) - }), this.search_results.bind("touchstart.chosen", function (e) { - t.search_results_touchstart(e) - }), this.search_results.bind("touchmove.chosen", function (e) { - t.search_results_touchmove(e) - }), this.search_results.bind("touchend.chosen", function (e) { - t.search_results_touchend(e) - }), this.form_field_jq.bind("chosen:updated.chosen", function (e) { - t.results_update_field(e) - }), this.form_field_jq.bind("chosen:activate.chosen", function (e) { - t.activate_field(e) - }), this.form_field_jq.bind("chosen:open.chosen", function (e) { - t.container_mousedown(e) - }), this.form_field_jq.bind("chosen:close.chosen", function (e) { - t.input_blur(e) - }), this.search_field.bind("blur.chosen", function (e) { - t.input_blur(e) - }), this.search_field.bind("keyup.chosen", function (e) { - t.keyup_checker(e) - }), this.search_field.bind("keydown.chosen", function (e) { - t.keydown_checker(e) - }), this.search_field.bind("focus.chosen", function (e) { - t.input_focus(e) - }), this.search_field.bind("cut.chosen", function (e) { - t.clipboard_event_checker(e) - }), this.search_field.bind("paste.chosen", function (e) { - t.clipboard_event_checker(e) - }), this.is_multiple ? this.search_choices.bind("click.chosen", function (e) { - t.choices_click(e) - }) : this.container.bind("click.chosen", function (t) { - t.preventDefault() - }) - }, i.prototype.destroy = function () { - return t(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action), this.search_field[0].tabIndex && (this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex), this.container.remove(), this.form_field_jq.removeData("chosen"), this.form_field_jq.show() - }, i.prototype.search_field_disabled = function () { - return this.is_disabled = this.form_field_jq[0].disabled, this.is_disabled ? (this.container.addClass("chosen-disabled"), this.search_field[0].disabled = !0, this.is_multiple || this.selected_item.unbind("focus.chosen", this.activate_action), this.close_field()) : (this.container.removeClass("chosen-disabled"), this.search_field[0].disabled = !1, this.is_multiple ? void 0 : this.selected_item.bind("focus.chosen", this.activate_action)) - }, i.prototype.container_mousedown = function (e) { - if (!this.is_disabled && (e && "mousedown" === e.type && !this.results_showing && e.preventDefault(), null == e || !t(e.target).hasClass("search-choice-close"))) return this.active_field ? this.is_multiple || !e || t(e.target)[0] !== this.selected_item[0] && !t(e.target).parents("a.chosen-single").length || (e.preventDefault(), this.results_toggle()) : (this.is_multiple && this.search_field.val(""), t(this.container[0].ownerDocument).bind("click.chosen", this.click_test_action), this.results_show()), this.activate_field() - }, i.prototype.container_mouseup = function (t) { - if ("ABBR" === t.target.nodeName && !this.is_disabled) return this.results_reset(t) - }, i.prototype.search_results_mousewheel = function (t) { - var e; - if (t.originalEvent && (e = -t.originalEvent.wheelDelta || t.originalEvent.detail), null != e) return t.preventDefault(), "DOMMouseScroll" === t.type && (e = 40 * e), this.search_results.scrollTop(e + this.search_results.scrollTop()) - }, i.prototype.blur_test = function (t) { - if (!this.active_field && this.container.hasClass("chosen-container-active")) return this.close_field() - }, i.prototype.close_field = function () { - return t(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action), this.active_field = !1, this.results_hide(), this.container.removeClass("chosen-container-active"), this.clear_backstroke(), this.show_search_field_default(), this.search_field_scale() - }, i.prototype.activate_field = function () { - return this.container.addClass("chosen-container-active"), this.active_field = !0, this.search_field.val(this.search_field.val()), this.search_field.focus() - }, i.prototype.test_active_click = function (e) { - var i; - return i = t(e.target).closest(".chosen-container"), i.length && this.container[0] === i[0] ? this.active_field = !0 : this.close_field() - }, i.prototype.results_build = function () { - return this.parsing = !0, this.selected_option_count = null, this.results_data = n.select_to_array(this.form_field), this.is_multiple ? this.search_choices.find("li.search-choice").remove() : this.is_multiple || (this.single_set_selected_text(), this.disable_search || this.form_field.options.length <= this.disable_search_threshold ? (this.search_field[0].readOnly = !0, this.container.addClass("chosen-container-single-nosearch"), this.container.removeClass("chosen-with-search")) : (this.search_field[0].readOnly = !1, this.container.removeClass("chosen-container-single-nosearch"), this.container.addClass("chosen-with-search"))), this.update_results_content(this.results_option_build({first: !0})), this.search_field_disabled(), this.show_search_field_default(), this.search_field_scale(), this.parsing = !1 - }, i.prototype.result_do_highlight = function (t, e) { - if (t.length) { - var i, n, o, a, s, r, l = -1; - this.result_clear_highlight(), this.result_highlight = t, this.result_highlight.addClass("highlighted"), o = parseInt(this.search_results.css("maxHeight"), 10), r = this.result_highlight.outerHeight(), s = this.search_results.scrollTop(), a = o + s, n = this.result_highlight.position().top + this.search_results.scrollTop(), i = n + r, this.middle_highlight && (e || "always" === this.middle_highlight) ? l = Math.min(n - r, Math.max(0, n - (o - r) / 2)) : i >= a ? l = i - o > 0 ? i - o : 0 : n < s && (l = n), l > -1 ? this.search_results.scrollTop(l) : this.result_highlight.scrollIntoView && this.result_highlight.scrollIntoView() - } - }, i.prototype.result_clear_highlight = function () { - return this.result_highlight && this.result_highlight.removeClass("highlighted"), this.result_highlight = null - }, i.prototype.results_show = function () { - var e = this; - if (e.is_multiple && e.max_selected_options <= e.choices_count()) return e.form_field_jq.trigger("chosen:maxselected", {chosen: this}), !1; - e.results_showing = !0, e.search_field.focus(), e.search_field.val(e.search_field.val()), e.container.addClass("chosen-with-drop"), e.winnow_results(1); - var i = e.drop_direction; - if ("function" == typeof i && (i = i.call(this)), "auto" === i) if (e.drop_directionFixed) i = e.drop_directionFixed; else { - var n = e.container.find(".chosen-drop"), o = n.outerHeight(); - e.drop_item_height && o < e.max_drop_height && (o = Math.min(e.max_drop_height, n.find(".chosen-results>.active-result").length * e.drop_item_height)); - var a = e.container.offset(); - a.top + o + 30 > t(window).height() + t(window).scrollTop() && (i = "up"), e.drop_directionFixed = i - } - return e.container.toggleClass("chosen-up", "up" === i), e.autoResizeDrop(), e.form_field_jq.trigger("chosen:showing_dropdown", {chosen: e}) - }, i.prototype.autoResizeDrop = function () { - var e = this, i = e.max_drop_width; - if (i) { - var n = e.container.find(".chosen-drop"); - n.removeClass("in"); - var o = 0, a = n.find(".chosen-results"), s = a.children("li"), - r = parseFloat(a.css("padding-left").replace("px", "")), - l = parseFloat(a.css("padding-right").replace("px", "")), - h = (isNaN(r) ? 0 : r) + (isNaN(l) ? 0 : l); - s.each(function () { - o = Math.max(o, t(this).outerWidth()) - }), n.css("width", Math.min(o + h + 20, i)), e.fixDropWidthTimer = setTimeout(function () { - e.fixDropWidthTimer = null, n.addClass("in"), e.winnow_results_set_highlight(1) - }, 50) - } - }, i.prototype.update_results_content = function (t) { - return this.search_results.html(t) - }, i.prototype.results_hide = function () { - var t = this; - return t.fixDropWidthTimer && (clearTimeout(t.fixDropWidthTimer), t.fixDropWidthTimer = null), t.results_showing && (t.result_clear_highlight(), t.container.removeClass("chosen-with-drop"), t.form_field_jq.trigger("chosen:hiding_dropdown", {chosen: t}), t.drop_directionFixed = 0), t.results_showing = !1 - }, i.prototype.set_tab_index = function (t) { - var e; - if (this.form_field.tabIndex) return e = this.form_field.tabIndex, this.form_field.tabIndex = -1, this.search_field[0].tabIndex = e - }, i.prototype.set_label_behavior = function () { - var e = this; - if (this.form_field_label = this.form_field_jq.parents("label"), !this.form_field_label.length && this.form_field.id.length && (this.form_field_label = t("label[for='" + this.form_field.id + "']")), this.form_field_label.length > 0) return this.form_field_label.bind("click.chosen", function (t) { - return e.is_multiple ? e.container_mousedown(t) : e.activate_field() - }) - }, i.prototype.show_search_field_default = function () { - return this.is_multiple && this.choices_count() < 1 && !this.active_field ? (this.search_field.val(this.default_text), this.search_field.addClass("default")) : (this.search_field.val(""), this.search_field.removeClass("default")) - }, i.prototype.search_results_mouseup = function (e) { - var i; - if (i = t(e.target).hasClass("active-result") ? t(e.target) : t(e.target).parents(".active-result").first(), i.length) return this.result_highlight = i, this.result_select(e), this.search_field.focus() - }, i.prototype.search_results_mouseover = function (e) { - var i; - if (i = t(e.target).hasClass("active-result") ? t(e.target) : t(e.target).parents(".active-result").first()) return this.result_do_highlight(i) - }, i.prototype.search_results_mouseout = function (e) { - if (t(e.target).hasClass("active-result")) return this.result_clear_highlight() - }, i.prototype.choice_build = function (e) { - var i, n, o = this; - return i = t("
      • ", {"class": "search-choice"}).html("" + e.html + ""), e.disabled ? i.addClass("search-choice-disabled") : (n = t("", { - "class": "search-choice-close", - "data-option-array-index": e.array_index - }), n.bind("click.chosen", function (t) { - return o.choice_destroy_link_click(t) - }), i.append(n)), this.search_container.before(i) - }, i.prototype.choice_destroy_link_click = function (e) { - if (e.preventDefault(), e.stopPropagation(), !this.is_disabled) return this.choice_destroy(t(e.target)) - }, i.prototype.choice_destroy = function (t) { - if (this.result_deselect(t[0].getAttribute("data-option-array-index"))) return this.show_search_field_default(), this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1 && this.results_hide(), t.parents("li").first().remove(), this.search_field_scale() - }, i.prototype.results_reset = function () { - var t = this.form_field_jq.val(); - this.reset_single_select_options(), this.form_field.options[0].selected = !0, this.single_set_selected_text(), this.show_search_field_default(), this.results_reset_cleanup(); - var e = this.form_field_jq.val(), i = {selected: e}; - if (t === e || e.length || (i.deselected = t), this.form_field_jq.trigger("change", i), this.sync_sort_field(), this.active_field) return this.results_hide() - }, i.prototype.results_reset_cleanup = function () { - return this.current_selectedIndex = this.form_field.selectedIndex, this.selected_item.find("abbr").remove() - }, i.prototype.result_select = function (t) { - var e, i; - if (this.result_highlight) return e = this.result_highlight, this.result_clear_highlight(), this.is_multiple && this.max_selected_options <= this.choices_count() ? (this.form_field_jq.trigger("chosen:maxselected", {chosen: this}), !1) : (this.is_multiple ? e.removeClass("active-result") : this.reset_single_select_options(), i = this.results_data[e[0].getAttribute("data-option-array-index")], i.selected = !0, this.form_field.options[i.options_index].selected = !0, this.selected_option_count = null, this.is_multiple ? this.choice_build(i) : this.single_set_selected_text(i.text), (t.metaKey || t.ctrlKey) && this.is_multiple || this.results_hide(), this.search_field.val(""), (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) && (this.form_field_jq.trigger("change", {selected: this.form_field.options[i.options_index].value}), this.sync_sort_field()), this.current_selectedIndex = this.form_field.selectedIndex, this.search_field_scale()) - }, i.prototype.single_set_selected_text = function (t) { - return null == t && (t = this.default_text), t === this.default_text ? this.selected_item.addClass("chosen-default") : (this.single_deselect_control_build(), this.selected_item.removeClass("chosen-default")), this.compact_search && this.search_field.attr("placeholder", t), this.selected_item.find("span").attr("title", t).text(t) - }, i.prototype.sync_sort_field = function () { - var e = this; - if (e.is_multiple && e.sort_field) { - var i = t(e.sort_field); - if (!i.length) return; - var n = []; - e.search_choices.find("li.search-choice").each(function () { - var i = t(this), o = i.children(".search-choice-close").first().data("optionArrayIndex"), - a = e.results_data[o]; - a && a.selected && n.push(a.value) - }), i.val(n.join(e.sort_value_splitter)).trigger("change") - } - }, i.prototype.result_deselect = function (t) { - var e; - return e = this.results_data[t], !this.form_field.options[e.options_index].disabled && (e.selected = !1, this.form_field.options[e.options_index].selected = !1, this.selected_option_count = null, this.result_clear_highlight(), this.results_showing && this.winnow_results(), this.form_field_jq.trigger("change", {deselected: this.form_field.options[e.options_index].value}), this.sync_sort_field(), this.search_field_scale(), !0) - }, i.prototype.single_deselect_control_build = function () { - if (this.allow_single_deselect) return this.selected_item.find("abbr").length || this.selected_item.find("span").first().after(''), this.selected_item.addClass("chosen-single-with-deselect") - }, i.prototype.get_search_text = function () { - return this.search_field.val() === this.default_text ? "" : t("
        ").text(t.trim(this.search_field.val())).html() - }, i.prototype.winnow_results_set_highlight = function (t) { - var e, i; - if (i = this.is_multiple ? [] : this.search_results.find(".result-selected.active-result"), e = i.length ? i.first() : this.search_results.find(".active-result").first(), null != e) return this.result_do_highlight(e, t) - }, i.prototype.no_results = function (e) { - var i; - return i = t('
      • ' + this.results_none_found + ' ""
      • '), i.find("span").first().html(e), this.search_results.append(i), this.form_field_jq.trigger("chosen:no_results", {chosen: this}) - }, i.prototype.no_results_clear = function () { - return this.search_results.find(".no-results").remove() - }, i.prototype.keydown_arrow = function () { - var t; - return this.results_showing && this.result_highlight ? (t = this.result_highlight.nextAll("li.active-result").first()) ? this.result_do_highlight(t) : void 0 : this.results_show() - }, i.prototype.keyup_arrow = function () { - var t; - return this.results_showing || this.is_multiple ? this.result_highlight ? (t = this.result_highlight.prevAll("li.active-result"), t.length ? this.result_do_highlight(t.first()) : (this.choices_count() > 0 && this.results_hide(), this.result_clear_highlight())) : void 0 : this.results_show() - }, i.prototype.keydown_backstroke = function () { - var t; - return this.pending_backstroke ? (this.choice_destroy(this.pending_backstroke.find("a").first()), this.clear_backstroke()) : (t = this.search_container.siblings("li.search-choice").last(), t.length && !t.hasClass("search-choice-disabled") ? (this.pending_backstroke = t, this.single_backstroke_delete ? this.keydown_backstroke() : this.pending_backstroke.addClass("search-choice-focus")) : void 0) - }, i.prototype.clear_backstroke = function () { - return this.pending_backstroke && this.pending_backstroke.removeClass("search-choice-focus"), this.pending_backstroke = null - }, i.prototype.keydown_checker = function (t) { - var e, i; - switch (e = null != (i = t.which) ? i : t.keyCode, this.search_field_scale(), 8 !== e && this.pending_backstroke && this.clear_backstroke(), e) { - case 8: - this.backstroke_length = this.search_field.val().length; - break; - case 9: - this.results_showing && !this.is_multiple && this.result_select(t), this.mouse_on_container = !1; - break; - case 13: - t.preventDefault(); - break; - case 38: - t.preventDefault(), this.keyup_arrow(); - break; - case 40: - t.preventDefault(), this.keydown_arrow() - } - }, i.prototype.search_field_scale = function () { - var e, i, n, o, a, s, r, l, h; - if (this.is_multiple) { - for (n = 0, r = 0, a = "position:absolute; left: -1000px; top: -1000px; display:none;", s = ["font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"], l = 0, h = s.length; l < h; l++) o = s[l], a += o + ":" + this.search_field.css(o) + ";"; - return e = t("
        ", {style: a}), e.text(this.search_field.val()), t("body").append(e), r = e.width() + 25, e.remove(), i = this.container.outerWidth(), r > i - 10 && (r = i - 10), this.search_field.css({width: r + "px"}) - } - }, i - }(e), i.DEFAULTS = l, i.LANGUAGES = r, t.fn.chosen.Constructor = i - }.call(this), function (t) { - "use strict"; - var e = "zui.selectable", i = function (i, n) { - this.name = e, this.$ = t(i), this.id = t.zui.uuid(), this.selectOrder = 1, this.selections = {}, this.getOptions(n), this._init() - }, n = function (t, e, i) { - return t >= i.left && t <= i.left + i.width && e >= i.top && e <= i.top + i.height - }, o = function (t, e) { - var i = Math.max(t.left, e.left), o = Math.max(t.top, e.top), a = Math.min(t.left + t.width, e.left + e.width), - s = Math.min(t.top + t.height, e.top + e.height); - return n(i, o, t) && n(a, s, t) && n(i, o, e) && n(a, s, e) - }; - i.DEFAULTS = { - selector: "li,tr,div", - trigger: "", - selectClass: "active", - rangeStyle: { - border: "1px solid " + (t.zui.colorset ? t.zui.colorset.primary : "#3280fc"), - backgroundColor: t.zui.colorset ? new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr() : "rgba(50, 128, 252, 0.2)" - }, - clickBehavior: "toggle", - ignoreVal: 3, - listenClick: !0 - }, i.prototype.getOptions = function (e) { - this.options = t.extend({}, i.DEFAULTS, this.$.data(), e) - }, i.prototype.select = function (t) { - this.toggle(t, !0) - }, i.prototype.unselect = function (t) { - this.toggle(t, !1) - }, i.prototype.toggle = function (e, i, n) { - var o, a, s = this.options.selector, r = this; - if (void 0 === e) return void this.$.find(s).each(function () { - r.toggle(this, i) - }); - if ("object" == typeof e ? (o = t(e).closest(s), a = o.data("id")) : (a = e, o = r.$.find('.slectable-item[data-id="' + a + '"]')), o && o.length) { - if (a || (a = t.zui.uuid(), o.attr("data-id", a)), void 0 !== i && null !== i || (i = !r.selections[a]), !!i != !!r.selections[a]) { - var l; - "function" == typeof n && (l = n(i)), l !== !0 && (r.selections[a] = !!i && r.selectOrder++, r.callEvent(i ? "select" : "unselect", { - id: a, selections: r.selections, target: o, - selected: r.getSelectedArray() - }, r)) - } - r.options.selectClass && o.toggleClass(r.options.selectClass, i) - } - }, i.prototype.getSelectedArray = function () { - var e = []; - return t.each(this.selections, function (t, i) { - i && e.push(t) - }), e - }, i.prototype.syncSelectionsFromClass = function () { - var e = this, i = e.$children = e.$.find(e.options.selector); - e.selections = {}, i.each(function () { - var i = t(this); - e.selections[i.data("id")] = i.hasClass(e.options.selectClass) - }) - }, i.prototype._init = function () { - var e, i, n, a, s, r, l, h = this.options, c = this, d = h.ignoreVal, u = !0, - f = "." + this.name + "." + this.id, p = "function" == typeof h.checkFunc ? h.checkFunc : null, - g = "function" == typeof h.rangeFunc ? h.rangeFunc : null, m = !1, v = null, y = "mousedown" + f, - b = function () { - a && c.$children.each(function () { - var e = t(this), i = e.offset(); - i.width = e.outerWidth(), i.height = e.outerHeight(); - var n = g ? g.call(this, a, i) : o(a, i); - if (p) { - var s = p.call(c, {intersect: n, target: e, range: a, targetRange: i}); - s === !0 ? c.select(e) : s === !1 && c.unselect(e) - } else n ? c.select(e) : c.multiKey || c.unselect(e) - }) - }, w = function (o) { - m && (s = o.pageX, r = o.pageY, a = { - width: Math.abs(s - e), - height: Math.abs(r - i), - left: s > e ? e : s, - top: r > i ? i : r - }, u && a.width < d && a.height < d || (n || (n = t('.selectable-range[data-id="' + c.id + '"]'), n.length || (n = t('
        ').css(t.extend({ - zIndex: 1060, - position: "absolute", - top: e, - left: i, - pointerEvents: "none" - }, c.options.rangeStyle)).appendTo(t("body")))), n.css(a), clearTimeout(l), l = setTimeout(b, 10), u = !1)) - }, x = function (e) { - t(document).off(f), clearTimeout(v), m && (m = !1, n && n.remove(), u || a && (clearTimeout(l), b(), a = null), c.callEvent("finish", { - selections: c.selections, - selected: c.getSelectedArray() - }), e.preventDefault()) - }, C = function (o) { - if (m) return x(o); - var a = t.zui.getMouseButtonCode(h.mouseButton); - if (!(a > -1 && o.button !== a || c.altKey || 3 === o.which || c.callEvent("start", o) === !1)) { - var s = c.$children = c.$.find(h.selector); - s.addClass("slectable-item"); - var r = c.multiKey ? "multi" : h.clickBehavior; - if ("single" === r && c.unselect(), h.listenClick && ("multi" === r ? c.toggle(o.target) : "single" === r ? c.select(o.target) : "toggle" === r && c.toggle(o.target, null, function (t) { - c.unselect() - })), c.callEvent("startDrag", o) === !1) return void c.callEvent("finish", { - selections: c.selections, - selected: c.getSelectedArray() - }); - e = o.pageX, i = o.pageY, n = null, u = !0, m = !0, t(document).on("mousemove" + f, w).on("mouseup" + f, x), v = setTimeout(function () { - t(document).on(y, x) - }, 10), o.preventDefault() - } - }, _ = h.container && "default" !== h.container ? t(h.container) : this.$; - h.trigger ? _.on(y, h.trigger, C) : _.on(y, C), t(document).on("keydown", function (t) { - var e = t.keyCode; - 17 === e || 91 == e ? c.multiKey = e : 18 === e && (c.altKey = !0) - }).on("keyup", function (t) { - c.multiKey = !1, c.altKey = !1 - }) - }, i.prototype.callEvent = function (e, i) { - var n = t.Event(e + "." + this.name); - this.$.trigger(n, i); - var o = n.result, a = this.options[e]; - return "function" == typeof a && (o = a.apply(this, Array.isArray(i) ? i : [i])), o - }, t.fn.selectable = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e), s = "object" == typeof n && n; - a || o.data(e, a = new i(this, s)), "string" == typeof n && a[n]() - }) - }, t.fn.selectable.Constructor = i, t(function () { - t('[data-ride="selectable"]').selectable() - }) -}(jQuery), +function (t, e, i) { - "use strict"; - if (!t.fn.droppable) return void console.error("Sortable requires droppable.js"); - var n = "zui.sortable", o = {selector: "li,div", dragCssClass: "invisible", sortingClass: "sortable-sorting"}, - a = "order", s = function (e, i) { - var n = this; - n.$ = t(e), n.options = t.extend({}, o, n.$.data(), i), n.init() - }; - s.DEFAULTS = o, s.NAME = n, s.prototype.init = function () { - var e, i = this, n = i.$, o = i.options, s = o.selector, r = o.containerSelector, l = o.sortingClass, - h = o.dragCssClass, c = o.targetSelector, d = o.reverse, u = function (e) { - e = e || i.getItems(1); - var n = e.length; - n && e.each(function (e) { - var i = d ? n - e : e; - t(this).attr("data-" + a, i).data(a, i) - }) - }; - u(), n.droppable({ - handle: o.trigger, - target: c ? c : r ? s + "," + r : s, - selector: s, - container: n, - always: o.always, - flex: !0, - lazy: o.lazy, - canMoveHere: o.canMoveHere, - dropToClass: o.dropToClass, - before: o.before, - nested: !!r, - mouseButton: o.mouseButton, - stopPropagation: o.stopPropagation, - start: function (t) { - h && t.element.addClass(h), e = !1, i.trigger("start", t) - }, - drag: function (t) { - if (n.addClass(l), t.isIn) { - var o = t.element, h = t.target, c = r && h.is(r); - if (c) { - if (!h.children(s).filter(".dragging").length) { - h.append(o); - var f = i.getItems(1); - u(f), i.trigger(a, {list: f, element: o}) - } - return - } - var p = o.data(a), g = h.data(a); - if (p === g) return u(f); - p > g ? h[d ? "after" : "before"](o) : h[d ? "before" : "after"](o), e = !0; - var f = i.getItems(1); - u(f), i.trigger(a, {list: f, element: o}) - } - }, - finish: function (t) { - h && t.element && t.element.removeClass(h), n.removeClass(l), i.trigger("finish", { - list: i.getItems(), - element: t.element, - changed: e - }) - } - }) - }, s.prototype.destroy = function () { - this.$.droppable("destroy"), this.$.data(n, null) - }, s.prototype.reset = function () { - this.destroy(), this.init() - }, s.prototype.getItems = function (e) { - var i = this.$.find(this.options.selector).not(".drag-shadow"); - return e ? i : i.map(function () { - var e = t(this); - return {item: e, order: e.data("order")} - }) - }, s.prototype.trigger = function (e, i) { - return t.zui.callEvent(this.options[e], i, this) - }, t.fn.sortable = function (e) { - return this.each(function () { - var i = t(this), o = i.data(n), a = "object" == typeof e && e; - o ? "object" == typeof e && o.reset() : i.data(n, o = new s(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.sortable.Constructor = s -}(jQuery, window, document), function (t, e) { - "use strict"; - var i = "zui.contextmenu", n = { - animation: "fade", - menuTemplate: '', - toggleTrigger: !1, - duration: 200, - limitInsideWindow: !0 - }, o = !1, a = {}, s = "zui-contextmenu-" + t.zui.uuid(), r = 0, l = 0, h = function () { - return t(document).off("mousemove." + i).on("mousemove." + i, function (t) { - r = t.clientX, l = t.clientY - }), a - }, c = function (e, i) { - if ("string" == typeof e && (e = "seperator" === e || "divider" === e || "-" === e || "|" === e ? {type: "seperator"} : { - label: e, - id: i - }), "seperator" === e.type || "divider" === e.type) return t('
      • '); - var n = t("
        ").attr({href: e.url || "###", "class": e.className, style: e.style}).data("item", e); - return e.html ? e.html === !0 ? n.html(e.label || e.text) : n = t(e.html) : n.text(e.label || e.text), e.onClick && n.on("click", e.onClick), t("
      • ").toggleClass("disabled", e.disabled === !0).append(n) - }, d = function (e) { - var i = t("#" + s); - return i.length && i.hasClass("contextmenu-show") && (!e || (i.data("options") || {}).id === e) - }, u = null, f = function (e, i) { - "function" == typeof e && (i = e, e = null), u && (clearTimeout(u), u = null); - var n = t("#" + s); - if (n.length) { - var o = n.removeClass("contextmenu-show").data("options"); - if (!e || o.id === e) { - var r = function () { - n.find(".contextmenu-menu").removeClass("open"), o.onHidden && o.onHidden(), i && i() - }; - o.onHide && o.onHide(); - var l = o.animation; - n.find(".contextmenu-menu").removeClass("in"), l ? u = setTimeout(r, o.duration) : r() - } - } - return a - }, p = function (h, d, p) { - t.isPlainObject(h) && (p = d, d = h, h = d.items), o = !0, d = t.extend({}, n, d); - var g = t("#" + s); - g.length || (g = t('
        ').appendTo("body")); - var m = g.find(".contextmenu-menu").off("click." + i).on("click." + i, "a,.contextmenu-item", function (e) { - var i = t(this), n = d.onClickItem && d.onClickItem(i.data("item"), i, e, d); - n !== !1 && f() - }).empty(); - m.attr("class", "contextmenu-menu" + (d.className ? " " + d.className : "")), g.attr("class", "contextmenu contextmenu-show"); - var v = d.menuCreator; - if (v) m.append(v(h, d)); else { - m.append(d.menuTemplate); - var y = m.children().first(), b = d.itemCreator || c, w = typeof h; - if ("string" === w ? h = h.split(",") : "function" === w && (h = h(d)), !h) return !1; - t.each(h, function (t, e) { - y.append(b(e, t, d)) - }) - } - var x = d.animation, C = d.duration; - x === !0 && (d.animation = x = "fade"), u && (clearTimeout(u), u = null); - var _ = function () { - m.addClass("in"), d.onShown && d.onShown(), p && p() - }; - d.onShow && d.onShow(), g.data("options", { - animation: x, - onHide: d.onHide, - onHidden: d.onHidden, - id: d.id, - duration: C - }); - var k = d.x, T = d.y; - k === e && (k = (d.event || d).clientX), k === e && (k = r), T === e && (T = (d.event || d).clientY), T === e && (T = l); - var y = m.children().first(), S = y.outerWidth(), D = y.outerHeight(); - if (d.position) { - var M = d.position({x: k, y: T, width: S, height: D}, d, m); - M && (k = M.x, T = M.y) - } - if (d.limitInsideWindow) { - var P = t(window); - k = Math.max(0, Math.min(k, P.width() - S)), T = Math.max(0, Math.min(T, P.height() - D)) - } - return g.css({left: k, top: T}).show(), m.addClass("open"), x ? (m.addClass(x), u = setTimeout(function () { - _(), o = !1 - }, 10)) : (_(), o = !1), a - }; - t.extend(a, {NAME: i, DEFAULTS: n, show: p, hide: f, listenMouse: h, isShow: d}), t.zui({ContextMenu: a}); - var g = function (e, n) { - var o = this; - o.name = i, o.$ = t(e), o.id = t.zui.uuid(), n = o.options = t.extend({trigger: "contextmenu"}, a.DEFAULTS, this.$.data(), n); - var s = function (t) { - if ("mousedown" !== t.type || 2 === t.button) { - if (n.toggleTrigger && o.isShow()) o.hide(); else { - var e = {x: t.clientX, y: t.clientY, event: t}; - if (o.show(e) === !1) return - } - return t.preventDefault(), t.returnValue = !1, !1 - } - }, r = n.trigger, l = r + "." + i; - n.selector ? o.$.on(l, n.selector, s) : o.$.on(l, s), n.show && o.show("object" == typeof n.show ? n.show : null) - }; - g.prototype.destory = function () { - that.$.off("." + i) - }, g.prototype.hide = function (t) { - return a.hide(this.id, t) - }, g.prototype.show = function (e, i) { - return e = t.extend({id: this.id, $toggle: this.$}, this.options, e), a.show(e, i) - }, g.prototype.isShow = function () { - return d(this.id) - }, t.fn.contextmenu = function (e) { - return this.each(function () { - var n = t(this), o = n.data(i), a = "object" == typeof e && e; - o || n.data(i, o = new g(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.contextmenu.Constructor = g, t.fn.contextDropdown = function (e) { - t(this).contextmenu(t.extend({ - trigger: "click", animation: "fade", toggleTrigger: !0, menuCreator: function (e, i) { - var n = i.$toggle, o = n.attr("data-target"); - o || (o = n.attr("href"), o = o && /#/.test(o) && o.replace(/.*(?=#[^\s]*$)/, "")); - var a = o ? t(o) : n.next(".dropdown-menu"), s = i.transferEvent; - if (s !== !1) { - var r = "data-contextmenu-index"; - a.find("a,.contextmenu-item").each(function (e) { - t(this).attr(r, e) - }); - var l = a.clone(); - return l.on("string" == typeof s ? s : "click", "a,.contextmenu-item", function (e) { - var i = a.find("[" + r + '="' + t(this).attr(r) + '"]'), n = i[0]; - if (n) return n[e.type] ? n[e.type]() : i.trigger(e.type), e.preventDefault(), e.stopPropagation(), !1 - }), l - } - return a.clone() - }, position: function (t, e, i) { - var n = e.placement, o = e.$toggle; - if (!n) { - var a = i.find(".dropdown-menu"), s = a.hasClass("pull-right"), r = o.parent().hasClass("dropup"); - n = s ? r ? "top-right" : "bottom-right" : r ? "top-left" : "bottom-left", s && a.removeClass("pull-right") - } - var l = o[0].getBoundingClientRect(); - switch (n) { - case"top-left": - return {x: l.left, y: Math.floor(l.top - t.height)}; - case"top-right": - return {x: Math.floor(l.right - t.width), y: Math.floor(l.top - t.height)}; - case"bottom-left": - return {x: l.left, y: l.bottom}; - case"bottom-right": - return {x: Math.floor(l.right - t.width), y: l.bottom} - } - return t - } - }, e)) - }, t(document).on("click", function (e) { - var n = t(e.target), a = n.closest('[data-toggle="context-dropdown"]'); - if (a.length) { - var s = a.data(i); - s || a.contextDropdown({show: !0}) - } else o || n.closest(".contextmenu").length || f() - }) -}(jQuery, void 0),/*! +function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
        ",i),this.is_multiple?this.container.html('
          '):(this.container.html('
          '+this.default_text+'
            '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
          • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
            ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
          • '+this.results_none_found+' ""
          • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.slectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, +selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width
            ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("slectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
          • ');var n=t("
            ").attr({href:e.url||"###","class":e.className,style:e.style}).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.onClick&&n.on("click",e.onClick),t("
          • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
            ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later @@ -4751,430 +63,7 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - function (t) { - "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof module && module.exports ? module.exports = function (e, i) { - return "undefined" == typeof i && (i = "undefined" != typeof window ? require("jquery") : require("jquery")(e)), t(i), i - } : t(jQuery) - }(function (t) { - "use strict"; - - function e(e) { - var i = e.data; - e.isDefaultPrevented() || (e.preventDefault(), t(e.target).closest("form").ajaxSubmit(i)) - } - - function i(e) { - var i = e.target, n = t(i); - if (!n.is("[type=submit],[type=image]")) { - var o = n.closest("[type=submit]"); - if (0 === o.length) return; - i = o[0] - } - var a = i.form; - if (a.clk = i, "image" === i.type) if ("undefined" != typeof e.offsetX) a.clk_x = e.offsetX, a.clk_y = e.offsetY; else if ("function" == typeof t.fn.offset) { - var s = n.offset(); - a.clk_x = e.pageX - s.left, a.clk_y = e.pageY - s.top - } else a.clk_x = e.pageX - i.offsetLeft, a.clk_y = e.pageY - i.offsetTop; - setTimeout(function () { - a.clk = a.clk_x = a.clk_y = null - }, 100) - } - - function n() { - if (t.fn.ajaxSubmit.debug) { - var e = "[jquery.form] " + Array.prototype.join.call(arguments, ""); - window.console && window.console.log ? window.console.log(e) : window.opera && window.opera.postError && window.opera.postError(e) - } - } - - var o = /\r?\n/g, a = {}; - a.fileapi = void 0 !== t('').get(0).files, a.formdata = "undefined" != typeof window.FormData; - var s = !!t.fn.prop; - t.fn.attr2 = function () { - if (!s) return this.attr.apply(this, arguments); - var t = this.prop.apply(this, arguments); - return t && t.jquery || "string" == typeof t ? t : this.attr.apply(this, arguments) - }, t.fn.ajaxSubmit = function (e, i, o, r) { - function l(i) { - var n, o, a = t.param(i, e.traditional).split("&"), s = a.length, r = []; - for (n = 0; n < s; n++) a[n] = a[n].replace(/\+/g, " "), o = a[n].split("="), r.push([decodeURIComponent(o[0]), decodeURIComponent(o[1])]); - return r - } - - function h(i) { - for (var n = new FormData, o = 0; o < i.length; o++) n.append(i[o].name, i[o].value); - if (e.extraData) { - var a = l(e.extraData); - for (o = 0; o < a.length; o++) a[o] && n.append(a[o][0], a[o][1]) - } - e.data = null; - var s = t.extend(!0, {}, t.ajaxSettings, e, { - contentType: !1, - processData: !1, - cache: !1, - type: d || "POST" - }); - e.uploadProgress && (s.xhr = function () { - var i = t.ajaxSettings.xhr(); - return i.upload && i.upload.addEventListener("progress", function (t) { - var i = 0, n = t.loaded || t.position, o = t.total; - t.lengthComputable && (i = Math.ceil(n / o * 100)), e.uploadProgress(t, n, o, i) - }, !1), i - }), s.data = null; - var r = s.beforeSend; - return s.beforeSend = function (t, i) { - e.formData ? i.data = e.formData : i.data = n, r && r.call(this, t, i) - }, t.ajax(s) - } - - function c(i) { - function o(t) { - var e = null; - try { - t.contentWindow && (e = t.contentWindow.document) - } catch (i) { - n("cannot get iframe.contentWindow document: " + i) - } - if (e) return e; - try { - e = t.contentDocument ? t.contentDocument : t.document - } catch (i) { - n("cannot get iframe.contentDocument: " + i), e = t.document - } - return e - } - - function a() { - function e() { - try { - var t = o(m).readyState; - n("state = " + t), t && "uninitialized" === t.toLowerCase() && setTimeout(e, 50) - } catch (i) { - n("Server abort: ", i, " (", i.name, ")"), r(M), C && clearTimeout(C), C = void 0 - } - } - - var i = p.attr2("target"), a = p.attr2("action"), s = "multipart/form-data", - l = p.attr("enctype") || p.attr("encoding") || s; - _.setAttribute("target", f), d && !/post/i.test(d) || _.setAttribute("method", "POST"), a !== c.url && _.setAttribute("action", c.url), c.skipEncodingOverride || d && !/post/i.test(d) || p.attr({ - encoding: "multipart/form-data", - enctype: "multipart/form-data" - }), c.timeout && (C = setTimeout(function () { - x = !0, r(D) - }, c.timeout)); - var h = []; - try { - if (c.extraData) for (var u in c.extraData) c.extraData.hasOwnProperty(u) && (t.isPlainObject(c.extraData[u]) && c.extraData[u].hasOwnProperty("name") && c.extraData[u].hasOwnProperty("value") ? h.push(t('', T).val(c.extraData[u].value).appendTo(_)[0]) : h.push(t('', T).val(c.extraData[u]).appendTo(_)[0])); - c.iframeTarget || g.appendTo(S), m.attachEvent ? m.attachEvent("onload", r) : m.addEventListener("load", r, !1), setTimeout(e, 15); - try { - _.submit() - } catch (v) { - var y = document.createElement("form").submit; - y.apply(_) - } - } finally { - _.setAttribute("action", a), _.setAttribute("enctype", l), i ? _.setAttribute("target", i) : p.removeAttr("target"), t.each(h, function () { - this.remove() - }) - } - } - - function r(e) { - if (!v.aborted && !I) { - if (F = o(m), F || (n("cannot access response document"), e = M), e === D && v) return v.abort("timeout"), void k.reject(v, "timeout"); - if (e === M && v) return v.abort("server abort"), void k.reject(v, "error", "server abort"); - if (F && F.location.href !== c.iframeSrc || x) { - m.detachEvent ? m.detachEvent("onload", r) : m.removeEventListener("load", r, !1); - var i, a = "success"; - try { - if (x) throw"timeout"; - var s = "xml" === c.dataType || F.XMLDocument || t.isXMLDoc(F); - if (n("isXml=" + s), !s && window.opera && (null === F.body || !F.body.innerHTML) && --$) return n("requeing onLoad callback, DOM not available"), void setTimeout(r, 250); - var l = F.body ? F.body : F.documentElement; - v.responseText = l ? l.innerHTML : null, v.responseXML = F.XMLDocument ? F.XMLDocument : F, s && (c.dataType = "xml"), v.getResponseHeader = function (t) { - var e = {"content-type": c.dataType}; - return e[t.toLowerCase()] - }, l && (v.status = Number(l.getAttribute("status")) || v.status, v.statusText = l.getAttribute("statusText") || v.statusText); - var h = (c.dataType || "").toLowerCase(), d = /(json|script|text)/.test(h); - if (d || c.textarea) { - var f = F.getElementsByTagName("textarea")[0]; - if (f) v.responseText = f.value, v.status = Number(f.getAttribute("status")) || v.status, v.statusText = f.getAttribute("statusText") || v.statusText; else if (d) { - var p = F.getElementsByTagName("pre")[0], y = F.getElementsByTagName("body")[0]; - p ? v.responseText = p.textContent ? p.textContent : p.innerText : y && (v.responseText = y.textContent ? y.textContent : y.innerText) - } - } else "xml" === h && !v.responseXML && v.responseText && (v.responseXML = A(v.responseText)); - try { - L = O(v, h, c) - } catch (b) { - a = "parsererror", v.error = i = b || a - } - } catch (b) { - n("error caught: ", b), a = "error", v.error = i = b || a - } - v.aborted && (n("upload aborted"), a = null), v.status && (a = v.status >= 200 && v.status < 300 || 304 === v.status ? "success" : "error"), "success" === a ? (c.success && c.success.call(c.context, L, "success", v), k.resolve(v.responseText, "success", v), u && t.event.trigger("ajaxSuccess", [v, c])) : a && ("undefined" == typeof i && (i = v.statusText), c.error && c.error.call(c.context, v, a, i), k.reject(v, "error", i), u && t.event.trigger("ajaxError", [v, c, i])), u && t.event.trigger("ajaxComplete", [v, c]), u && !--t.active && t.event.trigger("ajaxStop"), c.complete && c.complete.call(c.context, v, a), I = !0, c.timeout && clearTimeout(C), setTimeout(function () { - c.iframeTarget ? g.attr("src", c.iframeSrc) : g.remove(), v.responseXML = null - }, 100) - } - } - } - - var l, h, c, u, f, g, m, v, b, w, x, C, _ = p[0], k = t.Deferred(); - if (k.abort = function (t) { - v.abort(t) - }, i) for (h = 0; h < y.length; h++) l = t(y[h]), s ? l.prop("disabled", !1) : l.removeAttr("disabled"); - c = t.extend(!0, {}, t.ajaxSettings, e), c.context = c.context || c, f = "jqFormIO" + (new Date).getTime(); - var T = _.ownerDocument, S = p.closest("body"); - if (c.iframeTarget ? (g = t(c.iframeTarget, T), w = g.attr2("name"), w ? f = w : g.attr2("name", f)) : (g = t('