Created
September 4, 2012 16:31
-
-
Save tadyjp/3623166 to your computer and use it in GitHub Desktop.
External links in setting flyout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 便利のため名前空間を作る | |
WinJS.Namespace.define("SM.Ui.Flyouts", {}); | |
// 一度に複数のフライアウトを設定するときこうすると便利 | |
var flyoutPages = [ | |
{ key: "profile", title: "プロフィール変更", url: "/pages/profileFlyout/profileFlyout.html" }, | |
{ key: "tos", title: "利用規約", url: "/pages/charms/tos.html" }, | |
{ key: "policy", title: "プライバシーポリシー", url: "/pages/charms/policy.html" }, | |
{ key: "logout", title: "ログアウト", url: "/pages/charms/logout.html" }, | |
]; | |
// 設定チャームを開くイベントにハンドル | |
WinJS.Application.addEventListener("settings", function (e) { | |
flyoutPages.forEach(function (routing) { | |
e.detail.applicationcommands[routing.key] = { title: routing.title, href: routing.url }; | |
}); | |
WinJS.UI.SettingsFlyout.populateSettings(e); | |
}); | |
// 便利のため,SM.Ui.Flyouts.logout() というメソッドで「ログアウトフライアウト」を開くようにする | |
flyoutPages.forEach(function (routing) { | |
SM.Ui.Flyouts[routing.key] = function () { | |
WinJS.UI.SettingsFlyout.showSettings(routing.key, routing.url); | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript"> | |
// window.openでmetro番のIEが開く | |
// 同時に,このアプリはsuspendする | |
window.open("http://www.smokemeet.net/home/privacy-policy"); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment