Add: start screen - chart, highest record

This commit is contained in:
2019-07-18 18:35:28 +09:00
parent f79040fed4
commit d788d3e7d0
2 changed files with 47 additions and 26 deletions
+35 -10
View File
@@ -53,29 +53,54 @@ var Start = {
// bottom ui // bottom ui
var screenBottomUI = new ScreenBottomUI(); this.screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord()); this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName()); this.screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName()); this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
if(isTypingExamApp()) {
this.dbService.getTypingExamHighestRecord(
sessionStorageManager.getWritingID(),
(function(replyJSON) {
console.log(replyJSON);
var highestRecordData = replyJSON["highestRecordData"];
var highestRecord = highestRecordData["highestRecord"];
this.onReceiveAppHighestRecord(highestRecord);
}).bind(this),
(function(replyJSON) { // no data
this.onReceiveAppHighestRecord(0);
}).bind(this)
);
} else {
this.dbConnectManager.requestAppHighestRecord( this.dbConnectManager.requestAppHighestRecord(
sessionStorageManager.getMaestroID(), sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(), sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(), sessionStorageManager.getPlayingAppID(),
(function(replyJSON) { (function(replyJSON) {
var appHighestRecord = replyJSON["AppHighestRecord"]; var highestRecord = replyJSON["AppHighestRecord"];
sessionStorageManager.setAppHighestRecord(Number(appHighestRecord)); this.onReceiveAppHighestRecord(highestRecord);
screenBottomUI.printLeftTextWithAppHighestRecord(appHighestRecord);
}).bind(this), }).bind(this),
(function(replyJSON) { // no data (function(replyJSON) { // no data
sessionStorageManager.setAppHighestRecord(0); this.onReceiveAppHighestRecord(0);
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
}).bind(this) }).bind(this)
); );
}
}, },
onReceiveAppHighestRecord: function(highestRecord) {
sessionStorageManager.setAppHighestRecord(Number(highestRecord));
this.screenBottomUI.printLeftTextWithAppHighestRecord(highestRecord);
},
back: function() { back: function() {
if(isTypingPracticeApp()) if(isTypingExamApp())
location.href = '../../web/client/menu_typing_exam.html';
else if(isTypingPracticeApp())
location.href = '../../web/client/menu_typing_practice.html'; location.href = '../../web/client/menu_typing_practice.html';
else if(isTypingTestApp()) else if(isTypingTestApp())
location.href = '../../web/client/menu_typing_test.html'; location.href = '../../web/client/menu_typing_test.html';
+3 -7
View File
@@ -1,7 +1,6 @@
var TypingExamination = { var TypingExamination = {
create: function() { create: function() {
// for developing // for developing
// sessionStorageManager.setMaestroName("삼화초"); // sessionStorageManager.setMaestroName("삼화초");
// sessionStorageManager.setMaestroID(3); // sessionStorageManager.setMaestroID(3);
@@ -14,9 +13,6 @@ var TypingExamination = {
// sessionStorageManager.setPlayingAppKoreanName("타자 검정"); // sessionStorageManager.setPlayingAppKoreanName("타자 검정");
// sessionStorageManager.setRecord(0); // sessionStorageManager.setRecord(0);
// sessionStorageManager.setAppHighestRecord(100.123); // sessionStorageManager.setAppHighestRecord(100.123);
sessionStorageManager.setPlayingAppName("typing_exam");
sessionStorageManager.setPlayingAppKoreanName("타자 검정");
this.dbService = new DBService(); this.dbService = new DBService();
this.dbService.setMaestroID(sessionStorageManager.getMaestroID()); this.dbService.setMaestroID(sessionStorageManager.getMaestroID());
@@ -220,11 +216,11 @@ var TypingExamination = {
this.inputTextContent.canvasInput.placeHolder(""); this.inputTextContent.canvasInput.placeHolder("");
// inputTextContent.canvasInput._onkeydown = this.checkInputText; // inputTextContent.canvasInput._onkeydown = this.checkInputText;
// inputTextContent.canvasInput._onkeyup = function() { // inputTextContent.canvasInput._onkeyup = function() {
this.inputTextContent.canvasInput._onkeyup = function() { this.inputTextContent.canvasInput._onkeyup = (function() {
self.checkTypingContents(event); this.checkTypingContents(event);
// warning // warning
// : checkTypingContents is called onkeyup and onkeydown // : checkTypingContents is called onkeyup and onkeydown
} }).bind(this);