Fix: load how to play from server

This commit is contained in:
2018-06-05 14:17:58 +09:00
parent c50015a991
commit 1bcce524e3
18 changed files with 128 additions and 139 deletions
+21 -2
View File
@@ -102,7 +102,7 @@ class DBConnectManager {
requestMenuAppList(maestroID, onSucceededListener, onFailedListener) {
let xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/app/menu_app_list.php", true);
xhr.open("POST", this.phpPath + "server/app/menu_active_app_list.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
@@ -119,7 +119,7 @@ class DBConnectManager {
requestTypingPracticeAppList(maestroID, onSucceededListener, onFailedListener) {
let xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/app/active_typing_practice_app.php", true);
xhr.open("POST", this.phpPath + "server/app/active_typing_practice_app_list.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
@@ -335,6 +335,25 @@ class DBConnectManager {
return xhr;
}
requestHowToPlay(appID, onSucceededListener, onFailedListener) {
let xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/app/how_to_play.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
let replyJSON = JSON.parse(xhr.responseText);
console.log(replyJSON);
console.log(replyJSON["HowToPlay"]);
if(replyJSON != null && replyJSON["HowToPlay"] != null)
onSucceededListener(replyJSON);
else
onFailedListener(replyJSON);
}
};
xhr.send("AppID=" + appID);
}
loadTempPlayerHistory(historyRecordManager) {
+8
View File
@@ -51,6 +51,14 @@ class SessionStorageManager {
return sessionStorage.getItem("playingAppName");
}
// playing app korean name
set playingAppKoreanName(value) {
sessionStorage.setItem("playingAppKoreanName", value);
}
get playingAppKoreanName() {
return sessionStorage.getItem("playingAppKoreanName");
}
// record
set record(value) {
sessionStorage.setItem("record", value);