Fix: () => { } -> function() { }

This commit is contained in:
2018-09-13 15:13:14 +09:00
parent dad83205cd
commit e8c7304dba
22 changed files with 108 additions and 101 deletions
+2 -2
View File
@@ -29,13 +29,13 @@ class FullscreenButton extends RoundRectButton {
super(
setting,
RoundRectButton.NONE_ICON, RoundRectButton.NONE_BUTTON_TEXT,
() => {
(function() {
if(game.scale.isFullScreen) {
game.scale.stopFullScreen();
} else {
game.scale.startFullScreen();
}
}
})
);
let icon_fullscreen = game.add.sprite(0, 0, 'icon_fullscreen');
+3 -2
View File
@@ -4,12 +4,13 @@ class HeartGauge {
this.heartManager = heartManager;
this.hearts = [];
let self = this;
this.heartManager.addOnChangeCountListener(
() => { this.onChangeCountListener(); }
function() { self.onChangeCountListener(); }
);
this.heartManager.addOnChangeMaxCountListener(
() => { this.onChangeMaxCountListener(); }
function() { self.onChangeMaxCountListener(); }
);
let startPosX = GAME_SCREEN_SIZE.x - HeartGauge.GAP * 4;
+1 -1
View File
@@ -17,7 +17,7 @@ class Login {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.clear();
location.href = '../../web/main/index.html';
});
+9 -9
View File
@@ -36,7 +36,7 @@ class MenuApp {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.clear();
location.href = '../../web/client/login.html';
});
@@ -105,12 +105,12 @@ class MenuApp {
posX, posY, GameAppButton.TYPE_MOUSE_APP,
RoundRectButton.NONE_ICON, // "icon_fullscreen",
app.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = app.AppID;
sessionStorageManager.playingAppName = app.AppName;
sessionStorageManager.playingAppKoreanName = app.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(app.AppID, activeAppList))
@@ -134,9 +134,9 @@ class MenuApp {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
if(typingPracticeAppCount === 0)
typingPracticeTabButton.inputEnabled = false;
@@ -144,9 +144,9 @@ class MenuApp {
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
if(typingTestAppCount === 0)
typingTestTabButton.inputEnabled = false;
@@ -170,12 +170,12 @@ class MenuApp {
RoundRectButton.NONE_ICON, // "icon_fullscreen",
// (isKoreanTypingApp ? "(한글)" : "(영문)") + "\n" + app.KoreanName,
app.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = app.AppID;
sessionStorageManager.playingAppName = app.AppName;
sessionStorageManager.playingAppKoreanName = app.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(app.AppID, activeAppList))
+9 -9
View File
@@ -45,7 +45,7 @@ class MenuTypingPractice {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
@@ -55,18 +55,18 @@ class MenuTypingPractice {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
typingPracticeTabButton.inputEnabled = false;
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
// typingTestTabButton.inputEnabled = false;
@@ -143,12 +143,12 @@ class MenuTypingPractice {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.KoreanActiveAppList))
@@ -168,12 +168,12 @@ class MenuTypingPractice {
posX, posY,
self.getIconImage(activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.EnglishActiveAppList))
+9 -9
View File
@@ -45,7 +45,7 @@ class MenuTypingTest {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
@@ -55,18 +55,18 @@ class MenuTypingTest {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
// typingPracticeTabButton.inputEnabled = false;
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
typingTestTabButton.inputEnabled = false;
@@ -143,12 +143,12 @@ class MenuTypingTest {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.KoreanActiveAppList))
@@ -168,12 +168,12 @@ class MenuTypingTest {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.EnglishActiveAppList))
+11 -9
View File
@@ -4,24 +4,26 @@
class Game {
create() {
let self = this;
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
sessionStorageManager.isNewBestRecrd = false;
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
let scoreBoard = new ScoreBoard();
scoreManager.addOnChangeScoreListener( score => {
scoreManager.addOnChangeScoreListener( function(score) {
sessionStorageManager.record = score;
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
});
scoreManager.addOnChangeHighScoreListener( highScore => {
scoreManager.addOnChangeHighScoreListener( function(highScore) {
console.log(highScore);
sessionStorageManager.bestRecord = highScore;
sessionStorageManager.isNewBestRecrd = true;
@@ -30,7 +32,7 @@ class Game {
let heartGauge = new HeartGauge(heartManager);
heartManager.addOnChangeGameOverListener(
() => { this.gameOver(); }
function() { self.gameOver(); }
);
heartGauge.start();
@@ -55,11 +57,11 @@ class Game {
this.aliens = [];
for(let i = 0; i < 10; i++) {
let alien = new Alien(150 + 80 * i, 150,
() => { this.activateNextAlien(); }, // onGoOnstage
(sprite) => {
scoreManager.plusScore(this.getScore());
let scoreText = new ScoreText(sprite.x, sprite.y, this.getScore());
}, // this.onAlienFired,
(function() { self.activateNextAlien(); }), // onGoOnstage
(function(sprite) {
scoreManager.plusScore(self.getScore());
let scoreText = new ScoreText(sprite.x, sprite.y, self.getScore());
}), // this.onAlienFired,
this.onAlienEscaped
);
alien.goWaitingRoom();
+5 -5
View File
@@ -24,7 +24,7 @@ class Ranking {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/start.html';
});
screenTopUI.makeFullScreenButton();
@@ -151,12 +151,12 @@ class Ranking {
this.dbConnectManager.requestAppRanking(
sessionStorageManager.maestroID,
sessionStorageManager.playingAppID,
(jsonData) => {
(function(jsonData) {
self.showRanking(jsonData);
},
(jsonData) => {
}),
(function(jsonData) {
self.showRanking(null);
}
})
);
}
+2 -2
View File
@@ -25,7 +25,7 @@ class HistoryBoard {
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
date,
historyRecordManager => {
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("history board - no data");
return;
@@ -38,7 +38,7 @@ class HistoryBoard {
if(date == data.date)
this.todayBestRecord = data.bestRecord;
}
}
})
);
}
+1 -1
View File
@@ -20,7 +20,7 @@ class Result {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
if(isTypingPracticeStage())
location.href = '../../web/client/menu_typing_practice.html';
else if(isTypingTestStage())
+17 -13
View File
@@ -17,7 +17,7 @@ class Start {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
if(isTypingPracticeStage())
location.href = '../../web/client/menu_typing_practice.html';
else if(isTypingTestStage())
@@ -54,11 +54,11 @@ class Start {
sessionStorageManager.maestroID,
sessionStorageManager.playerID,
sessionStorageManager.playingAppID,
replyJSON => {
function(replyJSON) {
sessionStorageManager.bestRecord = Number(replyJSON["BestRecord"]);
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
},
replyJSON => { // no data
function(replyJSON) { // no data
sessionStorageManager.bestRecord = 0;
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
}
@@ -66,26 +66,30 @@ class Start {
}
loadHowToPlay(appID) {
let self = this;
this.dbConnectManager.requestHowToPlay(
sessionStorageManager.playingAppID, // space_invaders app ID
(jsonData) => {
function(jsonData) {
let howToPlayText = jsonData["HowToPlay"].replace(/\\n/g, "\n");
this.howToPlay.printHowToPlay(howToPlayText);
self.howToPlay.printHowToPlay(howToPlayText);
},
(jsonData) => {
this.howToPlay.printHowToPlay("No data");
function(jsonData) {
self.howToPlay.printHowToPlay("No data");
}
);
}
loadChart() {
let self = this;
let today = new Date();
let date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
date,
historyRecordManager => {
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
@@ -103,7 +107,7 @@ class Start {
// break;
let historyRecord = historyRecordManager.getAt(i);
this.chart.drawRecordGraph(
self.chart.drawRecordGraph(
i,
historyRecord === undefined ? "-" : historyRecord.date,
historyRecord === undefined ? "" : historyRecord.bestRecord,
@@ -111,8 +115,8 @@ class Start {
);
}
this.chart.printChartBaseLine();
}
self.chart.printChartBaseLine();
})
);
}
@@ -154,9 +158,9 @@ class Start {
let rankingButton = new RoundRectButton(
setting, RoundRectButton.NONE_ICON, "순위\n보기",
() => {
(function() {
location.href = '../../web/client/ranking.html';
}
})
);
if(sessionStorageManager.maestroAccountType == 100)
rankingButton.inputEnabled = false;
+5 -5
View File
@@ -15,7 +15,7 @@ class TypingPractice {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_practice.html';
});
@@ -29,12 +29,12 @@ class TypingPractice {
this.typingScore = new TypingScore();
this.stageTimer = new StageTimer( TypingPractice.STAGE_TIMER_SEC, () => {
this.stageTimer = new StageTimer( TypingPractice.STAGE_TIMER_SEC, (function() {
self.isOnStage = false;
// self.goResult();
self.gameOver();
});
}));
// typing content
@@ -88,12 +88,12 @@ class TypingPractice {
else
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH);
game.input.keyboard.processKeyPress = () => {
game.input.keyboard.processKeyPress = (function() {
if(self.isOnStage === false)
return;
self.checkTypingContents(event);
}
});
this.shiftKey = game.input.keyboard.addKey(Phaser.Keyboard.SHIFT);
// hands
+1 -1
View File
@@ -13,7 +13,7 @@ class TypingTest {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_test.html';
});
+4 -4
View File
@@ -35,11 +35,11 @@
"./../server/admin/maestro_registered_list.php",
"maestro_name=" + maestroName,
(jsonData) => {
function(jsonData) {
updateMaestroList(jsonData["maestroList"]);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
@@ -94,12 +94,12 @@
"./../server/admin/register_maestro.php",
"maestro_id=" + maestroID,
(jsonData) => {
function(jsonData) {
loadMaestroList("");
$("#error_message").text("마에스트로 계정이 정상적으로 등록되었습니다.");
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
+4 -4
View File
@@ -26,11 +26,11 @@
"./../server/admin/maestro_upgrade_list.php",
"maestro_name=" + maestroName,
(jsonData) => {
function(jsonData) {
updateMaestroUpgradeList(jsonData["maestroUpgradeList"]);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
console.log(errorMessage);
if($("#error_message").length) {
$("#error_message").text(errorMessage);
@@ -177,12 +177,12 @@
"./../server/admin/upgrade_maestro.php",
"maestro_upgrade_id=" + maestroUpgradeID + "&maestro_id=" + id + "&new_account_type=" + newAccountType,
(jsonData) => {
function(jsonData) {
loadMaestroUpgradeList("");
$("#error_message").text("마에스트로 계정이 정상적으로 등록되었습니다.");
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
+2 -2
View File
@@ -24,11 +24,11 @@
"./../server/admin/login.php",
"admin_name=" + name + "&password=" + password,
(jsonData) => {
function(jsonData) {
location.href = 'admin_register_list.html';
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
+2 -2
View File
@@ -17,7 +17,7 @@
"./../server/maestro/maestro_test_player.php",
"maestro_id=" + maestroID,
(jsonData) => {
function(jsonData) {
console.log("maestroAccountType : " + jsonData["maestroAccountType"]);
console.log("playerName : " + jsonData["playerName"]);
console.log("playerID : " + jsonData["playerID"]);
@@ -31,7 +31,7 @@
location.href='./../client/menu_app.html';
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
+2 -2
View File
@@ -14,7 +14,7 @@ class MaestroInfo {
"./../server/maestro/maestro_info.php",
"maestro_id=" + this.maestroID,
(jsonData) => {
function(jsonData) {
self.maestroName = jsonData["name"];
self.accountType = jsonData["accountType"];
self.playerCount = jsonData["playerCount"];
@@ -22,7 +22,7 @@ class MaestroInfo {
onSuccess();
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
onFail(errorMessage, errorCode);
}
+14 -14
View File
@@ -25,7 +25,7 @@
"./../server/player/registered_player_count.php",
"maestro_id=" + maestroID,
(jsonData) => {
function(jsonData) {
self.playerCount = jsonData["playerCount"];
self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
self.activePageNo = 1;
@@ -34,7 +34,7 @@
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -53,12 +53,12 @@
"./../server/player/registered_player_list.php",
"maestro_id=" + maestroID + "&start_no=" + startNo + "&end_no=" + endNo,
(jsonData) => {
function(jsonData) {
self.playerCount = jsonData["playerList"].length;
self.list.updatePlayerList(jsonData["playerList"]);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -78,13 +78,13 @@
"./../server/player/registered_player_list.php",
"maestro_id=" + maestroID + "&start_no=" + startNo + "&end_no=" + endNo,
(jsonData) => {
function(jsonData) {
self.playerCount = jsonData["playerList"].length;
self.list.updatePlayerList(jsonData["playerList"]);
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -101,7 +101,7 @@
"./../server/player/search_player_count.php",
"maestro_id=" + maestroID + "&player_name=" + this.searchPlayerName,
(jsonData) => {
function(jsonData) {
self.playerCount = jsonData["playerCount"];
self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
self.activePageNo = 1;
@@ -112,7 +112,7 @@
showErrorMessage(this.searchPlayerName + " : 검색 결과가 없습니다.", "info");
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -131,13 +131,13 @@
"./../server/player/search_player_list.php",
"maestro_id=" + maestroID + "&player_name=" + playerName + "&start_no=" + startNo + "&end_no=" + endNo,
(jsonData) => {
function(jsonData) {
self.playerCount = jsonData["playerList"].length;
self.list.updatePlayerList(jsonData["playerList"]);
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -169,7 +169,7 @@
"./../server/player/edit_player.php",
"maestro_id=" + maestroID + "&player_id=" + playerID + "&player_name=" + playerName + "&enter_code=" + playerEnterCode,
(jsonData) => {
function(jsonData) {
// console.log(jsonData);
if(this.playerListID === "add_player_list") {
self.setupAddPlayerList();
@@ -179,7 +179,7 @@
showErrorMessage("학생 데이터가 [ " + playerName + " / " + playerEnterCode + " ] 으로 변경되었습니다.", "success");
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -205,7 +205,7 @@
"./../server/player/delete_player.php",
"maestro_id=" + maestroID + "&player_id=" + playerID,
(jsonData) => {
function(jsonData) {
if(this.playerListID === "add_player_list") {
self.setupAddPlayerList();
} else if(this.playerListID === "search_player_list") {
@@ -216,7 +216,7 @@
onChangePlayerCount();
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
@@ -22,7 +22,7 @@
"./../server/maestro/maestro_test_account.php",
"",
(jsonData) => {
function(jsonData) {
let maestroID = jsonData["maestroID"];
let playerID = jsonData["playerID"];
let playerName = jsonData["playerName"];
@@ -37,7 +37,7 @@
location.href = "./../client/menu_app.html";
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
+2 -2
View File
@@ -22,7 +22,7 @@
"./../server/player/player_experience_account.php",
"",
(jsonData) => {
function(jsonData) {
let maestroID = jsonData["maestroID"];
let maestroAccountType = jsonData["maestroAccountType"];
let playerID = jsonData["playerID"];
@@ -44,7 +44,7 @@
location.href = "./../client/menu_app.html";
},
(errorMessage, errorCode) => {
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}