Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Import Cross-App HEAD from http://github.com/maygrait/Cross-App.git

  • Loading branch information...
commit 925ae7c33906e319a23016ce0377cb1c962462cb 1 parent f0a3a2a
@kpdecker kpdecker authored
Showing with 267 additions and 0 deletions.
  1. +12 −0 Cross-App/CrossAppLaunched/.project
  2. +21 −0 Cross-App/CrossAppLaunched/app/assistants/app-assistant.js
  3. +47 −0 Cross-App/CrossAppLaunched/app/assistants/first-assistant.js
  4. +31 −0 Cross-App/CrossAppLaunched/app/views/first/first-scene.html
  5. +10 −0 Cross-App/CrossAppLaunched/appinfo.json
  6. +7 −0 Cross-App/CrossAppLaunched/framework_config.json
  7. BIN  Cross-App/CrossAppLaunched/icon.png
  8. +10 −0 Cross-App/CrossAppLaunched/index.html
  9. +9 −0 Cross-App/CrossAppLaunched/sources.json
  10. +1 −0  Cross-App/CrossAppLaunched/stylesheets/crossapplaunched.css
  11. +12 −0 Cross-App/CrossAppLauncher/.project
  12. +48 −0 Cross-App/CrossAppLauncher/app/assistants/first-assistant.js
  13. +11 −0 Cross-App/CrossAppLauncher/app/assistants/stage-assistant.js
  14. +12 −0 Cross-App/CrossAppLauncher/app/views/first/first-scene.html
  15. +9 −0 Cross-App/CrossAppLauncher/appinfo.json
  16. +7 −0 Cross-App/CrossAppLauncher/framework_config.json
  17. BIN  Cross-App/CrossAppLauncher/icon.png
  18. +10 −0 Cross-App/CrossAppLauncher/index.html
  19. +9 −0 Cross-App/CrossAppLauncher/sources.json
  20. +1 −0  Cross-App/CrossAppLauncher/stylesheets/crossapplauncher.css
View
12 Cross-App/CrossAppLaunched/.project
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CrossAppLaunched</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>com.palm.pdt.nature</nature>
+ </natures>
+</projectDescription>
View
21 Cross-App/CrossAppLaunched/app/assistants/app-assistant.js
@@ -0,0 +1,21 @@
+function AppAssistant(appController) {
+}
+
+AppAssistant.prototype = {
+ cleanup: function() {
+ //blah blah
+ },
+ handleLaunch: function(launchParams){
+
+ Mojo.Log.error('****************************************** ' + JSON.stringify(launchParams))
+ /*
+ * Display the splash scene while we get the databases organized
+ * and figure out what launched us
+ */
+ var f = function(stageController) {
+ stageController.pushScene('first',launchParams)
+ };
+ Mojo.Controller.appController.createStageWithCallback({name: 'mainStage', lightweight: true}, f);
+ }
+
+}
View
47 Cross-App/CrossAppLaunched/app/assistants/first-assistant.js
@@ -0,0 +1,47 @@
+function FirstAssistant(args) {
+ this.launchParams = {}
+ if (launchParams.title) {
+ this.launchParams = args;
+ this.str1 = 'This app was launched by another app!'
+ this.str2 = 'Info passed from launcher app'
+ }
+ else {
+ this.launchParams.title = Mojo.appInfo.title;
+ this.launchParams.id = Mojo.appInfo.id;
+ this.launchParams.version = Mojo.appInfo.version;
+ this.str1 = 'This app was launched from the launcher'
+ this.str2 = 'Mojo info for app B'
+ }
+}
+
+FirstAssistant.prototype.setup = function() {
+ /* this function is for setup tasks that have to happen when the scene is first created */
+
+ /* use Mojo.View.render to render view templates and add them to the scene, if needed */
+
+ /* setup widgets here */
+
+ /* update the app info using values from our app */
+ this.controller.get("updateArea1").update(this.str1);
+ this.controller.get("updateArea2").update(this.str2);
+ this.controller.get("app-title").update(this.launchParams.title);
+ this.controller.get("app-id").update(this.launchParams.id);
+ this.controller.get("app-version").update(this.launchParams.version);
+
+ /* add event handlers to listen to events from widgets */
+};
+
+FirstAssistant.prototype.activate = function(event) {
+ /* put in event handlers here that should only be in effect when this scene is active. For
+ example, key handlers that are observing the document */
+};
+
+FirstAssistant.prototype.deactivate = function(event) {
+ /* remove any event handlers you added in activate and do any other cleanup that should happen before
+ this scene is popped or another scene is pushed on top */
+};
+
+FirstAssistant.prototype.cleanup = function(event) {
+ /* this function should do any cleanup needed before the scene is destroyed as
+ a result of being popped off the scene stack */
+};
View
31 Cross-App/CrossAppLaunched/app/views/first/first-scene.html
@@ -0,0 +1,31 @@
+<!-- TODO: replace the contents of this file with your own html -->
+<div class="palm-hasheader">
+ <div class="palm-header">
+ App B!
+ </div>
+</div>
+<div class="palm-header-spacer"></div>
+<div class="palm-body-text" id="updateArea1">
+
+</div>
+<div class="palm-group">
+ <div class="palm-group-title">
+ <div id='updateArea2'><span x-mojo-loc="">Info passed from launcher app</span></div>
+ </div>
+ <div class="palm-list">
+ <div class='palm-row single'>
+ <div class="palm-row-wrapper">
+ <div class="label left">title</div>
+ <div id="app-title" class="title right">????</div>
+ </div>
+ <div class="palm-row-wrapper">
+ <div class="label left">id</div>
+ <div id="app-id" class="title right">????</div>
+ </div>
+ <div class="palm-row-wrapper">
+ <div class="label left">version</div>
+ <div id="app-version" class="title right">????</div>
+ </div>
+ </div>
+ </div>
+</div>
View
10 Cross-App/CrossAppLaunched/appinfo.json
@@ -0,0 +1,10 @@
+{
+ "id": "com.palmdts.appb",
+ "version": "2.0.0",
+ "vendor": "Palm, inc",
+ "type": "web",
+ "main": "index.html",
+ "title": "App B",
+ "icon": "icon.png",
+ "noWindow": true
+}
View
7 Cross-App/CrossAppLaunched/framework_config.json
@@ -0,0 +1,7 @@
+{
+ "logLevel": 99,
+ "debuggingEnabled": true,
+ "timingEnabled": false,
+ "logEvents": false,
+ "escapeHTMLInTemplates" : true
+}
View
BIN  Cross-App/CrossAppLaunched/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 Cross-App/CrossAppLaunched/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>App B</title>
+ <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-version="1"></script>
+
+ <!-- application stylesheet should come in after the one loaded by the framework -->
+ <link href="stylesheets/crossapplaunched.css" media="screen" rel="stylesheet" type="text/css">
+</head>
+</html>
View
9 Cross-App/CrossAppLaunched/sources.json
@@ -0,0 +1,9 @@
+[
+ {
+ "source": "app/assistants/app-assistant.js"
+ },
+ {
+ "scenes": "first",
+ "source": "app/assistants/first-assistant.js"
+ }
+]
View
1  Cross-App/CrossAppLaunched/stylesheets/crossapplaunched.css
@@ -0,0 +1 @@
+/* TODO: put your application-specific CSS here */
View
12 Cross-App/CrossAppLauncher/.project
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CrossAppLauncher</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>com.palm.pdt.nature</nature>
+ </natures>
+</projectDescription>
View
48 Cross-App/CrossAppLauncher/app/assistants/first-assistant.js
@@ -0,0 +1,48 @@
+function FirstAssistant() {
+ /* this is the creator function for your scene assistant object. It will be passed all the
+ additional parameters (after the scene name) that were passed to pushScene. The reference
+ to the scene controller (this.controller) has not be established yet, so any initialization
+ that needs the scene controller should be done in the setup function below. */
+}
+
+FirstAssistant.prototype.setup = function() {
+ this.handleButtonPressed = this.handleButtonPressed.bind(this);
+ this.controller.setupWidget("buttonId",
+ this.attributes = {
+ },
+ this.model = {
+ label : "Cross lauch",
+ disabled: false
+ }
+ );
+ this.controller.get('updateArea').update( 'Title : ' +
+ Mojo.appInfo.title + '<br /> ID : ' +
+ Mojo.appInfo.id + '<br /> Version : ' +
+ Mojo.appInfo.version)
+};
+
+FirstAssistant.prototype.activate = function(event) {
+ /* put in event handlers here that should only be in effect when this scene is active. For
+ example, key handlers that are observing the document */
+ Mojo.Event.listen(this.controller.get("buttonId"),Mojo.Event.tap, this.handleButtonPressed);
+};
+FirstAssistant.prototype.handleButtonPressed = function(event) {
+ var args = {
+ appId: "com.palmdts.appb",
+ name: "first"
+ }
+ var params = {
+ title : Mojo.appInfo.title,
+ id : Mojo.appInfo.id,
+ version : Mojo.appInfo.version
+ }
+ this.controller.stageController.pushScene(args, params);
+}
+FirstAssistant.prototype.deactivate = function(event) {
+ Mojo.Event.stopListening(this.controller.get("buttonId"),Mojo.Event.tap, this.handleButtonPressed);
+};
+
+FirstAssistant.prototype.cleanup = function(event) {
+ /* this function should do any cleanup needed before the scene is destroyed as
+ a result of being popped off the scene stack */
+};
View
11 Cross-App/CrossAppLauncher/app/assistants/stage-assistant.js
@@ -0,0 +1,11 @@
+function StageAssistant() {
+ /* this is the creator function for your stage assistant object */
+}
+
+StageAssistant.prototype.setup = function() {
+ /* this function is for setup tasks that have to happen when the stage is first created */
+
+ /* for a simple application, the stage assistant's only task is to push the scene, making it
+ visible */
+ this.controller.pushScene("first");
+};
View
12 Cross-App/CrossAppLauncher/app/views/first/first-scene.html
@@ -0,0 +1,12 @@
+<!-- TODO: replace the contents of this file with your own html -->
+<div class="palm-hasheader">
+ <div class="palm-header">
+ App A
+ </div>
+</div>
+<div class="palm-header-spacer"></div>
+<div >
+ Info to be passed to App B
+</div>
+<div class="palm-body-text" id='updateArea'></div>
+ <div x-mojo-element="Button" id="buttonId" class="buttonClass" name="buttonName"></div>
View
9 Cross-App/CrossAppLauncher/appinfo.json
@@ -0,0 +1,9 @@
+{
+ "id": "com.palmdts.appa",
+ "version": "1.0.0",
+ "vendor": "Palm, inc",
+ "type": "web",
+ "main": "index.html",
+ "title": "App A",
+ "icon": "icon.png"
+}
View
7 Cross-App/CrossAppLauncher/framework_config.json
@@ -0,0 +1,7 @@
+{
+ "logLevel": 99,
+ "debuggingEnabled": true,
+ "timingEnabled": false,
+ "logEvents": false,
+ "escapeHTMLInTemplates" : true
+}
View
BIN  Cross-App/CrossAppLauncher/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 Cross-App/CrossAppLauncher/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>App A</title>
+ <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-version="1"></script>
+
+ <!-- application stylesheet should come in after the one loaded by the framework -->
+ <link href="stylesheets/crossapplauncher.css" media="screen" rel="stylesheet" type="text/css">
+</head>
+</html>
View
9 Cross-App/CrossAppLauncher/sources.json
@@ -0,0 +1,9 @@
+[
+ {
+ "source": "app/assistants/stage-assistant.js"
+ },
+ {
+ "scenes": "first",
+ "source": "app/assistants/first-assistant.js"
+ }
+]
View
1  Cross-App/CrossAppLauncher/stylesheets/crossapplauncher.css
@@ -0,0 +1 @@
+/* TODO: put your application-specific CSS here */
Please sign in to comment.
Something went wrong with that request. Please try again.