From 49fd613dfcb462234203f4f9b1b3313130c6ab85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 6 Jul 2018 08:41:47 +0900 Subject: [PATCH] Fix: loadMaestroID, saveMaestroID --- src/web/admin/activate_stage.html | 56 ----------------------- src/web/admin/add_user.html | 23 ---------- src/web/js/maestro_main.js | 9 +--- src/web/js/main.js | 37 +++++++++++++++ src/web/maestro/login.html | 1 + src/web/maestro/main_menu.html | 1 + src/web/maestro/register.html | 8 +--- src/web/main/faq.html | 8 +--- src/web/main/index.html | 11 +---- src/web/module/header.html | 3 +- src/web/module/home_section.html | 15 +++++- src/web/module/maestro_header.html | 15 +----- src/web/module/maestro_section_login.html | 3 +- 13 files changed, 62 insertions(+), 128 deletions(-) delete mode 100644 src/web/admin/activate_stage.html delete mode 100644 src/web/admin/add_user.html create mode 100644 src/web/js/main.js diff --git a/src/web/admin/activate_stage.html b/src/web/admin/activate_stage.html deleted file mode 100644 index 8232f01..0000000 --- a/src/web/admin/activate_stage.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - hello phaser! - - - - - - - - -
- 전체 선택
- -

-
- 기본자리
- 왼손 윗글쇠
- 검지 글쇠
- 오른손 윗글쇠
- 왼손 밑글쇠
- 오른손 밑글쇠
- 쌍자음
- 쌍모음
- 짧은 글
- 긴 글
- -

-
- 기본자리
- 왼손 윗글쇠
- 검지 글쇠
- 오른손 윗글쇠
- 왼손 밑글쇠
- 오른손 밑글쇠
- 짧은 글
- 긴 글
- -

- -
- - - \ No newline at end of file diff --git a/src/web/admin/add_user.html b/src/web/admin/add_user.html deleted file mode 100644 index 249b08a..0000000 --- a/src/web/admin/add_user.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - hello phaser! - - - - -
- 이름 :
- 생년월일 :
- -
- -

- -
- -
- - - \ No newline at end of file diff --git a/src/web/js/maestro_main.js b/src/web/js/maestro_main.js index fb04cf2..86cc221 100644 --- a/src/web/js/maestro_main.js +++ b/src/web/js/maestro_main.js @@ -1,17 +1,10 @@ -let maestroID = -1; - -let addPlayerListManager; +let addPlayerListManager; let searchPlayerListManager; let mouseAppList; let typingAppList; -$(document).ready(function() { - maestroID = sessionStorage.getItem("maestroID"); - console.log("maestroID : " + maestroID); -}); - function tabClicked(tabNo) { // hide and show tab for(let i = 0; i < 4; i++) { diff --git a/src/web/js/main.js b/src/web/js/main.js new file mode 100644 index 0000000..530790c --- /dev/null +++ b/src/web/js/main.js @@ -0,0 +1,37 @@ +let maestroID = -1; + +$(document).ready(function() { + loadMaestroID(); +}); + + +function loadMaestroID() { + maestroID = sessionStorage.getItem("maestroID"); + if(maestroID === null) { + maestroID = -1; + sessionStorage.setItem("maestroID", maestroID); + } + maestroID = Number(maestroID); + console.log("loaded maestroID : " + maestroID); +} + +function saveMaestroID() { + sessionStorage.setItem("maestroID", maestroID); + console.log("saved maestroID : " + maestroID); +} + +function goHome() { + if(maestroID === -1) { + location.href = "./../main/index.html"; + } else { + location.href = "./../maestro/main_menu.html"; + } +} + +function logout() { + sessionStorage.clear(); + maestroID = -1; + sessionStorage.setItem("maestroID", maestroID); + location.href = './../main/index.html'; +} + diff --git a/src/web/maestro/login.html b/src/web/maestro/login.html index c664b40..330fc07 100644 --- a/src/web/maestro/login.html +++ b/src/web/maestro/login.html @@ -9,6 +9,7 @@ + + diff --git a/src/web/maestro/register.html b/src/web/maestro/register.html index d9195a4..29c3855 100644 --- a/src/web/maestro/register.html +++ b/src/web/maestro/register.html @@ -9,18 +9,12 @@ + diff --git a/src/web/main/faq.html b/src/web/main/faq.html index d4375f5..148592c 100644 --- a/src/web/main/faq.html +++ b/src/web/main/faq.html @@ -9,18 +9,12 @@ + diff --git a/src/web/main/index.html b/src/web/main/index.html index 7c839ac..7fe16a7 100644 --- a/src/web/main/index.html +++ b/src/web/main/index.html @@ -9,21 +9,12 @@ + diff --git a/src/web/module/header.html b/src/web/module/header.html index 40b04b0..b6fd974 100644 --- a/src/web/module/header.html +++ b/src/web/module/header.html @@ -21,12 +21,11 @@ -
- 마우스 타자
연습 홈
+ 마우스 타자
연습 홈
diff --git a/src/web/module/home_section.html b/src/web/module/home_section.html index 3f75bb6..3d86d0c 100644 --- a/src/web/module/home_section.html +++ b/src/web/module/home_section.html @@ -12,6 +12,19 @@ + + + +
@@ -34,7 +47,7 @@
    diff --git a/src/web/module/maestro_header.html b/src/web/module/maestro_header.html index 84ccb9d..44d9994 100644 --- a/src/web/module/maestro_header.html +++ b/src/web/module/maestro_header.html @@ -21,22 +21,11 @@ - - - -
    - 마우스 타자
    연습 홈
    + 마우스 타자
    연습 홈
    @@ -44,7 +33,7 @@ function logout() {
    • - 마에스트로
      앱 실행
      + 마에스트로
      전용 앱 실행
    • diff --git a/src/web/module/maestro_section_login.html b/src/web/module/maestro_section_login.html index 123b9a4..0dfb64b 100644 --- a/src/web/module/maestro_section_login.html +++ b/src/web/module/maestro_section_login.html @@ -32,7 +32,8 @@ function login() { // console.log(replyJSON["MaestroID"]); if(replyJSON !== null && replyJSON["MaestroID"] !== undefined && replyJSON["MaestroID"] !== null) { - sessionStorage.setItem("maestroID", replyJSON["MaestroID"]); + maestroID = replyJSON["MaestroID"]; + sessionStorage.setItem("maestroID", maestroID); location.href = './../maestro/main_menu.html'; } else { $("#error_message").val(replyJSON["ERROR"]);