mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-27 06:38:40 -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 .panel-heading i").get(0).className = icons[val];
|
||||||
$("#new-incident .panel.new").get(0).className = classes[val] + " new";
|
$("#new-incident .panel.new").get(0).className = classes[val] + " new";
|
||||||
$('#time_input').val('');
|
$("#time_input").val("");
|
||||||
$('#end_time').val('');
|
$("#end_time").val("");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#new-incident select").trigger("change");
|
$("#new-incident select").trigger("change");
|
||||||
|
|
||||||
$("body").on("submit","#new-incident",function(){
|
$("body").on("submit","#new-incident",function(){
|
||||||
var time = Date.parse($('#time_input').val());
|
var time = Date.parse($("#time_input").val());
|
||||||
var end_time = Date.parse($('#end_time').val());
|
var end_time = Date.parse($("#end_time").val());
|
||||||
var type = $("#type").val() || 0;
|
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))
|
if (isNaN(end_time))
|
||||||
{
|
{
|
||||||
$('#time_input').addClass("error");
|
$("#time_input").addClass("error");
|
||||||
$.growl.error({ message: "Start time is invalid!" });
|
$.growl.error({ message: "Start time is invalid!" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(end_time))
|
if (isNaN(end_time))
|
||||||
{
|
{
|
||||||
$('#end_time').addClass("error");
|
$("#end_time").addClass("error");
|
||||||
$.growl.error({ message: "End time is invalid!" });
|
$.growl.error({ message: "End time is invalid!" });
|
||||||
}
|
}
|
||||||
return false;
|
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!" });
|
$.growl.error({ message: "End time is either the same or earlier than start time!" });
|
||||||
$('#time').addClass("error");
|
$("#time").addClass("error");
|
||||||
$('#end_time').addClass("error");
|
$("#end_time").addClass("error");
|
||||||
return false;
|
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!" });
|
$.growl.error({ message: "Please check at least one service!" });
|
||||||
$('#status-container').addClass("error");
|
$("#status-container").addClass("error");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -26,5 +26,5 @@ function timeago()
|
|||||||
timeago();
|
timeago();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user