Fix: html bugs

This commit is contained in:
2018-12-16 00:23:26 +09:00
parent 9125e035b6
commit 75e73c82c1
9 changed files with 95 additions and 20 deletions
+57 -11
View File
@@ -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>