Index

Classes

Class

Methods

Class Banana.Util.UrlManager


Defined in: UrlManager.js.

Class Detail
Banana.Util.UrlManager()

Url Manager. It allows a user to manager url parameters in the achor part of the url. It provides the functionality to set url parameters, listen to changes in the url and mark and read history points

Method Detail
<static>
Banana.Util.UrlManager.autoRegisterModules()

Auto registers modules by looking at the current url All parameters in the achor part will be registered as a module

<static>
Banana.Util.UrlManager.clearUrl()

Clears the url by first removing all the modules (no change event can occur) and then remove all the external registered listeners.

<static>
{String} Banana.Util.UrlManager.createUrlString(section, params)

Helper to construct url string from complex object

Parameters:
{String} section
{Object} params
Returns:
{String} url
<static>
{String} Banana.Util.UrlManager.getBrowserUrl()

gets current browser url.

Returns:
{String}
<static>
{Array} Banana.Util.UrlManager.getHistory()

gets complete history

Returns:
{Array}
<static>
{String} Banana.Util.UrlManager.getModule(param)

gets the value of a registered module. We always try to fetch the internally registered value first.

Parameters:
param
Returns:
{String} param name of in the url
<static>
Banana.Util.UrlManager.getModuleHistory(name)
Parameters:
name
Returns:
Object returns module history
<static>
{Object} Banana.Util.UrlManager.getURLObject()
Returns:
{Object} of url key values
<static>
Banana.Util.UrlManager.listenModule(name, fn, data)

binds a function to a url change event. when

Parameters:
{String} name
of the url parameter to listen on
{Function} fn
callback function when change is detected
{mixed} data
optional
<static>
Banana.Util.UrlManager.registerModule(name)

registers module in the url. This doesn't mean that we see it in the url. A value needs to be set first.

Parameters:
{String} name
of the url param
<static>
Banana.Util.UrlManager.removeListeners()

Removes all listeners

<static>
Banana.Util.UrlManager.removeModule(name, when)

removes module from url

Parameters:
{String} name
of the param which should be removed from the url
{boolean} when
true we only remove the param from the url. It stays registered.
<static>
Banana.Util.UrlManager.removeModules()

unregisters all modules. Change in url params pointing to removed modules will not result in a trigger change event

<static>
Banana.Util.UrlManager.saveModuleHistory()

saves module history

<static>
Banana.Util.UrlManager.setModule(name, value, when)

sets module value in the url. Calling this method will result in a visible url change.

Parameters:
{String} name
of the url parameter
{String} value
when
true we dont update the url itself. so it wont trigger a change event
<static>
Banana.Util.UrlManager.startChecking()

Start checking the url for changes

<static>
Banana.Util.UrlManager.stopChecking()

Stop checking the url for changes

<static>
Banana.Util.UrlManager.unlistenModule(name)

unbinds all functions from change event

Parameters:
{String} name
of the url parameter
<static>
Banana.Util.UrlManager.updateUrl()

forces url to be updated Handy when you register multiple modules without updating url to prevent multiple browser history moments


Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:02:08 GMT+0100 (CET)