From 7f345404a79e6e0f25bafa6f25c8ba1edf6aef73 Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 24 Apr 2016 22:23:04 +0200 Subject: Add JS debitAccount() helper --- js/craftmine.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/craftmine.js b/js/craftmine.js index bbb1074..46c726a 100644 --- a/js/craftmine.js +++ b/js/craftmine.js @@ -24,6 +24,11 @@ function updateData() { } } +function debitAccount(amount) { + data.gold -= amount; + updateData("gold"); +} + function withdrawMine() { sendRequest("craftmine.php", "op=withdrawMine&amount="+data.mine, function(xhr) { var gold = parseInt(xhr.responseText); // Server's response is a string -- cgit v1.2.3-70-g09d2