Created
March 11, 2013 01:51
-
-
Save DigiTec/5131407 to your computer and use it in GitHub Desktop.
Add a privacy policy to your Windows 8 based WWA. Note, all of the samples utilized WinJS and I needed a non WinJS version. I don't claim in any way this is novel, but it took me nearly an hour to pull this together since there were no fully baked samples.
This file contains hidden or 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
var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView(); | |
settingsPane.addEventListener("commandsrequested", foo); | |
function foo(args) { | |
var cmdPrivacy = new Windows.UI.ApplicationSettings.SettingsCommand("privacy", "Privacy Policy", privacyPolicyInvoked); | |
args.request.applicationCommands.push(cmdPrivacy); | |
} | |
function privacyPolicyInvoked(args) { | |
switch (args.id) { | |
case "privacy": | |
window.open("http://www.freeprivacypolicy.org/generic.php", "_blank"); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment