rails-adminlte 0.1.2 → 0.1.3

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rails/adminlte/version.rb +1 -1
  3. data/vendor/assets/images/avatar.png +0 -0
  4. data/vendor/assets/images/avatar04.png +0 -0
  5. data/vendor/assets/images/avatar2.png +0 -0
  6. data/vendor/assets/images/avatar3.png +0 -0
  7. data/vendor/assets/images/avatar5.png +0 -0
  8. data/vendor/assets/images/boxed-bg.jpg +0 -0
  9. data/vendor/assets/images/boxed-bg.png +0 -0
  10. data/vendor/assets/images/credit/american-express.png +0 -0
  11. data/vendor/assets/images/credit/cirrus.png +0 -0
  12. data/vendor/assets/images/credit/mastercard.png +0 -0
  13. data/vendor/assets/images/credit/mestro.png +0 -0
  14. data/vendor/assets/images/credit/paypal.png +0 -0
  15. data/vendor/assets/images/credit/paypal2.png +0 -0
  16. data/vendor/assets/images/credit/visa.png +0 -0
  17. data/vendor/assets/images/default-50x50.gif +0 -0
  18. data/vendor/assets/images/icons.png +0 -0
  19. data/vendor/assets/images/photo1.png +0 -0
  20. data/vendor/assets/images/photo2.png +0 -0
  21. data/vendor/assets/images/photo3.jpg +0 -0
  22. data/vendor/assets/images/photo4.jpg +0 -0
  23. data/vendor/assets/images/user1-128x128.jpg +0 -0
  24. data/vendor/assets/images/user2-160x160.jpg +0 -0
  25. data/vendor/assets/images/user3-128x128.jpg +0 -0
  26. data/vendor/assets/images/user4-128x128.jpg +0 -0
  27. data/vendor/assets/images/user5-128x128.jpg +0 -0
  28. data/vendor/assets/images/user6-128x128.jpg +0 -0
  29. data/vendor/assets/images/user7-128x128.jpg +0 -0
  30. data/vendor/assets/images/user8-128x128.jpg +0 -0
  31. data/vendor/assets/javascripts/adminlte/adminlte.js +772 -0
  32. data/vendor/assets/javascripts/bootstrap.js +2377 -0
  33. data/vendor/assets/stylesheets/adminlte/adminlte.css +4942 -0
  34. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-bootstrap-social.css +760 -0
  35. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-bootstrap-social.min.css +1 -0
  36. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-fullcalendar.css +93 -0
  37. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-fullcalendar.min.css +1 -0
  38. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-select2.css +97 -0
  39. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-select2.min.css +1 -0
  40. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-without-plugins.css +3992 -0
  41. data/vendor/assets/stylesheets/adminlte/alt/AdminLTE-without-plugins.min.css +7 -0
  42. data/vendor/assets/stylesheets/adminlte/skins/_all-skins.css +1770 -0
  43. data/vendor/assets/stylesheets/adminlte/skins/_all-skins.min.css +1 -0
  44. data/vendor/assets/stylesheets/adminlte/skins/skin-black-light.css +173 -0
  45. data/vendor/assets/stylesheets/adminlte/skins/skin-black-light.min.css +1 -0
  46. data/vendor/assets/stylesheets/adminlte/skins/skin-black.css +158 -0
  47. data/vendor/assets/stylesheets/adminlte/skins/skin-black.min.css +1 -0
  48. data/vendor/assets/stylesheets/adminlte/skins/skin-blue-light.css +164 -0
  49. data/vendor/assets/stylesheets/adminlte/skins/skin-blue-light.min.css +1 -0
  50. data/vendor/assets/stylesheets/adminlte/skins/skin-blue.css +139 -0
  51. data/vendor/assets/stylesheets/adminlte/skins/skin-blue.min.css +1 -0
  52. data/vendor/assets/stylesheets/adminlte/skins/skin-green-light.css +153 -0
  53. data/vendor/assets/stylesheets/adminlte/skins/skin-green-light.min.css +1 -0
  54. data/vendor/assets/stylesheets/adminlte/skins/skin-green.css +131 -0
  55. data/vendor/assets/stylesheets/adminlte/skins/skin-green.min.css +1 -0
  56. data/vendor/assets/stylesheets/adminlte/skins/skin-purple-light.css +153 -0
  57. data/vendor/assets/stylesheets/adminlte/skins/skin-purple-light.min.css +1 -0
  58. data/vendor/assets/stylesheets/adminlte/skins/skin-purple.css +131 -0
  59. data/vendor/assets/stylesheets/adminlte/skins/skin-purple.min.css +1 -0
  60. data/vendor/assets/stylesheets/adminlte/skins/skin-red-light.css +153 -0
  61. data/vendor/assets/stylesheets/adminlte/skins/skin-red-light.min.css +1 -0
  62. data/vendor/assets/stylesheets/adminlte/skins/skin-red.css +131 -0
  63. data/vendor/assets/stylesheets/adminlte/skins/skin-red.min.css +1 -0
  64. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow-light.css +153 -0
  65. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow-light.min.css +1 -0
  66. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow.css +131 -0
  67. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow.min.css +1 -0
  68. data/vendor/assets/stylesheets/bootstrap.css +6757 -0
  69. metadata +67 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e2a22635dd574e14019035fe84c88385e90af2f
4
- data.tar.gz: 4ec93a927ac93491fb2a8f2012dc240ee965a9a4
3
+ metadata.gz: e9e85080a810e1261b628f8536ef7730541fc113
4
+ data.tar.gz: dde3fc0b17124299afbc249392ee7c0df4c6fb39
5
5
  SHA512:
6
- metadata.gz: 56b6cebb8bdafc45888c80adcd712ec3a8dc14ed6fc8be80cbc74bed110a0f8660386a39a27cfa970ddbf2195f2047bdf60358001096b8bb17c1a318f5a95e8e
7
- data.tar.gz: 73e1b0c4e09e03c66fae44690021ea4d89b18e8f4b20d0fdadc8b113436f4238f8532a1ed332b9388481bf5a392a9018c462005b756d8e60fd3c665f6c7b5b7f
6
+ metadata.gz: 9bdf2580f65dd8d4b71e16a67ce426a46c967650e542245792d889379987f7df3911e2514e5eb6a96a3b31ff8ab8c951ac204f297e55e630f30631945603204a
7
+ data.tar.gz: ccbd37c95b6cb379a018ee168b72551f5b7c0458ee8baeb0ddb9da699902a145c2bcea95845e2b35156645b56def2d67709e7b13427725e4ae04f85765c54ddf
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Adminlte
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,772 @@
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.12
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 option 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));