admin_lte 0.1.0 → 2.2.0.1

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