use instead of $ to reference jquery
parent
9756f59a2c
commit
e301eaf6e4
|
@ -1,42 +1,42 @@
|
|||
$(document).ready(function() {
|
||||
$j(document).ready(function() {
|
||||
// Enable or disable the Delete button depending on the selected run state
|
||||
$("#runState").change(function() {
|
||||
runstate = $(this).val();
|
||||
$j("#runState").change(function() {
|
||||
runstate = $j(this).val();
|
||||
|
||||
if ( (runstate == 'stop') || (runstate == 'restart') || (runstate == 'start') || (runstate == 'default') ) {
|
||||
$("#btnDelete").prop( "disabled", true );
|
||||
$j("#btnDelete").prop( "disabled", true );
|
||||
} else {
|
||||
$("#btnDelete").prop( "disabled", false );
|
||||
$j("#btnDelete").prop( "disabled", false );
|
||||
}
|
||||
});
|
||||
|
||||
// Enable or disable the Save button when entering a new state
|
||||
$("#newState").keyup(function() {
|
||||
length = $(this).val().length;
|
||||
$j("#newState").keyup(function() {
|
||||
length = $j(this).val().length;
|
||||
console.log(length);
|
||||
if (length < 1) {
|
||||
$("#btnSave").prop( "disabled", true );
|
||||
$j("#btnSave").prop( "disabled", true );
|
||||
} else {
|
||||
$("#btnSave").prop( "disabled", false );
|
||||
$j("#btnSave").prop( "disabled", false );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Delete a state
|
||||
$("#btnDelete").click(function() {
|
||||
StateStuff( 'delete', $("#runState").val( ));
|
||||
$j("#btnDelete").click(function() {
|
||||
StateStuff( 'delete', $j("#runState").val( ));
|
||||
});
|
||||
|
||||
|
||||
// Save a new state
|
||||
$("#btnSave").click(function() {
|
||||
StateStuff( 'save', undefined, $("#newState").val() );
|
||||
$j("#btnSave").click(function() {
|
||||
StateStuff( 'save', undefined, $j("#newState").val() );
|
||||
|
||||
});
|
||||
|
||||
// Change state
|
||||
$("#btnApply").click(function() {
|
||||
StateStuff( 'state', $("#runState").val() );
|
||||
$j("#btnApply").click(function() {
|
||||
StateStuff( 'state', $j("#runState").val() );
|
||||
});
|
||||
|
||||
function StateStuff( action, runState, newState ){
|
||||
|
@ -49,9 +49,9 @@ $(document).ready(function() {
|
|||
};
|
||||
console.log(formData);
|
||||
|
||||
$("#pleasewait").toggleClass("hidden");
|
||||
$j("#pleasewait").toggleClass("hidden");
|
||||
|
||||
$.ajax({
|
||||
$j.ajax({
|
||||
type: 'POST',
|
||||
url: '/index.php',
|
||||
data: formData,
|
||||
|
|
Loading…
Reference in New Issue