Fix: go home button

This commit is contained in:
2018-07-12 14:54:45 +09:00
parent a0e0702370
commit a549a63491
10 changed files with 174 additions and 91 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
</li>
<li>
<span class="col">
<a href="./../maestro/login.html" id="login_maestro" class="btn btn-sea">마에스트로 계정<br/>로그인</a>
<a href="./../main/login.html" id="login_maestro" class="btn btn-sea">마에스트로 계정<br/>로그인</a>
</span>
</li>
</ul>
+19 -36
View File
@@ -15,40 +15,14 @@
<script>
function loadMaestroTestAccountInfo() {
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/maestro_test_account.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send();
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
// console.log(xhr.responseText);
// console.log(xhr.responseText.length);
if(xhr.responseText.length === 0 || xhr.responseText === null) {
console.log("no data from server");
return;
}
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/maestro/maestro_test_account.php",
"",
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
if(replyJSON === null) {
console.log("no data from server");
return;
}
if(replyJSON["ERROR"] !== undefined || replyJSON["RESULT"] === undefined) {
console.log(replyJSON["ERROR"]);
return;
}
if(replyJSON["RESULT"] === "fail") {
console.log(replyJSON["RESULT"]);
return;
}
let maestroID = replyJSON["maestroID"];
let playerID = replyJSON["playerID"];
let playerName = replyJSON["playerName"];
(jsonData) => {
let maestroID = jsonData["maestroID"];
let playerID = jsonData["playerID"];
let playerName = jsonData["playerName"];
console.log("maestroID : " + maestroID);
console.log("playerID : " + playerID);
@@ -57,13 +31,22 @@ function loadMaestroTestAccountInfo() {
sessionStorage.setItem("maestroID", maestroID);
sessionStorage.setItem("playerID", playerID);
sessionStorage.setItem("playerName", playerName);
},
(errorMessage) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
}
);
let xhr = new XMLHttpRequest(); //new로 생성.
}
function playFree() {
loadMaestroTestAccountInfo();
window.open("./../client/menu_app.html", "_blank");
// window.open("./../client/menu_app.html", "_blank");
location.href = "./../client/menu_app.html";
}
function experienceMaestro() {
@@ -116,7 +99,7 @@ function experienceMaestro() {
</ul>
<div class="col alignCenter">
<a href="./../maestro/register.html" id="maestro_register" class="btn btn-sea width400">마에스트로<br/>가입</a>
<a href="./../main/register.html" id="maestro_register" class="btn btn-sea width400">마에스트로<br/>가입</a>
</div>
<ul id="register_tip">
+43 -1
View File
@@ -24,6 +24,30 @@
<script type="text/javascript">
function loadMaestroTestAccountInfo() {
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/maestro/maestro_test_player.php",
"maestro_id=" + maestroID,
(jsonData) => {
let playerID = jsonData["playerID"];
let playerName = jsonData["playerName"];
console.log("playerID : " + playerID);
console.log("playerName : " + playerName);
sessionStorage.setItem("playerID", playerID);
sessionStorage.setItem("playerName", playerName);
},
(errorMessage) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/maestro_test_player.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -65,6 +89,7 @@ function loadMaestroTestAccountInfo() {
sessionStorage.setItem("playerName", playerName);
}
}
*/
}
function runMaestroAccountApp() {
@@ -75,7 +100,23 @@ function runMaestroAccountApp() {
function deleteMaestroAllRecords() {
// alert("마에스트로 전용 계정의 모든 플레이 기록이 지워집니다.\n예) 게임 기록, 타자 타수, 순위 등");
if(confirm("마에스트로 전용 계정의 모든 플레이 기록이 지워집니다.\n예) 게임 기록, 타자 타수, 순위 등")) {
let xhr = new XMLHttpRequest(); //new로 생성.
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/maestro/delete_test_player_record.php",
"maestro_id=" + maestroID,
(jsonData) => {
alert("마에스트로 전용 계정의 모든 플레이 기록이 지워졌습니다.");
},
(errorMessage) => {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
/* let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/delete_test_player_record.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID);
@@ -87,6 +128,7 @@ function deleteMaestroAllRecords() {
}
alert("마에스트로 전용 계정의 모든 플레이 기록이 지워졌습니다.");
*/
} else {
}
}