mirror of https://github.com/ColorlibHQ/AdminLTE
conform to jshint rules
parent
b1a94d780f
commit
37a065bb99
|
@ -11,8 +11,6 @@
|
||||||
* @license MIT <http://opensource.org/licenses/MIT>
|
* @license MIT <http://opensource.org/licenses/MIT>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
//Make sure jQuery has been loaded before app.js
|
//Make sure jQuery has been loaded before app.js
|
||||||
if (typeof jQuery === "undefined") {
|
if (typeof jQuery === "undefined") {
|
||||||
throw new Error("AdminLTE requires jQuery");
|
throw new Error("AdminLTE requires jQuery");
|
||||||
|
@ -140,6 +138,8 @@ $.AdminLTE.options = {
|
||||||
* options above.
|
* options above.
|
||||||
*/
|
*/
|
||||||
$(function () {
|
$(function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
//Extend options if external options exist
|
//Extend options if external options exist
|
||||||
if (typeof AdminLTEOptions !== "undefined") {
|
if (typeof AdminLTEOptions !== "undefined") {
|
||||||
$.extend(true,
|
$.extend(true,
|
||||||
|
@ -224,7 +224,7 @@ $(function () {
|
||||||
* All AdminLTE functions are implemented below.
|
* All AdminLTE functions are implemented below.
|
||||||
*/
|
*/
|
||||||
function _init() {
|
function _init() {
|
||||||
|
'use strict';
|
||||||
/* Layout
|
/* Layout
|
||||||
* ======
|
* ======
|
||||||
* Fixes the layout height in case min-height fails.
|
* Fixes the layout height in case min-height fails.
|
||||||
|
@ -279,8 +279,8 @@ function _init() {
|
||||||
$(".sidebar").slimScroll({destroy: true}).height("auto");
|
$(".sidebar").slimScroll({destroy: true}).height("auto");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (typeof $.fn.slimScroll == 'undefined' && console) {
|
} else if (typeof $.fn.slimScroll == 'undefined' && window.console) {
|
||||||
console.error("Error: the fixed layout requires the slimscroll plugin!");
|
window.console.error("Error: the fixed layout requires the slimscroll plugin!");
|
||||||
}
|
}
|
||||||
//Enable slimscroll for fixed layout
|
//Enable slimscroll for fixed layout
|
||||||
if ($.AdminLTE.options.sidebarSlimScroll) {
|
if ($.AdminLTE.options.sidebarSlimScroll) {
|
||||||
|
@ -476,7 +476,6 @@ function _init() {
|
||||||
},
|
},
|
||||||
//Open the control sidebar
|
//Open the control sidebar
|
||||||
open: function (sidebar, slide) {
|
open: function (sidebar, slide) {
|
||||||
var _this = this;
|
|
||||||
//Slide over content
|
//Slide over content
|
||||||
if (slide) {
|
if (slide) {
|
||||||
sidebar.addClass('control-sidebar-open');
|
sidebar.addClass('control-sidebar-open');
|
||||||
|
@ -603,6 +602,8 @@ function _init() {
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
$.fn.boxRefresh = function (options) {
|
$.fn.boxRefresh = function (options) {
|
||||||
|
|
||||||
// Render options
|
// Render options
|
||||||
|
@ -613,8 +614,10 @@ function _init() {
|
||||||
source: "",
|
source: "",
|
||||||
//Callbacks
|
//Callbacks
|
||||||
onLoadStart: function (box) {
|
onLoadStart: function (box) {
|
||||||
|
return box;
|
||||||
}, //Right after the button has been clicked
|
}, //Right after the button has been clicked
|
||||||
onLoadDone: function (box) {
|
onLoadDone: function (box) {
|
||||||
|
return box;
|
||||||
} //When the source has been loaded
|
} //When the source has been loaded
|
||||||
|
|
||||||
}, options);
|
}, options);
|
||||||
|
@ -625,8 +628,8 @@ function _init() {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
//if a source is specified
|
//if a source is specified
|
||||||
if (settings.source === "") {
|
if (settings.source === "") {
|
||||||
if (console) {
|
if (window.console) {
|
||||||
console.log("Please specify a source first - boxRefresh()");
|
window.console.log("Please specify a source first - boxRefresh()");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -677,6 +680,8 @@ function _init() {
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
$.fn.activateBox = function () {
|
$.fn.activateBox = function () {
|
||||||
$.AdminLTE.boxWidget.activate(this);
|
$.AdminLTE.boxWidget.activate(this);
|
||||||
};
|
};
|
||||||
|
@ -693,36 +698,44 @@ function _init() {
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
$.fn.todolist = function (options) {
|
$.fn.todolist = function (options) {
|
||||||
// Render options
|
// Render options
|
||||||
var settings = $.extend({
|
var settings = $.extend({
|
||||||
//When the user checks the input
|
//When the user checks the input
|
||||||
onCheck: function (ele) {
|
onCheck: function (ele) {
|
||||||
|
return ele;
|
||||||
},
|
},
|
||||||
//When the user unchecks the input
|
//When the user unchecks the input
|
||||||
onUncheck: function (ele) {
|
onUncheck: function (ele) {
|
||||||
|
return ele;
|
||||||
}
|
}
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
|
|
||||||
if (typeof $.fn.iCheck != 'undefined') {
|
if (typeof $.fn.iCheck != 'undefined') {
|
||||||
$('input', this).on('ifChecked', function (event) {
|
$('input', this).on('ifChecked', function () {
|
||||||
var ele = $(this).parents("li").first();
|
var ele = $(this).parents("li").first();
|
||||||
ele.toggleClass("done");
|
ele.toggleClass("done");
|
||||||
settings.onCheck.call(ele);
|
settings.onCheck.call(ele);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input', this).on('ifUnchecked', function (event) {
|
$('input', this).on('ifUnchecked', function () {
|
||||||
var ele = $(this).parents("li").first();
|
var ele = $(this).parents("li").first();
|
||||||
ele.toggleClass("done");
|
ele.toggleClass("done");
|
||||||
settings.onUncheck.call(ele);
|
settings.onUncheck.call(ele);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$('input', this).on('change', function (event) {
|
$('input', this).on('change', function () {
|
||||||
var ele = $(this).parents("li").first();
|
var ele = $(this).parents("li").first();
|
||||||
ele.toggleClass("done");
|
ele.toggleClass("done");
|
||||||
|
if ($('input', ele).is(":checked")) {
|
||||||
settings.onCheck.call(ele);
|
settings.onCheck.call(ele);
|
||||||
|
} else {
|
||||||
|
settings.onUncheck.call(ele);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,6 +6,8 @@
|
||||||
*/
|
*/
|
||||||
(function ($, AdminLTE) {
|
(function ($, AdminLTE) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of all the available skins
|
* List of all the available skins
|
||||||
*
|
*
|
||||||
|
@ -256,7 +258,7 @@
|
||||||
if (typeof (Storage) !== "undefined") {
|
if (typeof (Storage) !== "undefined") {
|
||||||
localStorage.setItem(name, val);
|
localStorage.setItem(name, val);
|
||||||
} else {
|
} else {
|
||||||
alert('Please use a modern browser to properly view this template!');
|
window.alert('Please use a modern browser to properly view this template!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +272,7 @@
|
||||||
if (typeof (Storage) !== "undefined") {
|
if (typeof (Storage) !== "undefined") {
|
||||||
return localStorage.getItem(name);
|
return localStorage.getItem(name);
|
||||||
} else {
|
} else {
|
||||||
alert('Please use a modern browser to properly view this template!');
|
window.alert('Please use a modern browser to properly view this template!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,18 +319,18 @@
|
||||||
$("[data-enable='expandOnHover']").on('click', function () {
|
$("[data-enable='expandOnHover']").on('click', function () {
|
||||||
$(this).attr('disabled', true);
|
$(this).attr('disabled', true);
|
||||||
AdminLTE.pushMenu.expandOnHover();
|
AdminLTE.pushMenu.expandOnHover();
|
||||||
if(!$('body').hasClass('sidebar-collapse'))
|
if (!$('body').hasClass('sidebar-collapse'))
|
||||||
$("[data-layout='sidebar-collapse']").click();
|
$("[data-layout='sidebar-collapse']").click();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset options
|
// Reset options
|
||||||
if($('body').hasClass('fixed')) {
|
if ($('body').hasClass('fixed')) {
|
||||||
$("[data-layout='fixed']").attr('checked', 'checked');
|
$("[data-layout='fixed']").attr('checked', 'checked');
|
||||||
}
|
}
|
||||||
if($('body').hasClass('layout-boxed')) {
|
if ($('body').hasClass('layout-boxed')) {
|
||||||
$("[data-layout='layout-boxed']").attr('checked', 'checked');
|
$("[data-layout='layout-boxed']").attr('checked', 'checked');
|
||||||
}
|
}
|
||||||
if($('body').hasClass('sidebar-collapse')) {
|
if ($('body').hasClass('sidebar-collapse')) {
|
||||||
$("[data-layout='sidebar-collapse']").attr('checked', 'checked');
|
$("[data-layout='sidebar-collapse']").attr('checked', 'checked');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
* Description:
|
* Description:
|
||||||
* This is a demo file used only for the main dashboard (index.html)
|
* This is a demo file used only for the main dashboard (index.html)
|
||||||
**/
|
**/
|
||||||
"use strict";
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
//Make the dashboard widgets sortable Using jquery UI
|
//Make the dashboard widgets sortable Using jquery UI
|
||||||
$(".connectedSortable").sortable({
|
$(".connectedSortable").sortable({
|
||||||
placeholder: "sort-highlight",
|
placeholder: "sort-highlight",
|
||||||
|
@ -29,8 +30,7 @@ $(function () {
|
||||||
//bootstrap WYSIHTML5 - text editor
|
//bootstrap WYSIHTML5 - text editor
|
||||||
$(".textarea").wysihtml5();
|
$(".textarea").wysihtml5();
|
||||||
|
|
||||||
$('.daterange').daterangepicker(
|
$('.daterange').daterangepicker({
|
||||||
{
|
|
||||||
ranges: {
|
ranges: {
|
||||||
'Today': [moment(), moment()],
|
'Today': [moment(), moment()],
|
||||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||||
|
@ -41,9 +41,8 @@ $(function () {
|
||||||
},
|
},
|
||||||
startDate: moment().subtract(29, 'days'),
|
startDate: moment().subtract(29, 'days'),
|
||||||
endDate: moment()
|
endDate: moment()
|
||||||
},
|
}, function (start, end) {
|
||||||
function (start, end) {
|
window.alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
||||||
alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* jQueryKnob */
|
/* jQueryKnob */
|
||||||
|
@ -190,44 +189,21 @@ $(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
//Fix for charts under tabs
|
//Fix for charts under tabs
|
||||||
$('.box ul.nav a').on('shown.bs.tab', function (e) {
|
$('.box ul.nav a').on('shown.bs.tab', function () {
|
||||||
area.redraw();
|
area.redraw();
|
||||||
donut.redraw();
|
donut.redraw();
|
||||||
});
|
line.redraw();
|
||||||
|
|
||||||
|
|
||||||
/* BOX REFRESH PLUGIN EXAMPLE (usage with morris charts) */
|
|
||||||
$("#loading-example").boxRefresh({
|
|
||||||
source: "ajax/dashboard-boxrefresh-demo.php",
|
|
||||||
onLoadDone: function (box) {
|
|
||||||
bar = new Morris.Bar({
|
|
||||||
element: 'bar-chart',
|
|
||||||
resize: true,
|
|
||||||
data: [
|
|
||||||
{y: '2006', a: 100, b: 90},
|
|
||||||
{y: '2007', a: 75, b: 65},
|
|
||||||
{y: '2008', a: 50, b: 40},
|
|
||||||
{y: '2009', a: 75, b: 65},
|
|
||||||
{y: '2010', a: 50, b: 40},
|
|
||||||
{y: '2011', a: 75, b: 65},
|
|
||||||
{y: '2012', a: 100, b: 90}
|
|
||||||
],
|
|
||||||
barColors: ['#00a65a', '#f56954'],
|
|
||||||
xkey: 'y',
|
|
||||||
ykeys: ['a', 'b'],
|
|
||||||
labels: ['CPU', 'DISK'],
|
|
||||||
hideHover: 'auto'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* The todo list plugin */
|
/* The todo list plugin */
|
||||||
$(".todo-list").todolist({
|
$(".todo-list").todolist({
|
||||||
onCheck: function (ele) {
|
onCheck: function (ele) {
|
||||||
console.log("The element has been checked")
|
window.console.log("The element has been checked");
|
||||||
|
return ele;
|
||||||
},
|
},
|
||||||
onUncheck: function (ele) {
|
onUncheck: function (ele) {
|
||||||
console.log("The element has been unchecked")
|
window.console.log("The element has been unchecked");
|
||||||
|
return ele;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/* ChartJS
|
/* ChartJS
|
||||||
* -------
|
* -------
|
||||||
* Here we will create a few charts using ChartJS
|
* Here we will create a few charts using ChartJS
|
||||||
|
|
Loading…
Reference in New Issue