Browse Source

Merge pull request #54 from BlockTester/exit-button

Fixes #17 add 'exit' button
master
miguelfreitas 11 years ago
parent
commit
3a0e983e63
  1. 40
      abort.html
  2. 5
      network.html
  3. 1
      tmobile.html
  4. 22
      twister_network.js

40
abort.html

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Aborting...</title>
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<script src="jquery.min.js"></script>
<script src="jQueryPlugins.js"></script>
<script src="jquery.json-2.4.js"></script>
<script src="jquery.jsonrpcclient.js"></script>
<script src="jquery.storageapi.js"></script>
<script src="mobile_abstract.js"></script>
<script src="twister_io.js"></script>
<script src="twister_user.js"></script>
<script src="twister_formatpost.js"></script>
<script src="twister_following.js"></script>
<script src="twister_newmsgs.js"></script>
<script src="twister_network.js"></script>
<script src="interface_common.js"></script>
<link rel="icon" type="image/png" href="img/twister_mini.png" />
</head>
<body>
<!-- MENU SUPERIOR INIT -->
<nav class="userMenu">
</nav>
<!-- MENU SUPERIOR END -->
<div class="wrapper">
<div class="network singleBlock">
<h2 style="text-align: center"> Daemon exited... </h2>
</div>
</div>
</body>
</html>

5
network.html

@ -83,6 +83,11 @@ @@ -83,6 +83,11 @@
<li>
<label>Client Version: </label>
<span class="version">00.00.00.00</label>
</li>
<li>
<label>Terminate Daemon:</label>
<button class="terminate-daemon">Exit</button>
</li>
</ul>
<h3> Detailed information </h3>

1
tmobile.html

@ -478,6 +478,7 @@ @@ -478,6 +478,7 @@
</div>
<div>&nbsp;</div>
</ul>
<button class="terminate-daemon">Terminate Daemon</button>
<h3> Detailed information </h3>
<ul>

22
twister_network.js

@ -223,6 +223,27 @@ function setSpamMsg() { @@ -223,6 +223,27 @@ function setSpamMsg() {
}, {});
}
function exitDaemon() {
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
function interfaceNetworkHandlers() {
$( ".new-peer-addr" ).keyup( peerKeypress );
@ -231,6 +252,7 @@ function interfaceNetworkHandlers() { @@ -231,6 +252,7 @@ function interfaceNetworkHandlers() {
$( ".add-dns").bind( "click", addDNSClick );
$( "select.genblock").change( setGenerate );
$( ".update-spam-msg").bind( "click", setSpamMsg );
$( ".terminate-daemon").bind( "click", exitDaemon )
}

Loading…
Cancel
Save