Files
pkrstarsbot/libs/phantombot/web/panel/vendors/adminlte/js/adminlte.min.js
2021-02-16 23:07:41 +01:00

2 lines
13 KiB
JavaScript

if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");!function(i){"use strict";var s="lte.boxrefresh",r={source:"",params:{},trigger:".refresh-btn",content:".box-body",loadInContent:!0,responseType:"",overlayTemplate:'<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>',onLoadStart:function(){},onLoadDone:function(t){return t}},t={data:'[data-widget="box-refresh"]'},a=function(t,e){if(this.element=t,this.options=e,this.$overlay=i(e.overlay),""===e.source)throw new Error("Source url was not defined. Please specify a url in your BoxRefresh source option.");this._setUpListeners(),this.load()};function e(n){return this.each(function(){var t=i(this),e=t.data(s);if(!e){var o=i.extend({},r,t.data(),"object"==typeof n&&n);t.data(s,e=new a(t,o))}if("string"==typeof e){if(void 0===e[n])throw new Error("No method named "+n);e[n]()}})}a.prototype.load=function(){this._addOverlay(),this.options.onLoadStart.call(i(this)),i.get(this.options.source,this.options.params,function(t){this.options.loadInContent&&i(this.options.content).html(t),this.options.onLoadDone.call(i(this),t),this._removeOverlay()}.bind(this),""!==this.options.responseType&&this.options.responseType)},a.prototype._setUpListeners=function(){i(this.element).on("click",t.trigger,function(t){t&&t.preventDefault(),this.load()}.bind(this))},a.prototype._addOverlay=function(){i(this.element).append(this.$overlay)},a.prototype._removeOverlay=function(){i(this.element).remove(this.$overlay)};var o=i.fn.boxRefresh;i.fn.boxRefresh=e,i.fn.boxRefresh.Constructor=a,i.fn.boxRefresh.noConflict=function(){return i.fn.boxRefresh=o,this},i(window).on("load",function(){i(t.data).each(function(){e.call(i(this))})})}(jQuery),function(i){"use strict";var s="lte.boxwidget",r={animationSpeed:500,collapseTrigger:'[data-widget="collapse"]',removeTrigger:'[data-widget="remove"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",removeIcon:"fa-times"},t=".box",e=".collapsed-box",n=".box-body",a=".box-footer",d=".box-tools",c="collapsed-box",l="collapsed.boxwidget",h="expanded.boxwidget",o="removed.boxwidget",p=function(t,e){this.element=t,this.options=e,this._setUpListeners()};function f(n){return this.each(function(){var t=i(this),e=t.data(s);if(!e){var o=i.extend({},r,t.data(),"object"==typeof n&&n);t.data(s,e=new p(t,o))}if("string"==typeof n){if(void 0===e[n])throw new Error("No method named "+n);e[n]()}})}p.prototype.toggle=function(){!i(this.element).is(e)?this.collapse():this.expand()},p.prototype.expand=function(){var t=i.Event(h),e=this.options.collapseIcon,o=this.options.expandIcon;i(this.element).removeClass(c),i(this.element).find(d).find("."+o).removeClass(o).addClass(e),i(this.element).find(n+", "+a).slideDown(this.options.animationSpeed,function(){i(this.element).trigger(t)}.bind(this))},p.prototype.collapse=function(){var t=i.Event(l),e=this.options.collapseIcon,o=this.options.expandIcon;i(this.element).find(d).find("."+e).removeClass(e).addClass(o),i(this.element).find(n+", "+a).slideUp(this.options.animationSpeed,function(){i(this.element).addClass(c),i(this.element).trigger(t)}.bind(this))},p.prototype.remove=function(){var t=i.Event(o);i(this.element).slideUp(this.options.animationSpeed,function(){i(this.element).trigger(t),i(this.element).remove()}.bind(this))},p.prototype._setUpListeners=function(){var e=this;i(this.element).on("click",this.options.collapseTrigger,function(t){t&&t.preventDefault(),e.toggle()}),i(this.element).on("click",this.options.removeTrigger,function(t){t&&t.preventDefault(),e.remove()})};var u=i.fn.boxWidget;i.fn.boxWidget=f,i.fn.boxWidget.Constructor=p,i.fn.boxWidget.noConflict=function(){return i.fn.boxWidget=u,this},i(window).on("load",function(){i(t).each(function(){f.call(i(this))})})}(jQuery),function(i){"use strict";var s="lte.controlsidebar",r={slide:!0},e=".control-sidebar",t='[data-toggle="control-sidebar"]',o=".control-sidebar-open",n=".control-sidebar-bg",a=".wrapper",d=".layout-boxed",c="control-sidebar-open",l="collapsed.controlsidebar",h="expanded.controlsidebar",p=function(t,e){this.element=t,this.options=e,this.hasBindedResize=!1,this.init()};function f(n){return this.each(function(){var t=i(this),e=t.data(s);if(!e){var o=i.extend({},r,t.data(),"object"==typeof n&&n);t.data(s,e=new p(t,o))}"string"==typeof n&&e.toggle()})}p.prototype.init=function(){i(this.element).is(t)||i(this).on("click",this.toggle),this.fix(),i(window).resize(function(){this.fix()}.bind(this))},p.prototype.toggle=function(t){t&&t.preventDefault(),this.fix(),i(e).is(o)||i("body").is(o)?this.collapse():this.expand()},p.prototype.expand=function(){this.options.slide?i(e).addClass(c):i("body").addClass(c),i(this.element).trigger(i.Event(h))},p.prototype.collapse=function(){i("body, "+e).removeClass(c),i(this.element).trigger(i.Event(l))},p.prototype.fix=function(){i("body").is(d)&&this._fixForBoxed(i(n))},p.prototype._fixForBoxed=function(t){t.css({position:"absolute",height:i(a).height()})};var u=i.fn.controlSidebar;i.fn.controlSidebar=f,i.fn.controlSidebar.Constructor=p,i.fn.controlSidebar.noConflict=function(){return i.fn.controlSidebar=u,this},i(document).on("click",t,function(t){t&&t.preventDefault(),f.call(i(this),"toggle")}),i(".content-wrapper, .main-sidebar").on("click",function(){p.prototype.collapse()})}(jQuery),function(n){"use strict";var i="lte.directchat",t='[data-widget="chat-pane-toggle"]',e=".direct-chat",o="direct-chat-contacts-open",s=function(t){this.element=t};function r(o){return this.each(function(){var t=n(this),e=t.data(i);e||t.data(i,e=new s(t)),"string"==typeof o&&e.toggle(t)})}s.prototype.toggle=function(t){t.parents(e).first().toggleClass(o)};var a=n.fn.directChat;n.fn.directChat=r,n.fn.directChat.Constructor=s,n.fn.directChat.noConflict=function(){return n.fn.directChat=a,this},n(document).on("click",t,function(t){t&&t.preventDefault(),r.call(n(this),"toggle")})}(jQuery),function(s){"use strict";var i="lte.layout",r={slimscroll:!0,resetHeight:!0},a=".wrapper",d=".content-wrapper",c=".layout-boxed",l=".main-footer",h=".main-header",p=".sidebar",f=".control-sidebar",t=".sidebar-menu",e=".main-header .logo",u="fixed",o="hold-transition",g=function(t){this.options=t,this.bindedResize=!1,this.activate()};function n(n){return this.each(function(){var t=s(this),e=t.data(i);if(!e){var o=s.extend({},r,t.data(),"object"==typeof n&&n);t.data(i,e=new g(o))}if("string"==typeof n){if(void 0===e[n])throw new Error("No method named "+n);e[n]()}})}g.prototype.activate=function(){this.fix(),this.fixSidebar(),s("body").removeClass(o),this.options.resetHeight&&s("body, html, "+a).css({height:"auto","min-height":"100%"}),this.bindedResize||(s(window).resize(function(){this.fix(),this.fixSidebar(),s(e+", "+p).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){this.fix(),this.fixSidebar()}.bind(this))}.bind(this)),this.bindedResize=!0),s(t).on("expanded.tree",function(){this.fix(),this.fixSidebar()}.bind(this)),s(t).on("collapsed.tree",function(){this.fix(),this.fixSidebar()}.bind(this))},g.prototype.fix=function(){s(c+" > "+a).css("overflow","hidden");var t=s(l).outerHeight()||0,e=(s(h).outerHeight(),s(window).height()-50),o=s(p).height()||0;if(s("body").hasClass(u))s(d).css("min-height",e-t);else{var n;o<=e?(s(d).css("min-height",e),n=e):(s(d).css("min-height",o),n=o);var i=s(f);void 0!==i&&i.height()>n&&s(d).css("min-height",i.height())}},g.prototype.fixSidebar=function(){s("body").hasClass(u)?this.options.slimscroll&&void 0!==s.fn.slimScroll&&s(p).slimScroll({height:s(window).height()-s(h).height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"}):void 0!==s.fn.slimScroll&&s(p).slimScroll({destroy:!0}).height("auto")};var v=s.fn.layout;s.fn.layout=n,s.fn.layout.Constuctor=g,s.fn.layout.noConflict=function(){return s.fn.layout=v,this},s(window).on("load",function(){n.call(s("body"))})}(jQuery),function(i){"use strict";var s="lte.pushmenu",r={collapseScreenSize:767,expandOnHover:!1,expandTransitionDelay:200},t=".sidebar-collapse",e=".main-sidebar",o=".content-wrapper",n=".sidebar-form .form-control",a='[data-toggle="push-menu"]',d=".sidebar-mini",c=".sidebar-expanded-on-hover",l=".fixed",h="sidebar-collapse",p="sidebar-open",f="sidebar-expanded-on-hover",u="sidebar-mini-expand-feature",g="expanded.pushMenu",v="collapsed.pushMenu",b=function(t){this.options=t,this.init()};function m(n){return this.each(function(){var t=i(this),e=t.data(s);if(!e){var o=i.extend({},r,t.data(),"object"==typeof n&&n);t.data(s,e=new b(o))}"toggle"===n&&e.toggle()})}b.prototype.init=function(){(this.options.expandOnHover||i("body").is(d+l))&&(this.expandOnHover(),i("body").addClass(u)),i(o).click(function(){i(window).width()<=this.options.collapseScreenSize&&i("body").hasClass(p)&&this.close()}.bind(this)),"closed"===localStorage.getItem("phantombot_panel_sidebar")&&this.close(),i(n).click(function(t){t.stopPropagation()})},b.prototype.toggle=function(){var t=i(window).width(),e=!i("body").hasClass(h);t<=this.options.collapseScreenSize&&(e=i("body").hasClass(p)),e?(this.close(),localStorage.setItem("phantombot_panel_sidebar","closed")):(this.open(),localStorage.setItem("phantombot_panel_sidebar","opened"))},b.prototype.open=function(){i(window).width()>this.options.collapseScreenSize?i("body").removeClass(h).trigger(i.Event(g)):i("body").addClass(p).trigger(i.Event(g))},b.prototype.close=function(){i(window).width()>this.options.collapseScreenSize?i("body").addClass(h).trigger(i.Event(v)):i("body").removeClass(p+" "+h).trigger(i.Event(v))},b.prototype.expandOnHover=function(){i(e).hover(function(){i("body").is(d+t)&&i(window).width()>this.options.collapseScreenSize&&this.expand()}.bind(this),function(){i("body").is(c)&&this.collapse()}.bind(this))},b.prototype.expand=function(){setTimeout(function(){i("body").removeClass(h).addClass(f)},this.options.expandTransitionDelay)},b.prototype.collapse=function(){setTimeout(function(){i("body").removeClass(f).addClass(h)},this.options.expandTransitionDelay)};var y=i.fn.pushMenu;i.fn.pushMenu=m,i.fn.pushMenu.Constructor=b,i.fn.pushMenu.noConflict=function(){return i.fn.pushMenu=y,this},i(document).on("click",a,function(t){t.preventDefault(),m.call(i(this),"toggle")}),i(window).on("load",function(){m.call(i(a))})}(jQuery),function(i){"use strict";var s="lte.todolist",r={onCheck:function(t){return t},onUnCheck:function(t){return t}},e={data:'[data-widget="todo-list"]'},o="done",a=function(t,e){this.element=t,this.options=e,this._setUpListeners()};function t(n){return this.each(function(){var t=i(this),e=t.data(s);if(!e){var o=i.extend({},r,t.data(),"object"==typeof n&&n);t.data(s,e=new a(t,o))}if("string"==typeof e){if(void 0===e[n])throw new Error("No method named "+n);e[n]()}})}a.prototype.toggle=function(t){t.parents(e.li).first().toggleClass(o),t.prop("checked")?this.check(t):this.unCheck(t)},a.prototype.check=function(t){this.options.onCheck.call(t)},a.prototype.unCheck=function(t){this.options.onUnCheck.call(t)},a.prototype._setUpListeners=function(){var t=this;i(this.element).on("change ifChanged","input:checkbox",function(){t.toggle(i(this))})};var n=i.fn.todoList;i.fn.todoList=t,i.fn.todoList.Constructor=a,i.fn.todoList.noConflict=function(){return i.fn.todoList=n,this},i(window).on("load",function(){i(e.data).each(function(){t.call(i(this))})})}(jQuery),function(s){"use strict";var n="lte.tree",i={animationSpeed:250,accordion:!0,followLink:!1,trigger:".treeview a"},r=".treeview",a=".treeview-menu",d=".menu-open, .active",t='[data-widget="tree"]',o=".active",c="menu-open",l="tree",h="collapsed.tree",p="expanded.tree",f=function(t,e){this.element=t,this.options=e,s(this.element).addClass(l),s(r+o,this.element).addClass(c),this._setUpListeners()};function e(o){return this.each(function(){var t=s(this);if(!t.data(n)){var e=s.extend({},i,t.data(),"object"==typeof o&&o);t.data(n,new f(t,e))}})}f.prototype.toggle=function(t,e){var o=t.next(a),n=t.parent(),i=n.hasClass(c);n.is(r)&&(this.options.followLink&&"#"!==t.attr("href")||e.preventDefault(),i?this.collapse(o,n):this.expand(o,n))},f.prototype.expand=function(t,e){var o=s.Event(p);if(this.options.accordion){var n=e.siblings(d),i=n.children(a);this.collapse(i,n)}e.addClass(c),t.slideDown(this.options.animationSpeed,function(){s(this.element).trigger(o)}.bind(this))},f.prototype.collapse=function(t,e){var o=s.Event(h);t.find(d).removeClass(c),e.removeClass(c),t.slideUp(this.options.animationSpeed,function(){t.find(d+" > "+r).slideUp(),s(this.element).trigger(o),t.find(a).slideUp()}.bind(this))},f.prototype._setUpListeners=function(){var e=this;s(this.element).on("click",this.options.trigger,function(t){e.toggle(s(this),t)})};var u=s.fn.tree;s.fn.tree=e,s.fn.tree.Constructor=f,s.fn.tree.noConflict=function(){return s.fn.tree=u,this},s(window).on("load",function(){s(t).each(function(){e.call(s(this))})})}(jQuery),function(e){e.fn.dinamicMenu=function(t){e("ul.sidebar-menu a").filter(function(){return this.href!==t}).parent().removeClass("active"),e("ul.sidebar-menu a").filter(function(){return this.href===t}).parent().addClass("active"),e("ul.treeview-menu a").filter(function(){return this.href===t}).parentsUntil(".sidebar-menu > .treeview-menu > li").addClass("active")},e("body").tooltip({selector:'[data-toggle="tooltip"]',container:"body",trigger:"hover",delay:{show:400,hide:30}}),toastr.options.progressBar=!0,toastr.options.preventDuplicates=!1,toastr.options.closeButton=!0,toastr.options.newestOnTop=!0}(jQuery);