Sha256: 8f0e28631b9f20a9a51a2c5e31bc377e1d2125a50c8245810d34c151ab4b4b8f

Contents?: true

Size: 1.45 KB

Versions: 2

Compression:

Stored size: 1.45 KB

Contents

/**
 * History.js jQuery Adapter
 * @author Benjamin Arthur Lupton <contact@balupton.com>
 * @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
 */

// Closure
(function(window, undefined) {
  // Localise Globals
  var
          History = window.History = window.History || {},
          jQuery = window.jQuery;

  // Check Existence
  if (typeof History.Adapter !== 'undefined') {
    throw new Error('History.js Adapter has already been loaded...');
  }

  // Add the Adapter
  History.Adapter = {
    /**
     * History.Adapter.bind(el,event,callback)
     * @param {Element|Selector} el
     * @param {String} event - custom and standard events
     * @param {Function} callback
     * @return
     */
    bind: function(el, event, callback) {
      jQuery(el).bind(event, callback);
    },

    /**
     * History.Adapter.trigger(el,event)
     * @param {Element|Selector} el
     * @param {String} event - custom and standard events
     * @return
     */
    trigger: function(el, event) {
      jQuery(el).trigger(event);
    },

    /**
     * History.Adapter.trigger(el,event,data)
     * @param {Function} callback
     * @return
     */
    onDomLoad: function(callback) {
      jQuery(callback);
    }
  };

  // Try and Initialise History
  if (typeof History.init !== 'undefined') {
    History.init();
  }

})(window);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
compass-jquery-plugin-0.3.3.1 templates/jquery/history.adapter.jquery.js
compass-jquery-plugin-0.3.3.0 templates/jquery/history.adapter.jquery.js