Add: show alert message - input score error

This commit is contained in:
2018-12-13 13:06:07 +09:00
parent 4e31886281
commit 607afcadcb
2 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ var LicenseTimer = {
sessionStorageManager.getPlayerID(), sessionStorageManager.getPlayerID(),
Timer.TIME_DEFAULT_SEC, Timer.TIME_DEFAULT_SEC,
(function(replyJson) { (function(replyJson) {
console.log(replyJson); // console.log(replyJson);
this.timer.loadDataFromServer(replyJson.leftTime, replyJson.startTime, replyJson.subjectName); this.timer.loadDataFromServer(replyJson.leftTime, replyJson.startTime, replyJson.subjectName);
this.inputScore.loadDataFromServer(replyJson.subjectName); this.inputScore.loadDataFromServer(replyJson.subjectName);
}).bind(this), }).bind(this),
+13 -12
View File
@@ -294,29 +294,28 @@ InputScore.prototype.makePanelSprite = function(x, y, width, height, color) {
return game.add.sprite(x, y, btnTexture); return game.add.sprite(x, y, btnTexture);
} }
InputScore.prototype.alert = function(message) { InputScore.prototype.showAlertWindow = function(message) {
console.log("Alert message : " + message); alert(message);
} }
InputScore.prototype.onClickSendToServerButton = function() { InputScore.prototype.onClickSendToServerButton = function() {
if(this.subjectFullname == "") { if(this.subjectFullname == "") {
this.alert("no subject error"); this.showAlertWindow("과목을 입력해 주세요.");
return; return;
} }
if(this.scoreText.value == "") { if(this.scoreText.value == "") {
this.alert("no score error"); this.showAlertWindow("점수를 입력해 주세요.");
return; return;
} }
if(this.passwordText.value == "") { if(this.passwordText.value == "") {
this.alert("no password error"); this.showAlertWindow("자격증 타이머용 비밀번호를 입력해 주세요.");
return; return;
} }
this.maestroPassword = this.passwordText.value; this.maestroPassword = this.passwordText.value;
console.log("send data to server"); // console.log("send data to server");
this.checkMaestroPasswordFromServer(); this.checkMaestroPasswordFromServer();
} }
@@ -332,6 +331,8 @@ InputScore.prototype.addScoreToServer = function(subjectName, score) {
console.log(replyJson); console.log(replyJson);
this.scoreText.setText(""); this.scoreText.setText("");
// this.showAlertWindow("점수가 정상적으로 등록되었습니다.");
this.chart.loadScoreFromServer(); this.chart.loadScoreFromServer();
}).bind(this), }).bind(this),
@@ -345,16 +346,16 @@ InputScore.prototype.checkMaestroPasswordFromServer = function() {
this.dbConnectManager.requestLicenseMaestroPassword( this.dbConnectManager.requestLicenseMaestroPassword(
sessionStorageManager.getMaestroID(), sessionStorageManager.getMaestroID(),
(function(replyJson) { (function(replyJson) {
console.log(replyJson); // console.log(replyJson);
console.log(this.maestroPassword); // console.log(this.maestroPassword);
console.log(replyJson.maestroPassword); // console.log(replyJson.maestroPassword);
if(replyJson.maestroPassword == null || replyJson.maestroPassword == "") { if(replyJson.maestroPassword == null || replyJson.maestroPassword == "") {
this.alert("set password!!!"); this.showAlertWindow("자격증 타이머용 비밀번호가 설정되지 않았습니다.\n마에스트로 관리자 페이지에 가서, 자격증 타이머용 비밀번호를 설정해 주세요.");
return; return;
} else if(this.maestroPassword != replyJson.maestroPassword) { } else if(this.maestroPassword != replyJson.maestroPassword) {
this.alert("wrong password"); this.showAlertWindow("비밀번호가 틀렸습니다.\n마에스트로 관리자 페이지에 가서, 자격증 타이머용 비밀번호를 확인해 주세요.");
return; return;
} }