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
+44 -19
View File
@@ -53,29 +53,54 @@ var Start = {
// bottom ui
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
this.screenBottomUI = new ScreenBottomUI();
this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
this.screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
this.dbConnectManager.requestAppHighestRecord(
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(),
(function(replyJSON) {
var appHighestRecord = replyJSON["AppHighestRecord"];
sessionStorageManager.setAppHighestRecord(Number(appHighestRecord));
screenBottomUI.printLeftTextWithAppHighestRecord(appHighestRecord);
}).bind(this),
(function(replyJSON) { // no data
sessionStorageManager.setAppHighestRecord(0);
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
}).bind(this)
);
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(
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(),
(function(replyJSON) {
var highestRecord = replyJSON["AppHighestRecord"];
this.onReceiveAppHighestRecord(highestRecord);
}).bind(this),
(function(replyJSON) { // no data
this.onReceiveAppHighestRecord(0);
}).bind(this)
);
}
},
onReceiveAppHighestRecord: function(highestRecord) {
sessionStorageManager.setAppHighestRecord(Number(highestRecord));
this.screenBottomUI.printLeftTextWithAppHighestRecord(highestRecord);
},
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';
else if(isTypingTestApp())
location.href = '../../web/client/menu_typing_test.html';