dojox/mobile/app/_base.js

  • Provides:

    • dojox.mobile.app._base
  • Requires:

    • dijit._base in common in project dijit
    • dijit._WidgetBase in common in project dijit
    • dojox.mobile in common
    • dojox.mobile.parser in common
    • dojox.mobile.app._event in common
    • dojox.mobile.app._Widget in common
    • dojox.mobile.app.StageController in common
    • dojox.mobile.app.SceneController in common
    • dojox.mobile.app.SceneAssistant in common
    • dojox.mobile.app.AlertDialog in common
    • dojox.mobile.app.List in common
    • dojox.mobile.app.ListSelector in common
    • dojox.mobile.app.TextBox in common
    • dojox.mobile.app.ImageView in common
    • dojox.mobile.app.ImageThumbView in common
  • dojox.mobile.app.init

    • type
      Function
    • parameters:
      • node: (typeof )
    • source: [view]
         rootNode = node || dojo.body();
         dojox.mobile.app.STAGE_CONTROLLER_ACTIVE = true;


         dojo.subscribe("/dojox/mobile/app/goback", function(){
          stageController.popScene();
         });


         dojo.subscribe("/dojox/mobile/app/alert", function(params){
          dojox.mobile.app.getActiveSceneController().showAlertDialog(params);
         });


         dojo.subscribe("/dojox/mobile/app/pushScene", function(sceneName, params){
          stageController.pushScene(sceneName, params || {});
         });


         // Get the list of files to load per scene/view
         dojo.xhrGet({
          url: "view-resources.json",
          load: function(data){
           var resources = [];


           if(data){
            // Should be an array
            sceneResources = data = dojo.fromJson(data);


            // Get the list of files to load that have no scene
            // specified, and therefore should be loaded on
            // startup
            for(var i = 0; i < data.length; i++){
             if(!data[i].scene){
              resources.push(data[i]);
             }
            }
           }
           if(resources.length > 0){
            loadResources(resources, pushFirstScene);
           }else{
            pushFirstScene();
           }
          },
          error: pushFirstScene
         });


         initBackButton();
    • summary
      Initializes the mobile app. Creates the
  • dojox.mobile.app.getActiveSceneController

    • type
      Function
    • source: [view]
         return stageController.getActiveSceneController();
    • summary
      Gets the controller for the active scene.
  • dojox.mobile.app.getStageController

    • type
      Function
    • source: [view]
         return stageController;
    • summary
      Gets the stage controller.
  • dojox.mobile.app.loadResources

    • type
      Function
    • parameters:
      • resources: (typeof )
      • callback: (typeof )
    • source: [view]
         loadResources(resources, callback);
    • summary
  • dojox.mobile.app.loadResourcesForScene

    • type
      Function
    • parameters:
      • sceneName: (typeof )
      • callback: (typeof )
    • source: [view]
         var resources = [];


         // Get the list of files to load that have no scene
         // specified, and therefore should be loaded on
         // startup
         for(var i = 0; i < sceneResources.length; i++){
          if(sceneResources[i].scene == sceneName){
           resources.push(sceneResources[i]);
          }
         }


         if(resources.length > 0){
          loadResources(resources, callback);
         }else{
          callback();
         }
    • summary
  • dojox.mobile.app.resolveTemplate

    • type
      Function
    • parameters:
      • sceneName: (typeof )
    • source: [view]
         return "app/views/" + sceneName + "/" + sceneName + "-scene.html";
    • summary
      Given the name of a scene, returns the path to it's template
      file.  For example, for a scene named 'main', the file
      returned is 'app/views/main/main-scene.html'
      This function can be overridden if it is desired to have
      a different name to file mapping.
  • dojox.mobile.app.resolveAssistant

    • type
      Function
    • parameters:
      • sceneName: (typeof )
    • source: [view]
         return "app/assistants/" + sceneName + "-assistant.js";
    • summary
      Given the name of a scene, returns the path to it's assistant
      file.  For example, for a scene named 'main', the file
      returned is 'app/assistants/main-assistant.js'
      This function can be overridden if it is desired to have
      a different name to file mapping.
  • dojox.mobile.app._base

    • type
      Object
    • summary
  • dojox.mobile.app

    • type
      Object
    • summary
  • dojox.mobile

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary