|
|
@ -309,9 +309,9 @@ thrimbletrimmerManualLink = function() {
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
thrimbletrimmerResetLink = function() {
|
|
|
|
thrimbletrimmerResetLink = function(force) {
|
|
|
|
var rowId = /id=(.*)(?:&|$)/.exec(document.location.search)[1];
|
|
|
|
var rowId = /id=(.*)(?:&|$)/.exec(document.location.search)[1];
|
|
|
|
if(!confirm(
|
|
|
|
if(force && !confirm(
|
|
|
|
'Are you sure you want to reset this event? ' +
|
|
|
|
'Are you sure you want to reset this event? ' +
|
|
|
|
'This will set the row back to UNEDITED and forget about any video that already may exist. ' +
|
|
|
|
'This will set the row back to UNEDITED and forget about any video that already may exist. ' +
|
|
|
|
'It is intended as a last-ditch command to clear a malfunctioning cutter, ' +
|
|
|
|
'It is intended as a last-ditch command to clear a malfunctioning cutter, ' +
|
|
|
@ -321,11 +321,12 @@ thrimbletrimmerResetLink = function() {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
document.getElementById("ResetButton").disabled = true;
|
|
|
|
document.getElementById("ResetButton").disabled = true;
|
|
|
|
|
|
|
|
document.getElementById("CancelButton").disabled = true;
|
|
|
|
var body = {}
|
|
|
|
var body = {}
|
|
|
|
if (!!user) {
|
|
|
|
if (!!user) {
|
|
|
|
body.token = user.getAuthResponse().id_token;
|
|
|
|
body.token = user.getAuthResponse().id_token;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fetch("/thrimshim/reset/"+rowId, {
|
|
|
|
fetch("/thrimshim/reset/"+rowId + "?force=" + force, {
|
|
|
|
method: 'POST',
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
|
'Accept': 'application/json',
|
|
|
|
'Accept': 'application/json',
|
|
|
@ -339,8 +340,9 @@ thrimbletrimmerResetLink = function() {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
alert(error);
|
|
|
|
alert(error);
|
|
|
|
document.getElementById("ResetButton").disabled = false;
|
|
|
|
document.getElementById("ResetButton").disabled = false;
|
|
|
|
|
|
|
|
document.getElementById("CancelButton").disabled = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
alert("Row has been reset. Reloading...");
|
|
|
|
alert("Row has been " + ((force) ? "reset" : "cancelled") +". Reloading...");
|
|
|
|
setTimeout(() => { window.location.reload(); }, 500);
|
|
|
|
setTimeout(() => { window.location.reload(); }, 500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|