mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Upgrade jQuery Magnific popup version to 1.1.0 and modify for jQuery 3.x deprecations
Co-authored-by: matjazpotocnik <matjaz.potocnik@um.si>
This commit is contained in:
64
wire/modules/Jquery/JqueryMagnific/JqueryMagnific.css
Executable file → Normal file
64
wire/modules/Jquery/JqueryMagnific/JqueryMagnific.css
Executable file → Normal file
@@ -8,8 +8,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background: #0b0b0b;
|
background: #0b0b0b;
|
||||||
opacity: 0.8;
|
opacity: 0.8; }
|
||||||
filter: alpha(opacity=80); }
|
|
||||||
|
|
||||||
.mfp-wrap {
|
.mfp-wrap {
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -29,8 +28,6 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box; }
|
box-sizing: border-box; }
|
||||||
|
|
||||||
.mfp-container:before {
|
.mfp-container:before {
|
||||||
@@ -118,8 +115,8 @@ button.mfp-arrow {
|
|||||||
outline: none;
|
outline: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
z-index: 1046;
|
z-index: 1046;
|
||||||
-webkit-box-shadow: none;
|
box-shadow: none;
|
||||||
box-shadow: none; }
|
touch-action: manipulation; }
|
||||||
|
|
||||||
button::-moz-focus-inner {
|
button::-moz-focus-inner {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -135,7 +132,6 @@ button::-moz-focus-inner {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
opacity: 0.65;
|
opacity: 0.65;
|
||||||
filter: alpha(opacity=65);
|
|
||||||
padding: 0 0 18px 10px;
|
padding: 0 0 18px 10px;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -143,8 +139,7 @@ button::-moz-focus-inner {
|
|||||||
font-family: Arial, Baskerville, monospace; }
|
font-family: Arial, Baskerville, monospace; }
|
||||||
.mfp-close:hover,
|
.mfp-close:hover,
|
||||||
.mfp-close:focus {
|
.mfp-close:focus {
|
||||||
opacity: 1;
|
opacity: 1; }
|
||||||
filter: alpha(opacity=100); }
|
|
||||||
.mfp-close:active {
|
.mfp-close:active {
|
||||||
top: 1px; }
|
top: 1px; }
|
||||||
|
|
||||||
@@ -171,7 +166,6 @@ button::-moz-focus-inner {
|
|||||||
.mfp-arrow {
|
.mfp-arrow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
opacity: 0.65;
|
opacity: 0.65;
|
||||||
filter: alpha(opacity=65);
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
margin-top: -55px;
|
margin-top: -55px;
|
||||||
@@ -183,12 +177,9 @@ button::-moz-focus-inner {
|
|||||||
margin-top: -54px; }
|
margin-top: -54px; }
|
||||||
.mfp-arrow:hover,
|
.mfp-arrow:hover,
|
||||||
.mfp-arrow:focus {
|
.mfp-arrow:focus {
|
||||||
opacity: 1;
|
opacity: 1; }
|
||||||
filter: alpha(opacity=100); }
|
|
||||||
.mfp-arrow:before,
|
.mfp-arrow:before,
|
||||||
.mfp-arrow:after,
|
.mfp-arrow:after {
|
||||||
.mfp-arrow .mfp-b,
|
|
||||||
.mfp-arrow .mfp-a {
|
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
width: 0;
|
width: 0;
|
||||||
@@ -199,36 +190,30 @@ button::-moz-focus-inner {
|
|||||||
margin-top: 35px;
|
margin-top: 35px;
|
||||||
margin-left: 35px;
|
margin-left: 35px;
|
||||||
border: medium inset transparent; }
|
border: medium inset transparent; }
|
||||||
.mfp-arrow:after,
|
.mfp-arrow:after {
|
||||||
.mfp-arrow .mfp-a {
|
|
||||||
border-top-width: 13px;
|
border-top-width: 13px;
|
||||||
border-bottom-width: 13px;
|
border-bottom-width: 13px;
|
||||||
top: 8px; }
|
top: 8px; }
|
||||||
.mfp-arrow:before,
|
.mfp-arrow:before {
|
||||||
.mfp-arrow .mfp-b {
|
|
||||||
border-top-width: 21px;
|
border-top-width: 21px;
|
||||||
border-bottom-width: 21px;
|
border-bottom-width: 21px;
|
||||||
opacity: 0.7; }
|
opacity: 0.7; }
|
||||||
|
|
||||||
.mfp-arrow-left {
|
.mfp-arrow-left {
|
||||||
left: 0; }
|
left: 0; }
|
||||||
.mfp-arrow-left:after,
|
.mfp-arrow-left:after {
|
||||||
.mfp-arrow-left .mfp-a {
|
|
||||||
border-right: 17px solid #FFF;
|
border-right: 17px solid #FFF;
|
||||||
margin-left: 31px; }
|
margin-left: 31px; }
|
||||||
.mfp-arrow-left:before,
|
.mfp-arrow-left:before {
|
||||||
.mfp-arrow-left .mfp-b {
|
|
||||||
margin-left: 25px;
|
margin-left: 25px;
|
||||||
border-right: 27px solid #3F3F3F; }
|
border-right: 27px solid #3F3F3F; }
|
||||||
|
|
||||||
.mfp-arrow-right {
|
.mfp-arrow-right {
|
||||||
right: 0; }
|
right: 0; }
|
||||||
.mfp-arrow-right:after,
|
.mfp-arrow-right:after {
|
||||||
.mfp-arrow-right .mfp-a {
|
|
||||||
border-left: 17px solid #FFF;
|
border-left: 17px solid #FFF;
|
||||||
margin-left: 39px; }
|
margin-left: 39px; }
|
||||||
.mfp-arrow-right:before,
|
.mfp-arrow-right:before {
|
||||||
.mfp-arrow-right .mfp-b {
|
|
||||||
border-left: 27px solid #3F3F3F; }
|
border-left: 27px solid #3F3F3F; }
|
||||||
|
|
||||||
.mfp-iframe-holder {
|
.mfp-iframe-holder {
|
||||||
@@ -263,8 +248,6 @@ img.mfp-img {
|
|||||||
height: auto;
|
height: auto;
|
||||||
display: block;
|
display: block;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 40px 0 40px;
|
padding: 40px 0 40px;
|
||||||
margin: 0 auto; }
|
margin: 0 auto; }
|
||||||
@@ -336,8 +319,6 @@ img.mfp-img {
|
|||||||
top: auto;
|
top: auto;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box; }
|
box-sizing: border-box; }
|
||||||
.mfp-img-mobile .mfp-bottom-bar:empty {
|
.mfp-img-mobile .mfp-bottom-bar:empty {
|
||||||
padding: 0; }
|
padding: 0; }
|
||||||
@@ -368,24 +349,3 @@ img.mfp-img {
|
|||||||
.mfp-container {
|
.mfp-container {
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
padding-right: 6px; } }
|
padding-right: 6px; } }
|
||||||
|
|
||||||
.mfp-ie7 .mfp-img {
|
|
||||||
padding: 0; }
|
|
||||||
|
|
||||||
.mfp-ie7 .mfp-bottom-bar {
|
|
||||||
width: 600px;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -300px;
|
|
||||||
margin-top: 5px;
|
|
||||||
padding-bottom: 5px; }
|
|
||||||
|
|
||||||
.mfp-ie7 .mfp-container {
|
|
||||||
padding: 0; }
|
|
||||||
|
|
||||||
.mfp-ie7 .mfp-content {
|
|
||||||
padding-top: 44px; }
|
|
||||||
|
|
||||||
.mfp-ie7 .mfp-close {
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
padding-top: 0; }
|
|
||||||
|
237
wire/modules/Jquery/JqueryMagnific/JqueryMagnific.js
Executable file → Normal file
237
wire/modules/Jquery/JqueryMagnific/JqueryMagnific.js
Executable file → Normal file
@@ -1,6 +1,6 @@
|
|||||||
/*! Magnific Popup - v1.0.0 - 2015-09-17
|
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
||||||
* http://dimsemenov.com/plugins/magnific-popup/
|
* http://dimsemenov.com/plugins/magnific-popup/
|
||||||
* Copyright (c) 2015 Dmitry Semenov; */
|
* Copyright (c) 2016 Dmitry Semenov; */
|
||||||
;(function (factory) {
|
;(function (factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// AMD. Register as an anonymous module.
|
// AMD. Register as an anonymous module.
|
||||||
@@ -83,7 +83,7 @@ var _mfpOn = function(name, f) {
|
|||||||
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
||||||
e = e.charAt(0).toLowerCase() + e.slice(1);
|
e = e.charAt(0).toLowerCase() + e.slice(1);
|
||||||
if(mfp.st.callbacks[e]) {
|
if(mfp.st.callbacks[e]) {
|
||||||
mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
|
mfp.st.callbacks[e].apply(mfp, Array.isArray(data) ? data : [data]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -136,9 +136,7 @@ MagnificPopup.prototype = {
|
|||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
var appVersion = navigator.appVersion;
|
var appVersion = navigator.appVersion;
|
||||||
mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
|
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
||||||
mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
|
|
||||||
mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
|
|
||||||
mfp.isAndroid = (/android/gi).test(appVersion);
|
mfp.isAndroid = (/android/gi).test(appVersion);
|
||||||
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
||||||
mfp.supportsTransition = supportsTransitions();
|
mfp.supportsTransition = supportsTransitions();
|
||||||
@@ -177,7 +175,7 @@ MagnificPopup.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mfp.items = $.isArray(data.items) ? data.items : [data.items];
|
mfp.items = Array.isArray(data.items) ? data.items : [data.items];
|
||||||
mfp.index = data.index || 0;
|
mfp.index = data.index || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,8 +444,8 @@ MagnificPopup.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(mfp._lastFocusedEl) {
|
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
||||||
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
$(mfp._lastFocusedEl).trigger('focus'); // put tab focus back
|
||||||
}
|
}
|
||||||
mfp.currItem = null;
|
mfp.currItem = null;
|
||||||
mfp.content = null;
|
mfp.content = null;
|
||||||
@@ -501,10 +499,6 @@ MagnificPopup.prototype = {
|
|||||||
|
|
||||||
mfp.currItem = item;
|
mfp.currItem = item;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!mfp.currTemplate[type]) {
|
if(!mfp.currTemplate[type]) {
|
||||||
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
||||||
|
|
||||||
@@ -565,8 +559,6 @@ MagnificPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates Magnific Popup data object based on given data
|
* Creates Magnific Popup data object based on given data
|
||||||
* @param {int} index Index of item to parse
|
* @param {int} index Index of item to parse
|
||||||
@@ -649,7 +641,7 @@ MagnificPopup.prototype = {
|
|||||||
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
||||||
|
|
||||||
if(disableOn) {
|
if(disableOn) {
|
||||||
if($.isFunction(disableOn)) {
|
if(typeof disableOn === 'function') {
|
||||||
if( !disableOn.call(mfp) ) {
|
if( !disableOn.call(mfp) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -668,7 +660,6 @@ MagnificPopup.prototype = {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
options.el = $(e.mfpEl);
|
options.el = $(e.mfpEl);
|
||||||
if(options.delegate) {
|
if(options.delegate) {
|
||||||
@@ -764,7 +755,7 @@ MagnificPopup.prototype = {
|
|||||||
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
||||||
},
|
},
|
||||||
_setFocus: function() {
|
_setFocus: function() {
|
||||||
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
|
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger('focus');
|
||||||
},
|
},
|
||||||
_onFocusIn: function(e) {
|
_onFocusIn: function(e) {
|
||||||
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
||||||
@@ -797,7 +788,7 @@ MagnificPopup.prototype = {
|
|||||||
if(el.is('img')) {
|
if(el.is('img')) {
|
||||||
el.attr('src', value);
|
el.attr('src', value);
|
||||||
} else {
|
} else {
|
||||||
el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
|
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
el.attr(arr[1], value);
|
el.attr(arr[1], value);
|
||||||
@@ -843,7 +834,6 @@ $.magnificPopup = {
|
|||||||
} else {
|
} else {
|
||||||
options = $.extend(true, {}, options);
|
options = $.extend(true, {}, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
options.isObj = true;
|
options.isObj = true;
|
||||||
options.index = index || 0;
|
options.index = index || 0;
|
||||||
@@ -907,7 +897,9 @@ $.magnificPopup = {
|
|||||||
|
|
||||||
tClose: 'Close (Esc)',
|
tClose: 'Close (Esc)',
|
||||||
|
|
||||||
tLoading: 'Loading...'
|
tLoading: 'Loading...',
|
||||||
|
|
||||||
|
autoFocusLast: true
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -963,26 +955,6 @@ $.fn.magnificPopup = function(options) {
|
|||||||
return jqEl;
|
return jqEl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//Quick benchmark
|
|
||||||
/*
|
|
||||||
var start = performance.now(),
|
|
||||||
i,
|
|
||||||
rounds = 1000;
|
|
||||||
|
|
||||||
for(i = 0; i < rounds; i++) {
|
|
||||||
|
|
||||||
}
|
|
||||||
console.log('Test #1:', performance.now() - start);
|
|
||||||
|
|
||||||
start = performance.now();
|
|
||||||
for(i = 0; i < rounds; i++) {
|
|
||||||
|
|
||||||
}
|
|
||||||
console.log('Test #2:', performance.now() - start);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*>>core*/
|
/*>>core*/
|
||||||
|
|
||||||
/*>>inline*/
|
/*>>inline*/
|
||||||
@@ -1134,12 +1106,6 @@ $.magnificPopup.registerModule(AJAX_NS, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*>>ajax*/
|
/*>>ajax*/
|
||||||
|
|
||||||
/*>>image*/
|
/*>>image*/
|
||||||
@@ -1151,7 +1117,7 @@ var _imgInterval,
|
|||||||
var src = mfp.st.image.titleSrc;
|
var src = mfp.st.image.titleSrc;
|
||||||
|
|
||||||
if(src) {
|
if(src) {
|
||||||
if($.isFunction(src)) {
|
if(typeof src === 'function') {
|
||||||
return src.call(mfp, item);
|
return src.call(mfp, item);
|
||||||
} else if(item.el) {
|
} else if(item.el) {
|
||||||
return item.el.attr(src) || '';
|
return item.el.attr(src) || '';
|
||||||
@@ -1388,8 +1354,6 @@ $.magnificPopup.registerModule('image', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*>>image*/
|
/*>>image*/
|
||||||
|
|
||||||
/*>>zoom*/
|
/*>>zoom*/
|
||||||
@@ -1723,8 +1687,7 @@ $.magnificPopup.registerModule('gallery', {
|
|||||||
initGallery: function() {
|
initGallery: function() {
|
||||||
|
|
||||||
var gSt = mfp.st.gallery,
|
var gSt = mfp.st.gallery,
|
||||||
ns = '.mfp-gallery',
|
ns = '.mfp-gallery';
|
||||||
supportsFastClick = Boolean($.fn.mfpFastClick);
|
|
||||||
|
|
||||||
mfp.direction = true; // true - next, false - prev
|
mfp.direction = true; // true - next, false - prev
|
||||||
|
|
||||||
@@ -1769,22 +1732,13 @@ $.magnificPopup.registerModule('gallery', {
|
|||||||
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
||||||
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
||||||
|
|
||||||
var eName = supportsFastClick ? 'mfpFastClick' : 'click';
|
arrowLeft.on('click', function() {
|
||||||
arrowLeft[eName](function() {
|
|
||||||
mfp.prev();
|
mfp.prev();
|
||||||
});
|
});
|
||||||
arrowRight[eName](function() {
|
arrowRight.on('click', function() {
|
||||||
mfp.next();
|
mfp.next();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
|
|
||||||
if(mfp.isIE7) {
|
|
||||||
_getEl('b', arrowLeft[0], false, true);
|
|
||||||
_getEl('a', arrowLeft[0], false, true);
|
|
||||||
_getEl('b', arrowRight[0], false, true);
|
|
||||||
_getEl('a', arrowRight[0], false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
mfp.container.append(arrowLeft.add(arrowRight));
|
mfp.container.append(arrowLeft.add(arrowRight));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1802,10 +1756,6 @@ $.magnificPopup.registerModule('gallery', {
|
|||||||
_mfpOn(CLOSE_EVENT+ns, function() {
|
_mfpOn(CLOSE_EVENT+ns, function() {
|
||||||
_document.off(ns);
|
_document.off(ns);
|
||||||
mfp.wrap.off('click'+ns);
|
mfp.wrap.off('click'+ns);
|
||||||
|
|
||||||
if(mfp.arrowLeft && supportsFastClick) {
|
|
||||||
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
|
|
||||||
}
|
|
||||||
mfp.arrowRight = mfp.arrowLeft = null;
|
mfp.arrowRight = mfp.arrowLeft = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1868,58 +1818,6 @@ $.magnificPopup.registerModule('gallery', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
Touch Support that might be implemented some day
|
|
||||||
|
|
||||||
addSwipeGesture: function() {
|
|
||||||
var startX,
|
|
||||||
moved,
|
|
||||||
multipleTouches;
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
var namespace = '.mfp',
|
|
||||||
addEventNames = function(pref, down, move, up, cancel) {
|
|
||||||
mfp._tStart = pref + down + namespace;
|
|
||||||
mfp._tMove = pref + move + namespace;
|
|
||||||
mfp._tEnd = pref + up + namespace;
|
|
||||||
mfp._tCancel = pref + cancel + namespace;
|
|
||||||
};
|
|
||||||
|
|
||||||
if(window.navigator.msPointerEnabled) {
|
|
||||||
addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
|
|
||||||
} else if('ontouchstart' in window) {
|
|
||||||
addEventNames('touch', 'start', 'move', 'end', 'cancel');
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_window.on(mfp._tStart, function(e) {
|
|
||||||
var oE = e.originalEvent;
|
|
||||||
multipleTouches = moved = false;
|
|
||||||
startX = oE.pageX || oE.changedTouches[0].pageX;
|
|
||||||
}).on(mfp._tMove, function(e) {
|
|
||||||
if(e.originalEvent.touches.length > 1) {
|
|
||||||
multipleTouches = e.originalEvent.touches.length;
|
|
||||||
} else {
|
|
||||||
//e.preventDefault();
|
|
||||||
moved = true;
|
|
||||||
}
|
|
||||||
}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
|
|
||||||
if(moved && !multipleTouches) {
|
|
||||||
var oE = e.originalEvent,
|
|
||||||
diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
|
|
||||||
|
|
||||||
if(diff > 20) {
|
|
||||||
mfp.next();
|
|
||||||
} else if(diff < -20) {
|
|
||||||
mfp.prev();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*>>gallery*/
|
/*>>gallery*/
|
||||||
|
|
||||||
/*>>retina*/
|
/*>>retina*/
|
||||||
@@ -1960,101 +1858,4 @@ $.magnificPopup.registerModule(RETINA_NS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/*>>retina*/
|
/*>>retina*/
|
||||||
|
_checkInstance(); }));
|
||||||
/*>>fastclick*/
|
|
||||||
/**
|
|
||||||
* FastClick event implementation. (removes 300ms delay on touch devices)
|
|
||||||
* Based on https://developers.google.com/mobile/articles/fast_buttons
|
|
||||||
*
|
|
||||||
* You may use it outside the Magnific Popup by calling just:
|
|
||||||
*
|
|
||||||
* $('.your-el').mfpFastClick(function() {
|
|
||||||
* console.log('Clicked!');
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* To unbind:
|
|
||||||
* $('.your-el').destroyMfpFastClick();
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
|
|
||||||
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ghostClickDelay = 1000,
|
|
||||||
supportsTouch = 'ontouchstart' in window,
|
|
||||||
unbindTouchMove = function() {
|
|
||||||
_window.off('touchmove'+ns+' touchend'+ns);
|
|
||||||
},
|
|
||||||
eName = 'mfpFastClick',
|
|
||||||
ns = '.'+eName;
|
|
||||||
|
|
||||||
|
|
||||||
// As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
|
|
||||||
$.fn.mfpFastClick = function(callback) {
|
|
||||||
|
|
||||||
return $(this).each(function() {
|
|
||||||
|
|
||||||
var elem = $(this),
|
|
||||||
lock;
|
|
||||||
|
|
||||||
if( supportsTouch ) {
|
|
||||||
|
|
||||||
var timeout,
|
|
||||||
startX,
|
|
||||||
startY,
|
|
||||||
pointerMoved,
|
|
||||||
point,
|
|
||||||
numPointers;
|
|
||||||
|
|
||||||
elem.on('touchstart' + ns, function(e) {
|
|
||||||
pointerMoved = false;
|
|
||||||
numPointers = 1;
|
|
||||||
|
|
||||||
point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
|
|
||||||
startX = point.clientX;
|
|
||||||
startY = point.clientY;
|
|
||||||
|
|
||||||
_window.on('touchmove'+ns, function(e) {
|
|
||||||
point = e.originalEvent ? e.originalEvent.touches : e.touches;
|
|
||||||
numPointers = point.length;
|
|
||||||
point = point[0];
|
|
||||||
if (Math.abs(point.clientX - startX) > 10 ||
|
|
||||||
Math.abs(point.clientY - startY) > 10) {
|
|
||||||
pointerMoved = true;
|
|
||||||
unbindTouchMove();
|
|
||||||
}
|
|
||||||
}).on('touchend'+ns, function(e) {
|
|
||||||
unbindTouchMove();
|
|
||||||
if(pointerMoved || numPointers > 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
lock = true;
|
|
||||||
e.preventDefault();
|
|
||||||
clearTimeout(timeout);
|
|
||||||
timeout = setTimeout(function() {
|
|
||||||
lock = false;
|
|
||||||
}, ghostClickDelay);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
elem.on('click' + ns, function() {
|
|
||||||
if(!lock) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.destroyMfpFastClick = function() {
|
|
||||||
$(this).off('touchstart' + ns + ' click' + ns);
|
|
||||||
if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
/*>>fastclick*/
|
|
||||||
_checkInstance(); }));
|
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -5,9 +5,9 @@ class JqueryMagnific extends ModuleJS {
|
|||||||
public static function getModuleInfo() {
|
public static function getModuleInfo() {
|
||||||
return array(
|
return array(
|
||||||
'title' => 'jQuery Magnific Popup',
|
'title' => 'jQuery Magnific Popup',
|
||||||
'version' => 1,
|
'version' => '1.1.0',
|
||||||
'summary' => 'Provides lightbox capability for image galleries. Replacement for FancyBox. Uses Magnific Popup by @dimsemenov.',
|
'summary' => 'Provides lightbox capability for image galleries. Replacement for FancyBox. Uses Magnific Popup by @dimsemenov.',
|
||||||
'href' => 'http://dimsemenov.com/plugins/magnific-popup/',
|
'href' => 'https://github.com/dimsemenov/Magnific-Popup/'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user