Browse Source

Added confirmation popup.

master
Block Tester 11 years ago
parent
commit
beb80b6606
  1. 33
      twister_network.js

33
twister_network.js

@ -224,21 +224,24 @@ function setSpamMsg() { @@ -224,21 +224,24 @@ function setSpamMsg() {
}
function exitDaemon() {
$( ".terminate-daemon").text("Exiting...");
$( ".terminate-daemon").addClass("disabled");
$.MAL.disableButton( $( ".terminate-daemon") );
twisterRpc("stop", undefined,
function(args, ret) {
console.log("daemon exiting");
setTimeout(function _reload_after_exit() {
window.location.href = '/abort.html';
}, 2000);
}, {},
function(args, ret) {
console.log("error while exiting daemon");
}, {});
if (confirm('Are you sure you want to exit the daemon?\nThe Twister client will stop working.')) {
$( ".terminate-daemon").text("Exiting...");
$( ".terminate-daemon").addClass("disabled");
$.MAL.disableButton( $( ".terminate-daemon") );
twisterRpc("stop", undefined,
function(args, ret) {
console.log("daemon exiting");
setTimeout(function _reload_after_exit() {
window.location.href = '/abort.html';
}, 2000);
}, {},
function(args, ret) {
console.log("error while exiting daemon");
}, {});
}
}
// handlers common to both desktop and mobile

Loading…
Cancel
Save