diff --git a/src/game/license_timer/loading.js b/src/game/license_timer/loading.js index babc065..02db6e6 100644 --- a/src/game/license_timer/loading.js +++ b/src/game/license_timer/loading.js @@ -8,7 +8,7 @@ var Loading = { // var userID = sessionStorage.getItem("UserID"); // console.log("userID : " + userID); - // game.stage.backgroundColor = '#4d4d4d'; + game.stage.backgroundColor = '#4d4d4d'; // // Progress report // this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic); diff --git a/src/game/menu/main_menu_app.js b/src/game/menu/main_menu_app.js index e3ccff3..86016a7 100644 --- a/src/game/menu/main_menu_app.js +++ b/src/game/menu/main_menu_app.js @@ -1,7 +1,7 @@ ///////////////////////////// // Main game -var CONTENT_ID = "Menu"; +var CONTENT_ID = "MenuApp"; var game = new Phaser.Game( GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y, diff --git a/src/game/menu/main_menu_typing_practice.js b/src/game/menu/main_menu_typing_practice.js index a9e99a2..243c661 100644 --- a/src/game/menu/main_menu_typing_practice.js +++ b/src/game/menu/main_menu_typing_practice.js @@ -1,7 +1,7 @@ ///////////////////////////// // Main game -var CONTENT_ID = "Menu"; +var CONTENT_ID = "MenuApp"; var game = new Phaser.Game( GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y, diff --git a/src/game/menu/main_menu_typing_test.js b/src/game/menu/main_menu_typing_test.js index 0f79e22..cc7ddea 100644 --- a/src/game/menu/main_menu_typing_test.js +++ b/src/game/menu/main_menu_typing_test.js @@ -1,7 +1,7 @@ ///////////////////////////// // Main game -var CONTENT_ID = "Menu"; +var CONTENT_ID = "MenuApp"; var game = new Phaser.Game( GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y, diff --git a/src/web/client/result.html b/src/web/client/result.html index 72bfc4b..c24b8b6 100644 --- a/src/web/client/result.html +++ b/src/web/client/result.html @@ -59,7 +59,7 @@ -
+
앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요.
diff --git a/src/web/client/typing_practice.html b/src/web/client/typing_practice.html index c21d8c1..d1e9dd6 100644 --- a/src/web/client/typing_practice.html +++ b/src/web/client/typing_practice.html @@ -112,7 +112,7 @@ -
+
앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요.
diff --git a/src/web/js/lib/account_validator.js b/src/web/js/lib/account_validator.js index 842b48e..607c67e 100644 --- a/src/web/js/lib/account_validator.js +++ b/src/web/js/lib/account_validator.js @@ -4,9 +4,12 @@ function AccountValidator() { this.patternPlayerID = /^[A-Za-z0-9가-힣-_]{1,8}$/; this.patternPlayerPW = /^[0-9]{2,8}$/; + + this.patternLicenseTimerPW = /^[0-9]{2,8}$/; } -// maestro + +// maestro ID AccountValidator.prototype.isValidMaestroID = function(textID) { if(!this.patternMaestroID.test(textID)) return false; @@ -26,6 +29,7 @@ AccountValidator.prototype.messageForInvalidMaestroID = function(textID) { } +// maestro password AccountValidator.prototype.isValidMaestroPW = function(textPW) { if(!this.patternMaestroPW.test(textPW)) return false; @@ -46,7 +50,7 @@ AccountValidator.prototype.messageForInvalidMaestroPW = function(textPW) { } -// player +// player ID AccountValidator.prototype.isValidPlayerID = function(textID) { if(!this.patternPlayerID.test(textID)) return false; @@ -64,6 +68,7 @@ AccountValidator.prototype.messageForInvalidPlayerID = function(textID) { } +// player password AccountValidator.prototype.isValidPlayerPW = function(textPW) { if(!this.patternPlayerPW.test(textPW)) return false; @@ -81,6 +86,26 @@ AccountValidator.prototype.messageForInvalidPlayerPW = function(textPW) { } +// license timer maestro password +AccountValidator.prototype.isValidLicenseTimerPassword = function(textID) { + if(!this.patternLicenseTimerPW.test(textID)) + return false; + + return true; +} + +AccountValidator.prototype.messageForInvalidLicenseTimerPassword = function(textID) { + if(textID.length < AccountValidator.LICENSE_TIMER_PW_LENGTH_MINIMUM) + return "자격증 타이머의 비밀번호는 " + AccountValidator.LICENSE_TIMER_PW_LENGTH_MINIMUM + "글자 이상이어야 합니다."; + else if(textID.length > AccountValidator.LICENSE_TIMER_PW_LENGTH_MAXIMUM) + return "자격증 타이머의 비밀번호는 " + AccountValidator.LICENSE_TIMER_PW_LENGTH_MAXIMUM + "글자 이하이어야 합니다."; + else + return "자격증 타이머의 비밀번호는 2~8자리 숫자로 입력해 주세요."; +} + + + + AccountValidator.MAESTRO_ID_LENGTH_MINIMUM = 4; AccountValidator.MAESTRO_ID_LENGTH_MAXIMUM = 20; @@ -92,4 +117,7 @@ AccountValidator.PLAYER_ID_LENGTH_MINIMUM = 1; AccountValidator.PLAYER_ID_LENGTH_MAXIMUM = 8; AccountValidator.PLAYER_PW_LENGTH_MINIMUM = 2; -AccountValidator.PLAYER_PW_LENGTH_MAXIMUM = 8; \ No newline at end of file +AccountValidator.PLAYER_PW_LENGTH_MAXIMUM = 8; + +AccountValidator.LICENSE_TIMER_PW_LENGTH_MINIMUM = 2; +AccountValidator.LICENSE_TIMER_PW_LENGTH_MAXIMUM = 8; \ No newline at end of file diff --git a/src/web/module/maestro_section_timer.html b/src/web/module/maestro_section_timer.html index 46fb077..c7554b2 100644 --- a/src/web/module/maestro_section_timer.html +++ b/src/web/module/maestro_section_timer.html @@ -2,28 +2,74 @@ $(document).ready(function() { - // load maestro timer password and show it - $("#timer_short_url").html( "자격증 타이머 앱 바로 실행 URL :
" + "http://www.chocomae.com/timer/" + maestroInfo.maestroName ); + + $("#entercode").keydown(function(key) { + if(key.keyCode == 13) { + editPassword(); + } + }); + + // load maestro timer password and show it + sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); + "./../server/license_timer/get_license_maestro_password.php", + "MaestroID=" + maestroID, + + (function(jsonData) { + // showErrorMessage(playerName + " : 학생 데이터가 추가되었습니다", "success"); + $("#password").val(jsonData.maestroPassword); + }), + + (function(errorMessage, errorCode) { + showErrorMessage(errorMessage, "error"); + }) + + ); + }); +function editPassword() { + var password = $("#password").val(); -function onErrorPlayerName(message) { - showErrorMessage(message, "error"); + if(password.length === 0) { + onErrorPassword("자격증 타이머의 비밀번호를 입력하세요."); + return; + } - $("#player_name").select(); - $("#player_name").focus(); + if(!accountValidator.isValidLicenseTimerPassword(password)) { + // console.log("Error - playerName : " + playerName); + onErrorPassword(accountValidator.messageForInvalidLicenseTimerPassword(password)); + return; + } + + sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); + "./../server/license_timer/update_license_maestro_password.php", + "MaestroID=" + maestroID + "&Password=" + password, + + (function(jsonData) { + console.log(jsonData); + showErrorMessage("자격증 타이머 비밀번호가 " + jsonData.maestroPassword + "로 변경되었습니다", "success"); + addPlayerListManager.updateAddPlayerListPage(1); + + onChangePlayerCount(); + }), + + (function(errorMessage, errorCode) { + showErrorMessage(errorMessage, "error"); + }) + + ); } -function onErrorPlayerPW(message) { +function onErrorPassword(message) { showErrorMessage(message, "error"); - $("#entercode").select(); - $("#entercode").focus(); + $("#password").select(); + $("#password").focus(); } @@ -55,9 +101,9 @@ function onErrorPlayerPW(message) {
- +
- + 2~8자리의 숫자
diff --git a/src/web/server/license_timer/update_license_maestro_password.php b/src/web/server/license_timer/update_license_maestro_password.php index 2c99950..7e7acea 100644 --- a/src/web/server/license_timer/update_license_maestro_password.php +++ b/src/web/server/license_timer/update_license_maestro_password.php @@ -12,6 +12,7 @@ include "./../setup/connect_db.php"; update_maestro_password($maestro_id, $password); +set_data("maestroPassword", $password); send_result_success(); exit;