OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/h58pcdgame/GameScriptCore...
[h58pcdgame/GameScriptCoreLibrary.git] / www / stage / login.js
1 //ステージの設定
2 //      グローバル名前空間にmainManagerがすでに存在する状況下で呼ばれる。
3 //      最初の行で新たなインスタンスを生成し、最後のreturnでそれを返す。
4
5 stage = new GameStage();
6
7 //関数のオーバーライド
8 stage.runStage = function(){
9         //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
10         GameStage.prototype.runStage.apply(this, []);
11         this.authform = createDOMObject("form", "authform", "MainArea");
12         this.authform.style.zIndex = 4;
13         this.authform.style.position = "absolute";
14         this.authform.style.top = "200px";
15         this.authform.style.left = "70px";
16         this.authform.onsubmit = function () { this.submitAuth; return false;};
17         this.authform.innerHTML = "ユーザー名:<input id='authUserName' type='text' name='userName' style='z-index:6' size='50'/><br>";
18         this.authform.innerHTML += "<input id='authSubmitButton' type='button' value='ログイン'>";
19         this.authSubmitButton = document.getElementById("authSubmitButton");
20         this.authSubmitButton.onclick = this.submitAuth;
21 };
22 stage.submitAuth = function(){
23         mainManager.userManager.loginAs(mainManager.runningStage.authform.userName.value);
24         return false; //常に送信しない。
25 };
26
27 stage.stopStage = function(){
28         destroyDOMObjectByID("authform");
29         //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
30         GameStage.prototype.stopStage.apply();
31 };
32
33 stage;