diff options
-rw-r--r-- | css/craftmine.css | 6 | ||||
-rw-r--r-- | inc/mine.inc | 2 | ||||
-rw-r--r-- | js/craftmine.js | 8 |
3 files changed, 13 insertions, 3 deletions
diff --git a/css/craftmine.css b/css/craftmine.css index a3ab87d..c459baa 100644 --- a/css/craftmine.css +++ b/css/craftmine.css @@ -9,7 +9,13 @@ .tab-pane:target { display: block; } +.list-inline > li { + padding-top: 5px; + padding-bottom: 5px; +} .item-icon { + display:inline-block; + width: 1em; font-size: 3em; font-family: "Symbola"; } diff --git a/inc/mine.inc b/inc/mine.inc index 94a2c66..752fc69 100644 --- a/inc/mine.inc +++ b/inc/mine.inc @@ -1,7 +1,7 @@ <?php function initCraftMine() { - $_SESSION["mine"] = array("mine" => 0, "gold" => 0, "miners" => 0); + $_SESSION["mine"] = array("gold" => 0, "miners" => 0); } function withdrawMine() { diff --git a/js/craftmine.js b/js/craftmine.js index 92fa45a..43c4870 100644 --- a/js/craftmine.js +++ b/js/craftmine.js @@ -11,7 +11,10 @@ function sendRequest(url, params, callback) { xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == "200") { - var data = JSON.parse(xhr.responseText); + var data = ""; + if(xhr.responseText) data = JSON.parse(xhr.responseText); + if(data.info) + showInfo(data.info); if(data.error) { showError(data.error); return; @@ -47,10 +50,11 @@ function withdrawMine() { function initCraftMine() { sendRequest("craftmine.php", "op=getCraftMine", function(ret) { data.gold = parseInt(ret.gold); // Server's response is a string + data.mine = 0; // Reset mine if(ret.shop) displayShop(ret.shop); displayInventory(ret.inventory); data.miners = parseInt(ret.miners); - updateData("gold","miners"); + updateData("gold", "mine", "miners"); }) } |