Index

Classes

Namespace

Variables

Functions

Namespace hasher

History Manager for rich-media applications.
Defined in: hasher.js.

Namespace Detail
hasher

Hasher

Field Detail
<static>
{string} hasher.appendHash

String that should always be added to the end of Hash value.

  • default value: '';
  • will be automatically removed from `hasher.getHash()`
  • avoid conflicts with elements that contain ID equal to hash value;
<static>
{signals.Signal} hasher.changed

Signal dispatched when hash value changes. - pass current hash as 1st parameter to listeners and previous hash value as 2nd parameter.

<static>
{signals.Signal} hasher.initialized

Signal dispatched when hasher is initialized. - pass current hash as first parameter to listeners.

<static>
{string} hasher.prependHash

String that should always be added to the beginning of Hash value.

  • default value: '/';
  • will be automatically removed from `hasher.getHash()`
  • avoid conflicts with elements that contain ID equal to hash value;
<static>
{string} hasher.separator

String used to split hash paths; used by hasher.getHashAsArray() to split paths.

  • default value: '/';
<static>
{signals.Signal} hasher.stopped

Signal dispatched when hasher is stopped. - pass current hash as first parameter to listeners

<static> <constant>
{string} hasher.VERSION

hasher Version Number

Method Detail
<static>
hasher.dispose()

Removes all event listeners, stops hasher and destroy hasher object. - IMPORTANT: hasher won't work after calling this method, hasher Object will be deleted.

<static>
{string} hasher.getBaseURL()
Returns:
{string} Retrieve URL without query string and hash.
<static>
{string} hasher.getHash()
Returns:
{string} Hash value without '#', `hasher.appendHash` and `hasher.prependHash`.
<static>
{Array.} hasher.getHashAsArray()
Returns:
{Array.} Hash value split into an Array.
<static>
{string} hasher.getURL()
Returns:
{string} Full URL.
<static>
hasher.init()

Start listening/dispatching changes in the hash/history.

  • hasher won't dispatch CHANGE events by manually typing a new value or pressing the back/forward buttons before calling this method.
<static>
{boolean} hasher.isActive()
Returns:
{boolean} If hasher is listening to changes on the browser history and/or hash value.
<static>
hasher.replaceHash(path)

Set Hash value without keeping previous hash on the history record. Similar to calling window.location.replace("#/hash") but will also work on IE6-7.

hasher.replaceHash('lorem', 'ipsum', 'dolor') -> '#/lorem/ipsum/dolor'
Parameters:
{...string} path
Hash value without '#'. Hasher will join path segments using `hasher.separator` and prepend/append hash value with `hasher.appendHash` and `hasher.prependHash`
<static>
hasher.setHash(path)

Set Hash value, generating a new history record.

hasher.setHash('lorem', 'ipsum', 'dolor') -> '#/lorem/ipsum/dolor'
Parameters:
{...string} path
Hash value without '#'. Hasher will join path segments using `hasher.separator` and prepend/append hash value with `hasher.appendHash` and `hasher.prependHash`
<static>
hasher.stop()

Stop listening/dispatching changes in the hash/history.

  • hasher won't dispatch CHANGE events by manually typing a new value or pressing the back/forward buttons after calling this method, unless you call hasher.init() again.
  • hasher will still dispatch changes made programatically by calling hasher.setHash();
<static>
{string} hasher.toString()
Returns:
{string} A string representation of the object.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 31 2012 15:19:09 GMT-0200 (BRST) | template based on Steffen Siering jsdoc-simple.