Class rio.Application
Extends
rio.Attr.
Application is used to create new rio application classes. It provides functionality for dependency management,
routing, history management and page management.
Defined in: application.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
rio.Application.create(name, extends, args)
Creates an instance of rio.Application.
|
<static> |
rio.Application.environment()
Returns the application level environment variables
|
<static> |
rio.Application.fail(msg, msg)
This causes the application to fail and log a 'fail' error message.
|
Get the full path of your rio application after the hash.
|
|
Returns the instance of the currently loaded page in the app.
|
|
<static> |
rio.Application.include(fileName)
Alias of rio.Application.require
|
<static> |
rio.Application.includeCss(toInclude)
|
reboot()
Reboots your application.
|
|
refresh()
Refreshes the browser.
|
|
<static> |
rio.Application.require(fileName)
Alias of rio.Application.require
|
<static> |
rio.Application.route(path, target)
Specifies the lowest priority route for an application class.
|
<static> |
rio.Application.setEnvironment(env)
Specifies the application level environment variables.
|
<static> |
rio.Application.toString()
|
toString()
|
|
unload()
This method is called just before the page is unloaded.
|
- Methods borrowed from class rio.Attr:
- bind, binding, extend, fire, fireWhenReady, freeze, frozen, observe, setAndReturnAfterSet, stopObserving, transaction, unfreeze, updateAttributes
Method Detail
<static>
{rio.Application}
rio.Application.create(name, extends, args)
Creates an instance of rio.Application.
rio.apps.example = rio.Application.create({ require: ["pages/example_page"], requireCss: ["css_reset", "example"], routes: { "": "examplePage" }, attrAccessors: [], attrReaders: [], methods: { initialize: function(options) { }, examplePage: function() { return new rio.pages.ExamplePage(); } } });
- Parameters:
- {String} name
- (optional) The name of this Application. Used primarily for testing reports.
- {Object} extends
- (optional) An Attr class to use as a superclass.
- {Object} args
- (optional) The definition of the class.
- Returns:
- a new instance of type Application
<static>
rio.Application.environment()
Returns the application level environment variables
<static>
rio.Application.fail(msg, msg)
This causes the application to fail and log a 'fail' error message. If the application class
has a fail method, that method will be called with the message passed in here.
- Parameters:
- {String} msg
- The application failure message
- {String} msg
- A more in depth description of the application failure
{String}
getCurrentLocation()
Get the full path of your rio application after the hash.
e.g. http://thinklinkr.com/outliner#584/revisions => "584/revisions"
- Returns:
- the path of your rio application after the hash
{rio.Page}
getCurrentPage()
Returns the instance of the currently loaded page in the app.
- Returns:
- the instance of the currently loaded page
<static>
rio.Application.include(fileName)
Alias of rio.Application.require
- Parameters:
- {String} fileName
- The path to the javascript file that will be loaded.
<static>
rio.Application.includeCss(toInclude)
- Parameters:
- toInclude
reboot()
Reboots your application. Rebooting your application will reset and reload the
current page.
refresh()
Refreshes the browser. This will reload your app's source code
and reinitialize your app. This is more severe than rebooting.
<static>
rio.Application.require(fileName)
Alias of rio.Application.require
- Parameters:
- {String} fileName
- The path to the javascript file that will be loaded.
<static>
rio.Application.route(path, target)
Specifies the lowest priority route for an application class.
You are better off specifying routes when creating an
application with a 'routes' parameter.
- Parameters:
- path
- target
<static>
rio.Application.setEnvironment(env)
Specifies the application level environment variables.
You are better off specifying environment when creating an
application with a 'environment' parameter.
- Parameters:
- env
<static>
rio.Application.toString()
toString()
unload()
This method is called just before the page is unloaded. This can be triggered by
following a link, closing the window, using the back button, etc.
This method is meant to be overriden