"), $(".jsPanel-connector-bottomleft", a).css("border-bottom-color", f || d("bottomleft")), a.option.position.offsetY = a.option.position.offsetY + 10 || 10) : a.hasClass("jsPanel-tooltip-bottomright") && (a.append("
"), $(".jsPanel-connector-bottomright", a).css("border-bottom-color", f || d("bottomright")), a.option.position.offsetY = a.option.position.offsetY + 10 || 10);
}, setTrigger: function setTrigger(a) {
return "string" === typeof a.of ? document.querySelector(a.of) : a.of.jquery ? a.of[0] : a.of;
}, closeTooltips: function closeTooltips() {
$(".jsPanel-tooltip").each(function (a, c) {
c.jspanel && c.jspanel.close();
});
}, setTooltipClass: function setTooltipClass(a) {
var c = a.option.position;"center-bottom" === c.my && "center-top" === c.at ? a.addClass("jsPanel-tooltip-top") : "left-bottom" === c.my && "right-top" === c.at ? a.addClass("jsPanel-tooltip-righttopcorner") : "left-center" === c.my && "right-center" === c.at ? a.addClass("jsPanel-tooltip-right") : "left-top" === c.my && "right-bottom" === c.at ? a.addClass("jsPanel-tooltip-rightbottomcorner") : "center-top" === c.my && "center-bottom" === c.at ? a.addClass("jsPanel-tooltip-bottom") : "right-top" === c.my && "left-bottom" === c.at ? a.addClass("jsPanel-tooltip-leftbottomcorner") : "right-center" === c.my && "left-center" === c.at ? a.addClass("jsPanel-tooltip-left") : "right-bottom" === c.my && "left-top" === c.at ? a.addClass("jsPanel-tooltip-lefttopcorner") : "center" === c.my && "center" === c.at ? a.addClass("jsPanel-tooltip-center") : "right-top" === c.my && "left-top" === c.at ? a.addClass("jsPanel-tooltip-lefttop") : "right-bottom" === c.my && "left-bottom" === c.at ? a.addClass("jsPanel-tooltip-leftbottom") : "left-bottom" === c.my && "left-top" === c.at ? a.addClass("jsPanel-tooltip-topleft") : "right-bottom" === c.my && "right-top" === c.at ? a.addClass("jsPanel-tooltip-topright") : "left-top" === c.my && "right-top" === c.at ? a.addClass("jsPanel-tooltip-righttop") : "left-bottom" === c.my && "right-bottom" === c.at ? a.addClass("jsPanel-tooltip-rightbottom") : "left-top" === c.my && "left-bottom" === c.at ? a.addClass("jsPanel-tooltip-bottomleft") : "right-top" === c.my && "right-bottom" === c.at && a.addClass("jsPanel-tooltip-bottomright");
}, setTooltipMode: function setTooltipMode(a, c) {
"semisticky" === a.option.paneltype.mode ? a.hover(function () {
return $.noop();
}, function () {
a.close();$(c).removeClass("hasTooltip");
}) : "sticky" === a.option.paneltype.mode ? $.noop() : $(c).mouseout(function () {
a.close();$(c).removeClass("hasTooltip");
});
}, ajax: function ajax(a) {
var c = a.option.contentAjax;$.ajax(c).done(function (d, e, b) {
c.autoload && a.content.append(d);
$.isFunction(c.done) && c.done.call(a, d, e, b, a);
}).fail(function (d, e, b) {
$.isFunction(c.fail) && c.fail.call(a, d, e, b, a);
}).always(function (d, e, b) {
$.isFunction(c.always) && c.always.call(a, d, e, b, a);
}).then(function (d, e, b) {
c.then && $.isArray(c.then) && $.isFunction(c.then[0]) && c.then[0].call(a, d, e, b, a);
}, function (d, e, b) {
$.isArray(c.then) && $.isFunction(c.then[1]) && c.then[1].call(a, d, e, b, a);
});a.data("ajaxURL", c.url);
}, iframe: function iframe(a) {
var c = $("
"),
d = a.option.contentIframe;d.srcdoc && (c.prop("srcdoc", d.srcdoc), a.data("iframeDOC", d.srcdoc));d.src && (c.prop("src", d.src), a.data("iframeSRC", d.src));"auto" === a.option.contentSize.width || d.width ? c.prop("width", d.width) : c.css("width", "100%");"auto" === a.option.contentSize.height || d.height ? c.prop("height", d.height) : c.css("height", "100%");d.name && c.prop("name", d.name);d.sandbox && c.prop("sandox", d.sandbox);d.id && c.prop("id", d.id);$.isPlainObject(d.style) && c.css(d.style);"string" === typeof d.classname ? c.addClass(d.classname) : $.isFunction(d.classname) && c.addClass(d.classname());
a.content.append(c);
}, contentReload: function contentReload(a, c) {
a.option.content ? a.content.empty().append(a.option.content) : a.option.contentAjax ? (a.content.empty(), this.ajax(a)) : a.option.contentIframe && (a.content.empty(), this.iframe(a));return a;
}, contentResize: function contentResize(a) {
var c,
d = parseInt(a.css("border-top-width"), 10) + parseInt(a.css("border-bottom-width"), 10);a.footer.hasClass("active") ? c = a.header.outerHeight() + a.footer.outerHeight() : c = a.header.outerHeight();a.content.css({ height: a.outerHeight() - c - d });return a;
},
configIconfont: function configIconfont(a) {
var c = "close maximize normalize minimize smallify smallifyrev".split(" "),
d = "remove fullscreen resize-full minus chevron-up chevron-down".split(" "),
e = "times arrows-alt expand minus chevron-up chevron-down".split(" "),
b = a.option.headerControls.iconfont,
f = a.header.headerbar;"bootstrap" === b || "glyphicon" === b ? (c.forEach(function (b, a) {
$(".jsPanel-btn-" + b + " span", f).removeClass().addClass("glyphicon glyphicon-" + d[a]);
}), $(".jsPanel-headerbar .jsPanel-btn", a).css("padding-top", "4px")) : "font-awesome" === b && c.forEach(function (b, a) {
$(".jsPanel-btn-" + b + " span", f).removeClass().addClass("fa fa-" + e[a]);
});
}, headerControl: function headerControl(a, c, d) {
var e = a.header.headerbar,
b = a[0];"disable" === d ? "removed" !== b.getAttribute("data-btn" + c) && (b.setAttribute("data-btn" + c, "disabled"), $(".jsPanel-btn-" + c, e).css({ pointerEvents: "none", opacity: .4, cursor: "default" })) : "enable" === d ? "removed" !== b.getAttribute("data-btn" + c) && (b.setAttribute("data-btn" + c, "enabled"), $(".jsPanel-btn-" + c, e).css({ pointerEvents: "auto",
opacity: 1, cursor: "pointer" })) : "remove" === d && "close" !== c && (b.setAttribute("data-btn" + c, "removed"), $(".jsPanel-btn-" + c, e).remove());return a;
}, hideControls: function hideControls(a, c) {
var d = c.header.headerbar;$("div", d).css("display", "flex");$(a, d).css("display", "none");
}, headerTitle: function headerTitle(a, c) {
return c ? (a.header.title.empty().append(c), a) : a.header.title.html();
}, configToolbar: function configToolbar(a, c, d) {
var e, b;a.forEach(function (a) {
"object" === (typeof a === "undefined" ? "undefined" : _typeof(a)) && (e = $(a.item), "string" === typeof a.btntext && e.append(a.btntext), "string" === typeof a.btnclass && e.addClass(a.btnclass), c.append(e), $.isFunction(a.callback) && (b = a.event || "click", e.on(b, d, a.callback)));
});
}, toolbar: function toolbar(a, c, d, e) {
"header" === c ? (a.header.toolbar.addClass("active"), $.isArray(d) ? this.configToolbar(d, a.header.toolbar, a) : $.isFunction(d) ? a.header.toolbar.append(d(a.header)) : a.header.toolbar.append(d)) : "footer" === c && (a.content.removeClass("jsPanel-content-nofooter"), a.footer.addClass("active"), $.isArray(d) ? this.configToolbar(d, a.footer, a) : $.isFunction(d) ? a.footer.append(d(a.footer)) : a.footer.append(d));this.contentResize(a);e && $.isFunction(e) && e.call(a, a);return a;
}, closeChildpanels: function closeChildpanels(a) {
$(".jsPanel", a).each(function (a, d) {
d.jspanel.close();
});return a;
}, dblclickhelper: function dblclickhelper(a, c) {
if ("string" === typeof a) if ("maximize" === a || "normalize" === a) "normalized" === c.data("status") ? c.maximize() : c.normalize();else if ("minimize" === a || "smallify" === a || "close" === a) c[a]();
}, exportPanels: function exportPanels(a, c) {
a = void 0 === a ? ".jsPanel" : a;c = void 0 === c ? "jspanels" : c;var d,
e,
b,
f,
m,
q,
h,
k = [],
g,
p = $(".jsPanel").not(".jsPanel-tooltip, .jsPanel-hint, .jsPanel-modal").filter(a);
p.each(function (b, a) {
"normalized" !== $(a).data("status") && $(".jsPanel-btn-normalize", a).trigger("click");
});p.each(function (a, c) {
h = $(c).data("container");d = $(c).offset();e = $(c).position();"body" === h.toLowerCase() ? (b = Math.floor(d.top - $(window).scrollTop()), f = Math.floor(d.left - $(window).scrollLeft())) : (b = Math.floor(e.top), f = Math.floor(e.left));m = $(c).css("width");q = $(".jsPanel-content", c).css("height");g = { status: $(c).data("status"), id: $(c).prop("id"), headerTitle: $(".jsPanel-title", c).html(), custom: $(c).data("custom"),
content: $(c).data("content"), contentSize: { width: m, height: q }, position: { my: "left-top", at: "left-top", offsetX: f, offsetY: b } };$(c).data("ajaxURL") && (g.contentAjax = { url: $(c).data("ajaxURL"), autoload: !0 });if ($(c).data("iframeDOC") || $(c).data("iframeSRC")) g.contentIframe = { src: $(c).data("iframeSRC") || "", srcdoc: $(c).data("iframeDOC") || "" };k.push(g);switch (g.status) {case "minimized":
$(".jsPanel-btn-minimize", c).trigger("click");break;case "maximized":
$(".jsPanel-btn-maximize", c).trigger("click");break;case "smallified":
$(".jsPanel-btn-smallify", c).trigger("click");break;case "smallifiedMax":
$(".jsPanel-btn-smallify", c).trigger("click");}
});window.localStorage.setItem(c, JSON.stringify(k));return k;
}, importPanels: function importPanels(a, c) {
var d = JSON.parse(localStorage[void 0 === c ? "jspanels" : c]),
e = a["default"] || {},
b;d.forEach(function (c) {
b = "string" === typeof c.custom.config ? $.extend(!0, {}, e, a[c.custom.config], c) : $.extend(!0, {}, e, c);$.jsPanel(b);
});
}, resize: function resize(a, c, d, e) {
if ("minimized" !== a.data("status")) {
if ($.isFunction(a.option.onbeforeresize) && !1 === a.option.onbeforeresize.call(a, a)) return a;c && null !== c || (c = a.content.css("width") + a.content.css("border-left-width"));a.css("width", c);d && null !== d && a.css("height", d);a.contentResize();if ($.isFunction(a.option.onresized) && !1 === a.option.onresized.call(a, a)) return a;e && $.isFunction(e) && e.call(a, a);
}return a;
}, setZi: function setZi(a) {
a.hasClass("jsPanel-modal") || (this.zi += 1) > a.css("z-index") && a.css("z-index", this.zi);
}, resetZis: function resetZis() {
var a = [];$(".jsPanel:not(.jsPanel-modal):not(.jsPanel-hint)").each(function (c, d) {
a.push(d);
});a.sort(function (a, d) {
return $(a).css("z-index") - $(d).css("z-index");
}).forEach(function (a, d) {
(jsPanel.zi += 1) > $(a).css("z-index") && $(a).css("z-index", jsPanel.ziBase + d);
});this.zi = this.ziBase - 1 + a.length;
}, updateCachedData: function updateCachedData(a) {
var c = window.getComputedStyle(a[0], null);a.cachedData.top = c.getPropertyValue("top");a.cachedData.left = c.getPropertyValue("left");a.cachedData.width = c.getPropertyValue("width");a.cachedData.height = c.getPropertyValue("height");
}, getTopmostPanel: function getTopmostPanel() {
var a = [];$(".jsPanel:not(.jsPanel-tooltip):not(.jsPanel-hint)").each(function (c, d) {
a.push(d);
});a.sort(function (a, d) {
return $(d).css("z-index") - $(a).css("z-index");
});return a[0].getAttribute("id");
} };
(function (a) {
a.jsPanel = function (c) {
var d;c = c || {};var e = a.extend(!0, {}, c.config || {}, c),
b = a(c.template || jsPanel.template),
f,
m;"tooltip" === e.paneltype && (e.paneltype = { tooltip: !0 });e.paneltype ? "modal" === e.paneltype ? b.option = a.extend(!0, {}, a.jsPanel.defaults, a.jsPanel.modaldefaults, e) : e.paneltype.tooltip ? b.option = a.extend(!0, {}, a.jsPanel.defaults, a.jsPanel.tooltipdefaults, e) : "hint" === e.paneltype && (b.option = a.extend(!0, {}, a.jsPanel.defaults, a.jsPanel.hintdefaults, e)) : b.option = a.extend(!0, {}, a.jsPanel.defaults, e);if (b.option.paneltype.tooltip && (f = jsPanel.setTrigger(b.option.position), a(f).hasClass("hasTooltip"))) return !1;var q = "container contentAjax contentIframe contentOverflow contentSize footerToolbar headerControls headerRemove headerTitle headerToolbar".split(" ");"selector ajax iframe overflow size toolbarFooter controls removeHeader title toolbarHeader".split(" ").forEach(function (a, c) {
b.option[a] && (b.option[q[c]] = b.option[a]);
});switch (b.option.theme) {case "light":
b.option.theme = "gainsboro";break;
case "medium":
b.option.theme = "silver";break;case "dark":
b.option.theme = "gray";break;case "autumngreen":
b.option.theme = "#5A521B";break;case "autumnbrown":
b.option.theme = "#823E1D";break;case "autumnred":
b.option.theme = "#852228";}if (b.option.bootstrap) switch (b.option.bootstrap) {case "default":
b.option.theme = "bootstrap-default";break;case "primary":
b.option.theme = "bootstrap-primary";break;case "info":
b.option.theme = "bootstrap-info";break;case "success":
b.option.theme = "bootstrap-success";break;case "warning":
b.option.theme = "bootstrap-warning";break;case "danger":
b.option.theme = "bootstrap-danger";}b.option.load.url && (b.option.contentAjax = { url: b.option.load.url, autoload: !0, data: b.option.load.data || void 0, done: b.option.load.complete || void 0 });b.option.panelstatus && ("smallifiedMax" === b.option.panelstatus ? b.option.setstatus = "maximize smallify" : b.option.setstatus = b.option.panelstatus);b.option.headerControls.buttons && (b.option.headerControls.controls = b.option.headerControls.buttons);"string" === typeof b.option.id ? d = b.option.id : a.isFunction(b.option.id) && (b.option.id = d = b.option.id());if (0 < a("#" + d).length) return console.warn("jsPanel Error: No jsPanel created - id attribute passed with option.id already exists in document"), !1;b.attr("id", d);b.data("custom", b.option.custom);b.header = a(".jsPanel-hdr", b);b.header.headerbar = a(".jsPanel-headerbar", b.header);b.header.title = a(".jsPanel-title", b.header.headerbar);b.header.controls = a(".jsPanel-controlbar", b.header.headerbar);b.header.toolbar = a(".jsPanel-hdr-toolbar", b.header);b.content = a(".jsPanel-content", b);b.footer = a(".jsPanel-ftr", b);b.data("status", "initialized");b.cachedData = {};b.toolbarAdd = function (a, c, d) {
c = void 0 === c ? [] : c;return jsPanel.toolbar(b, void 0 === a ? "header" : a, c, d);
};b.close = function (c) {
a(document).trigger("jspanelbeforeclose", d);if (a.isFunction(b.option.onbeforeclose) && !1 === b.option.onbeforeclose.call(b, b)) return b;var e = b.option.position;if (e.autoposition || "string" === typeof e && e.match(/DOWN|RIGHT|UP|LEFT/)) {
var e = a("#" + d).parent(),
g = document.getElementById(d).className.match(/left-top|center-top|right-top|left-center|center|right-center|left-bottom|center-bottom|right-bottom/);
g && (jsPanel.lastbeforeclose = { parent: e, "class": g[0] });
}b.closeChildpanels().remove();e = jsPanel.activePanels.list.findIndex(function (b) {
return b === d;
});-1 < e && jsPanel.activePanels.list.splice(e, 1);a("#" + d + "-min").remove();"modal" === b.option.paneltype && a("#jsPanel-modal-backdrop-" + b.attr("id")).remove();b.option.paneltype.tooltip && a(f).removeClass("hasTooltip");a(document).trigger("jspanelclosed", d);a(document).trigger("jspanelstatuschange", d);var p, m;jsPanel.lastbeforeclose && (p = jsPanel.lastbeforeclose.parent, p = a("." + jsPanel.lastbeforeclose["class"], p), m = jsPanel.lastbeforeclose["class"]);p && (p.each(function (b, c) {
a(c).removeClass(m);
}), p.each(function (b, a) {
var c = a.getAttribute("data-autoposition"),
d = a.getAttribute("data-offsetx"),
h = a.getAttribute("data-offsety");jsPanel.position(a, { my: m, at: m, autoposition: c, offsetX: d, offsetY: h });
}));jsPanel.lastbeforeclose = !1;a.isFunction(b.option.onclosed) && b.option.onclosed.call(b, b);c && a.isFunction(c) && c.call(b, b);jsPanel.resetZis();
};b.closeChildpanels = function () {
return jsPanel.closeChildpanels(b);
};
b.contentReload = function () {
return jsPanel.contentReload(b);
};b.contentResize = function () {
return jsPanel.contentResize(b);
};b.headerControl = function (a, c) {
c = void 0 === c ? "enable" : c;a ? jsPanel.headerControl(b, a, c) : ["close", "maximize", "minimize", "normalize", "smallify"].forEach(function (a) {
jsPanel.headerControl(b, a, c);
});return b;
};b.headerTitle = function (a) {
return jsPanel.headerTitle(b, a);
};b.front = function (c) {
b.css("z-index", jsPanel.setZi(b));jsPanel.resetZis();a(document).trigger("jspanelfronted", d);if (a.isFunction(b.option.onfronted)) {
if (!1 === b.option.onfronted.call(b, b)) return b;b.option.onfronted.call(b, b);
}c && a.isFunction(c) && c.call(b, b);return b;
};b.normalize = function (c) {
if ("normalized" === b.data("status")) return b;a(document).trigger("jspanelbeforenormalize", d);if (a.isFunction(b.option.onbeforenormalize) && !1 === b.option.onbeforenormalize.call(b, b)) return b;if ("smallified" === b.data("status")) return b.smallify(), a(document).trigger("jspanelnormalized", d), a(document).trigger("jspanelstatuschange", d), a.isFunction(b.option.onnormalized) && b.option.onnormalized.call(b, b), b;b.css({ left: b.cachedData.left, top: b.cachedData.top, width: b.cachedData.width, height: b.cachedData.height, zIndex: function zIndex() {
jsPanel.setZi(b);
}, overflow: "visible" }).data("status", "normalized").contentResize();jsPanel.hideControls(".jsPanel-btn-normalize, .jsPanel-btn-smallifyrev", b);a("#" + b.prop("id") + "-min").remove();a(document).trigger("jspanelnormalized", d);a(document).trigger("jspanelstatuschange", d);a.isFunction(b.option.onnormalized) && b.option.onnormalized.call(b, b);c && a.isFunction(c) && c.call(b, b);return b;
};b.maximize = function (c) {
var e = b.option.maximizedMargin,
g = b[0].parentNode;if ("maximized" === b.data("status")) return b;"normalized" === b.data("status") && jsPanel.updateCachedData(b);a(document).trigger("jspanelbeforemaximize", d);if (a.isFunction(b.option.onbeforemaximize) && !1 === b.option.onbeforemaximize.call(b, b)) return b;b.css("overflow", "visible");g === document.body ? (b.css({ width: document.documentElement.clientWidth - e.left - e.right + "px", height: document.documentElement.clientHeight - e.top - e.bottom + "px", left: e.left + "px", top: e.top + "px" }), !1 === b.option.position.fixed && b.css({ left: window.pageXOffset + e.left + "px", top: window.pageYOffset + e.top + "px" })) : b.css({ width: g.clientWidth - e.left - e.right + "px", height: g.clientHeight - e.top - e.bottom + "px", left: e.left + "px", top: e.top + "px" });b.contentResize().data("status", "maximized").css("z-index", jsPanel.setZi(b));jsPanel.hideControls(".jsPanel-btn-maximize, .jsPanel-btn-smallifyrev", b);a("#" + b.prop("id") + "-min").remove();a(document).trigger("jspanelmaximized", d);a(document).trigger("jspanelstatuschange", d);a.isFunction(b.option.onmaximized) && b.option.onmaximized.call(b, b);c && a.isFunction(c) && c.call(b, b);return b;
};b.minimize = function (c) {
if ("minimized" === b.data("status")) return b;a(document).trigger("jspanelbeforeminimize", d);if (a.isFunction(b.option.onbeforeminimize) && !1 === b.option.onbeforeminimize.call(b, b)) return b;var e = b.header.headerbar.css("color"),
g;g = b.hasClass("panel") ? "transparent" === b.header.css("background-color") ? b.css("background-color") : b.header.css("background-color") : b.css("background-color");"normalized" === b.data("status") && jsPanel.updateCachedData(b);var f = a(jsPanel.replacementTemplate);f.left = b.css("left");b.css("left", "-9999px").data("status", "minimized");f.css({ backgroundColor: g }).prop("id", b.prop("id") + "-min").find("h3").css({ color: e }).prop("title", b.header.title[0].textContent).html(b.headerTitle());g = b.option.headerControls.iconfont;if ("font-awesome" === g) a(".jsglyph.jsglyph-normalize", f).removeClass().addClass("fa fa-expand"), a(".jsglyph.jsglyph-maximize", f).removeClass().addClass("fa fa-arrows-alt"), a(".jsglyph.jsglyph-close", f).removeClass().addClass("fa fa-times");else if ("bootstrap" === g || "glyphicon" === g) a(".jsglyph.jsglyph-normalize", f).removeClass().addClass("glyphicon glyphicon-resize-full"), a(".jsglyph.jsglyph-maximize", f).removeClass().addClass("glyphicon glyphicon-fullscreen"), a(".jsglyph.jsglyph-close", f).removeClass().addClass("glyphicon glyphicon-remove");a(".jsPanel-btn span", f).css({ color: e });e = a(b.option.container).closest(".jsPanel-content");
e.length ? (a(".jsPanel-minimized-box").length || a(e[0]).append("
"), a(".jsPanel-minimized-box").append(f)) : a("#jsPanel-replacement-container").append(f);a(document).trigger("jspanelminimized", d);a(document).trigger("jspanelstatuschange", d);a.isFunction(b.option.onminimized) && b.option.onminimized.call(b, b);c && a.isFunction(c) && c.call(b, b);a(".jsPanel-btn-normalize", f).css("display", "block").click(function () {
b.css("left", f.left);f.remove();a(".jsPanel-btn-normalize", b).trigger("click");
});
"disabled" === b[0].dataset.btnnormalize ? a(".jsPanel-btn-normalize", f).css({ pointerEvents: "none", opacity: .5, cursor: "default" }) : "removed" === b[0].dataset.btnnormalize && a(".jsPanel-btn-normalize", f).remove();a(".jsPanel-btn-maximize", f).click(function () {
b.css("left", f.left);f.remove();a(".jsPanel-btn-maximize", b).trigger("click");
});"disabled" === b[0].dataset.btnmaximize ? a(".jsPanel-btn-maximize", f).css({ pointerEvents: "none", opacity: .5, cursor: "default" }) : "removed" === b[0].dataset.btnmaximize && a(".jsPanel-btn-maximize", f).remove();a(".jsPanel-btn-close", f).click(function () {
f.remove();b.close();
});"disabled" === b[0].dataset.btnclose && a(".jsPanel-btn-close", f).css({ pointerEvents: "none", opacity: .5, cursor: "default" });return b;
};b.reposition = function (a, c) {
return jsPanel.reposition(b, a, c);
};b.resize = function (a, c, d) {
return jsPanel.resize(b, a, c, d);
};b.smallify = function (c) {
"normalized" === b.data("status") || "maximized" === b.data("status") ? "smallified" !== b.data("status") && "smallifiedMax" !== b.data("status") && (a(document).trigger("jspanelbeforesmallify", d), a.isFunction(b.option.onbeforesmallify) && b.option.onbeforesmallify.call(b, b), b.smallify.height = b.outerHeight(), b.css("overflow", "hidden"), b.animate({ height: b.header.headerbar.outerHeight() + "px" }, { done: function done() {
"maximized" === b.data("status") ? (jsPanel.hideControls(".jsPanel-btn-maximize, .jsPanel-btn-smallify", b), b.data("status", "smallifiedMax"), a(document).trigger("jspanelsmallifiedmax", d)) : (jsPanel.hideControls(".jsPanel-btn-normalize, .jsPanel-btn-smallify", b), b.data("status", "smallified"), a(document).trigger("jspanelsmallified", d));a.isFunction(b.option.onsmallified) && b.option.onsmallified.call(b, b);a(document).trigger("jspanelstatuschange", d);
} })) : "minimized" !== b.data("status") && (a(document).trigger("jspanelbeforeunsmallify", d), a.isFunction(b.option.onbeforeunsmallify) && b.option.onbeforeunsmallify.call(b, b), b.css("overflow", "visible"), b.animate({ height: b.smallify.height }, { done: function done() {
"smallified" === b.data("status") ? (jsPanel.hideControls(".jsPanel-btn-normalize, .jsPanel-btn-smallifyrev", b), b.data("status", "normalized"), a(document).trigger("jspanelnormalized", d), a.isFunction(b.option.onnormalized) && b.option.onnormalized.call(b, b)) : (jsPanel.hideControls(".jsPanel-btn-maximize, .jsPanel-btn-smallifyrev", b), b.data("status", "maximized"), a(document).trigger("jspanelmaximized", d), a.isFunction(b.option.onmaximized) && b.option.onmaximized.call(b, b));a(document).trigger("jspanelstatuschange", d);a.isFunction(b.option.onunsmallified) && b.option.onunsmallified.call(b, b);
} }));b.css("z-index", jsPanel.setZi(b));
c && a.isFunction(c) && c.call(b, b);return b;
};b.setTheme = function (c, d) {
c = void 0 === c ? b.option.theme.toLowerCase().replace(/ /g, "") : c;c = c.toLowerCase().replace(/ /g, "");var e = [],
f,
m,
n,
l;jsPanel.themes.forEach(function (a, c, d) {
b.removeClass("panel card card-inverse jsPanel-theme-" + a + " panel-" + a + " card-" + a);
});b.header.removeClass("panel-heading").title.removeClass("panel-title");b.content.removeClass("panel-body").css("border-top-color", "");b.footer.removeClass("panel-footer card-footer");b.css("background", "").content.css({ borderTop: "", backgroundColor: "", color: "" });b.css({ borderWidth: "", borderStyle: "", borderColor: "" });a(".jsPanel-hdr *", b).css({ color: "" });b.header.toolbar.css({ boxShadow: "", width: "", marginLeft: "" });c.endsWith("filled") ? (e[1] = "filled", e[0] = c.substr(0, c.length - 6)) : c.endsWith("filledlight") ? (e[1] = "filledlight", e[0] = c.substr(0, c.length - 11)) : (e[1] = "", e[0] = c);e[0].match("-") && (f = e[0].split("-"), m = !0);m ? (b.addClass("panel panel-" + f[1]).addClass("card card-inverse card-" + f[1]).header.addClass("panel-heading").title.addClass("panel-title"), b.content.addClass("panel-body").css("border-top-color", function () {
return b.header.css("border-top-color");
}), b.footer.addClass("panel-footer card-footer"), l = "transparent" === a(".panel-heading", b).css("background-color") ? b.css("background-color").replace(/\s+/g, "") : a(".panel-heading", b).css("background-color").replace(/\s+/g, ""), f = jsPanel.calcColors(l), a("*", b.header).css("color", f[3]), b.option.headerToolbar ? b.header.toolbar.css({ boxShadow: "0 0 1px " + f[3] + " inset", width: "calc(100% + 4px)", marginLeft: "-2px" }) : b.content.css({ borderTop: "1px solid " + f[3] }), "filled" === e[1] ? b.content.css({ backgroundColor: l, color: f[3] }) : "filledlight" === e[1] && b.content.css({ backgroundColor: f[1], color: "#000000" })) : jsPanel.themes.includes(e[0]) ? (b.addClass("jsPanel-theme-" + e[0]), "filled" === e[1] ? b.content.css("background", "").addClass("jsPanel-content-filled") : "filledlight" === e[1] && b.content.css("background", "").addClass("jsPanel-content-filledlight"), b.option.headerToolbar || b.content.css({ borderTop: "1px solid " + b.header.title.css("color") })) : (n = jsPanel.calcColors(e[0]), b.css("background-color", n[0]), a(".jsPanel-hdr *", b).css({ color: n[3] }), b.option.headerToolbar ? b.header.toolbar.css({ boxShadow: "0 0 1px " + n[3] + " inset", width: "calc(100% + 4px)", marginLeft: "-2px" }) : b.content.css({ borderTop: "1px solid " + n[3] }), "filled" === e[1] ? b.content.css({ "background-color": n[0], color: n[3] }) : "filledlight" === e[1] && b.content.css({ "background-color": n[1] }));b.option.border ? (f = b.option.border.split(" "), b.css({ "border-width": f[0], "border-style": f[1] }), m ? b.css("border-color", l) : jsPanel.themes.includes(e[0]) || b.css("border-color", n[0])) : b.css({ borderWidth: "", borderStyle: "", borderColor: "" });d && a.isFunction(d) && d.call(b, b);return b;
};b.addToolbar = b.toolbarAdd;b.reloadContent = b.contentReload;b.resizeContent = b.contentResize;b.control = b.headerControl;b.title = b.headerTitle;a(".jsPanel-btn-close", b).on("click", function (a) {
a.preventDefault();b.close();
});a(".jsPanel-btn-minimize", b).on("click", function (a) {
a.preventDefault();b.minimize();
});a(".jsPanel-btn-maximize", b).on("click", function (a) {
a.preventDefault();b.maximize();
});a(".jsPanel-btn-normalize", b).on("click", function (a) {
a.preventDefault();b.normalize();
});a(".jsPanel-btn-smallify, .jsPanel-btn-smallifyrev", b).on("click", function (a) {
a.preventDefault();b.smallify();
});b.appendTo(b.option.container);jsPanel.activePanels.list.push(d);a(document).trigger("jspanelloaded", d);b.data("container", b.option.container);b.setTheme();b.option.headerRemove ? (b.header.remove(), b.content.addClass("jsPanel-content-noheader"), ["close", "maximize", "minimize", "normalize", "smallify"].forEach(function (a) {
b[0].setAttribute("data-btn" + a, "removed");
})) : "closeonly" === b.option.headerControls.controls ? (a(".jsPanel-btn:not(.jsPanel-btn-close)", b.header.headerbar).remove(), ["maximize", "minimize", "normalize", "smallify"].forEach(function (a) {
b[0].setAttribute("data-btn" + a, "removed");
}), b[0].setAttribute("data-btn-close", "enabled")) : "none" === b.option.headerControls.controls ? (a(b.header.controls).remove(), ["close", "maximize", "minimize", "normalize", "smallify"].forEach(function (a) {
b[0].setAttribute("data-btn" + a, "removed");
})) : ["close", "maximize", "minimize", "normalize", "smallify"].forEach(function (a) {
"disable" === b.option.headerControls[a] ? b.headerControl(a, "disable") : "remove" === b.option.headerControls[a] ? b.headerControl(a, "remove") : b[0].setAttribute("data-btn" + a, "enabled");
});(b.option.headerRemove || 1 > a(".jsPanel-hdr").length) && b.content.css("border", "none");jsPanel.configIconfont(b);"modal" === b.option.paneltype ? (jsPanel.insertModalBackdrop(b), b.addClass("jsPanel-modal").css("z-index", jsPanel.modalcount + 9999)) : "hint" === b.option.paneltype ? b.addClass("jsPanel-hint").css("z-index", 1E4) : b.option.paneltype.tooltip && (f = jsPanel.setTrigger(b.option.position), b.addClass("jsPanel-tooltip"), jsPanel.setTooltipClass(b), b.option.paneltype.solo && jsPanel.closeTooltips(), jsPanel.setTooltipMode(b, f));b.option.paneltype.tooltip && a(f).addClass("hasTooltip");b.option.headerToolbar && !b.option.headerRemove && jsPanel.toolbar(b, "header", b.option.headerToolbar);b.option.footerToolbar && jsPanel.toolbar(b, "footer", b.option.footerToolbar);
b.option.content && (b.content.append(b.option.content), b.data("content", b.option.content));"string" === typeof b.option.contentAjax ? (b.option.contentAjax = { url: b.option.contentAjax, autoload: !0 }, jsPanel.ajax(b)) : a.isPlainObject(b.option.contentAjax) && jsPanel.ajax(b);a.isPlainObject(b.option.contentIframe) && (b.option.contentIframe.src || b.option.contentIframe.srcdoc) && jsPanel.iframe(b);b.option.paneltype.connector && jsPanel.addConnector(b);"string" === typeof b.option.contentSize && (c = b.option.contentSize.trim().split(" "), e = c.length, b.option.contentSize = { width: c[0], height: c[--e] });0 === b.option.contentSize.height && (b.option.contentSize.height = "0");b.content.css({ width: b.option.contentSize.width || a.jsPanel.defaults.contentSize.width, height: b.option.contentSize.height || a.jsPanel.defaults.contentSize.height });b.css({ width: function width() {
return 0 < a(".jsPanel-content", b).length ? b.content.outerWidth() + "px" : b.option.contentSize.width || a.jsPanel.defaults.contentSize.width;
}, zIndex: function zIndex() {
jsPanel.setZi(b);
} });b.content.css("width", "100%");jsPanel.position(b, b.option.position);b.data("status", "normalized");a(document).trigger("jspanelstatuschange", d);if (!b.option.paneltype && b.option.dblclicks) {
if (b.option.dblclicks.title) b.header.headerbar.on("dblclick", function (a) {
a.preventDefault();jsPanel.dblclickhelper(b.option.dblclicks.title, b);
});if (b.option.dblclicks.content) b.content.on("dblclick", function (a) {
a.preventDefault();jsPanel.dblclickhelper(b.option.dblclicks.content, b);
});if (b.option.dblclicks.footer) b.footer.on("dblclick", function (a) {
a.preventDefault();jsPanel.dblclickhelper(b.option.dblclicks.footer, b);
});
}"string" === typeof b.option.contentOverflow ? b.content.css("overflow", b.option.contentOverflow) : a.isPlainObject(b.option.contentOverflow) && b.content.css({ "overflow-y": b.option.contentOverflow.vertical || b.option.contentOverflow["overflow-y"], "overflow-x": b.option.contentOverflow.horizontal || b.option.contentOverflow["overflow-x"] });a.isPlainObject(b.option.draggable) ? b.draggable(b.option.draggable) : "disabled" === b.option.draggable ? (a(".jsPanel-hdr, .jsPanel-ftr", b).css("cursor", "default"), b.draggable({ disabled: !0 })) : a(".jsPanel-hdr, .jsPanel-ftr", b).css("cursor", "default");a.isPlainObject(b.option.resizable) ? b.resizable(b.option.resizable) : "disabled" === b.option.resizable && (b.resizable({ disabled: !0 }), a(".ui-icon-gripsmall-diagonal-se, .ui-resizable-handle.ui-resizable-sw", b).css({ "background-image": "none", "text-indent": -9999 }), a(".ui-resizable-handle", b).css({ cursor: "inherit" }));b.on("resize", function () {
return b.contentResize();
});
!0 === b.option.rtl.rtl && (a(".jsPanel-hdr, .jsPanel-headerbar, .jsPanel-titlebar, .jsPanel-controlbar, .jsPanel-hdr-toolbar, .jsPanel-ftr", b).addClass("jsPanel-rtl"), [b.header.title, b.content, a("*", b.header.toolbar), a("*", b.footer)].forEach(function (a) {
a.prop("dir", "rtl");b.option.rtl.lang && a.prop("lang", b.option.rtl.lang);
}), a(".ui-icon-gripsmall-diagonal-se", b).css({ backgroundImage: "none", textIndent: -9999 }));"string" === typeof b.option.show && b.addClass(b.option.show).css("opacity", 1);b.header.title.empty().prepend(b.option.headerTitle);
b[0].addEventListener("mousedown", function (c) {
a(c.target).hasClass("jsglyph-close") || a(c.target).hasClass("jsglyph-minimize") || (c = a(c.target).closest(".jsPanel").css("z-index"), !b.hasClass("jsPanel-modal") && c <= jsPanel.zi && b.front());
}, !1);jsPanel.updateCachedData(b);"string" === typeof b.option.setstatus && ("maximize smallify" === b.option.setstatus ? b.maximize().smallify() : b[b.option.setstatus]());"number" === typeof b.option.autoclose && 0 < b.option.autoclose && window.setTimeout(function () {
b && b.close();
}, b.option.autoclose);
b.on("resizestart", function () {
m = b.outerHeight();
});b.on("resizestop", function () {
b.outerHeight() !== m && (jsPanel.hideControls(".jsPanel-btn-normalize, .jsPanel-btn-smallifyrev", b), b.data("status", "normalized"), a(document).trigger("jspanelnormalized", d), a(document).trigger("jspanelstatuschange", d), a.isFunction(b.option.onnormalized) && b.option.onnormalized.call(b, b));
});b[0].jspanel = { options: b.option, close: function close(a) {
b.close(a);
}, normalize: function normalize(a) {
b.normalize(a);return b;
}, maximize: function maximize(a) {
b.maximize(a);
return b;
}, minimize: function minimize(a) {
b.minimize(a);return b;
}, smallify: function smallify(a) {
b.smallify(a);return b;
}, front: function front(a) {
b.front(a);return b;
}, closeChildpanels: function closeChildpanels() {
b.closeChildpanels();return b;
}, reposition: function reposition(a, c) {
b.reposition(a, c);return b;
}, resize: function resize(a, c, d) {
b.resize(a, c, d);return b;
}, contentResize: function contentResize() {
b.contentResize();return b;
}, contentReload: function contentReload() {
b.contentReload();return b;
}, headerTitle: function headerTitle(a) {
b.headerTitle(a);return b;
}, headerControl: function headerControl(a, c) {
b.headerControl(a, c);return b;
}, toolbarAdd: function toolbarAdd(a, c, d) {
b.toolbarAdd(a, c, d);return b;
}, setTheme: function setTheme(a, c) {
b.setTheme(a, callback);return b;
}, noop: function noop() {
return b;
} };b.option.callback && a.isFunction(b.option.callback) ? b.option.callback.call(b, b) : a.isArray(b.option.callback) && b.option.callback.forEach(function (c) {
a.isFunction(c) && c.call(b, b);
});return b;
};a.jsPanel.defaults = { autoclose: !1, border: !1, callback: !1, container: "body", content: !1, contentAjax: !1, contentIframe: !1, contentOverflow: "hidden", contentSize: { width: 400,
height: 200 }, custom: !1, dblclicks: !1, draggable: { handle: "div.jsPanel-hdr, div.jsPanel-ftr", opacity: .8 }, footerToolbar: !1, headerControls: { close: !1, maximize: !1, minimize: !1, normalize: !1, smallify: !1, controls: "all", iconfont: "jsglyph" }, headerRemove: !1, headerTitle: "jsPanel", headerToolbar: !1, id: function id() {
return "jsPanel-" + (jsPanel.id += 1);
}, load: !1, maximizedMargin: { top: 5, right: 5, bottom: 5, left: 5 }, onbeforeclose: !1, onbeforemaximize: !1, onbeforeminimize: !1, onbeforenormalize: !1, onbeforesmallify: !1, onbeforeunsmallify: !1,
onclosed: !1, onmaximized: !1, onminimized: !1, onnormalized: !1, onbeforeresize: !1, onresized: !1, onsmallified: !1, onunsmallified: !1, onfronted: !1, paneltype: !1, position: { my: "center", at: "center" }, resizable: { handles: "n, e, s, w, ne, se, sw, nw", autoHide: !1, minWidth: 40, minHeight: 40 }, rtl: !1, setstatus: !1, show: !1, template: !1, theme: "default" };a.jsPanel.modaldefaults = { draggable: "disabled", headerControls: { controls: "closeonly" }, position: { my: "center", at: "center" }, resizable: "disabled" };a.jsPanel.tooltipdefaults = { draggable: !1,
headerControls: { controls: "closeonly" }, position: { fixed: !1 }, resizable: !1 };a.jsPanel.hintdefaults = { autoclose: 8E3, draggable: !1, headerControls: { controls: "closeonly" }, resizable: !1 };a(document).ready(function () {
document.body.addEventListener("click", function (c) {
1 > a(c.target).closest(".jsPanel").length && !a(c.target).hasClass("hasTooltip") && (jsPanel.closeTooltips(), a(".hasTooltip").removeClass("hasTooltip"));
}, !1);a(document.body).append("
");window.addEventListener("keydown", function (a) {
a = a.key || a.code;("Escape" === a || "Esc" === a) && jsPanel.closeOnEscape && jsPanel.activePanels.getPanel(jsPanel.getTopmostPanel()).close();
}, !1);
});
})(jQuery);
//# sourceMappingURL=jquery.jspanel.min-compiled.js.map