diff options
author | piernov <piernov@piernov.org> | 2016-05-08 13:44:08 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-05-08 13:44:08 +0200 |
commit | 2de30b863b6f78c10a1fed54d229dabea7383b97 (patch) | |
tree | dcf6cf9077234d5130d5339663594442602a8dea /js | |
parent | f52c46918efa0725affc490fd325977516be1870 (diff) | |
parent | 14ee8b1962fe3ce332e0de5fb96ae3f342187f94 (diff) | |
download | candybox-2de30b863b6f78c10a1fed54d229dabea7383b97.tar.gz candybox-2de30b863b6f78c10a1fed54d229dabea7383b97.tar.bz2 candybox-2de30b863b6f78c10a1fed54d229dabea7383b97.tar.xz candybox-2de30b863b6f78c10a1fed54d229dabea7383b97.zip |
Merge branch 'feat/savegame' into piernov
Diffstat (limited to 'js')
-rw-r--r-- | js/savegame.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/savegame.js b/js/savegame.js index c069b5c..98d973b 100644 --- a/js/savegame.js +++ b/js/savegame.js @@ -10,7 +10,6 @@ function listSaves() { tmphtml += "</div>" } - console.log(tmphtml); document.getElementById("listsaves").innerHTML = tmphtml; }); } @@ -18,7 +17,7 @@ function listSaves() { function getCheckedSave() { var radios = document.getElementsByName('saveRadio'); for (var i = 0, length = radios.length; i < length; i++) { - if (radios[i].checked) return radios[i].parentNode.textContent; + if (radios[i].checked) return radios[i].parentNode.parentNode.childNodes.item(1).value; } return -1; } @@ -42,7 +41,9 @@ function deleteSave() { } function saveGame() { - sendRequest("craftmine.php", "op=saveGame"); + sendRequest("craftmine.php", "op=saveGame", function(ret) { + listSaves(); + }); } function downGame() { @@ -60,6 +61,6 @@ function uploadSave() { form.append("savefile", selectedFile.files[0]); sendRequest("upload.php", form, function(ret) { - console.log(ret); + listSaves(); }, true); } |