cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

app.js (23277B)


      1 /*! AdminLTE app.js
      2  * ================
      3  * Main JS application file for AdminLTE v2. This file
      4  * should be included in all pages. It controls some layout
      5  * options and implements exclusive AdminLTE plugins.
      6  *
      7  * @Author  Almsaeed Studio
      8  * @Support <http://www.almsaeedstudio.com>
      9  * @Email   <abdullah@almsaeedstudio.com>
     10  * @version 2.3.8
     11  * @license MIT <http://opensource.org/licenses/MIT>
     12  */
     13 
     14 //Make sure jQuery has been loaded before app.js
     15 if (typeof jQuery === "undefined") {
     16   throw new Error("AdminLTE requires jQuery");
     17 }
     18 
     19 /* AdminLTE
     20  *
     21  * @type Object
     22  * @description $.AdminLTE is the main object for the template's app.
     23  *              It's used for implementing functions and options related
     24  *              to the template. Keeping everything wrapped in an object
     25  *              prevents conflict with other plugins and is a better
     26  *              way to organize our code.
     27  */
     28 $.AdminLTE = {};
     29 
     30 /* --------------------
     31  * - AdminLTE Options -
     32  * --------------------
     33  * Modify these options to suit your implementation
     34  */
     35 $.AdminLTE.options = {
     36   //Add slimscroll to navbar menus
     37   //This requires you to load the slimscroll plugin
     38   //in every page before app.js
     39   navbarMenuSlimscroll: true,
     40   navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar
     41   navbarMenuHeight: "200px", //The height of the inner menu
     42   //General animation speed for JS animated elements such as box collapse/expand and
     43   //sidebar treeview slide up/down. This options accepts an integer as milliseconds,
     44   //'fast', 'normal', or 'slow'
     45   animationSpeed: 500,
     46   //Sidebar push menu toggle button selector
     47   sidebarToggleSelector: "[data-toggle='offcanvas']",
     48   //Activate sidebar push menu
     49   sidebarPushMenu: true,
     50   //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin)
     51   sidebarSlimScroll: true,
     52   //Enable sidebar expand on hover effect for sidebar mini
     53   //This option is forced to true if both the fixed layout and sidebar mini
     54   //are used together
     55   sidebarExpandOnHover: false,
     56   //BoxRefresh Plugin
     57   enableBoxRefresh: true,
     58   //Bootstrap.js tooltip
     59   enableBSToppltip: true,
     60   BSTooltipSelector: "[data-toggle='tooltip']",
     61   //Enable Fast Click. Fastclick.js creates a more
     62   //native touch experience with touch devices. If you
     63   //choose to enable the plugin, make sure you load the script
     64   //before AdminLTE's app.js
     65   enableFastclick: false,
     66   //Control Sidebar Tree views
     67   enableControlTreeView: true,
     68   //Control Sidebar Options
     69   enableControlSidebar: true,
     70   controlSidebarOptions: {
     71     //Which button should trigger the open/close event
     72     toggleBtnSelector: "[data-toggle='control-sidebar']",
     73     //The sidebar selector
     74     selector: ".control-sidebar",
     75     //Enable slide over content
     76     slide: true
     77   },
     78   //Box Widget Plugin. Enable this plugin
     79   //to allow boxes to be collapsed and/or removed
     80   enableBoxWidget: true,
     81   //Box Widget plugin options
     82   boxWidgetOptions: {
     83     boxWidgetIcons: {
     84       //Collapse icon
     85       collapse: 'fa-minus',
     86       //Open icon
     87       open: 'fa-plus',
     88       //Remove icon
     89       remove: 'fa-times'
     90     },
     91     boxWidgetSelectors: {
     92       //Remove button selector
     93       remove: '[data-widget="remove"]',
     94       //Collapse button selector
     95       collapse: '[data-widget="collapse"]'
     96     }
     97   },
     98   //Direct Chat plugin options
     99   directChat: {
    100     //Enable direct chat by default
    101     enable: true,
    102     //The button to open and close the chat contacts pane
    103     contactToggleSelector: '[data-widget="chat-pane-toggle"]'
    104   },
    105   //Define the set of colors to use globally around the website
    106   colors: {
    107     lightBlue: "#3c8dbc",
    108     red: "#f56954",
    109     green: "#00a65a",
    110     aqua: "#00c0ef",
    111     yellow: "#f39c12",
    112     blue: "#0073b7",
    113     navy: "#001F3F",
    114     teal: "#39CCCC",
    115     olive: "#3D9970",
    116     lime: "#01FF70",
    117     orange: "#FF851B",
    118     fuchsia: "#F012BE",
    119     purple: "#8E24AA",
    120     maroon: "#D81B60",
    121     black: "#222222",
    122     gray: "#d2d6de"
    123   },
    124   //The standard screen sizes that bootstrap uses.
    125   //If you change these in the variables.less file, change
    126   //them here too.
    127   screenSizes: {
    128     xs: 480,
    129     sm: 768,
    130     md: 992,
    131     lg: 1200
    132   }
    133 };
    134 
    135 /* ------------------
    136  * - Implementation -
    137  * ------------------
    138  * The next block of code implements AdminLTE's
    139  * functions and plugins as specified by the
    140  * options above.
    141  */
    142 $(function () {
    143   "use strict";
    144 
    145   //Fix for IE page transitions
    146   $("body").removeClass("hold-transition");
    147 
    148   //Extend options if external options exist
    149   if (typeof AdminLTEOptions !== "undefined") {
    150     $.extend(true,
    151       $.AdminLTE.options,
    152       AdminLTEOptions);
    153   }
    154 
    155   //Easy access to options
    156   var o = $.AdminLTE.options;
    157 
    158   //Set up the object
    159   _init();
    160 
    161   //Activate the layout maker
    162   $.AdminLTE.layout.activate();
    163 
    164   //Enable sidebar tree view controls
    165   if (o.enableControlTreeView) {
    166     $.AdminLTE.tree('.sidebar');
    167   }
    168 
    169   //Enable control sidebar
    170   if (o.enableControlSidebar) {
    171     $.AdminLTE.controlSidebar.activate();
    172   }
    173 
    174   //Add slimscroll to navbar dropdown
    175   if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') {
    176     $(".navbar .menu").slimscroll({
    177       height: o.navbarMenuHeight,
    178       alwaysVisible: false,
    179       size: o.navbarMenuSlimscrollWidth
    180     }).css("width", "100%");
    181   }
    182 
    183   //Activate sidebar push menu
    184   if (o.sidebarPushMenu) {
    185     $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector);
    186   }
    187 
    188   //Activate Bootstrap tooltip
    189   if (o.enableBSToppltip) {
    190     $('body').tooltip({
    191       selector: o.BSTooltipSelector,
    192       container: 'body'
    193     });
    194   }
    195 
    196   //Activate box widget
    197   if (o.enableBoxWidget) {
    198     $.AdminLTE.boxWidget.activate();
    199   }
    200 
    201   //Activate fast click
    202   if (o.enableFastclick && typeof FastClick != 'undefined') {
    203     FastClick.attach(document.body);
    204   }
    205 
    206   //Activate direct chat widget
    207   if (o.directChat.enable) {
    208     $(document).on('click', o.directChat.contactToggleSelector, function () {
    209       var box = $(this).parents('.direct-chat').first();
    210       box.toggleClass('direct-chat-contacts-open');
    211     });
    212   }
    213 
    214   /*
    215    * INITIALIZE BUTTON TOGGLE
    216    * ------------------------
    217    */
    218   $('.btn-group[data-toggle="btn-toggle"]').each(function () {
    219     var group = $(this);
    220     $(this).find(".btn").on('click', function (e) {
    221       group.find(".btn.active").removeClass("active");
    222       $(this).addClass("active");
    223       e.preventDefault();
    224     });
    225 
    226   });
    227 });
    228 
    229 /* ----------------------------------
    230  * - Initialize the AdminLTE Object -
    231  * ----------------------------------
    232  * All AdminLTE functions are implemented below.
    233  */
    234 function _init() {
    235   'use strict';
    236   /* Layout
    237    * ======
    238    * Fixes the layout height in case min-height fails.
    239    *
    240    * @type Object
    241    * @usage $.AdminLTE.layout.activate()
    242    *        $.AdminLTE.layout.fix()
    243    *        $.AdminLTE.layout.fixSidebar()
    244    */
    245   $.AdminLTE.layout = {
    246     activate: function () {
    247       var _this = this;
    248       _this.fix();
    249       _this.fixSidebar();
    250       $('body, html, .wrapper').css('height', 'auto');
    251       $(window, ".wrapper").resize(function () {
    252         _this.fix();
    253         _this.fixSidebar();
    254       });
    255     },
    256     fix: function () {
    257       // Remove overflow from .wrapper if layout-boxed exists
    258       $(".layout-boxed > .wrapper").css('overflow', 'hidden');
    259       //Get window height and the wrapper height
    260       var footer_height = $('.main-footer').outerHeight() || 0;
    261       var neg = $('.main-header').outerHeight() + footer_height;
    262       var window_height = $(window).height();
    263       var sidebar_height = $(".sidebar").height() || 0;
    264       //Set the min-height of the content and sidebar based on the
    265       //the height of the document.
    266       if ($("body").hasClass("fixed")) {
    267         $(".content-wrapper, .right-side").css('min-height', window_height - footer_height);
    268       } else {
    269         var postSetWidth;
    270         if (window_height >= sidebar_height) {
    271           $(".content-wrapper, .right-side").css('min-height', window_height - neg);
    272           postSetWidth = window_height - neg;
    273         } else {
    274           $(".content-wrapper, .right-side").css('min-height', sidebar_height);
    275           postSetWidth = sidebar_height;
    276         }
    277 
    278         //Fix for the control sidebar height
    279         var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);
    280         if (typeof controlSidebar !== "undefined") {
    281           if (controlSidebar.height() > postSetWidth)
    282             $(".content-wrapper, .right-side").css('min-height', controlSidebar.height());
    283         }
    284 
    285       }
    286     },
    287     fixSidebar: function () {
    288       //Make sure the body tag has the .fixed class
    289       if (!$("body").hasClass("fixed")) {
    290         if (typeof $.fn.slimScroll != 'undefined') {
    291           $(".sidebar").slimScroll({destroy: true}).height("auto");
    292         }
    293         return;
    294       } else if (typeof $.fn.slimScroll == 'undefined' && window.console) {
    295         window.console.error("Error: the fixed layout requires the slimscroll plugin!");
    296       }
    297       //Enable slimscroll for fixed layout
    298       if ($.AdminLTE.options.sidebarSlimScroll) {
    299         if (typeof $.fn.slimScroll != 'undefined') {
    300           //Destroy if it exists
    301           $(".sidebar").slimScroll({destroy: true}).height("auto");
    302           //Add slimscroll
    303           $(".sidebar").slimScroll({
    304             height: ($(window).height() - $(".main-header").height()) + "px",
    305             color: "rgba(0,0,0,0.2)",
    306             size: "3px"
    307           });
    308         }
    309       }
    310     }
    311   };
    312 
    313   /* PushMenu()
    314    * ==========
    315    * Adds the push menu functionality to the sidebar.
    316    *
    317    * @type Function
    318    * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']")
    319    */
    320   $.AdminLTE.pushMenu = {
    321     activate: function (toggleBtn) {
    322       //Get the screen sizes
    323       var screenSizes = $.AdminLTE.options.screenSizes;
    324 
    325       //Enable sidebar toggle
    326       $(document).on('click', toggleBtn, function (e) {
    327         e.preventDefault();
    328 
    329         //Enable sidebar push menu
    330         if ($(window).width() > (screenSizes.sm - 1)) {
    331           if ($("body").hasClass('sidebar-collapse')) {
    332             $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu');
    333           } else {
    334             $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu');
    335           }
    336         }
    337         //Handle sidebar push menu for small screens
    338         else {
    339           if ($("body").hasClass('sidebar-open')) {
    340             $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu');
    341           } else {
    342             $("body").addClass('sidebar-open').trigger('expanded.pushMenu');
    343           }
    344         }
    345       });
    346 
    347       $(".content-wrapper").click(function () {
    348         //Enable hide menu when clicking on the content-wrapper on small screens
    349         if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
    350           $("body").removeClass('sidebar-open');
    351         }
    352       });
    353 
    354       //Enable expand on hover for sidebar mini
    355       if ($.AdminLTE.options.sidebarExpandOnHover
    356         || ($('body').hasClass('fixed')
    357         && $('body').hasClass('sidebar-mini'))) {
    358         this.expandOnHover();
    359       }
    360     },
    361     expandOnHover: function () {
    362       var _this = this;
    363       var screenWidth = $.AdminLTE.options.screenSizes.sm - 1;
    364       //Expand sidebar on hover
    365       $('.main-sidebar').hover(function () {
    366         if ($('body').hasClass('sidebar-mini')
    367           && $("body").hasClass('sidebar-collapse')
    368           && $(window).width() > screenWidth) {
    369           _this.expand();
    370         }
    371       }, function () {
    372         if ($('body').hasClass('sidebar-mini')
    373           && $('body').hasClass('sidebar-expanded-on-hover')
    374           && $(window).width() > screenWidth) {
    375           _this.collapse();
    376         }
    377       });
    378     },
    379     expand: function () {
    380       $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover');
    381     },
    382     collapse: function () {
    383       if ($('body').hasClass('sidebar-expanded-on-hover')) {
    384         $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse');
    385       }
    386     }
    387   };
    388 
    389   /* Tree()
    390    * ======
    391    * Converts the sidebar into a multilevel
    392    * tree view menu.
    393    *
    394    * @type Function
    395    * @Usage: $.AdminLTE.tree('.sidebar')
    396    */
    397   $.AdminLTE.tree = function (menu) {
    398     var _this = this;
    399     var animationSpeed = $.AdminLTE.options.animationSpeed;
    400     $(document).off('click', menu + ' li a')
    401       .on('click', menu + ' li a', function (e) {
    402         //Get the clicked link and the next element
    403         var $this = $(this);
    404         var checkElement = $this.next();
    405 
    406         //Check if the next element is a menu and is visible
    407         if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) {
    408           //Close the menu
    409           checkElement.slideUp(animationSpeed, function () {
    410             checkElement.removeClass('menu-open');
    411             //Fix the layout in case the sidebar stretches over the height of the window
    412             //_this.layout.fix();
    413           });
    414           checkElement.parent("li").removeClass("active");
    415         }
    416         //If the menu is not visible
    417         else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) {
    418           //Get the parent menu
    419           var parent = $this.parents('ul').first();
    420           //Close all open menus within the parent
    421           var ul = parent.find('ul:visible').slideUp(animationSpeed);
    422           //Remove the menu-open class from the parent
    423           ul.removeClass('menu-open');
    424           //Get the parent li
    425           var parent_li = $this.parent("li");
    426 
    427           //Open the target menu and add the menu-open class
    428           checkElement.slideDown(animationSpeed, function () {
    429             //Add the class active to the parent li
    430             checkElement.addClass('menu-open');
    431             parent.find('li.active').removeClass('active');
    432             parent_li.addClass('active');
    433             //Fix the layout in case the sidebar stretches over the height of the window
    434             _this.layout.fix();
    435           });
    436         }
    437         //if this isn't a link, prevent the page from being redirected
    438         if (checkElement.is('.treeview-menu')) {
    439           e.preventDefault();
    440         }
    441       });
    442   };
    443 
    444   /* ControlSidebar
    445    * ==============
    446    * Adds functionality to the right sidebar
    447    *
    448    * @type Object
    449    * @usage $.AdminLTE.controlSidebar.activate(options)
    450    */
    451   $.AdminLTE.controlSidebar = {
    452     //instantiate the object
    453     activate: function () {
    454       //Get the object
    455       var _this = this;
    456       //Update options
    457       var o = $.AdminLTE.options.controlSidebarOptions;
    458       //Get the sidebar
    459       var sidebar = $(o.selector);
    460       //The toggle button
    461       var btn = $(o.toggleBtnSelector);
    462 
    463       //Listen to the click event
    464       btn.on('click', function (e) {
    465         e.preventDefault();
    466         //If the sidebar is not open
    467         if (!sidebar.hasClass('control-sidebar-open')
    468           && !$('body').hasClass('control-sidebar-open')) {
    469           //Open the sidebar
    470           _this.open(sidebar, o.slide);
    471         } else {
    472           _this.close(sidebar, o.slide);
    473         }
    474       });
    475 
    476       //If the body has a boxed layout, fix the sidebar bg position
    477       var bg = $(".control-sidebar-bg");
    478       _this._fix(bg);
    479 
    480       //If the body has a fixed layout, make the control sidebar fixed
    481       if ($('body').hasClass('fixed')) {
    482         _this._fixForFixed(sidebar);
    483       } else {
    484         //If the content height is less than the sidebar's height, force max height
    485         if ($('.content-wrapper, .right-side').height() < sidebar.height()) {
    486           _this._fixForContent(sidebar);
    487         }
    488       }
    489     },
    490     //Open the control sidebar
    491     open: function (sidebar, slide) {
    492       //Slide over content
    493       if (slide) {
    494         sidebar.addClass('control-sidebar-open');
    495       } else {
    496         //Push the content by adding the open class to the body instead
    497         //of the sidebar itself
    498         $('body').addClass('control-sidebar-open');
    499       }
    500     },
    501     //Close the control sidebar
    502     close: function (sidebar, slide) {
    503       if (slide) {
    504         sidebar.removeClass('control-sidebar-open');
    505       } else {
    506         $('body').removeClass('control-sidebar-open');
    507       }
    508     },
    509     _fix: function (sidebar) {
    510       var _this = this;
    511       if ($("body").hasClass('layout-boxed')) {
    512         sidebar.css('position', 'absolute');
    513         sidebar.height($(".wrapper").height());
    514         if (_this.hasBindedResize) {
    515           return;
    516         }
    517         $(window).resize(function () {
    518           _this._fix(sidebar);
    519         });
    520         _this.hasBindedResize = true;
    521       } else {
    522         sidebar.css({
    523           'position': 'fixed',
    524           'height': 'auto'
    525         });
    526       }
    527     },
    528     _fixForFixed: function (sidebar) {
    529       sidebar.css({
    530         'position': 'fixed',
    531         'max-height': '100%',
    532         'overflow': 'auto',
    533         'padding-bottom': '50px'
    534       });
    535     },
    536     _fixForContent: function (sidebar) {
    537       $(".content-wrapper, .right-side").css('min-height', sidebar.height());
    538     }
    539   };
    540 
    541   /* BoxWidget
    542    * =========
    543    * BoxWidget is a plugin to handle collapsing and
    544    * removing boxes from the screen.
    545    *
    546    * @type Object
    547    * @usage $.AdminLTE.boxWidget.activate()
    548    *        Set all your options in the main $.AdminLTE.options object
    549    */
    550   $.AdminLTE.boxWidget = {
    551     selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
    552     icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
    553     animationSpeed: $.AdminLTE.options.animationSpeed,
    554     activate: function (_box) {
    555       var _this = this;
    556       if (!_box) {
    557         _box = document; // activate all boxes per default
    558       }
    559       //Listen for collapse event triggers
    560       $(_box).on('click', _this.selectors.collapse, function (e) {
    561         e.preventDefault();
    562         _this.collapse($(this));
    563       });
    564 
    565       //Listen for remove event triggers
    566       $(_box).on('click', _this.selectors.remove, function (e) {
    567         e.preventDefault();
    568         _this.remove($(this));
    569       });
    570     },
    571     collapse: function (element) {
    572       var _this = this;
    573       //Find the box parent
    574       var box = element.parents(".box").first();
    575       //Find the body and the footer
    576       var box_content = box.find("> .box-body, > .box-footer, > form  >.box-body, > form > .box-footer");
    577       if (!box.hasClass("collapsed-box")) {
    578         //Convert minus into plus
    579         element.children(":first")
    580           .removeClass(_this.icons.collapse)
    581           .addClass(_this.icons.open);
    582         //Hide the content
    583         box_content.slideUp(_this.animationSpeed, function () {
    584           box.addClass("collapsed-box");
    585         });
    586       } else {
    587         //Convert plus into minus
    588         element.children(":first")
    589           .removeClass(_this.icons.open)
    590           .addClass(_this.icons.collapse);
    591         //Show the content
    592         box_content.slideDown(_this.animationSpeed, function () {
    593           box.removeClass("collapsed-box");
    594         });
    595       }
    596     },
    597     remove: function (element) {
    598       //Find the box parent
    599       var box = element.parents(".box").first();
    600       box.slideUp(this.animationSpeed);
    601     }
    602   };
    603 }
    604 
    605 /* ------------------
    606  * - Custom Plugins -
    607  * ------------------
    608  * All custom plugins are defined below.
    609  */
    610 
    611 /*
    612  * BOX REFRESH BUTTON
    613  * ------------------
    614  * This is a custom plugin to use with the component BOX. It allows you to add
    615  * a refresh button to the box. It converts the box's state to a loading state.
    616  *
    617  * @type plugin
    618  * @usage $("#box-widget").boxRefresh( options );
    619  */
    620 (function ($) {
    621 
    622   "use strict";
    623 
    624   $.fn.boxRefresh = function (options) {
    625 
    626     // Render options
    627     var settings = $.extend({
    628       //Refresh button selector
    629       trigger: ".refresh-btn",
    630       //File source to be loaded (e.g: ajax/src.php)
    631       source: "",
    632       //Callbacks
    633       onLoadStart: function (box) {
    634         return box;
    635       }, //Right after the button has been clicked
    636       onLoadDone: function (box) {
    637         return box;
    638       } //When the source has been loaded
    639 
    640     }, options);
    641 
    642     //The overlay
    643     var overlay = $('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');
    644 
    645     return this.each(function () {
    646       //if a source is specified
    647       if (settings.source === "") {
    648         if (window.console) {
    649           window.console.log("Please specify a source first - boxRefresh()");
    650         }
    651         return;
    652       }
    653       //the box
    654       var box = $(this);
    655       //the button
    656       var rBtn = box.find(settings.trigger).first();
    657 
    658       //On trigger click
    659       rBtn.on('click', function (e) {
    660         e.preventDefault();
    661         //Add loading overlay
    662         start(box);
    663 
    664         //Perform ajax call
    665         box.find(".box-body").load(settings.source, function () {
    666           done(box);
    667         });
    668       });
    669     });
    670 
    671     function start(box) {
    672       //Add overlay and loading img
    673       box.append(overlay);
    674 
    675       settings.onLoadStart.call(box);
    676     }
    677 
    678     function done(box) {
    679       //Remove overlay and loading img
    680       box.find(overlay).remove();
    681 
    682       settings.onLoadDone.call(box);
    683     }
    684 
    685   };
    686 
    687 })(jQuery);
    688 
    689 /*
    690  * EXPLICIT BOX CONTROLS
    691  * -----------------------
    692  * This is a custom plugin to use with the component BOX. It allows you to activate
    693  * a box inserted in the DOM after the app.js was loaded, toggle and remove box.
    694  *
    695  * @type plugin
    696  * @usage $("#box-widget").activateBox();
    697  * @usage $("#box-widget").toggleBox();
    698  * @usage $("#box-widget").removeBox();
    699  */
    700 (function ($) {
    701 
    702   'use strict';
    703 
    704   $.fn.activateBox = function () {
    705     $.AdminLTE.boxWidget.activate(this);
    706   };
    707 
    708   $.fn.toggleBox = function () {
    709     var button = $($.AdminLTE.boxWidget.selectors.collapse, this);
    710     $.AdminLTE.boxWidget.collapse(button);
    711   };
    712 
    713   $.fn.removeBox = function () {
    714     var button = $($.AdminLTE.boxWidget.selectors.remove, this);
    715     $.AdminLTE.boxWidget.remove(button);
    716   };
    717 
    718 })(jQuery);
    719 
    720 /*
    721  * TODO LIST CUSTOM PLUGIN
    722  * -----------------------
    723  * This plugin depends on iCheck plugin for checkbox and radio inputs
    724  *
    725  * @type plugin
    726  * @usage $("#todo-widget").todolist( options );
    727  */
    728 (function ($) {
    729 
    730   'use strict';
    731 
    732   $.fn.todolist = function (options) {
    733     // Render options
    734     var settings = $.extend({
    735       //When the user checks the input
    736       onCheck: function (ele) {
    737         return ele;
    738       },
    739       //When the user unchecks the input
    740       onUncheck: function (ele) {
    741         return ele;
    742       }
    743     }, options);
    744 
    745     return this.each(function () {
    746 
    747       if (typeof $.fn.iCheck != 'undefined') {
    748         $('input', this).on('ifChecked', function () {
    749           var ele = $(this).parents("li").first();
    750           ele.toggleClass("done");
    751           settings.onCheck.call(ele);
    752         });
    753 
    754         $('input', this).on('ifUnchecked', function () {
    755           var ele = $(this).parents("li").first();
    756           ele.toggleClass("done");
    757           settings.onUncheck.call(ele);
    758         });
    759       } else {
    760         $('input', this).on('change', function () {
    761           var ele = $(this).parents("li").first();
    762           ele.toggleClass("done");
    763           if ($('input', ele).is(":checked")) {
    764             settings.onCheck.call(ele);
    765           } else {
    766             settings.onUncheck.call(ele);
    767           }
    768         });
    769       }
    770     });
    771   };
    772 }(jQuery));