Files
chocomae/src/web/module/maestro_section_timer.html
T
2018-12-16 00:23:26 +09:00

116 lines
3.1 KiB
HTML

<script type="text/javascript">
$(document).ready(function() {
$("#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();
if(password.length === 0) {
onErrorPassword("자격증 타이머의 비밀번호를 입력하세요.");
return;
}
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 onErrorPassword(message) {
showErrorMessage(message, "error");
$("#password").select();
$("#password").focus();
}
</script>
<div class="row mx-1">
<div class="col-5">
<h5 class="my-3">자격증 타이머</h5>
<!--
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="timer-password">비밀번호</span>
</div>
<input type="text" class="form-control" placeholder="새로운 비밀번호 입력" aria-label="timer password" aria-describedby="submit-password">
<div class="input-group-append">
<button class="btn btn-primary" type="button" id="submit-password" onClick="updatePassword()">수정</button>
</div>
</div>
<small class="form-text text-muted">1~8 글자 / [ 한글,영문,숫자,-,_ ]</small>
-->
<div id="timer_short_url" class="col-sm pr-0 my-auto"></div>
<br/>
<form class="mx-2">
<div class="form-group row">
<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="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>
</div>
</form>
<br/>
<br/>
</div>