My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Documentation  
Updated Feb 4, 2010 by jlbfal...@gmail.com

#osg documentation.

Introduction

Examples Annotations

You can use annotations to define some application settings. Exemple: (application code)

/

  • Some comments...
  • @id YOU_APP_IDMODULE_ID
  • @title OSG Sample application
  • @height 500
  • @description This is a OSG Generated application
  • @singleton
  • @thumbnail resources/thumbnail.jpg
  • @require opensocial-0.5
  • @require tabs
  • @require flash
  • @initFunction onInit
  • @js lib/mylib.js
  • @css resources/another_file.css

  • @id => The application instance name ($INSTANCE reference on js code)
  • @initFunction => first function called on application object.
  • @css => set the css file. (resources/default.css is added if exists and @css don't exists)
  • @js => include a external javascript

Using if / loop in template.

application code (javascript)

... var td = new osg.TemplateData(); td.add("list", ['item1', 'item2', 'item3']); td.add("key", "fasd0f7asdfhasdfalsdf"); setFooPage(td); ...

in template/foo.htm

Using self::action() this.action() app.action()

application code (javascript)

...

doSomething:function(id) {
// do something with id.
}
...

in template/foo.htm

Complex examples

application code (javascript)

... var td = new osg.TemplateData(); td.add("object", {foo:function(p) { alert(p); }}); td.add("lista", [1,2,3,4]); setFooPage(td); ...

in template/foo.htm

Using include

in template/bar.htm

<!--#foo.htm-->

Using $HOST and $INSTANCE

application code (javascript)

//$INSTANCE is the main application object. var $INSTANCE = {

onInit:function() {
//$HOST is defined in --host IG_FetchXmlContent("$HOST/xml/something.xml", function(){});
}
}

Powered by Google Project Hosting