Fix: html bugs
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="Start" style="text-align:center;"></div>
|
||||
<div id="Result" style="text-align:center;"></div>
|
||||
<div style="margin-top: 20px; text-align:center;">
|
||||
앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( <span class="oi oi-reload" title="icon reload" aria-hidden="true"></span> , 단축키 : Ctrl + R)을 눌러주세요.
|
||||
</div>
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="Typing Test" style="text-align:center;"></div>
|
||||
<div id="Typing Practice" style="text-align:center;"></div>
|
||||
<div style="margin-top: 20px; text-align:center;">
|
||||
앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( <span class="oi oi-reload" title="icon reload" aria-hidden="true"></span> , 단축키 : Ctrl + R)을 눌러주세요.
|
||||
</div>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -93,3 +118,6 @@ AccountValidator.PLAYER_ID_LENGTH_MAXIMUM = 8;
|
||||
|
||||
AccountValidator.PLAYER_PW_LENGTH_MINIMUM = 2;
|
||||
AccountValidator.PLAYER_PW_LENGTH_MAXIMUM = 8;
|
||||
|
||||
AccountValidator.LICENSE_TIMER_PW_LENGTH_MINIMUM = 2;
|
||||
AccountValidator.LICENSE_TIMER_PW_LENGTH_MAXIMUM = 8;
|
||||
@@ -2,28 +2,74 @@
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// load maestro timer password and show it
|
||||
|
||||
$("#timer_short_url").html(
|
||||
"<span class='text-secondary'>자격증 타이머 앱 <span class='font-weight-bold'>바로 실행 URL</span> :</span><br/>"
|
||||
+ "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) {
|
||||
<form class="mx-2">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="player_name" class="col-sm-3 col-form-label">비밀번호</label>
|
||||
<label for="password" class="col-sm-3 col-form-label">비밀번호</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control col-sm-9" id="player_name" placeholder="새로운 비밀번호 입력">
|
||||
<input type="text" class="form-control col-sm-9" id="password" placeholder="새로운 비밀번호 입력">
|
||||
<small class="form-text text-muted">2~8자리의 숫자</small>
|
||||
<button type="button" class="col-sm-7 btn btn-primary btn-lg mt-3" onClick="editPassword()">수정</button>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ include "./../setup/connect_db.php";
|
||||
|
||||
update_maestro_password($maestro_id, $password);
|
||||
|
||||
set_data("maestroPassword", $password);
|
||||
send_result_success();
|
||||
exit;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user