Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/ninja-fo.../assets/js/lib
File: jquery.ui.touch-punch.js
/*!
[0] Fix | Delete
*
[1] Fix | Delete
* This library has been modified! This function has been changed: mouseProto._mouseInit
[2] Fix | Delete
*
[3] Fix | Delete
* Original Version:
[4] Fix | Delete
*
[5] Fix | Delete
* mouseProto._mouseInit = function () {
[6] Fix | Delete
*
[7] Fix | Delete
* var self = this;
[8] Fix | Delete
*
[9] Fix | Delete
* // Delegate the touch handlers to the widget's element
[10] Fix | Delete
* self.element.bind({
[11] Fix | Delete
* touchstart: $.proxy(self, '_touchStart'),
[12] Fix | Delete
* touchmove: $.proxy(self, '_touchMove'),
[13] Fix | Delete
* touchend: $.proxy(self, '_touchEnd')
[14] Fix | Delete
* });
[15] Fix | Delete
*
[16] Fix | Delete
* // Call the original $.ui.mouse init method
[17] Fix | Delete
* _mouseInit.call(self);
[18] Fix | Delete
* };
[19] Fix | Delete
*
[20] Fix | Delete
*
[21] Fix | Delete
* New Version:
[22] Fix | Delete
*
[23] Fix | Delete
* mouseProto._mouseInit = function () {
[24] Fix | Delete
*
[25] Fix | Delete
* var self = this;
[26] Fix | Delete
*
[27] Fix | Delete
* // Delegate the touch handlers to the widget's element
[28] Fix | Delete
* self.element
[29] Fix | Delete
* .bind('taphold', $.proxy(self, '_touchStart')) // IMPORTANT!MOD FOR TAPHOLD TO START SORTABLE
[30] Fix | Delete
* .bind('touchmove', $.proxy(self, '_touchMove'))
[31] Fix | Delete
* .bind('touchend', $.proxy(self, '_touchEnd'));
[32] Fix | Delete
*
[33] Fix | Delete
* // Call the original $.ui.mouse init method
[34] Fix | Delete
* _mouseInit.call(self);
[35] Fix | Delete
* };
[36] Fix | Delete
*
[37] Fix | Delete
* Why?
[38] Fix | Delete
*
[39] Fix | Delete
* The original version mapped any tap start to a click. This means that you weren't able to scroll through
[40] Fix | Delete
* the sortable on a mobile device, as every attempt to scroll was intercepted as a click.
[41] Fix | Delete
*
[42] Fix | Delete
* jQuery UI Touch Punch 0.2.3
[43] Fix | Delete
*
[44] Fix | Delete
* Copyright 2011–2014, Dave Furfero
[45] Fix | Delete
* Dual licensed under the MIT or GPL Version 2 licenses.
[46] Fix | Delete
*
[47] Fix | Delete
* Depends:
[48] Fix | Delete
* jquery.ui.widget.js
[49] Fix | Delete
* jquery.ui.mouse.js
[50] Fix | Delete
*/
[51] Fix | Delete
(function ($) {
[52] Fix | Delete
[53] Fix | Delete
// Detect touch support
[54] Fix | Delete
$.support.touch = 'ontouchend' in document;
[55] Fix | Delete
[56] Fix | Delete
// Ignore browsers without touch support
[57] Fix | Delete
if (!$.support.touch) {
[58] Fix | Delete
return;
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
var mouseProto = $.ui.mouse.prototype,
[62] Fix | Delete
_mouseInit = mouseProto._mouseInit,
[63] Fix | Delete
_mouseDestroy = mouseProto._mouseDestroy,
[64] Fix | Delete
touchHandled;
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* Simulate a mouse event based on a corresponding touch event
[68] Fix | Delete
* @param {Object} event A touch event
[69] Fix | Delete
* @param {String} simulatedType The corresponding mouse event
[70] Fix | Delete
*/
[71] Fix | Delete
function simulateMouseEvent (event, simulatedType) {
[72] Fix | Delete
[73] Fix | Delete
// Ignore multi-touch events
[74] Fix | Delete
if (event.originalEvent.touches.length > 1) {
[75] Fix | Delete
return;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
event.preventDefault();
[79] Fix | Delete
[80] Fix | Delete
var touch = event.originalEvent.changedTouches[0],
[81] Fix | Delete
simulatedEvent = document.createEvent('MouseEvents');
[82] Fix | Delete
[83] Fix | Delete
// Initialize the simulated mouse event using the touch event's coordinates
[84] Fix | Delete
simulatedEvent.initMouseEvent(
[85] Fix | Delete
simulatedType, // type
[86] Fix | Delete
true, // bubbles
[87] Fix | Delete
true, // cancelable
[88] Fix | Delete
window, // view
[89] Fix | Delete
1, // detail
[90] Fix | Delete
touch.screenX, // screenX
[91] Fix | Delete
touch.screenY, // screenY
[92] Fix | Delete
touch.clientX, // clientX
[93] Fix | Delete
touch.clientY, // clientY
[94] Fix | Delete
false, // ctrlKey
[95] Fix | Delete
false, // altKey
[96] Fix | Delete
false, // shiftKey
[97] Fix | Delete
false, // metaKey
[98] Fix | Delete
0, // button
[99] Fix | Delete
null // relatedTarget
[100] Fix | Delete
);
[101] Fix | Delete
[102] Fix | Delete
// Dispatch the simulated event to the target element
[103] Fix | Delete
event.target.dispatchEvent(simulatedEvent);
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Handle the jQuery UI widget's touchstart events
[108] Fix | Delete
* @param {Object} event The widget element's touchstart event
[109] Fix | Delete
*/
[110] Fix | Delete
mouseProto._touchStart = function (event) {
[111] Fix | Delete
[112] Fix | Delete
var self = this;
[113] Fix | Delete
[114] Fix | Delete
// Ignore the event if another widget is already being handled
[115] Fix | Delete
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
[116] Fix | Delete
return;
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
// Set the flag to prevent other widgets from inheriting the touch event
[120] Fix | Delete
touchHandled = true;
[121] Fix | Delete
[122] Fix | Delete
// Track movement to determine if interaction was a click
[123] Fix | Delete
self._touchMoved = false;
[124] Fix | Delete
[125] Fix | Delete
// Simulate the mouseover event
[126] Fix | Delete
simulateMouseEvent(event, 'mouseover');
[127] Fix | Delete
[128] Fix | Delete
// Simulate the mousemove event
[129] Fix | Delete
simulateMouseEvent(event, 'mousemove');
[130] Fix | Delete
[131] Fix | Delete
// Simulate the mousedown event
[132] Fix | Delete
simulateMouseEvent(event, 'mousedown');
[133] Fix | Delete
};
[134] Fix | Delete
[135] Fix | Delete
/**
[136] Fix | Delete
* Handle the jQuery UI widget's touchmove events
[137] Fix | Delete
* @param {Object} event The document's touchmove event
[138] Fix | Delete
*/
[139] Fix | Delete
mouseProto._touchMove = function (event) {
[140] Fix | Delete
[141] Fix | Delete
// Ignore event if not handled
[142] Fix | Delete
if (!touchHandled) {
[143] Fix | Delete
return;
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
// Interaction was not a click
[147] Fix | Delete
this._touchMoved = true;
[148] Fix | Delete
[149] Fix | Delete
// Simulate the mousemove event
[150] Fix | Delete
simulateMouseEvent(event, 'mousemove');
[151] Fix | Delete
};
[152] Fix | Delete
[153] Fix | Delete
/**
[154] Fix | Delete
* Handle the jQuery UI widget's touchend events
[155] Fix | Delete
* @param {Object} event The document's touchend event
[156] Fix | Delete
*/
[157] Fix | Delete
mouseProto._touchEnd = function (event) {
[158] Fix | Delete
[159] Fix | Delete
// Ignore event if not handled
[160] Fix | Delete
if (!touchHandled) {
[161] Fix | Delete
return;
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
// Simulate the mouseup event
[165] Fix | Delete
simulateMouseEvent(event, 'mouseup');
[166] Fix | Delete
[167] Fix | Delete
// Simulate the mouseout event
[168] Fix | Delete
simulateMouseEvent(event, 'mouseout');
[169] Fix | Delete
[170] Fix | Delete
// If the touch interaction did not move, it should trigger a click
[171] Fix | Delete
if (!this._touchMoved) {
[172] Fix | Delete
[173] Fix | Delete
// Simulate the click event
[174] Fix | Delete
simulateMouseEvent(event, 'click');
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
// Unset the flag to allow other widgets to inherit the touch event
[178] Fix | Delete
touchHandled = false;
[179] Fix | Delete
};
[180] Fix | Delete
[181] Fix | Delete
/**
[182] Fix | Delete
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
[183] Fix | Delete
* This method extends the widget with bound touch event handlers that
[184] Fix | Delete
* translate touch events to mouse events and pass them to the widget's
[185] Fix | Delete
* original mouse event handling methods.
[186] Fix | Delete
*/
[187] Fix | Delete
mouseProto._mouseInit = function () {
[188] Fix | Delete
[189] Fix | Delete
var self = this;
[190] Fix | Delete
[191] Fix | Delete
// Delegate the touch handlers to the widget's element
[192] Fix | Delete
self.element
[193] Fix | Delete
.bind('taphold', $.proxy(self, '_touchStart')) // IMPORTANT!MOD FOR TAPHOLD TO START SORTABLE
[194] Fix | Delete
.bind('touchmove', $.proxy(self, '_touchMove'))
[195] Fix | Delete
.bind('touchend', $.proxy(self, '_touchEnd'));
[196] Fix | Delete
[197] Fix | Delete
// Call the original $.ui.mouse init method
[198] Fix | Delete
_mouseInit.call(self);
[199] Fix | Delete
};
[200] Fix | Delete
[201] Fix | Delete
[202] Fix | Delete
/**
[203] Fix | Delete
* Remove the touch event handlers
[204] Fix | Delete
*/
[205] Fix | Delete
mouseProto._mouseDestroy = function () {
[206] Fix | Delete
[207] Fix | Delete
var self = this;
[208] Fix | Delete
[209] Fix | Delete
// Delegate the touch handlers to the widget's element
[210] Fix | Delete
self.element.unbind({
[211] Fix | Delete
touchstart: $.proxy(self, '_touchStart'),
[212] Fix | Delete
touchmove: $.proxy(self, '_touchMove'),
[213] Fix | Delete
touchend: $.proxy(self, '_touchEnd')
[214] Fix | Delete
});
[215] Fix | Delete
[216] Fix | Delete
// Call the original $.ui.mouse destroy method
[217] Fix | Delete
_mouseDestroy.call(self);
[218] Fix | Delete
};
[219] Fix | Delete
[220] Fix | Delete
})(jQuery);
[221] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function