There is a library of JavaScript functions for interacting with the base system (material at the phone level) and CSS tags, styles, etc. for rendering in the style of Palm webOS.
The SDK comes with a palm-generate script that creates a set of configuration files and folder structures. The "Palm-package" script builds the isntaller, and the nother script, "palm-install" loads the installer into the emulator's file system (or a real palm, I think ... mine is custom and should be here Monday !!!).
It is easy enough to find this code, and it is not at all original, but I thought it would be useful to see here ...
Hello World - copied from a tutorial in palm webos sdk
alt text http://i29.tinypic.com/mttkiw.jpg
HelloWorld / appinfo.json - meta information for this application, including a unique name (domain style) and the root of the application ("index.html")
{ "id": "com.yourdomain.hello", "title": "Hello World", "type": "web", "main": "index.html", "icon": "icon.png", "version": "1.0.0", "vendor": "Your Company" }
HelloWorld / sources.json - manifest
[ { "source": "app\/assistants\/stage-assistant.js" }, { "source": "app\/assistants\/first-assistant.js", "scenes": "first" } ]
helloWorld / app / assistantants / stage-assistant.js - controller for the application. each application consists of a stage with several scenes; the StageAssistant.setup () method starts first, providing time for initializing data, connections, etc.
function StageAssistant () { } StageAssistant.prototype.setup = function() { this.controller.pushScene('first'); }
HelloWorld / index.html - view for the stage
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPECTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Hello, World!</title> <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-version="1"></script> </head> <body> Hello, World! 2:59 </body> </html>
helloWorld / app / assistantants / first-assistant.js - view for the "first" scene
<div id="main" class="palm-hasheader"> <div class="palm-header">Header</div> <div id="count" class="palm-body-text">count</div> <div id="MyButton" name="MyButton1" x-mojo-element="Button"></div> </div>
helloWorld / app / assistantants / first-assistant.js - controller for the "first" scene
function FirstAssistant() { } FirstAssistant.prototype.handleButtonPress = function(event){