Add: maestro_info
This commit is contained in:
@@ -15,17 +15,6 @@ function addPlayer() {
|
||||
let playerName = $("#add_player_name").val();
|
||||
let enterCode = $("#add_player_enter_code").val();
|
||||
|
||||
if(!accountValidator.isValidPlayerID(playerName)) {
|
||||
console.log("Error - playerName : " + playerName);
|
||||
onErrorPlayerID(accountValidator.messageForInvalidPlayerID(playerName));
|
||||
return;
|
||||
} else if(!accountValidator.isValidPlayerPW(enterCode)) {
|
||||
console.log("Error - enterCode : " + enterCode);
|
||||
onErrorPlayerPW(accountValidator.messageForInvalidPlayerPW(enterCode));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if(playerName.length === 0) {
|
||||
// $("#add_player_notice").val("학생 이름을 입력하세요.");
|
||||
$("#error_message").text("학생 이름을 입력하세요.");
|
||||
@@ -37,7 +26,22 @@ function addPlayer() {
|
||||
$("#add_player_enter_code").focus();
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if(maestroInfo.getRegisteredPlayerCount() >= maestroInfo.getMaxPlayerCount()) {
|
||||
$("#error_message").text("학생을 더 이상 추가할 수 없습니다. (더 많은 학생수로 업그레이드 하세요)");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!accountValidator.isValidPlayerID(playerName)) {
|
||||
console.log("Error - playerName : " + playerName);
|
||||
onErrorPlayerID(accountValidator.messageForInvalidPlayerID(playerName));
|
||||
return;
|
||||
} else if(!accountValidator.isValidPlayerPW(enterCode)) {
|
||||
console.log("Error - enterCode : " + enterCode);
|
||||
onErrorPlayerPW(accountValidator.messageForInvalidPlayerPW(enterCode));
|
||||
return;
|
||||
}
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/player/add_player.php",
|
||||
@@ -45,6 +49,8 @@ function addPlayer() {
|
||||
|
||||
(jsonData) => {
|
||||
addPlayerListManager.updateAddPlayerListPage(1);
|
||||
|
||||
onChangePlayerCount();
|
||||
},
|
||||
|
||||
(errorMessage, errorCode) => {
|
||||
|
||||
@@ -1,17 +1,47 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
let maestroInfo = new MaestroInfo();
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#section_add_player").load("./../module/maestro_section_add_player.html");
|
||||
$("#search_player").load("./../module/maestro_section_search.html");
|
||||
$("#mouse_app_list").load("./../module/maestro_section_mouse_app.html");
|
||||
$("#typing_app_list").load("./../module/maestro_section_typing_app.html");
|
||||
|
||||
maestroInfo.loadMaestroInfo(onLoadSuccessMaestroInfo, onLoadFailMaestroInfo);
|
||||
});
|
||||
|
||||
function onLoadSuccessMaestroInfo() {
|
||||
$("#maestro_info_id").text(maestroInfo.maestroName + "님, 환영합니다.");
|
||||
$("#maestro_info_player_count").text("학생수 : " + maestroInfo.getRegisteredPlayerCount() + " / " + maestroInfo.getMaxPlayerCount());
|
||||
}
|
||||
|
||||
function onLoadFailMaestroInfo(errorMessage, errorCode) {
|
||||
console.log("errorMessage : " + errorMessage);
|
||||
console.log("errorCode : " + errorCode);
|
||||
}
|
||||
|
||||
function onChangePlayerCount() {
|
||||
maestroInfo.loadMaestroInfo(onLoadSuccessMaestroInfo, onLoadFailMaestroInfo);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div id="maestro_info">
|
||||
<span id="maestro_info_id">마에스트로 계정 이름
|
||||
</span>
|
||||
<span id="maestro_info_player_count">학생수 ? / ?
|
||||
</span>
|
||||
<span id="maestro_info_upgrade">업그레이드 버튼
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="page-tabs">
|
||||
<ul>
|
||||
<li class="widthQuarter activated" onClick="tabClicked(1)">학생 목록</li>
|
||||
|
||||
Reference in New Issue
Block a user