Skip to content

Instantly share code, notes, and snippets.

@zishon89us
Forked from pc035860/gist:3104034
Created July 16, 2013 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zishon89us/6008272 to your computer and use it in GitHub Desktop.
Save zishon89us/6008272 to your computer and use it in GitHub Desktop.
(function () {
var standard_commands,
special_commands;
standard_commands = {
game: {title: 'game settings'}
};
special_commands = {
popup: {title: 'go Facebook.com', cmd: function () {
window.open('http://www.facebook.com');
}}
};
WinJS.Application.onsettings = function (e) {
// populate standard commands
e.detail.applicationcommands = standard_commands;
WinJS.UI.SettingsFlyout.populateSettings(e);
// populate special commands -> extract from BingFinance app
var appSettings = Windows.UI.ApplicationSettings,
vector = e.detail.e.request.applicationCommands;
for (var key in special_commands) {
var entry = special_commands[key],
cmd = new appSettings.SettingsCommand(key, entry.title, entry.command);
vector.append(cmd);
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment