Advertisement
patrickc

Untitled

Aug 1st, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var vers =  new versionCookie();
  2. function StageAssistant() {
  3.     /* this is the creator function for your stage assistant object */
  4. };
  5.  
  6. StageAssistant.prototype.setup = function() {
  7.     /* this function is for setup tasks that have to happen when the stage is first created */
  8.        
  9.     this.controller.pushScene("main");
  10.    
  11.     appMenu = {
  12.  
  13.         visible: true,
  14.         items: [
  15.             Mojo.Menu.editItem,
  16.                 {
  17.                     label: $L("Preferences & Accounts"),
  18.                     command: 'do-prefs'
  19.                 },         
  20.                 {
  21.                     label: $L("Help"),
  22.                     command: 'do-helpGen'
  23.                 },
  24.                 /*
  25.                 {
  26.                     label: $L("Help..."),
  27.                     command: 'do-help'
  28.                 },
  29.                 */
  30.                
  31.         ]
  32.     }; 
  33.  
  34.  
  35.  
  36.  
  37.     //Get cookie
  38.     /*myCookie = new Mojo.Model.Cookie('MyCookie');
  39.     cookieData = myCookie.get() || '';
  40.     if(cookieData =='') {
  41.         this.controller.pushScene("changelog");
  42.         myCookie.put({ firstuse:true });
  43.         }
  44.         else{
  45.         this.controller.pushScene("main");
  46.         }*/
  47. };
  48.  
  49. StageAssistant.prototype.launchFirstScene = function(controller) {
  50.     vers.init();
  51.     if (vers.showStartupScene()) {
  52.         controller.pushScene('changelog');
  53.     }
  54.     else {
  55.         controller.pushScene('main');
  56.     }
  57. }
  58.  
  59. StageAssistant.prototype.handleCommand = function (event) {
  60. var currentScene = this.controller.activeScene();
  61.  
  62. switch(event.type) {
  63. case Mojo.Event.commandEnable:
  64. case Mojo.Event.command:
  65.                 switch (event.command) {
  66.                    
  67.                        
  68.                     case 'do-prefs':
  69.                         this.controller.pushScene("prefs");
  70.                         break;
  71.                        
  72.                     case 'do-helpGen':
  73.                         this.controller.pushAppSupportInfoScene();
  74.                         break; 
  75.                        
  76.                     /*
  77.                     case 'do-help':
  78.                         this.controller.pushScene("support");
  79.                         break;
  80.                     */
  81.                     }                  
  82.                 break;
  83.             };
  84. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement