PHP 8.1.33
Preview: mouse.js Size: 6.08 KB
/home/jambtst2015/public_html/qasandra.com/wp-includes/js/jquery/ui/mouse.js

/*!
 * jQuery UI Mouse 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */

//>>label: Mouse
//>>group: Widgets
//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
//>>docs: https://api.jqueryui.com/mouse/

( function( factory ) {
	"use strict";

	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define( [
			"jquery",
			"../ie",
			"../version",
			"../widget"
		], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} )( function( $ ) {
"use strict";

var mouseHandled = false;
$( document ).on( "mouseup", function() {
	mouseHandled = false;
} );

return $.widget( "ui.mouse", {
	version: "1.13.3",
	options: {
		cancel: "input, textarea, button, select, option",
		distance: 1,
		delay: 0
	},
	_mouseInit: function() {
		var that = this;

		this.element
			.on( "mousedown." + this.widgetName, function( event ) {
				return that._mouseDown( event );
			} )
			.on( "click." + this.widgetName, function( event ) {
				if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
					$.removeData( event.target, that.widgetName + ".preventClickEvent" );
					event.stopImmediatePropagation();
					return false;
				}
			} );

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.off( "." + this.widgetName );
		if ( this._mouseMoveDelegate ) {
			this.document
				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
		}
	},

	_mouseDown: function( event ) {

		// don't let more than one widget handle mouseStart
		if ( mouseHandled ) {
			return;
		}

		this._mouseMoved = false;

		// We may have missed mouseup (out of window)
		if ( this._mouseStarted ) {
			this._mouseUp( event );
		}

		this._mouseDownEvent = event;

		var that = this,
			btnIsLeft = ( event.which === 1 ),

			// event.target.nodeName works around a bug in IE 8 with
			// disabled inputs (#7620)
			elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
				$( event.target ).closest( this.options.cancel ).length : false );
		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if ( !this.mouseDelayMet ) {
			this._mouseDelayTimer = setTimeout( function() {
				that.mouseDelayMet = true;
			}, this.options.delay );
		}

		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
			this._mouseStarted = ( this._mouseStart( event ) !== false );
			if ( !this._mouseStarted ) {
				event.preventDefault();
				return true;
			}
		}

		// Click event may never have fired (Gecko & Opera)
		if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
			$.removeData( event.target, this.widgetName + ".preventClickEvent" );
		}

		// These delegates are required to keep context
		this._mouseMoveDelegate = function( event ) {
			return that._mouseMove( event );
		};
		this._mouseUpDelegate = function( event ) {
			return that._mouseUp( event );
		};

		this.document
			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );

		event.preventDefault();

		mouseHandled = true;
		return true;
	},

	_mouseMove: function( event ) {

		// Only check for mouseups outside the document if you've moved inside the document
		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
		// fire a mousemove event if content is placed under the cursor. See #7778
		// Support: IE <9
		if ( this._mouseMoved ) {

			// IE mouseup check - mouseup happened when mouse was out of window
			if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
					!event.button ) {
				return this._mouseUp( event );

			// Iframe mouseup check - mouseup occurred in another document
			} else if ( !event.which ) {

				// Support: Safari <=8 - 9
				// Safari sets which to 0 if you press any of the following keys
				// during a drag (#14461)
				if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
						event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
					this.ignoreMissingWhich = true;
				} else if ( !this.ignoreMissingWhich ) {
					return this._mouseUp( event );
				}
			}
		}

		if ( event.which || event.button ) {
			this._mouseMoved = true;
		}

		if ( this._mouseStarted ) {
			this._mouseDrag( event );
			return event.preventDefault();
		}

		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
			this._mouseStarted =
				( this._mouseStart( this._mouseDownEvent, event ) !== false );
			if ( this._mouseStarted ) {
				this._mouseDrag( event );
			} else {
				this._mouseUp( event );
			}
		}

		return !this._mouseStarted;
	},

	_mouseUp: function( event ) {
		this.document
			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );

		if ( this._mouseStarted ) {
			this._mouseStarted = false;

			if ( event.target === this._mouseDownEvent.target ) {
				$.data( event.target, this.widgetName + ".preventClickEvent", true );
			}

			this._mouseStop( event );
		}

		if ( this._mouseDelayTimer ) {
			clearTimeout( this._mouseDelayTimer );
			delete this._mouseDelayTimer;
		}

		this.ignoreMissingWhich = false;
		mouseHandled = false;
		event.preventDefault();
	},

	_mouseDistanceMet: function( event ) {
		return ( Math.max(
				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
				Math.abs( this._mouseDownEvent.pageY - event.pageY )
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function( /* event */ ) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function( /* event */ ) {},
	_mouseDrag: function( /* event */ ) {},
	_mouseStop: function( /* event */ ) {},
	_mouseCapture: function( /* event */ ) {
		return true;
	}
} );

} );

Directory Contents

Dirs: 0 × Files: 74

Name Size Perms Modified Actions
15.76 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
8.65 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
17.12 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
8.34 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
11.43 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
6.01 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
7.41 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
4.25 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
8.42 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
4.30 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
48.72 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
20.96 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
80.59 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
35.89 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
23.34 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
12.79 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
34.71 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
17.99 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
12.60 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
6.51 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.61 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
880 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
2.60 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
991 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.54 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
796 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.56 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
753 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
2.86 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.10 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
968 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
525 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
2.13 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1020 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.21 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
648 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
995 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
510 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.53 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
688 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.34 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
723 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.84 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
846 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
5.29 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
2.43 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.92 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
917 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
888 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
442 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
24.04 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
10.09 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
18.52 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
9.96 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
6.08 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
3.35 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
4.14 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
2.50 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
29.78 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
18.38 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
7.94 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
4.40 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
15.96 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
9.28 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
19.14 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
10.51 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
46.52 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
24.91 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
14.10 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
7.50 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
23.11 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
11.73 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
14.14 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
6.10 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).