Fix: client menu - show setup button if allow edit entercode is activated
This commit is contained in:
@@ -79,7 +79,7 @@ DBConnectManager.prototype.requestPlayerEnterCode = function(maestroID, playerID
|
|||||||
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID);
|
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBConnectManager.prototype.requestEditPlayerEnterCode = function(maestroID, playerID, enterCode, onSucceededListener, onFailedListener) {
|
DBConnectManager.prototype.updatePlayerEnterCode = function(maestroID, playerID, enterCode, onSucceededListener, onFailedListener) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", this.phpPath + "server/player/edit_entercode.php", true);
|
xhr.open("POST", this.phpPath + "server/player/edit_entercode.php", true);
|
||||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
@@ -96,6 +96,23 @@ DBConnectManager.prototype.requestEditPlayerEnterCode = function(maestroID, play
|
|||||||
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID + "&enter_code=" + enterCode);
|
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID + "&enter_code=" + enterCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBConnectManager.prototype.requestAllowEditEnterCode = function(maestroID, onSucceededListener, onFailedListener) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", this.phpPath + "server/maestro/get_allow_edit_entercode.php", true);
|
||||||
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
|
var replyJSON = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
|
if(replyJSON != null && replyJSON["AllowEditEnterCode"] != null)
|
||||||
|
onSucceededListener(replyJSON);
|
||||||
|
else
|
||||||
|
onFailedListener(replyJSON);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.send("maestro_id=" + maestroID);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DBConnectManager.prototype.requestAppList = function(maestroID, onSucceededListener, onFailedListener) {
|
DBConnectManager.prototype.requestAppList = function(maestroID, onSucceededListener, onFailedListener) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
|||||||
@@ -44,11 +44,8 @@ var MenuApp = {
|
|||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
screenTopUI.makeSetupButton( (function() {
|
|
||||||
console.log("setup");
|
|
||||||
location.href = '../../web/client/setup.html';
|
|
||||||
}).bind(this) );
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
this.loadAllowEditEnterCode(screenTopUI);
|
||||||
|
|
||||||
|
|
||||||
// bottom ui
|
// bottom ui
|
||||||
@@ -77,6 +74,26 @@ var MenuApp = {
|
|||||||
location.href = '../../web/client/login.html';
|
location.href = '../../web/client/login.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadAllowEditEnterCode: function(screenTopUI) {
|
||||||
|
var dbConnectManager = new DBConnectManager();
|
||||||
|
dbConnectManager.requestAllowEditEnterCode(
|
||||||
|
sessionStorageManager.getMaestroID(),
|
||||||
|
|
||||||
|
(function(replyJSON) {
|
||||||
|
if(replyJSON["AllowEditEnterCode"] == "1") {
|
||||||
|
screenTopUI.makeSetupButton( (function() {
|
||||||
|
console.log("setup");
|
||||||
|
location.href = '../../web/client/setup.html';
|
||||||
|
}).bind(this) );
|
||||||
|
}
|
||||||
|
}).bind(this),
|
||||||
|
|
||||||
|
(function(replyJSON) {
|
||||||
|
this.loadFailed(replyJSON);
|
||||||
|
}).bind(this)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
loadAppData: function() {
|
loadAppData: function() {
|
||||||
var dbConnectManager = new DBConnectManager();
|
var dbConnectManager = new DBConnectManager();
|
||||||
dbConnectManager.requestMenuAppList(
|
dbConnectManager.requestMenuAppList(
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ var Setup = {
|
|||||||
|
|
||||||
this.showInfoText("입장번호를 바꾸겠습니다.");
|
this.showInfoText("입장번호를 바꾸겠습니다.");
|
||||||
var dbConnectManager = new DBConnectManager();
|
var dbConnectManager = new DBConnectManager();
|
||||||
dbConnectManager.requestEditPlayerEnterCode(
|
dbConnectManager.updateEditPlayerEnterCode(
|
||||||
sessionStorageManager.getMaestroID(),
|
sessionStorageManager.getMaestroID(),
|
||||||
sessionStorageManager.getPlayerID(),
|
sessionStorageManager.getPlayerID(),
|
||||||
newEnterCode,
|
newEnterCode,
|
||||||
|
|||||||
Reference in New Issue
Block a user