Add: allow edit player's entercode
This commit is contained in:
@@ -91,6 +91,27 @@ DBService.prototype.tddRun = function(command, onSucceededListener, onFailedList
|
||||
xhr.send("command=" + command);
|
||||
}
|
||||
|
||||
|
||||
// allow edit setting for play enter code
|
||||
DBService.prototype.requestAllowEditEnterCode = function(onSucceededListener, onFailedListener) {
|
||||
var xhr = this.makeXhr(
|
||||
"php/menu/allow_edit_entercode.php",
|
||||
(function() { // onreadystatechange
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
var replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
}).bind(this)
|
||||
);
|
||||
xhr.send("maestroID=" + this.maestroID);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// writing
|
||||
DBService.prototype.requestWritingPlayerList = function(onSucceededListener, onFailedListener) {
|
||||
var xhr = this.makeXhr(
|
||||
|
||||
@@ -72,9 +72,10 @@ MainMenu.prototype.fontLoaded = function() {
|
||||
);
|
||||
|
||||
// top UI
|
||||
this.makeButtons();
|
||||
this.backButton = new BackButton(
|
||||
(function() { console.log("back"); }).bind(this)
|
||||
);
|
||||
this.backButton.applyLoadedFont();
|
||||
this.settingButton.applyLoadedFont();
|
||||
|
||||
this.makeAppGroupTab();
|
||||
this.makeLanguageTab();
|
||||
@@ -100,6 +101,8 @@ MainMenu.prototype.fontLoaded = function() {
|
||||
this.activeSavedAppGroupTab();
|
||||
this.activeSavedLanguageTab();
|
||||
// this.loadAppData();
|
||||
|
||||
this.loadAllowEditEnterCode();
|
||||
}
|
||||
|
||||
|
||||
@@ -109,26 +112,14 @@ MainMenu.prototype.back = function() {
|
||||
location.href = '../../web/client/login.html';
|
||||
}
|
||||
|
||||
MainMenu.prototype.loadAllowEditEnterCode = function(screenTopUI) {
|
||||
/*
|
||||
var dbConnectManager = new DBConnectManager();
|
||||
dbConnectManager.requestAllowEditEnterCode(
|
||||
sessionStorageManager.getMaestroID(),
|
||||
|
||||
MainMenu.prototype.loadAllowEditEnterCode = function() {
|
||||
this.dbService.requestAllowEditEnterCode(
|
||||
(function(replyJSON) {
|
||||
if(replyJSON["AllowEditEnterCode"] == "1") {
|
||||
screenTopUI.makeSetupButton( (function() {
|
||||
console.log("setup");
|
||||
location.href = '../../web/client/setup.html';
|
||||
}).bind(this) );
|
||||
}
|
||||
if(parseInt(replyJSON.allowEditEntercode) === 1)
|
||||
this.makeSettingButton();
|
||||
}).bind(this),
|
||||
|
||||
(function(replyJSON) {
|
||||
this.loadFailed(replyJSON);
|
||||
}).bind(this)
|
||||
(function(replyJSON) { console.log(replyJSON); }).bind(this)
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
MainMenu.prototype.loadAppData = function() {
|
||||
@@ -140,9 +131,7 @@ MainMenu.prototype.loadAppData = function() {
|
||||
this.updateAppButtons(replyJSON.appGroup, replyJSON.appData);
|
||||
// this.updateLanguageTab(replyJSON.appGroup);
|
||||
}).bind(this),
|
||||
(function(replyJSON) {
|
||||
console.log(replyJSON);
|
||||
}).bind(this)
|
||||
(function(replyJSON) { console.log(replyJSON); }).bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -420,14 +409,11 @@ MainMenu.prototype.updatePlayAppButtons = function(appData) {
|
||||
}
|
||||
|
||||
|
||||
MainMenu.prototype.makeButtons = function() {
|
||||
this.backButton = new BackButton(
|
||||
(function() { console.log("back"); }).bind(this)
|
||||
);
|
||||
|
||||
MainMenu.prototype.makeSettingButton = function() {
|
||||
this.settingButton = new SettingButton(
|
||||
(function() { console.log("setting"); }).bind(this)
|
||||
(function() { location.href = '../../web/client/setup.html'; }).bind(this)
|
||||
);
|
||||
this.settingButton.applyLoadedFont();
|
||||
}
|
||||
|
||||
MainMenu.prototype.activeSavedAppGroupTab = function() {
|
||||
|
||||
@@ -54,9 +54,8 @@ var Setup = {
|
||||
},
|
||||
|
||||
back: function() {
|
||||
// sessionStorageManager.clear();
|
||||
// location.href = '../../web/main/index.html';
|
||||
location.href = '../../web/client/menu_app.html';
|
||||
// location.href = '../../web/client/menu_app.html';
|
||||
location.href = '../../web/client/main_menu.html';
|
||||
},
|
||||
|
||||
makePrevEnterCodeText: function(x, y) {
|
||||
|
||||
Reference in New Issue
Block a user