conform to jshint rules

This commit is contained in:
Abdullah Almsaeed 2015-07-25 15:06:16 -04:00
parent b1a94d780f
commit 37a065bb99
5 changed files with 58 additions and 66 deletions

39
dist/js/app.js vendored
View file

@ -11,8 +11,6 @@
* @license MIT <http://opensource.org/licenses/MIT>
*/
'use strict';
//Make sure jQuery has been loaded before app.js
if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery");
@ -140,6 +138,8 @@ $.AdminLTE.options = {
* options above.
*/
$(function () {
"use strict";
//Extend options if external options exist
if (typeof AdminLTEOptions !== "undefined") {
$.extend(true,
@ -224,7 +224,7 @@ $(function () {
* All AdminLTE functions are implemented below.
*/
function _init() {
'use strict';
/* Layout
* ======
* Fixes the layout height in case min-height fails.
@ -279,8 +279,8 @@ function _init() {
$(".sidebar").slimScroll({destroy: true}).height("auto");
}
return;
} else if (typeof $.fn.slimScroll == 'undefined' && console) {
console.error("Error: the fixed layout requires the slimscroll plugin!");
} else if (typeof $.fn.slimScroll == 'undefined' && window.console) {
window.console.error("Error: the fixed layout requires the slimscroll plugin!");
}
//Enable slimscroll for fixed layout
if ($.AdminLTE.options.sidebarSlimScroll) {
@ -476,7 +476,6 @@ function _init() {
},
//Open the control sidebar
open: function (sidebar, slide) {
var _this = this;
//Slide over content
if (slide) {
sidebar.addClass('control-sidebar-open');
@ -603,6 +602,8 @@ function _init() {
*/
(function ($) {
"use strict";
$.fn.boxRefresh = function (options) {
// Render options
@ -613,8 +614,10 @@ function _init() {
source: "",
//Callbacks
onLoadStart: function (box) {
return box;
}, //Right after the button has been clicked
onLoadDone: function (box) {
return box;
} //When the source has been loaded
}, options);
@ -625,8 +628,8 @@ function _init() {
return this.each(function () {
//if a source is specified
if (settings.source === "") {
if (console) {
console.log("Please specify a source first - boxRefresh()");
if (window.console) {
window.console.log("Please specify a source first - boxRefresh()");
}
return;
}
@ -677,6 +680,8 @@ function _init() {
*/
(function ($) {
'use strict';
$.fn.activateBox = function () {
$.AdminLTE.boxWidget.activate(this);
};
@ -693,38 +698,46 @@ function _init() {
*/
(function ($) {
'use strict';
$.fn.todolist = function (options) {
// Render options
var settings = $.extend({
//When the user checks the input
onCheck: function (ele) {
return ele;
},
//When the user unchecks the input
onUncheck: function (ele) {
return ele;
}
}, options);
return this.each(function () {
if (typeof $.fn.iCheck != 'undefined') {
$('input', this).on('ifChecked', function (event) {
$('input', this).on('ifChecked', function () {
var ele = $(this).parents("li").first();
ele.toggleClass("done");
settings.onCheck.call(ele);
});
$('input', this).on('ifUnchecked', function (event) {
$('input', this).on('ifUnchecked', function () {
var ele = $(this).parents("li").first();
ele.toggleClass("done");
settings.onUncheck.call(ele);
});
} else {
$('input', this).on('change', function (event) {
$('input', this).on('change', function () {
var ele = $(this).parents("li").first();
ele.toggleClass("done");
settings.onCheck.call(ele);
if ($('input', ele).is(":checked")) {
settings.onCheck.call(ele);
} else {
settings.onUncheck.call(ele);
}
});
}
});
};
}(jQuery));
}(jQuery));

2
dist/js/app.min.js vendored

File diff suppressed because one or more lines are too long

14
dist/js/demo.js vendored
View file

@ -6,6 +6,8 @@
*/
(function ($, AdminLTE) {
"use strict";
/**
* List of all the available skins
*
@ -256,7 +258,7 @@
if (typeof (Storage) !== "undefined") {
localStorage.setItem(name, val);
} 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") {
return localStorage.getItem(name);
} 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 () {
$(this).attr('disabled', true);
AdminLTE.pushMenu.expandOnHover();
if(!$('body').hasClass('sidebar-collapse'))
if (!$('body').hasClass('sidebar-collapse'))
$("[data-layout='sidebar-collapse']").click();
});
// Reset options
if($('body').hasClass('fixed')) {
if ($('body').hasClass('fixed')) {
$("[data-layout='fixed']").attr('checked', 'checked');
}
if($('body').hasClass('layout-boxed')) {
if ($('body').hasClass('layout-boxed')) {
$("[data-layout='layout-boxed']").attr('checked', 'checked');
}
if($('body').hasClass('sidebar-collapse')) {
if ($('body').hasClass('sidebar-collapse')) {
$("[data-layout='sidebar-collapse']").attr('checked', 'checked');
}

View file

@ -4,10 +4,11 @@
* Description:
* This is a demo file used only for the main dashboard (index.html)
**/
"use strict";
$(function () {
"use strict";
//Make the dashboard widgets sortable Using jquery UI
$(".connectedSortable").sortable({
placeholder: "sort-highlight",
@ -29,21 +30,19 @@ $(function () {
//bootstrap WYSIHTML5 - text editor
$(".textarea").wysihtml5();
$('.daterange').daterangepicker(
{
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
startDate: moment().subtract(29, 'days'),
endDate: moment()
},
function (start, end) {
alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
$('.daterange').daterangepicker({
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
startDate: moment().subtract(29, 'days'),
endDate: moment()
}, function (start, end) {
window.alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
});
/* jQueryKnob */
@ -190,44 +189,21 @@ $(function () {
});
//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();
donut.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'
});
}
line.redraw();
});
/* The todo list plugin */
$(".todo-list").todolist({
onCheck: function (ele) {
console.log("The element has been checked")
window.console.log("The element has been checked");
return ele;
},
onUncheck: function (ele) {
console.log("The element has been unchecked")
window.console.log("The element has been unchecked");
return ele;
}
});

View file

@ -1,6 +1,7 @@
'use strict';
$(function () {
'use strict';
/* ChartJS
* -------
* Here we will create a few charts using ChartJS