mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-23 12:48:39 -05:00
Lint
This commit is contained in:
parent
93565fc014
commit
668502f1df
24
js/admin.js
24
js/admin.js
@ -15,44 +15,44 @@
|
||||
|
||||
$("#new-incident .panel.new .panel-heading i").get(0).className = icons[val];
|
||||
$("#new-incident .panel.new").get(0).className = classes[val] + " new";
|
||||
$('#time_input').val('');
|
||||
$('#end_time').val('');
|
||||
$("#time_input").val("");
|
||||
$("#end_time").val("");
|
||||
});
|
||||
|
||||
$("#new-incident select").trigger("change");
|
||||
|
||||
$("body").on("submit","#new-incident",function(){
|
||||
var time = Date.parse($('#time_input').val());
|
||||
var end_time = Date.parse($('#end_time').val());
|
||||
var time = Date.parse($("#time_input").val());
|
||||
var end_time = Date.parse($("#end_time").val());
|
||||
var type = $("#type").val() || 0;
|
||||
|
||||
if (type == 2 &&(isNaN(time) || isNaN(end_time)))
|
||||
if (parseInt(type) === 2 &&(isNaN(time) || isNaN(end_time)))
|
||||
{
|
||||
if (isNaN(end_time))
|
||||
{
|
||||
$('#time_input').addClass("error");
|
||||
$("#time_input").addClass("error");
|
||||
$.growl.error({ message: "Start time is invalid!" });
|
||||
}
|
||||
|
||||
if (isNaN(end_time))
|
||||
{
|
||||
$('#end_time').addClass("error");
|
||||
$("#end_time").addClass("error");
|
||||
$.growl.error({ message: "End time is invalid!" });
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (type == 2 && time >= end_time)
|
||||
else if (parseInt(type) === 2 && time >= end_time)
|
||||
{
|
||||
$.growl.error({ message: "End time is either the same or earlier than start time!" });
|
||||
$('#time').addClass("error");
|
||||
$('#end_time').addClass("error");
|
||||
$("#time").addClass("error");
|
||||
$("#end_time").addClass("error");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#status-container :checkbox:checked').length == 0)
|
||||
if($("#status-container :checkbox:checked").length === 0)
|
||||
{
|
||||
$.growl.error({ message: "Please check at least one service!" });
|
||||
$('#status-container').addClass("error");
|
||||
$("#status-container").addClass("error");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
36
js/main.js
36
js/main.js
@ -9,22 +9,22 @@ function timeago()
|
||||
|
||||
(function(){
|
||||
timeago();
|
||||
|
||||
$("body").on("click", ".navbar-toggle", function(){
|
||||
$($(this).data("target")).toggleClass("collapse");
|
||||
});
|
||||
|
||||
|
||||
$("body").on("click", ".navbar-toggle", function(){
|
||||
$($(this).data("target")).toggleClass("collapse");
|
||||
});
|
||||
|
||||
var incidents = $('.timeline');
|
||||
$("body").on("click", "#loadmore", function(e){
|
||||
e.preventDefault();
|
||||
var url = $("#loadmore").attr("href") + "&ajax=true";
|
||||
$("#loadmore").remove();
|
||||
|
||||
$.get(url,
|
||||
function(data){
|
||||
incidents.append(data);
|
||||
timeago();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
$("body").on("click", "#loadmore", function(e){
|
||||
e.preventDefault();
|
||||
var url = $("#loadmore").attr("href") + "&ajax=true";
|
||||
$("#loadmore").remove();
|
||||
|
||||
$.get(url,
|
||||
function(data){
|
||||
incidents.append(data);
|
||||
timeago();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user