aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-08 13:44:29 +0200
committerpiernov <piernov@piernov.org>2016-05-08 13:44:29 +0200
commit90e9e78500e09447cc3c26d129348eb3f0d2433d (patch)
treeae732ae51a8f7d1fab6f611b3a7e8ec287c3fae8 /js
parent3795b462a30a1942f5ebac3105e72824acbd1a87 (diff)
parent2de30b863b6f78c10a1fed54d229dabea7383b97 (diff)
downloadcandybox-90e9e78500e09447cc3c26d129348eb3f0d2433d.tar.gz
candybox-90e9e78500e09447cc3c26d129348eb3f0d2433d.tar.bz2
candybox-90e9e78500e09447cc3c26d129348eb3f0d2433d.tar.xz
candybox-90e9e78500e09447cc3c26d129348eb3f0d2433d.zip
Merge branch 'piernov' into alexichi
Diffstat (limited to 'js')
-rw-r--r--js/savegame.js9
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);
}