Have ideas to improve npm?Join in the discussion! »

    conglomerate-history

    2.0.3 • Public • Published

    NPM version Build Status

    conglomerate-history

    cross-browser history management

    Documentation

    History

    src/index.js:22-364

    Extends EventEmitter

    Handles cross-browser history management, based on either pushState and real URLs, or onhashchange and URL fragments. If the browser supports neither.

    _updateHash

    src/index.js:354-363

    Update the hash location, either replacing the current entry, or adding a new one to the browser history.

    Parameters

    checkUrl

    src/index.js:245-257

    Checks the current URL to see if it has changed, and if it has, calls loadUrl, normalizing across the hidden iframe.

    Parameters

    decodeFragment

    src/index.js:62-64

    Unicode characters in location.pathname are percent encoded so they're decoded for comparison. %25 should not be decoded since it may be part of an encoded parameter.

    Parameters

    Returns string decoded fragment

    getFragment

    src/index.js:108-118

    Get the cross-browser normalized URL fragment from the path or hash.

    Parameters

    Returns string normalized url fragment

    getHash

    src/index.js:84-87

    Gets the true hash value. Cannot use location.hash dir in Firefox where location.hash will always be decoded.

    Parameters

    • window object the global window or History instance

    Returns string

    getPath

    src/index.js:95-100

    Get the pathname and search params, without the root.

    Returns string pathname and search params

    getSearch

    src/index.js:72-75

    In IE6, the hash fragment and search params are incorrect if the fragment contains ?.

    Returns string

    loadUrl

    src/index.js:266-278

    Attempt to load the current URL fragment. If a route succeeds with a match, fires 'change' event.

    Parameters

    matchRoot

    src/index.js:48-52

    Does the pathname match the root?

    Returns boolean

    navigate

    src/index.js:293-344

    Save a fragment into the hash history, or replace the URL state if the 'replace' option is passed. You are responsible for properly URL-encoding the fragment in advance.

    The options object can contain trigger: true if you wish to have the route callback be fired (not usually desirable), or replace: true, if you wish to modify the current URL without adding an entry to the history.

    Parameters

    start

    src/index.js:127-201

    Start the hash change handling, returning true if the current URL matches an existing route, and false otherwise.

    Parameters

    stop

    src/index.js:208-231

    Disable Backbone.history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers.

    License

    conglomerate-history is released under the terms of the BSD-3-Clause license.

    This software includes or is derivative of works distributed under the licenses listed below. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses.

    • Backbone is released under the terms of the MIT license.

    Thanks

    Thanks to Jeremy Ashkenas and the rest of the Backbone.js authors.

    Install

    npm i conglomerate-history

    DownloadsWeekly Downloads

    0

    Version

    2.0.3

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • avatar