snipe-it/public/assets/js/all.js.map
2016-03-25 01:18:05 -07:00

1 line
28 KiB
Plaintext

{"version":3,"sources":["snipeit.js","app.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/**\n * Module containing core application logic.\n * @param {jQuery} $ Insulated jQuery object\n * @param {JSON} settings Insulated `window.snipeit.settings` object.\n * @return {IIFE} Immediately invoked. Returns self.\n */\n(function($, settings) {\n var Components = {};\n Components.modals = {};\n\n // confirm delete modal\n Components.modals.confirmDelete = function() {\n var $el = $('table');\n\n var events = {\n 'click': function(evnt) {\n var $context = $(this);\n var $dataConfirmModal = $('#dataConfirmModal');\n var href = $context.attr('href');\n var message = $context.attr('data-content');\n var title = $context.attr('data-title');\n\n $('#myModalLabel').text(title);\n $dataConfirmModal.find('.modal-body').text(message);\n $('#dataConfirmOK').attr('href', href);\n $dataConfirmModal.modal({\n show: true\n });\n return false;\n }\n };\n\n var render = function() {\n $el.on('click', '.delete-asset', events['click']);\n };\n\n return {\n render: render\n };\n };\n\n\n /**\n * Application start point\n * Component definition stays out of load event, execution only happens.\n */\n $(function() {\n new Components.modals.confirmDelete().render();\n });\n}(jQuery, window.snipeit.settings));\n","/*! AdminLTE app.js\n * ================\n * Main JS application file for AdminLTE v2. This file\n * should be included in all pages. It controls some layout\n * options and implements exclusive AdminLTE plugins.\n *\n * @Author Almsaeed Studio\n * @Support <http://www.almsaeedstudio.com>\n * @Email <[email protected]>\n * @version 2.3.0\n * @license MIT <http://opensource.org/licenses/MIT>\n */\n\n//Make sure jQuery has been loaded before app.js\nif (typeof jQuery === \"undefined\") {\n throw new Error(\"AdminLTE requires jQuery\");\n}\n\n/* AdminLTE\n *\n * @type Object\n * @description $.AdminLTE is the main object for the template's app.\n * It's used for implementing functions and options related\n * to the template. Keeping everything wrapped in an object\n * prevents conflict with other plugins and is a better\n * way to organize our code.\n */\n$.AdminLTE = {};\n\n/* --------------------\n * - AdminLTE Options -\n * --------------------\n * Modify these options to suit your implementation\n */\n$.AdminLTE.options = {\n //Add slimscroll to navbar menus\n //This requires you to load the slimscroll plugin\n //in every page before app.js\n navbarMenuSlimscroll: true,\n navbarMenuSlimscrollWidth: \"3px\", //The width of the scroll bar\n navbarMenuHeight: \"200px\", //The height of the inner menu\n //General animation speed for JS animated elements such as box collapse/expand and\n //sidebar treeview slide up/down. This options accepts an integer as milliseconds,\n //'fast', 'normal', or 'slow'\n animationSpeed: 500,\n //Sidebar push menu toggle button selector\n sidebarToggleSelector: \"[data-toggle='offcanvas']\",\n //Activate sidebar push menu\n sidebarPushMenu: true,\n //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin)\n sidebarSlimScroll: true,\n //Enable sidebar expand on hover effect for sidebar mini\n //This option is forced to true if both the fixed layout and sidebar mini\n //are used together\n sidebarExpandOnHover: false,\n //BoxRefresh Plugin\n enableBoxRefresh: true,\n //Bootstrap.js tooltip\n enableBSToppltip: true,\n BSTooltipSelector: \"[data-toggle='tooltip']\",\n //Enable Fast Click. Fastclick.js creates a more\n //native touch experience with touch devices. If you\n //choose to enable the plugin, make sure you load the script\n //before AdminLTE's app.js\n enableFastclick: true,\n //Control Sidebar Options\n enableControlSidebar: true,\n controlSidebarOptions: {\n //Which button should trigger the open/close event\n toggleBtnSelector: \"[data-toggle='control-sidebar']\",\n //The sidebar selector\n selector: \".control-sidebar\",\n //Enable slide over content\n slide: true\n },\n //Box Widget Plugin. Enable this plugin\n //to allow boxes to be collapsed and/or removed\n enableBoxWidget: true,\n //Box Widget plugin options\n boxWidgetOptions: {\n boxWidgetIcons: {\n //Collapse icon\n collapse: 'fa-minus',\n //Open icon\n open: 'fa-plus',\n //Remove icon\n remove: 'fa-times'\n },\n boxWidgetSelectors: {\n //Remove button selector\n remove: '[data-widget=\"remove\"]',\n //Collapse button selector\n collapse: '[data-widget=\"collapse\"]'\n }\n },\n //Direct Chat plugin options\n directChat: {\n //Enable direct chat by default\n enable: true,\n //The button to open and close the chat contacts pane\n contactToggleSelector: '[data-widget=\"chat-pane-toggle\"]'\n },\n //Define the set of colors to use globally around the website\n colors: {\n lightBlue: \"#3c8dbc\",\n red: \"#f56954\",\n green: \"#00a65a\",\n aqua: \"#00c0ef\",\n yellow: \"#f39c12\",\n blue: \"#0073b7\",\n navy: \"#001F3F\",\n teal: \"#39CCCC\",\n olive: \"#3D9970\",\n lime: \"#01FF70\",\n orange: \"#FF851B\",\n fuchsia: \"#F012BE\",\n purple: \"#8E24AA\",\n maroon: \"#D81B60\",\n black: \"#222222\",\n gray: \"#d2d6de\"\n },\n //The standard screen sizes that bootstrap uses.\n //If you change these in the variables.less file, change\n //them here too.\n screenSizes: {\n xs: 480,\n sm: 768,\n md: 992,\n lg: 1200\n }\n};\n\n/* ------------------\n * - Implementation -\n * ------------------\n * The next block of code implements AdminLTE's\n * functions and plugins as specified by the\n * options above.\n */\n$(function () {\n \"use strict\";\n\n //Fix for IE page transitions\n $(\"body\").removeClass(\"hold-transition\");\n\n //Extend options if external options exist\n if (typeof AdminLTEOptions !== \"undefined\") {\n $.extend(true,\n $.AdminLTE.options,\n AdminLTEOptions);\n }\n\n //Easy access to options\n var o = $.AdminLTE.options;\n\n //Set up the object\n _init();\n\n //Activate the layout maker\n $.AdminLTE.layout.activate();\n\n //Enable sidebar tree view controls\n $.AdminLTE.tree('.sidebar');\n\n //Enable control sidebar\n if (o.enableControlSidebar) {\n $.AdminLTE.controlSidebar.activate();\n }\n\n //Add slimscroll to navbar dropdown\n if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') {\n $(\".navbar .menu\").slimscroll({\n height: o.navbarMenuHeight,\n alwaysVisible: false,\n size: o.navbarMenuSlimscrollWidth\n }).css(\"width\", \"100%\");\n }\n\n //Activate sidebar push menu\n if (o.sidebarPushMenu) {\n $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector);\n }\n\n //Activate Bootstrap tooltip\n if (o.enableBSToppltip) {\n $('body').tooltip({\n selector: o.BSTooltipSelector\n });\n }\n\n //Activate box widget\n if (o.enableBoxWidget) {\n $.AdminLTE.boxWidget.activate();\n }\n\n //Activate fast click\n if (o.enableFastclick && typeof FastClick != 'undefined') {\n FastClick.attach(document.body);\n }\n\n //Activate direct chat widget\n if (o.directChat.enable) {\n $(document).on('click', o.directChat.contactToggleSelector, function () {\n var box = $(this).parents('.direct-chat').first();\n box.toggleClass('direct-chat-contacts-open');\n });\n }\n\n /*\n * INITIALIZE BUTTON TOGGLE\n * ------------------------\n */\n $('.btn-group[data-toggle=\"btn-toggle\"]').each(function () {\n var group = $(this);\n $(this).find(\".btn\").on('click', function (e) {\n group.find(\".btn.active\").removeClass(\"active\");\n $(this).addClass(\"active\");\n e.preventDefault();\n });\n\n });\n});\n\n/* ----------------------------------\n * - Initialize the AdminLTE Object -\n * ----------------------------------\n * All AdminLTE functions are implemented below.\n */\nfunction _init() {\n 'use strict';\n /* Layout\n * ======\n * Fixes the layout height in case min-height fails.\n *\n * @type Object\n * @usage $.AdminLTE.layout.activate()\n * $.AdminLTE.layout.fix()\n * $.AdminLTE.layout.fixSidebar()\n */\n $.AdminLTE.layout = {\n activate: function () {\n var _this = this;\n _this.fix();\n _this.fixSidebar();\n $(window, \".wrapper\").resize(function () {\n _this.fix();\n _this.fixSidebar();\n });\n },\n fix: function () {\n //Get window height and the wrapper height\n var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight();\n var window_height = $(window).height();\n var sidebar_height = $(\".sidebar\").height();\n //Set the min-height of the content and sidebar based on the\n //the height of the document.\n if ($(\"body\").hasClass(\"fixed\")) {\n $(\".content-wrapper, .right-side\").css('min-height', window_height - $('.main-footer').outerHeight());\n } else {\n var postSetWidth;\n if (window_height >= sidebar_height) {\n $(\".content-wrapper, .right-side\").css('min-height', window_height - neg);\n postSetWidth = window_height - neg;\n } else {\n $(\".content-wrapper, .right-side\").css('min-height', sidebar_height);\n postSetWidth = sidebar_height;\n }\n\n //Fix for the control sidebar height\n var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);\n if (typeof controlSidebar !== \"undefined\") {\n if (controlSidebar.height() > postSetWidth)\n $(\".content-wrapper, .right-side\").css('min-height', controlSidebar.height());\n }\n\n }\n },\n fixSidebar: function () {\n //Make sure the body tag has the .fixed class\n if (!$(\"body\").hasClass(\"fixed\")) {\n if (typeof $.fn.slimScroll != 'undefined') {\n $(\".sidebar\").slimScroll({destroy: true}).height(\"auto\");\n }\n return;\n } else if (typeof $.fn.slimScroll == 'undefined' && window.console) {\n window.console.error(\"Error: the fixed layout requires the slimscroll plugin!\");\n }\n //Enable slimscroll for fixed layout\n if ($.AdminLTE.options.sidebarSlimScroll) {\n if (typeof $.fn.slimScroll != 'undefined') {\n //Destroy if it exists\n $(\".sidebar\").slimScroll({destroy: true}).height(\"auto\");\n //Add slimscroll\n $(\".sidebar\").slimscroll({\n height: ($(window).height() - $(\".main-header\").height()) + \"px\",\n color: \"rgba(0,0,0,0.2)\",\n size: \"3px\"\n });\n }\n }\n }\n };\n\n /* PushMenu()\n * ==========\n * Adds the push menu functionality to the sidebar.\n *\n * @type Function\n * @usage: $.AdminLTE.pushMenu(\"[data-toggle='offcanvas']\")\n */\n $.AdminLTE.pushMenu = {\n activate: function (toggleBtn) {\n //Get the screen sizes\n var screenSizes = $.AdminLTE.options.screenSizes;\n\n //Enable sidebar toggle\n $(toggleBtn).on('click', function (e) {\n e.preventDefault();\n\n //Enable sidebar push menu\n if ($(window).width() > (screenSizes.sm - 1)) {\n if ($(\"body\").hasClass('sidebar-collapse')) {\n $(\"body\").removeClass('sidebar-collapse').trigger('expanded.pushMenu');\n } else {\n $(\"body\").addClass('sidebar-collapse').trigger('collapsed.pushMenu');\n }\n }\n //Handle sidebar push menu for small screens\n else {\n if ($(\"body\").hasClass('sidebar-open')) {\n $(\"body\").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu');\n } else {\n $(\"body\").addClass('sidebar-open').trigger('expanded.pushMenu');\n }\n }\n });\n\n $(\".content-wrapper\").click(function () {\n //Enable hide menu when clicking on the content-wrapper on small screens\n if ($(window).width() <= (screenSizes.sm - 1) && $(\"body\").hasClass(\"sidebar-open\")) {\n $(\"body\").removeClass('sidebar-open');\n }\n });\n\n //Enable expand on hover for sidebar mini\n if ($.AdminLTE.options.sidebarExpandOnHover\n || ($('body').hasClass('fixed')\n && $('body').hasClass('sidebar-mini'))) {\n this.expandOnHover();\n }\n },\n expandOnHover: function () {\n var _this = this;\n var screenWidth = $.AdminLTE.options.screenSizes.sm - 1;\n //Expand sidebar on hover\n $('.main-sidebar').hover(function () {\n if ($('body').hasClass('sidebar-mini')\n && $(\"body\").hasClass('sidebar-collapse')\n && $(window).width() > screenWidth) {\n _this.expand();\n }\n }, function () {\n if ($('body').hasClass('sidebar-mini')\n && $('body').hasClass('sidebar-expanded-on-hover')\n && $(window).width() > screenWidth) {\n _this.collapse();\n }\n });\n },\n expand: function () {\n $(\"body\").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover');\n },\n collapse: function () {\n if ($('body').hasClass('sidebar-expanded-on-hover')) {\n $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse');\n }\n }\n };\n\n /* Tree()\n * ======\n * Converts the sidebar into a multilevel\n * tree view menu.\n *\n * @type Function\n * @Usage: $.AdminLTE.tree('.sidebar')\n */\n $.AdminLTE.tree = function (menu) {\n var _this = this;\n var animationSpeed = $.AdminLTE.options.animationSpeed;\n $(document).on('click', menu + ' li a', function (e) {\n //Get the clicked link and the next element\n var $this = $(this);\n var checkElement = $this.next();\n\n //Check if the next element is a menu and is visible\n if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible'))) {\n //Close the menu\n checkElement.slideUp(animationSpeed, function () {\n checkElement.removeClass('menu-open');\n //Fix the layout in case the sidebar stretches over the height of the window\n //_this.layout.fix();\n });\n checkElement.parent(\"li\").removeClass(\"active\");\n }\n //If the menu is not visible\n else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) {\n //Get the parent menu\n var parent = $this.parents('ul').first();\n //Close all open menus within the parent\n var ul = parent.find('ul:visible').slideUp(animationSpeed);\n //Remove the menu-open class from the parent\n ul.removeClass('menu-open');\n //Get the parent li\n var parent_li = $this.parent(\"li\");\n\n //Open the target menu and add the menu-open class\n checkElement.slideDown(animationSpeed, function () {\n //Add the class active to the parent li\n checkElement.addClass('menu-open');\n parent.find('li.active').removeClass('active');\n parent_li.addClass('active');\n //Fix the layout in case the sidebar stretches over the height of the window\n _this.layout.fix();\n });\n }\n //if this isn't a link, prevent the page from being redirected\n if (checkElement.is('.treeview-menu')) {\n e.preventDefault();\n }\n });\n };\n\n /* ControlSidebar\n * ==============\n * Adds functionality to the right sidebar\n *\n * @type Object\n * @usage $.AdminLTE.controlSidebar.activate(options)\n */\n $.AdminLTE.controlSidebar = {\n //instantiate the object\n activate: function () {\n //Get the object\n var _this = this;\n //Update options\n var o = $.AdminLTE.options.controlSidebarOptions;\n //Get the sidebar\n var sidebar = $(o.selector);\n //The toggle button\n var btn = $(o.toggleBtnSelector);\n\n //Listen to the click event\n btn.on('click', function (e) {\n e.preventDefault();\n //If the sidebar is not open\n if (!sidebar.hasClass('control-sidebar-open')\n && !$('body').hasClass('control-sidebar-open')) {\n //Open the sidebar\n _this.open(sidebar, o.slide);\n } else {\n _this.close(sidebar, o.slide);\n }\n });\n\n //If the body has a boxed layout, fix the sidebar bg position\n var bg = $(\".control-sidebar-bg\");\n _this._fix(bg);\n\n //If the body has a fixed layout, make the control sidebar fixed\n if ($('body').hasClass('fixed')) {\n _this._fixForFixed(sidebar);\n } else {\n //If the content height is less than the sidebar's height, force max height\n if ($('.content-wrapper, .right-side').height() < sidebar.height()) {\n _this._fixForContent(sidebar);\n }\n }\n },\n //Open the control sidebar\n open: function (sidebar, slide) {\n //Slide over content\n if (slide) {\n sidebar.addClass('control-sidebar-open');\n } else {\n //Push the content by adding the open class to the body instead\n //of the sidebar itself\n $('body').addClass('control-sidebar-open');\n }\n },\n //Close the control sidebar\n close: function (sidebar, slide) {\n if (slide) {\n sidebar.removeClass('control-sidebar-open');\n } else {\n $('body').removeClass('control-sidebar-open');\n }\n },\n _fix: function (sidebar) {\n var _this = this;\n if ($(\"body\").hasClass('layout-boxed')) {\n sidebar.css('position', 'absolute');\n sidebar.height($(\".wrapper\").height());\n $(window).resize(function () {\n _this._fix(sidebar);\n });\n } else {\n sidebar.css({\n 'position': 'fixed',\n 'height': 'auto'\n });\n }\n },\n _fixForFixed: function (sidebar) {\n sidebar.css({\n 'position': 'fixed',\n 'max-height': '100%',\n 'overflow': 'auto',\n 'padding-bottom': '50px'\n });\n },\n _fixForContent: function (sidebar) {\n $(\".content-wrapper, .right-side\").css('min-height', sidebar.height());\n }\n };\n\n /* BoxWidget\n * =========\n * BoxWidget is a plugin to handle collapsing and\n * removing boxes from the screen.\n *\n * @type Object\n * @usage $.AdminLTE.boxWidget.activate()\n * Set all your options in the main $.AdminLTE.options object\n */\n $.AdminLTE.boxWidget = {\n selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,\n icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,\n animationSpeed: $.AdminLTE.options.animationSpeed,\n activate: function (_box) {\n var _this = this;\n if (!_box) {\n _box = document; // activate all boxes per default\n }\n //Listen for collapse event triggers\n $(_box).on('click', _this.selectors.collapse, function (e) {\n e.preventDefault();\n _this.collapse($(this));\n });\n\n //Listen for remove event triggers\n $(_box).on('click', _this.selectors.remove, function (e) {\n e.preventDefault();\n _this.remove($(this));\n });\n },\n collapse: function (element) {\n var _this = this;\n //Find the box parent\n var box = element.parents(\".box\").first();\n //Find the body and the footer\n var box_content = box.find(\"> .box-body, > .box-footer, > form >.box-body, > form > .box-footer\");\n if (!box.hasClass(\"collapsed-box\")) {\n //Convert minus into plus\n element.children(\":first\")\n .removeClass(_this.icons.collapse)\n .addClass(_this.icons.open);\n //Hide the content\n box_content.slideUp(_this.animationSpeed, function () {\n box.addClass(\"collapsed-box\");\n });\n } else {\n //Convert plus into minus\n element.children(\":first\")\n .removeClass(_this.icons.open)\n .addClass(_this.icons.collapse);\n //Show the content\n box_content.slideDown(_this.animationSpeed, function () {\n box.removeClass(\"collapsed-box\");\n });\n }\n },\n remove: function (element) {\n //Find the box parent\n var box = element.parents(\".box\").first();\n box.slideUp(this.animationSpeed);\n }\n };\n}\n\n/* ------------------\n * - Custom Plugins -\n * ------------------\n * All custom plugins are defined below.\n */\n\n/*\n * BOX REFRESH BUTTON\n * ------------------\n * This is a custom plugin to use with the component BOX. It allows you to add\n * a refresh button to the box. It converts the box's state to a loading state.\n *\n * @type plugin\n * @usage $(\"#box-widget\").boxRefresh( options );\n */\n(function ($) {\n\n \"use strict\";\n\n $.fn.boxRefresh = function (options) {\n\n // Render options\n var settings = $.extend({\n //Refresh button selector\n trigger: \".refresh-btn\",\n //File source to be loaded (e.g: ajax/src.php)\n source: \"\",\n //Callbacks\n onLoadStart: function (box) {\n return box;\n }, //Right after the button has been clicked\n onLoadDone: function (box) {\n return box;\n } //When the source has been loaded\n\n }, options);\n\n //The overlay\n var overlay = $('<div class=\"overlay\"><div class=\"fa fa-refresh fa-spin\"></div></div>');\n\n return this.each(function () {\n //if a source is specified\n if (settings.source === \"\") {\n if (window.console) {\n window.console.log(\"Please specify a source first - boxRefresh()\");\n }\n return;\n }\n //the box\n var box = $(this);\n //the button\n var rBtn = box.find(settings.trigger).first();\n\n //On trigger click\n rBtn.on('click', function (e) {\n e.preventDefault();\n //Add loading overlay\n start(box);\n\n //Perform ajax call\n box.find(\".box-body\").load(settings.source, function () {\n done(box);\n });\n });\n });\n\n function start(box) {\n //Add overlay and loading img\n box.append(overlay);\n\n settings.onLoadStart.call(box);\n }\n\n function done(box) {\n //Remove overlay and loading img\n box.find(overlay).remove();\n\n settings.onLoadDone.call(box);\n }\n\n };\n\n})(jQuery);\n\n/*\n * EXPLICIT BOX ACTIVATION\n * -----------------------\n * This is a custom plugin to use with the component BOX. It allows you to activate\n * a box inserted in the DOM after the app.js was loaded.\n *\n * @type plugin\n * @usage $(\"#box-widget\").activateBox();\n */\n(function ($) {\n\n 'use strict';\n\n $.fn.activateBox = function () {\n $.AdminLTE.boxWidget.activate(this);\n };\n\n})(jQuery);\n\n/*\n * TODO LIST CUSTOM PLUGIN\n * -----------------------\n * This plugin depends on iCheck plugin for checkbox and radio inputs\n *\n * @type plugin\n * @usage $(\"#todo-widget\").todolist( options );\n */\n(function ($) {\n\n 'use strict';\n\n $.fn.todolist = function (options) {\n // Render options\n var settings = $.extend({\n //When the user checks the input\n onCheck: function (ele) {\n return ele;\n },\n //When the user unchecks the input\n onUncheck: function (ele) {\n return ele;\n }\n }, options);\n\n return this.each(function () {\n\n if (typeof $.fn.iCheck != 'undefined') {\n $('input', this).on('ifChecked', function () {\n var ele = $(this).parents(\"li\").first();\n ele.toggleClass(\"done\");\n settings.onCheck.call(ele);\n });\n\n $('input', this).on('ifUnchecked', function () {\n var ele = $(this).parents(\"li\").first();\n ele.toggleClass(\"done\");\n settings.onUncheck.call(ele);\n });\n } else {\n $('input', this).on('change', function () {\n var ele = $(this).parents(\"li\").first();\n ele.toggleClass(\"done\");\n if ($('input', ele).is(\":checked\")) {\n settings.onCheck.call(ele);\n } else {\n settings.onUncheck.call(ele);\n }\n });\n }\n });\n };\n}(jQuery));"],"sourceRoot":"/source/"}