Advertisement
Guest User

buttons.js

a guest
Aug 3rd, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function dialogCommandHandler(command)
  2. {
  3.     if (command.label === "Yes") {
  4.         saveCharInfo()
  5.     }
  6.     else
  7.     {
  8.         return;
  9.     }
  10. }
  11.  
  12. function message(message) {
  13.     var msgBox = new Windows.UI.Popups.MessageDialog(message);
  14.     msgBox.commands.append(new Windows.UI.Popups.UICommand("Yes", dialogCommandHandler));
  15.     msgBox.commands.append(new Windows.UI.Popups.UICommand("No", dialogCommandHandler));
  16.     msgBox.showAsync();
  17. }
  18.  
  19. function testSaveCharInfo()
  20. {
  21.     charName = document.getElementById("char_name");
  22.     if (charName.value.length === 0)
  23.     {
  24.         alert("Fill in a name first");
  25.     }
  26.     else
  27.     {
  28.         message("Are you sure you want to save?\nYou can't change this later on without resetting your character");
  29.     }
  30. }
  31. function saveCharInfo()
  32. {
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement