Class: App

App


new App()

This class describes the behavior of the application
Source:

Members


<static, constant> INVALID_URI

The URI to return for non existing route
Source:

Methods


dialog(action)

Load a URL in a dialog box
Parameters:
Name Type Description
action string The action to perform. If "close", it will wlose the current dialog box, else it will load the action in the dialog box and open it
Source:

getRouteFromUri(uri)

Get the route name corresponding to an URI
Parameters:
Name Type Description
uri string The uri to look the corresponding route for
Source:
Returns:
The found route
Type
Object

getUri(method, args)

Get uri for a given route name or the controller of the route
Parameters:
Name Type Description
method string The route name or the controller method executed by this route
args Object The route parameters
Source:
Returns:
- the computed URI
Type
string

hideNotification()

Hide the displayed notification
Source:

load(url, data,)

Load a page in the current tab, or a new tab, or a given html node
Parameters:
Name Type Description
url string The url to load
data, Object the options. This object can hasve the following data : - newtab (default false) : if set to true, the page will be loaded in a new tab of the application - onload (default null) : A callback function to execute when the page is loaded - post (default null) : an object of POST data to send in the URL
Source:

notify(level, message, options)

Display a notification on the application or on the user desktop
Parameters:
Name Type Description
level string The notification level (info, success, warning, danger or desktop)
message string The message to display in the notification
options Object The options for desktop notifications
Source:

openLastTabs(uris, onload)

Open a set of pages
Parameters:
Name Type Description
uris Array The uris to open, each one in a tab
onload function The callback to execute when all the tabs are loaded
Source:

print(element)

Print a part of the page (or the whole page)
Parameters:
Name Type Description
element NodeElement The DOM element to print. If not set or null, then this will print the whole page
Source:

ready(callback)

Add a callback when the application is ready to run
Parameters:
Name Type Description
callback function The action to perform when the application is ready to run
Source:

refreshMenu()

Refresh the main menu
Source:

setLanguage(language)

Set the language of the application
Parameters:
Name Type Description
language string The language tag
Source:

setRootUrl(url)

Set the root url of the application
Parameters:
Name Type Description
url string The root url to set
Source:

setRoutes(routes)

Set the existing routes of the application
Parameters:
Name Type Description
routes Object The routes to set
Source:

start()

Initialize the application
Source: