plugins/touchswipe.js
function init(options) {
		//Prep and extend the options
		if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) {
			options.allowPageScroll = NONE;
		}
		
        //Check for deprecated options
		//Ensure that any old click handlers are assigned to the new tap, unless we have a tap
		if(options.click!==undefined && options.tap===undefined) {
		    options.tap = options.click;
		}

		if (!options) {
			options = {};
		}
		
        //pass empty object so we dont modify the defaults
		options = $.extend({}, $.fn.swipe.defaults, options);

		//For each element instantiate the plugin
		return this.each(function () {
			var $this = $(this);

			//Check we havent already initialised the plugin
			var plugin = $this.data(PLUGIN_NS);

			if (!plugin) {
				plugin = new TouchSwipe(this, options);
				$this.data(PLUGIN_NS, plugin);
			}
		});
	}
function init(options) {
		//Prep and extend the options
		if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) {
			options.allowPageScroll = NONE;
		}
		
        //Check for deprecated options
		//Ensure that any old click handlers are assigned to the new tap, unless we have a tap
		if(options.click!==undefined && options.tap===undefined) {
		    options.tap = options.click;
		}

		if (!options) {
			options = {};
		}
		
        //pass empty object so we dont modify the defaults
		options = $.extend({}, $.fn.swipe.defaults, options);

		//For each element instantiate the plugin
		return this.each(function () {
			var $this = $(this);

			//Check we havent already initialised the plugin
			var plugin = $this.data(PLUGIN_NS);

			if (!plugin) {
				plugin = new TouchSwipe(this, options);
				$this.data(PLUGIN_NS, plugin);
			}
		});
	}
function init ( options ) { //Prep and extend the options if ( options && ( options . allowPageScroll === undefined && ( options . swipe !== undefined || options . swipeStatus !== undefined ) ) ) { options . allowPageScroll = NONE ; } //Check for deprecated options //Ensure that any old click handlers are assigned to the new tap, unless we have a tap if ( options . click !== undefined && options . tap === undefined ) { options . tap = options . click ; } if ( ! options ) { options = { } ; } //pass empty object so we dont modify the defaults options = $ . extend ( { } , $ . fn . swipe . defaults , options ) ; //For each element instantiate the plugin return this . each ( function ( ) { var $this = $ ( this ) ; //Check we havent already initialised the plugin var plugin = $this . data ( PLUGIN_NS ) ; if ( ! plugin ) { plugin = new TouchSwipe ( this , options ) ; $this . data ( PLUGIN_NS , plugin ) ; } } ) ; }
Initialise the plugin for each DOM element matched
This creates a new instance of the main TouchSwipe class for each DOM element, and then
saves a reference to that instance in the elements data property.
@internal
Initialise the plugin for each DOM element matched This creates a new instance of the main TouchSwipe class for each DOM element and then saves a reference to that instance in the elements data property .