Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/jquery/ui
File: mouse.js
/*!
[0] Fix | Delete
* jQuery UI Mouse 1.12.1
[1] Fix | Delete
* http://jqueryui.com
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright jQuery Foundation and other contributors
[4] Fix | Delete
* Released under the MIT license.
[5] Fix | Delete
* http://jquery.org/license
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
//>>label: Mouse
[9] Fix | Delete
//>>group: Widgets
[10] Fix | Delete
//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
[11] Fix | Delete
//>>docs: http://api.jqueryui.com/mouse/
[12] Fix | Delete
[13] Fix | Delete
( function( factory ) {
[14] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[15] Fix | Delete
[16] Fix | Delete
// AMD. Register as an anonymous module.
[17] Fix | Delete
define( [
[18] Fix | Delete
"jquery",
[19] Fix | Delete
"./core"
[20] Fix | Delete
], factory );
[21] Fix | Delete
} else {
[22] Fix | Delete
[23] Fix | Delete
// Browser globals
[24] Fix | Delete
factory( jQuery );
[25] Fix | Delete
}
[26] Fix | Delete
}( function( $ ) {
[27] Fix | Delete
[28] Fix | Delete
var mouseHandled = false;
[29] Fix | Delete
$( document ).on( "mouseup", function() {
[30] Fix | Delete
mouseHandled = false;
[31] Fix | Delete
} );
[32] Fix | Delete
[33] Fix | Delete
return $.widget( "ui.mouse", {
[34] Fix | Delete
version: "1.12.1",
[35] Fix | Delete
options: {
[36] Fix | Delete
cancel: "input, textarea, button, select, option",
[37] Fix | Delete
distance: 1,
[38] Fix | Delete
delay: 0
[39] Fix | Delete
},
[40] Fix | Delete
_mouseInit: function() {
[41] Fix | Delete
var that = this;
[42] Fix | Delete
[43] Fix | Delete
this.element
[44] Fix | Delete
.on( "mousedown." + this.widgetName, function( event ) {
[45] Fix | Delete
return that._mouseDown( event );
[46] Fix | Delete
} )
[47] Fix | Delete
.on( "click." + this.widgetName, function( event ) {
[48] Fix | Delete
if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
[49] Fix | Delete
$.removeData( event.target, that.widgetName + ".preventClickEvent" );
[50] Fix | Delete
event.stopImmediatePropagation();
[51] Fix | Delete
return false;
[52] Fix | Delete
}
[53] Fix | Delete
} );
[54] Fix | Delete
[55] Fix | Delete
this.started = false;
[56] Fix | Delete
},
[57] Fix | Delete
[58] Fix | Delete
// TODO: make sure destroying one instance of mouse doesn't mess with
[59] Fix | Delete
// other instances of mouse
[60] Fix | Delete
_mouseDestroy: function() {
[61] Fix | Delete
this.element.off( "." + this.widgetName );
[62] Fix | Delete
if ( this._mouseMoveDelegate ) {
[63] Fix | Delete
this.document
[64] Fix | Delete
.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
[65] Fix | Delete
.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
[66] Fix | Delete
}
[67] Fix | Delete
},
[68] Fix | Delete
[69] Fix | Delete
_mouseDown: function( event ) {
[70] Fix | Delete
[71] Fix | Delete
// don't let more than one widget handle mouseStart
[72] Fix | Delete
if ( mouseHandled ) {
[73] Fix | Delete
return;
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
this._mouseMoved = false;
[77] Fix | Delete
[78] Fix | Delete
// We may have missed mouseup (out of window)
[79] Fix | Delete
( this._mouseStarted && this._mouseUp( event ) );
[80] Fix | Delete
[81] Fix | Delete
this._mouseDownEvent = event;
[82] Fix | Delete
[83] Fix | Delete
var that = this,
[84] Fix | Delete
btnIsLeft = ( event.which === 1 ),
[85] Fix | Delete
[86] Fix | Delete
// event.target.nodeName works around a bug in IE 8 with
[87] Fix | Delete
// disabled inputs (#7620)
[88] Fix | Delete
elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
[89] Fix | Delete
$( event.target ).closest( this.options.cancel ).length : false );
[90] Fix | Delete
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
[91] Fix | Delete
return true;
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
this.mouseDelayMet = !this.options.delay;
[95] Fix | Delete
if ( !this.mouseDelayMet ) {
[96] Fix | Delete
this._mouseDelayTimer = setTimeout( function() {
[97] Fix | Delete
that.mouseDelayMet = true;
[98] Fix | Delete
}, this.options.delay );
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
[102] Fix | Delete
this._mouseStarted = ( this._mouseStart( event ) !== false );
[103] Fix | Delete
if ( !this._mouseStarted ) {
[104] Fix | Delete
event.preventDefault();
[105] Fix | Delete
return true;
[106] Fix | Delete
}
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
// Click event may never have fired (Gecko & Opera)
[110] Fix | Delete
if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
[111] Fix | Delete
$.removeData( event.target, this.widgetName + ".preventClickEvent" );
[112] Fix | Delete
}
[113] Fix | Delete
[114] Fix | Delete
// These delegates are required to keep context
[115] Fix | Delete
this._mouseMoveDelegate = function( event ) {
[116] Fix | Delete
return that._mouseMove( event );
[117] Fix | Delete
};
[118] Fix | Delete
this._mouseUpDelegate = function( event ) {
[119] Fix | Delete
return that._mouseUp( event );
[120] Fix | Delete
};
[121] Fix | Delete
[122] Fix | Delete
this.document
[123] Fix | Delete
.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
[124] Fix | Delete
.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
[125] Fix | Delete
[126] Fix | Delete
event.preventDefault();
[127] Fix | Delete
[128] Fix | Delete
mouseHandled = true;
[129] Fix | Delete
return true;
[130] Fix | Delete
},
[131] Fix | Delete
[132] Fix | Delete
_mouseMove: function( event ) {
[133] Fix | Delete
[134] Fix | Delete
// Only check for mouseups outside the document if you've moved inside the document
[135] Fix | Delete
// at least once. This prevents the firing of mouseup in the case of IE<9, which will
[136] Fix | Delete
// fire a mousemove event if content is placed under the cursor. See #7778
[137] Fix | Delete
// Support: IE <9
[138] Fix | Delete
if ( this._mouseMoved ) {
[139] Fix | Delete
[140] Fix | Delete
// IE mouseup check - mouseup happened when mouse was out of window
[141] Fix | Delete
if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
[142] Fix | Delete
!event.button ) {
[143] Fix | Delete
return this._mouseUp( event );
[144] Fix | Delete
[145] Fix | Delete
// Iframe mouseup check - mouseup occurred in another document
[146] Fix | Delete
} else if ( !event.which ) {
[147] Fix | Delete
[148] Fix | Delete
// Support: Safari <=8 - 9
[149] Fix | Delete
// Safari sets which to 0 if you press any of the following keys
[150] Fix | Delete
// during a drag (#14461)
[151] Fix | Delete
if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
[152] Fix | Delete
event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
[153] Fix | Delete
this.ignoreMissingWhich = true;
[154] Fix | Delete
} else if ( !this.ignoreMissingWhich ) {
[155] Fix | Delete
return this._mouseUp( event );
[156] Fix | Delete
}
[157] Fix | Delete
}
[158] Fix | Delete
}
[159] Fix | Delete
[160] Fix | Delete
if ( event.which || event.button ) {
[161] Fix | Delete
this._mouseMoved = true;
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
if ( this._mouseStarted ) {
[165] Fix | Delete
this._mouseDrag( event );
[166] Fix | Delete
return event.preventDefault();
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
[170] Fix | Delete
this._mouseStarted =
[171] Fix | Delete
( this._mouseStart( this._mouseDownEvent, event ) !== false );
[172] Fix | Delete
( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
return !this._mouseStarted;
[176] Fix | Delete
},
[177] Fix | Delete
[178] Fix | Delete
_mouseUp: function( event ) {
[179] Fix | Delete
this.document
[180] Fix | Delete
.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
[181] Fix | Delete
.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
[182] Fix | Delete
[183] Fix | Delete
if ( this._mouseStarted ) {
[184] Fix | Delete
this._mouseStarted = false;
[185] Fix | Delete
[186] Fix | Delete
if ( event.target === this._mouseDownEvent.target ) {
[187] Fix | Delete
$.data( event.target, this.widgetName + ".preventClickEvent", true );
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
this._mouseStop( event );
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
if ( this._mouseDelayTimer ) {
[194] Fix | Delete
clearTimeout( this._mouseDelayTimer );
[195] Fix | Delete
delete this._mouseDelayTimer;
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
this.ignoreMissingWhich = false;
[199] Fix | Delete
mouseHandled = false;
[200] Fix | Delete
event.preventDefault();
[201] Fix | Delete
},
[202] Fix | Delete
[203] Fix | Delete
_mouseDistanceMet: function( event ) {
[204] Fix | Delete
return ( Math.max(
[205] Fix | Delete
Math.abs( this._mouseDownEvent.pageX - event.pageX ),
[206] Fix | Delete
Math.abs( this._mouseDownEvent.pageY - event.pageY )
[207] Fix | Delete
) >= this.options.distance
[208] Fix | Delete
);
[209] Fix | Delete
},
[210] Fix | Delete
[211] Fix | Delete
_mouseDelayMet: function( /* event */ ) {
[212] Fix | Delete
return this.mouseDelayMet;
[213] Fix | Delete
},
[214] Fix | Delete
[215] Fix | Delete
// These are placeholder methods, to be overriden by extending plugin
[216] Fix | Delete
_mouseStart: function( /* event */ ) {},
[217] Fix | Delete
_mouseDrag: function( /* event */ ) {},
[218] Fix | Delete
_mouseStop: function( /* event */ ) {},
[219] Fix | Delete
_mouseCapture: function( /* event */ ) { return true; }
[220] Fix | Delete
} );
[221] Fix | Delete
[222] Fix | Delete
} ) );
[223] Fix | Delete
[224] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function