adminlte_assets 0.0.33

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