Class Banana.Util.UrlManager
Defined in: UrlManager.js.
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
Auto registers modules by looking at the current url All parameters in the achor part will be registered as a module
Clears the url by first removing all the modules (no change event can occur) and then remove all the external registered listeners.
Helper to construct url string from complex object
- Parameters:
- {String} section
- {Object} params
- Returns:
- {String} url
gets current browser url.
- Returns:
- {String}
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
- Parameters:
- name
- Returns:
- Object returns module history
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
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
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.
unregisters all modules. Change in url params pointing to removed modules will not result in a trigger change event
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