ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: default.js
名前: lightbox
処理選択
パスワード

件名 default.js
名前 lightbox
コメント
@DIV
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
(function () {
    "use strict";

    var app = WinJS.Application;
    var nav = WinJS.Navigation;

    app.onactivated = function (eventObject) {
        if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
            if (eventObject.detail.previousExecutionState !== Windows.ApplicationModel.Activation.ApplicationExecutionState.terminated) {
                // TODO: This application has been newly launched. Initialize 
                // your application here.

                nav.navigate("/html/homePage.html");
                Debug.writeln("初期処理");

            } else {
                // TODO: This application has been reactivated from suspension. 
                // Restore application state here.
            }
            WinJS.UI.processAll();
        }
    };

    WinJS.Navigation.addEventListener("navigated", function (ev) {
        Debug.writeln("navigated");
        Debug.writeln(ev.detail.location);
        var target = document.querySelector("#contentHost");
        WinJS.Utilities.empty(target);
        WinJS.UI.Fragments.render(ev.detail.location, target).then(function () {

            var backButton = document.querySelector(".win-backbutton");
            if (backButton) {
                backButton.addEventListener('click', function () {
                    WinJS.Navigation.back();
                }, false);
                if (WinJS.Navigation.canGoBack) {
                    backButton.removeAttribute('disabled');
                }
                else {
                    backButton.setAttribute('disabled', 'true');
                }
            }

        });


    }, false);

    function navigateHome() {
        Debug.writeln("メニュー");
        document.getElementById("appbar").winControl.hide();
    }
    function navigateGame() {
        Debug.writeln("ゲーム");
        document.getElementById("appbar").winControl.hide();
    }
    function navigateRules() {
        Debug.writeln("ルール");
        document.getElementById("appbar").winControl.hide();
    }
    function navigateScores() {
        Debug.writeln("スコア");
        nav.navigate("/html/homePage.html");
        document.getElementById("appbar").winControl.hide();
    }
    function navigateCredits() {
        Debug.writeln("クレジット");
        document.getElementById("appbar").winControl.hide();
        nav.navigate("/html/homePage_light.html");
    }


    app.oncheckpoint = function (eventObject) {
        // TODO: This application is about to be suspended. Save any state
        // that needs to persist across suspensions here. You might use the 
        // WinJS.Application.sessionState object, which is automatically
        // saved and restored across suspension. If you need to complete an
        // asynchronous operation before your application is suspended, call
        // eventObject.setPromise(). 
    };

    app.start();
    WinJS.Namespace.define("R101", {
        navigateHome: navigateHome,
        navigateGame: navigateGame,
        navigateRules: navigateRules,
        navigateScores: navigateScores,
        navigateCredits: navigateCredits
    });

})();

@END