Fix: ES6 -> ES5 (imcompleted)

This commit is contained in:
2018-09-14 11:15:24 +09:00
parent bccee696d4
commit 1a2d9e6800
15 changed files with 832 additions and 819 deletions
+31 -35
View File
@@ -16,7 +16,7 @@ class Start {
// top ui
let screenTopUI = new ScreenTopUI();
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( function() {
if(isTypingPracticeStage())
location.href = '../../web/client/menu_typing_practice.html';
@@ -45,7 +45,7 @@ class Start {
// bottom ui
let screenBottomUI = new ScreenBottomUI();
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftText("오늘의 최고 기록 : ");
screenBottomUI.printCenterText(sessionStorageManager.playingAppKoreanName);
screenBottomUI.printRightText(sessionStorageManager.playerName);
@@ -54,38 +54,34 @@ class Start {
sessionStorageManager.maestroID,
sessionStorageManager.playerID,
sessionStorageManager.playingAppID,
function(replyJSON) {
(function(replyJSON) {
sessionStorageManager.bestRecord = Number(replyJSON["BestRecord"]);
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
},
function(replyJSON) { // no data
}).bind(this),
(function(replyJSON) { // no data
sessionStorageManager.bestRecord = 0;
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
}
}).bind(this)
);
}
loadHowToPlay(appID) {
let self = this;
this.dbConnectManager.requestHowToPlay(
sessionStorageManager.playingAppID, // space_invaders app ID
function(jsonData) {
let howToPlayText = jsonData["HowToPlay"].replace(/\\n/g, "\n");
self.howToPlay.printHowToPlay(howToPlayText);
},
function(jsonData) {
self.howToPlay.printHowToPlay("No data");
}
(function(jsonData) {
var howToPlayText = jsonData["HowToPlay"].replace(/\\n/g, "\n");
this.howToPlay.printHowToPlay(howToPlayText);
}).bind(this),
(function(jsonData) {
this.howToPlay.printHowToPlay("No data");
}).bind(this)
);
}
loadChart() {
let self = this;
let today = new Date();
let date = DateUtil.getYYYYMMDD(today);
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
date,
@@ -95,19 +91,19 @@ class Start {
return;
}
let underValue = historyRecordManager.underValueForGraph();
let upperValue = historyRecordManager.upperValueForGraph();
var underValue = historyRecordManager.underValueForGraph();
var upperValue = historyRecordManager.upperValueForGraph();
let minValue = underValue - (upperValue - underValue) / 10;
let maxValue = upperValue;// + (upperValue - underValue) / 10;
var minValue = underValue - (upperValue - underValue) / 10;
var maxValue = upperValue;// + (upperValue - underValue) / 10;
let countRecord = historyRecordManager.count;
for(let i = 0; i < Chart.CHART_COUNT; i++) {
var countRecord = historyRecordManager.count;
for(var i = 0; i < Chart.CHART_COUNT; i++) {
// if(i > 6)
// break;
let historyRecord = historyRecordManager.getAt(i);
self.chart.drawRecordGraph(
var historyRecord = historyRecordManager.getAt(i);
this.chart.drawRecordGraph(
i,
historyRecord === undefined ? "-" : historyRecord.date,
historyRecord === undefined ? "" : historyRecord.bestRecord,
@@ -115,20 +111,20 @@ class Start {
);
}
self.chart.printChartBaseLine();
this.chart.printChartBaseLine();
})
);
}
calcDate(daysBefore) {
let date = new Date();
var date = new Date();
date.setDate(date.getDate() - daysBefore);
return date;
}
printSampleChart() {
let minValue = 0;
let maxValue = 1000;
var minValue = 0;
var maxValue = 1000;
this.chart.drawRecordGraph(0, this.calcDate(1), 980, minValue, maxValue);
this.chart.drawRecordGraph(1, this.calcDate(2), 760, minValue, maxValue);
this.chart.drawRecordGraph(2, this.calcDate(5), 740, minValue, maxValue);
@@ -141,14 +137,14 @@ class Start {
}
makeStartButton() {
let setting = new RoundRectButtonSetting(game.world.centerX, game.world.centerY, 200, 100);
var setting = new RoundRectButtonSetting(game.world.centerX, game.world.centerY, 200, 100);
setting.fontStyle.fontWeight = "bold";
let startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "시작", this.startStage);
var startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "시작", this.startStage);
}
makeRankingButton() {
let setting = new RoundRectButtonSetting(game.world.centerX + 160, game.world.centerY, 60, 60);
var setting = new RoundRectButtonSetting(game.world.centerX + 160, game.world.centerY, 60, 60);
setting.fontStyle = {
font: "18px Arial",
boundsAlignH: "center", // left, center. right
@@ -156,7 +152,7 @@ class Start {
fill: "#fff"
};
let rankingButton = new RoundRectButton(
var rankingButton = new RoundRectButton(
setting, RoundRectButton.NONE_ICON, "순위\n보기",
(function() {
location.href = '../../web/client/ranking.html';