183 lines
6.3 KiB
HTML
183 lines
6.3 KiB
HTML
<script type="text/javascript">
|
|
|
|
var maestroInfo = new MaestroInfo();
|
|
var isMaestroInfoLoaded = false;
|
|
|
|
|
|
$(document).ready(function() {
|
|
$("#section_add_player").load("./../module/maestro_section_add_player.html");
|
|
$("#section_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 isExperienceMaestroAccount() {
|
|
var maestroAccountType = maestroInfo.accountType;
|
|
console.log("maestroAccountType : " + maestroAccountType);
|
|
if(maestroAccountType == 101)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
function onLoadSuccessMaestroInfo() {
|
|
$("#maestro_info_id").text(maestroInfo.maestroName + "님, 환영합니다.");
|
|
$("#maestro_info_player_count").val("학생수 : " + maestroInfo.getRegisteredPlayerCount() + " / " + maestroInfo.getMaxPlayerCount());
|
|
|
|
if(maestroInfo.getRegisteredPlayerCount() === maestroInfo.getMaxPlayerCount()) {
|
|
$("#maestro_info_player_count").addClass("text-danger borer-danger");
|
|
} else if(maestroInfo.getRegisteredPlayerCount() + 5 > maestroInfo.getMaxPlayerCount()) {
|
|
$("#maestro_info_player_count").addClass("text-danger");
|
|
}
|
|
|
|
if(isExperienceMaestroAccount() && !isMaestroInfoLoaded) {
|
|
isMaestroInfoLoaded = true;
|
|
$("#experienceMaestroModal").modal();
|
|
}
|
|
}
|
|
|
|
function onLoadFailMaestroInfo(errorMessage, errorCode) {
|
|
console.log("errorMessage : " + errorMessage);
|
|
console.log("errorCode : " + errorCode);
|
|
}
|
|
|
|
function onChangePlayerCount() {
|
|
maestroInfo.loadMaestroInfo(onLoadSuccessMaestroInfo, onLoadFailMaestroInfo);
|
|
}
|
|
|
|
function onClickMaestroUpgrade() {
|
|
// console.log("onClickMaestroUpgrade");
|
|
location.href='./../maestro/upgrade.html';
|
|
}
|
|
|
|
function activateApp(appID) {
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/app/activate_app.php",
|
|
"maestro_id=" + maestroID + "&app_id=" + appID,
|
|
|
|
(function(jsonData) {
|
|
// console.log(jsonData);
|
|
showErrorMessage("[ " + jsonData["koreanName"] + "] 앱이 메뉴에 추가되었습니다. (위의 [마에스트로 앱 실행] 버튼을 눌러 확인해보세요)", "success");
|
|
}),
|
|
|
|
(function(errorMessage, errorCode) {
|
|
showErrorMessage(errorMessage, "error");
|
|
})
|
|
|
|
);
|
|
}
|
|
|
|
function deactivateApp(appID) {
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/app/deactivate_app.php",
|
|
"maestro_id=" + maestroID + "&app_id=" + appID,
|
|
|
|
(function(jsonData) {
|
|
// console.log(jsonData);
|
|
showErrorMessage("[ " + jsonData["koreanName"] + "] 앱이 메뉴에서 삭제되었습니다. (위의 [마에스트로 앱 실행] 버튼을 눌러 확인해보세요)", "danger");
|
|
}),
|
|
|
|
(function(errorMessage, errorCode) {
|
|
showErrorMessage(errorMessage, "error");
|
|
})
|
|
|
|
);
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
<div class="modal fade" id="experienceMaestroModal" tabindex="-1" role="dialog" aria-labelledby="experienceMaestroModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header alert-danger">
|
|
<h5 class="modal-title" id="exerienceMaestroModalLabel">체험 마에스트로 로그인</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
▶ [체험 마에스트로 계정] 데이터 초기화
|
|
<br/>
|
|
- 학생 목록이 샘플 데이터로 초기화되었습니다.<br/>
|
|
- 다른 사람이 "체험 마에스트로" 계정으로 로그인 할 때에도, 모든 데이터가 초기화됩니다.<br/>
|
|
<br/>
|
|
▶ 체험판 [마에스트로 앱] 기능 제한 안내<br/>
|
|
- 타자, 마우스 앱 연습 결과가 서버에 저장되지 않습니다.<br/>
|
|
- 모든 컨텐츠는 20초만 플레이하실 수 있습니다.<br/>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container">
|
|
<div class="row border border-primary rounded py-2 mx-1 my-2">
|
|
<div id="maestro_info_id" class="col my-auto"></div>
|
|
<div id="maestro_url" class="col my-auto"></div>
|
|
|
|
<div class="eyebrow ml-auto mt-0 d-md-flex align-items-center">
|
|
<div class="input-group my-auto">
|
|
<input type="text" id="maestro_info_player_count" class="form-control" value="학생수 :">
|
|
<div class="input-group-append">
|
|
<button class="btn btn-primary px-3 mr-2" type="button" onClick="location.href='./../maestro/upgrade.html';">업그레이드</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="btn btn-primary px-3 mr-3" href="./../maestro/setup.html">계정 정보 수정</a>
|
|
</div>
|
|
|
|
</div> <!-- row border -->
|
|
|
|
<div class="row mx-1">
|
|
<div class="col">
|
|
<div id="message_box"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" id="add-tab" data-toggle="tab" href="#add" role="tab" aria-controls="add" aria-selected="true">학생 목록</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="search-tab" data-toggle="tab" href="#search" role="tab" aria-controls="search" aria-selected="false">학생 검색</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="mouse-tab" data-toggle="tab" href="#mouse" role="tab" aria-controls="mouse" aria-selected="false">마우스 앱 활성화</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="typing-tab" data-toggle="tab" href="#typing" role="tab" aria-controls="typing" aria-selected="false">타자 앱 활성화</a>
|
|
</li>
|
|
</ul> <!-- 탭 -->
|
|
|
|
<div class="tab-content" id="myTabContent">
|
|
|
|
<div class="tab-pane fade show active my-3" id="add" role="tabpanel" aria-labelledby="add-tab">
|
|
<div id="section_add_player"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade my-3" id="search" role="tabpanel" aria-labelledby="search-tab">
|
|
<div id="section_search_player"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade my-3" id="mouse" role="tabpanel" aria-labelledby="mouse-tab">
|
|
<div id="mouse_app_list"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade my-3" id="typing" role="tabpanel" aria-labelledby="typing-tab">
|
|
<div id="typing_app_list"></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> <!-- container --> |