magnific-popup-rails 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/magnific-popup.js +61 -263
- data/app/assets/stylesheets/magnific-popup.css +12 -52
- data/magnific-popup-rails.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b7544956727b2852b9f6a6d1ec53018b205872f
|
4
|
+
data.tar.gz: 6f18f638d061b89409f25a9c8be4b14c8768a3d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b55b8879b1975d79c91b74f32c65f76123ff007d2b72581bae5847ea2478ae45941f46d5bdda18375c0c30d46a53679f6b3b8151eac33b1bedd3716976452b0c
|
7
|
+
data.tar.gz: 005beb749d4213ca00e5e6dd7cf115e03be46129eb34af832d733b8b41823a5131ceddbdcd6679ba51f5b6bc451d5065c1020690cf3419c35a6fccdf9992ac20
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Integrates [magnific-popup.css](http://dimsemenov.com/plugins/magnific-popup/) w
|
|
4
4
|
|
5
5
|
Magnific Popup is a free responsive jQuery lightbox plugin that is focused on performance and providing best experience for user with any device (Zepto.js compatible).
|
6
6
|
|
7
|
-
The magnific popup is created by
|
7
|
+
The magnific popup is created by Dmitry Semenov.
|
8
8
|
|
9
9
|
|
10
10
|
# For Rails 3.1+ only
|
@@ -1,6 +1,6 @@
|
|
1
|
-
/*! Magnific Popup - v1.0
|
1
|
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2
2
|
* http://dimsemenov.com/plugins/magnific-popup/
|
3
|
-
* Copyright (c)
|
3
|
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4
4
|
;(function (factory) {
|
5
5
|
if (typeof define === 'function' && define.amd) {
|
6
6
|
// AMD. Register as an anonymous module.
|
@@ -136,9 +136,7 @@ MagnificPopup.prototype = {
|
|
136
136
|
*/
|
137
137
|
init: function() {
|
138
138
|
var appVersion = navigator.appVersion;
|
139
|
-
mfp.
|
140
|
-
mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
|
141
|
-
mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
|
139
|
+
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
142
140
|
mfp.isAndroid = (/android/gi).test(appVersion);
|
143
141
|
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
144
142
|
mfp.supportsTransition = supportsTransitions();
|
@@ -493,17 +491,13 @@ MagnificPopup.prototype = {
|
|
493
491
|
item = mfp.parseEl( mfp.index );
|
494
492
|
}
|
495
493
|
|
496
|
-
var type = item.type;
|
494
|
+
var type = item.type;
|
497
495
|
|
498
496
|
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
499
497
|
// BeforeChange event works like so:
|
500
498
|
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
501
|
-
|
502
|
-
mfp.currItem = item;
|
503
|
-
|
504
|
-
|
505
499
|
|
506
|
-
|
500
|
+
mfp.currItem = item;
|
507
501
|
|
508
502
|
if(!mfp.currTemplate[type]) {
|
509
503
|
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
@@ -522,7 +516,7 @@ MagnificPopup.prototype = {
|
|
522
516
|
if(_prevContentType && _prevContentType !== item.type) {
|
523
517
|
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
524
518
|
}
|
525
|
-
|
519
|
+
|
526
520
|
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
527
521
|
mfp.appendContent(newContent, type);
|
528
522
|
|
@@ -530,7 +524,7 @@ MagnificPopup.prototype = {
|
|
530
524
|
|
531
525
|
_mfpTrigger(CHANGE_EVENT, item);
|
532
526
|
_prevContentType = item.type;
|
533
|
-
|
527
|
+
|
534
528
|
// Append container back after its content changed
|
535
529
|
mfp.container.prepend(mfp.contentContainer);
|
536
530
|
|
@@ -543,7 +537,7 @@ MagnificPopup.prototype = {
|
|
543
537
|
*/
|
544
538
|
appendContent: function(newContent, type) {
|
545
539
|
mfp.content = newContent;
|
546
|
-
|
540
|
+
|
547
541
|
if(newContent) {
|
548
542
|
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
549
543
|
mfp.currTemplate[type] === true) {
|
@@ -565,8 +559,6 @@ MagnificPopup.prototype = {
|
|
565
559
|
},
|
566
560
|
|
567
561
|
|
568
|
-
|
569
|
-
|
570
562
|
/**
|
571
563
|
* Creates Magnific Popup data object based on given data
|
572
564
|
* @param {int} index Index of item to parse
|
@@ -620,11 +612,11 @@ MagnificPopup.prototype = {
|
|
620
612
|
|
621
613
|
if(!options) {
|
622
614
|
options = {};
|
623
|
-
}
|
615
|
+
}
|
624
616
|
|
625
617
|
var eName = 'click.magnificPopup';
|
626
618
|
options.mainEl = el;
|
627
|
-
|
619
|
+
|
628
620
|
if(options.items) {
|
629
621
|
options.isObj = true;
|
630
622
|
el.off(eName).on(eName, eHandler);
|
@@ -659,7 +651,7 @@ MagnificPopup.prototype = {
|
|
659
651
|
}
|
660
652
|
}
|
661
653
|
}
|
662
|
-
|
654
|
+
|
663
655
|
if(e.type) {
|
664
656
|
e.preventDefault();
|
665
657
|
|
@@ -668,7 +660,6 @@ MagnificPopup.prototype = {
|
|
668
660
|
e.stopPropagation();
|
669
661
|
}
|
670
662
|
}
|
671
|
-
|
672
663
|
|
673
664
|
options.el = $(e.mfpEl);
|
674
665
|
if(options.delegate) {
|
@@ -797,7 +788,7 @@ MagnificPopup.prototype = {
|
|
797
788
|
if(el.is('img')) {
|
798
789
|
el.attr('src', value);
|
799
790
|
} else {
|
800
|
-
el.replaceWith( '<img
|
791
|
+
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
801
792
|
}
|
802
793
|
} else {
|
803
794
|
el.attr(arr[1], value);
|
@@ -836,14 +827,13 @@ $.magnificPopup = {
|
|
836
827
|
modules: [],
|
837
828
|
|
838
829
|
open: function(options, index) {
|
839
|
-
_checkInstance();
|
830
|
+
_checkInstance();
|
840
831
|
|
841
832
|
if(!options) {
|
842
833
|
options = {};
|
843
834
|
} else {
|
844
835
|
options = $.extend(true, {}, options);
|
845
836
|
}
|
846
|
-
|
847
837
|
|
848
838
|
options.isObj = true;
|
849
839
|
options.index = index || 0;
|
@@ -858,16 +848,16 @@ $.magnificPopup = {
|
|
858
848
|
if(module.options) {
|
859
849
|
$.magnificPopup.defaults[name] = module.options;
|
860
850
|
}
|
861
|
-
$.extend(this.proto, module.proto);
|
851
|
+
$.extend(this.proto, module.proto);
|
862
852
|
this.modules.push(name);
|
863
853
|
},
|
864
854
|
|
865
|
-
defaults: {
|
855
|
+
defaults: {
|
866
856
|
|
867
857
|
// Info about options is in docs:
|
868
858
|
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
869
|
-
|
870
|
-
disableOn: 0,
|
859
|
+
|
860
|
+
disableOn: 0,
|
871
861
|
|
872
862
|
key: null,
|
873
863
|
|
@@ -878,12 +868,12 @@ $.magnificPopup = {
|
|
878
868
|
preloader: true,
|
879
869
|
|
880
870
|
focus: '', // CSS selector of input to focus after popup is opened
|
881
|
-
|
871
|
+
|
882
872
|
closeOnContentClick: false,
|
883
873
|
|
884
874
|
closeOnBgClick: true,
|
885
875
|
|
886
|
-
closeBtnInside: true,
|
876
|
+
closeBtnInside: true,
|
887
877
|
|
888
878
|
showCloseBtn: true,
|
889
879
|
|
@@ -892,13 +882,13 @@ $.magnificPopup = {
|
|
892
882
|
modal: false,
|
893
883
|
|
894
884
|
alignTop: false,
|
895
|
-
|
885
|
+
|
896
886
|
removalDelay: 0,
|
897
887
|
|
898
888
|
prependTo: null,
|
899
|
-
|
900
|
-
fixedContentPos: 'auto',
|
901
|
-
|
889
|
+
|
890
|
+
fixedContentPos: 'auto',
|
891
|
+
|
902
892
|
fixedBgPos: 'auto',
|
903
893
|
|
904
894
|
overflowY: 'auto',
|
@@ -947,9 +937,9 @@ $.fn.magnificPopup = function(options) {
|
|
947
937
|
} else {
|
948
938
|
// clone options obj
|
949
939
|
options = $.extend(true, {}, options);
|
950
|
-
|
940
|
+
|
951
941
|
/*
|
952
|
-
* As Zepto doesn't support .data() method for objects
|
942
|
+
* As Zepto doesn't support .data() method for objects
|
953
943
|
* and it works only in normal browsers
|
954
944
|
* we assign "options" object directly to the DOM element. FTW!
|
955
945
|
*/
|
@@ -965,33 +955,13 @@ $.fn.magnificPopup = function(options) {
|
|
965
955
|
return jqEl;
|
966
956
|
};
|
967
957
|
|
968
|
-
|
969
|
-
//Quick benchmark
|
970
|
-
/*
|
971
|
-
var start = performance.now(),
|
972
|
-
i,
|
973
|
-
rounds = 1000;
|
974
|
-
|
975
|
-
for(i = 0; i < rounds; i++) {
|
976
|
-
|
977
|
-
}
|
978
|
-
console.log('Test #1:', performance.now() - start);
|
979
|
-
|
980
|
-
start = performance.now();
|
981
|
-
for(i = 0; i < rounds; i++) {
|
982
|
-
|
983
|
-
}
|
984
|
-
console.log('Test #2:', performance.now() - start);
|
985
|
-
*/
|
986
|
-
|
987
|
-
|
988
958
|
/*>>core*/
|
989
959
|
|
990
960
|
/*>>inline*/
|
991
961
|
|
992
962
|
var INLINE_NS = 'inline',
|
993
963
|
_hiddenClass,
|
994
|
-
_inlinePlaceholder,
|
964
|
+
_inlinePlaceholder,
|
995
965
|
_lastInlineElement,
|
996
966
|
_putInlineElementsBack = function() {
|
997
967
|
if(_lastInlineElement) {
|
@@ -1136,18 +1106,12 @@ $.magnificPopup.registerModule(AJAX_NS, {
|
|
1136
1106
|
}
|
1137
1107
|
});
|
1138
1108
|
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
1109
|
/*>>ajax*/
|
1146
1110
|
|
1147
1111
|
/*>>image*/
|
1148
1112
|
var _imgInterval,
|
1149
1113
|
_getTitle = function(item) {
|
1150
|
-
if(item.data && item.data.title !== undefined)
|
1114
|
+
if(item.data && item.data.title !== undefined)
|
1151
1115
|
return item.data.title;
|
1152
1116
|
|
1153
1117
|
var src = mfp.st.image.titleSrc;
|
@@ -1178,7 +1142,7 @@ $.magnificPopup.registerModule('image', {
|
|
1178
1142
|
'</figure>'+
|
1179
1143
|
'</div>',
|
1180
1144
|
cursor: 'mfp-zoom-out-cur',
|
1181
|
-
titleSrc: 'title',
|
1145
|
+
titleSrc: 'title',
|
1182
1146
|
verticalFit: true,
|
1183
1147
|
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1184
1148
|
},
|
@@ -1223,13 +1187,13 @@ $.magnificPopup.registerModule('image', {
|
|
1223
1187
|
},
|
1224
1188
|
_onImageHasSize: function(item) {
|
1225
1189
|
if(item.img) {
|
1226
|
-
|
1190
|
+
|
1227
1191
|
item.hasSize = true;
|
1228
1192
|
|
1229
1193
|
if(_imgInterval) {
|
1230
1194
|
clearInterval(_imgInterval);
|
1231
1195
|
}
|
1232
|
-
|
1196
|
+
|
1233
1197
|
item.isCheckingImgSize = false;
|
1234
1198
|
|
1235
1199
|
_mfpTrigger('ImageHasSize', item);
|
@@ -1237,7 +1201,7 @@ $.magnificPopup.registerModule('image', {
|
|
1237
1201
|
if(item.imgHidden) {
|
1238
1202
|
if(mfp.content)
|
1239
1203
|
mfp.content.removeClass('mfp-loading');
|
1240
|
-
|
1204
|
+
|
1241
1205
|
item.imgHidden = false;
|
1242
1206
|
}
|
1243
1207
|
|
@@ -1290,7 +1254,7 @@ $.magnificPopup.registerModule('image', {
|
|
1290
1254
|
if(item) {
|
1291
1255
|
if (item.img[0].complete) {
|
1292
1256
|
item.img.off('.mfploader');
|
1293
|
-
|
1257
|
+
|
1294
1258
|
if(item === mfp.currItem){
|
1295
1259
|
mfp._onImageHasSize(item);
|
1296
1260
|
|
@@ -1301,7 +1265,7 @@ $.magnificPopup.registerModule('image', {
|
|
1301
1265
|
item.loaded = true;
|
1302
1266
|
|
1303
1267
|
_mfpTrigger('ImageLoadComplete');
|
1304
|
-
|
1268
|
+
|
1305
1269
|
}
|
1306
1270
|
else {
|
1307
1271
|
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
@@ -1351,7 +1315,7 @@ $.magnificPopup.registerModule('image', {
|
|
1351
1315
|
img = item.img[0];
|
1352
1316
|
if(img.naturalWidth > 0) {
|
1353
1317
|
item.hasSize = true;
|
1354
|
-
} else if(!img.width) {
|
1318
|
+
} else if(!img.width) {
|
1355
1319
|
item.hasSize = false;
|
1356
1320
|
}
|
1357
1321
|
}
|
@@ -1383,15 +1347,13 @@ $.magnificPopup.registerModule('image', {
|
|
1383
1347
|
item.imgHidden = true;
|
1384
1348
|
template.addClass('mfp-loading');
|
1385
1349
|
mfp.findImageSize(item);
|
1386
|
-
}
|
1350
|
+
}
|
1387
1351
|
|
1388
1352
|
return template;
|
1389
1353
|
}
|
1390
1354
|
}
|
1391
1355
|
});
|
1392
1356
|
|
1393
|
-
|
1394
|
-
|
1395
1357
|
/*>>image*/
|
1396
1358
|
|
1397
1359
|
/*>>zoom*/
|
@@ -1400,7 +1362,7 @@ var hasMozTransform,
|
|
1400
1362
|
if(hasMozTransform === undefined) {
|
1401
1363
|
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1402
1364
|
}
|
1403
|
-
return hasMozTransform;
|
1365
|
+
return hasMozTransform;
|
1404
1366
|
};
|
1405
1367
|
|
1406
1368
|
$.magnificPopup.registerModule('zoom', {
|
@@ -1420,7 +1382,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1420
1382
|
var zoomSt = mfp.st.zoom,
|
1421
1383
|
ns = '.zoom',
|
1422
1384
|
image;
|
1423
|
-
|
1385
|
+
|
1424
1386
|
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1425
1387
|
return;
|
1426
1388
|
}
|
@@ -1456,7 +1418,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1456
1418
|
mfp.content.css('visibility', 'hidden');
|
1457
1419
|
|
1458
1420
|
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1459
|
-
|
1421
|
+
|
1460
1422
|
image = mfp._getItemToZoom();
|
1461
1423
|
|
1462
1424
|
if(!image) {
|
@@ -1464,8 +1426,8 @@ $.magnificPopup.registerModule('zoom', {
|
|
1464
1426
|
return;
|
1465
1427
|
}
|
1466
1428
|
|
1467
|
-
animatedImg = getElToAnimate(image);
|
1468
|
-
|
1429
|
+
animatedImg = getElToAnimate(image);
|
1430
|
+
|
1469
1431
|
animatedImg.css( mfp._getOffset() );
|
1470
1432
|
|
1471
1433
|
mfp.wrap.append(animatedImg);
|
@@ -1480,7 +1442,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1480
1442
|
animatedImg.remove();
|
1481
1443
|
image = animatedImg = null;
|
1482
1444
|
_mfpTrigger('ZoomAnimationEnded');
|
1483
|
-
}, 16); // avoid blink when switching images
|
1445
|
+
}, 16); // avoid blink when switching images
|
1484
1446
|
|
1485
1447
|
}, duration); // this timeout equals animation duration
|
1486
1448
|
|
@@ -1504,12 +1466,11 @@ $.magnificPopup.registerModule('zoom', {
|
|
1504
1466
|
}
|
1505
1467
|
animatedImg = getElToAnimate(image);
|
1506
1468
|
}
|
1507
|
-
|
1508
|
-
|
1469
|
+
|
1509
1470
|
animatedImg.css( mfp._getOffset(true) );
|
1510
1471
|
mfp.wrap.append(animatedImg);
|
1511
1472
|
mfp.content.css('visibility', 'hidden');
|
1512
|
-
|
1473
|
+
|
1513
1474
|
setTimeout(function() {
|
1514
1475
|
animatedImg.css( mfp._getOffset() );
|
1515
1476
|
}, 16);
|
@@ -1524,7 +1485,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1524
1485
|
animatedImg.remove();
|
1525
1486
|
}
|
1526
1487
|
image = null;
|
1527
|
-
}
|
1488
|
+
}
|
1528
1489
|
});
|
1529
1490
|
},
|
1530
1491
|
|
@@ -1556,7 +1517,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1556
1517
|
|
1557
1518
|
|
1558
1519
|
/*
|
1559
|
-
|
1520
|
+
|
1560
1521
|
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1561
1522
|
|
1562
1523
|
*/
|
@@ -1587,11 +1548,11 @@ $.magnificPopup.registerModule('zoom', {
|
|
1587
1548
|
|
1588
1549
|
var IFRAME_NS = 'iframe',
|
1589
1550
|
_emptyPage = '//about:blank',
|
1590
|
-
|
1551
|
+
|
1591
1552
|
_fixIframeBugs = function(isShowing) {
|
1592
1553
|
if(mfp.currTemplate[IFRAME_NS]) {
|
1593
1554
|
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1594
|
-
if(el.length) {
|
1555
|
+
if(el.length) {
|
1595
1556
|
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1596
1557
|
if(!isShowing) {
|
1597
1558
|
el[0].src = _emptyPage;
|
@@ -1618,8 +1579,8 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1618
1579
|
// we don't care and support only one default type of URL by default
|
1619
1580
|
patterns: {
|
1620
1581
|
youtube: {
|
1621
|
-
index: 'youtube.com',
|
1622
|
-
id: 'v=',
|
1582
|
+
index: 'youtube.com',
|
1583
|
+
id: 'v=',
|
1623
1584
|
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1624
1585
|
},
|
1625
1586
|
vimeo: {
|
@@ -1644,7 +1605,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1644
1605
|
_fixIframeBugs(); // iframe if removed
|
1645
1606
|
} else if(newType === IFRAME_NS) {
|
1646
1607
|
_fixIframeBugs(true); // iframe is showing
|
1647
|
-
}
|
1608
|
+
}
|
1648
1609
|
}// else {
|
1649
1610
|
// iframe source is switched, don't do anything
|
1650
1611
|
//}
|
@@ -1658,7 +1619,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1658
1619
|
getIframe: function(item, template) {
|
1659
1620
|
var embedSrc = item.src;
|
1660
1621
|
var iframeSt = mfp.st.iframe;
|
1661
|
-
|
1622
|
+
|
1662
1623
|
$.each(iframeSt.patterns, function() {
|
1663
1624
|
if(embedSrc.indexOf( this.index ) > -1) {
|
1664
1625
|
if(this.id) {
|
@@ -1672,7 +1633,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1672
1633
|
return false; // break;
|
1673
1634
|
}
|
1674
1635
|
});
|
1675
|
-
|
1636
|
+
|
1676
1637
|
var dataObj = {};
|
1677
1638
|
if(iframeSt.srcAction) {
|
1678
1639
|
dataObj[iframeSt.srcAction] = embedSrc;
|
@@ -1725,11 +1686,10 @@ $.magnificPopup.registerModule('gallery', {
|
|
1725
1686
|
initGallery: function() {
|
1726
1687
|
|
1727
1688
|
var gSt = mfp.st.gallery,
|
1728
|
-
ns = '.mfp-gallery'
|
1729
|
-
supportsFastClick = Boolean($.fn.mfpFastClick);
|
1689
|
+
ns = '.mfp-gallery';
|
1730
1690
|
|
1731
1691
|
mfp.direction = true; // true - next, false - prev
|
1732
|
-
|
1692
|
+
|
1733
1693
|
if(!gSt || !gSt.enabled ) return false;
|
1734
1694
|
|
1735
1695
|
_wrapClasses += ' mfp-gallery';
|
@@ -1768,24 +1728,15 @@ $.magnificPopup.registerModule('gallery', {
|
|
1768
1728
|
_mfpOn('BuildControls' + ns, function() {
|
1769
1729
|
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1770
1730
|
var markup = gSt.arrowMarkup,
|
1771
|
-
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1731
|
+
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1772
1732
|
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1773
1733
|
|
1774
|
-
|
1775
|
-
arrowLeft[eName](function() {
|
1734
|
+
arrowLeft.click(function() {
|
1776
1735
|
mfp.prev();
|
1777
|
-
});
|
1778
|
-
arrowRight
|
1736
|
+
});
|
1737
|
+
arrowRight.click(function() {
|
1779
1738
|
mfp.next();
|
1780
|
-
});
|
1781
|
-
|
1782
|
-
// Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
|
1783
|
-
if(mfp.isIE7) {
|
1784
|
-
_getEl('b', arrowLeft[0], false, true);
|
1785
|
-
_getEl('a', arrowLeft[0], false, true);
|
1786
|
-
_getEl('b', arrowRight[0], false, true);
|
1787
|
-
_getEl('a', arrowRight[0], false, true);
|
1788
|
-
}
|
1739
|
+
});
|
1789
1740
|
|
1790
1741
|
mfp.container.append(arrowLeft.add(arrowRight));
|
1791
1742
|
}
|
@@ -1797,21 +1748,17 @@ $.magnificPopup.registerModule('gallery', {
|
|
1797
1748
|
mfp._preloadTimeout = setTimeout(function() {
|
1798
1749
|
mfp.preloadNearbyImages();
|
1799
1750
|
mfp._preloadTimeout = null;
|
1800
|
-
}, 16);
|
1751
|
+
}, 16);
|
1801
1752
|
});
|
1802
1753
|
|
1803
1754
|
|
1804
1755
|
_mfpOn(CLOSE_EVENT+ns, function() {
|
1805
1756
|
_document.off(ns);
|
1806
1757
|
mfp.wrap.off('click'+ns);
|
1807
|
-
|
1808
|
-
if(mfp.arrowLeft && supportsFastClick) {
|
1809
|
-
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
|
1810
|
-
}
|
1811
1758
|
mfp.arrowRight = mfp.arrowLeft = null;
|
1812
1759
|
});
|
1813
1760
|
|
1814
|
-
},
|
1761
|
+
},
|
1815
1762
|
next: function() {
|
1816
1763
|
mfp.direction = true;
|
1817
1764
|
mfp.index = _getLoopedId(mfp.index + 1);
|
@@ -1870,58 +1817,6 @@ $.magnificPopup.registerModule('gallery', {
|
|
1870
1817
|
}
|
1871
1818
|
});
|
1872
1819
|
|
1873
|
-
/*
|
1874
|
-
Touch Support that might be implemented some day
|
1875
|
-
|
1876
|
-
addSwipeGesture: function() {
|
1877
|
-
var startX,
|
1878
|
-
moved,
|
1879
|
-
multipleTouches;
|
1880
|
-
|
1881
|
-
return;
|
1882
|
-
|
1883
|
-
var namespace = '.mfp',
|
1884
|
-
addEventNames = function(pref, down, move, up, cancel) {
|
1885
|
-
mfp._tStart = pref + down + namespace;
|
1886
|
-
mfp._tMove = pref + move + namespace;
|
1887
|
-
mfp._tEnd = pref + up + namespace;
|
1888
|
-
mfp._tCancel = pref + cancel + namespace;
|
1889
|
-
};
|
1890
|
-
|
1891
|
-
if(window.navigator.msPointerEnabled) {
|
1892
|
-
addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
|
1893
|
-
} else if('ontouchstart' in window) {
|
1894
|
-
addEventNames('touch', 'start', 'move', 'end', 'cancel');
|
1895
|
-
} else {
|
1896
|
-
return;
|
1897
|
-
}
|
1898
|
-
_window.on(mfp._tStart, function(e) {
|
1899
|
-
var oE = e.originalEvent;
|
1900
|
-
multipleTouches = moved = false;
|
1901
|
-
startX = oE.pageX || oE.changedTouches[0].pageX;
|
1902
|
-
}).on(mfp._tMove, function(e) {
|
1903
|
-
if(e.originalEvent.touches.length > 1) {
|
1904
|
-
multipleTouches = e.originalEvent.touches.length;
|
1905
|
-
} else {
|
1906
|
-
//e.preventDefault();
|
1907
|
-
moved = true;
|
1908
|
-
}
|
1909
|
-
}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
|
1910
|
-
if(moved && !multipleTouches) {
|
1911
|
-
var oE = e.originalEvent,
|
1912
|
-
diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
|
1913
|
-
|
1914
|
-
if(diff > 20) {
|
1915
|
-
mfp.next();
|
1916
|
-
} else if(diff < -20) {
|
1917
|
-
mfp.prev();
|
1918
|
-
}
|
1919
|
-
}
|
1920
|
-
});
|
1921
|
-
},
|
1922
|
-
*/
|
1923
|
-
|
1924
|
-
|
1925
1820
|
/*>>gallery*/
|
1926
1821
|
|
1927
1822
|
/*>>retina*/
|
@@ -1962,101 +1857,4 @@ $.magnificPopup.registerModule(RETINA_NS, {
|
|
1962
1857
|
});
|
1963
1858
|
|
1964
1859
|
/*>>retina*/
|
1965
|
-
|
1966
|
-
/*>>fastclick*/
|
1967
|
-
/**
|
1968
|
-
* FastClick event implementation. (removes 300ms delay on touch devices)
|
1969
|
-
* Based on https://developers.google.com/mobile/articles/fast_buttons
|
1970
|
-
*
|
1971
|
-
* You may use it outside the Magnific Popup by calling just:
|
1972
|
-
*
|
1973
|
-
* $('.your-el').mfpFastClick(function() {
|
1974
|
-
* console.log('Clicked!');
|
1975
|
-
* });
|
1976
|
-
*
|
1977
|
-
* To unbind:
|
1978
|
-
* $('.your-el').destroyMfpFastClick();
|
1979
|
-
*
|
1980
|
-
*
|
1981
|
-
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
|
1982
|
-
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
|
1983
|
-
*
|
1984
|
-
*/
|
1985
|
-
|
1986
|
-
(function() {
|
1987
|
-
var ghostClickDelay = 1000,
|
1988
|
-
supportsTouch = 'ontouchstart' in window,
|
1989
|
-
unbindTouchMove = function() {
|
1990
|
-
_window.off('touchmove'+ns+' touchend'+ns);
|
1991
|
-
},
|
1992
|
-
eName = 'mfpFastClick',
|
1993
|
-
ns = '.'+eName;
|
1994
|
-
|
1995
|
-
|
1996
|
-
// As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
|
1997
|
-
$.fn.mfpFastClick = function(callback) {
|
1998
|
-
|
1999
|
-
return $(this).each(function() {
|
2000
|
-
|
2001
|
-
var elem = $(this),
|
2002
|
-
lock;
|
2003
|
-
|
2004
|
-
if( supportsTouch ) {
|
2005
|
-
|
2006
|
-
var timeout,
|
2007
|
-
startX,
|
2008
|
-
startY,
|
2009
|
-
pointerMoved,
|
2010
|
-
point,
|
2011
|
-
numPointers;
|
2012
|
-
|
2013
|
-
elem.on('touchstart' + ns, function(e) {
|
2014
|
-
pointerMoved = false;
|
2015
|
-
numPointers = 1;
|
2016
|
-
|
2017
|
-
point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
|
2018
|
-
startX = point.clientX;
|
2019
|
-
startY = point.clientY;
|
2020
|
-
|
2021
|
-
_window.on('touchmove'+ns, function(e) {
|
2022
|
-
point = e.originalEvent ? e.originalEvent.touches : e.touches;
|
2023
|
-
numPointers = point.length;
|
2024
|
-
point = point[0];
|
2025
|
-
if (Math.abs(point.clientX - startX) > 10 ||
|
2026
|
-
Math.abs(point.clientY - startY) > 10) {
|
2027
|
-
pointerMoved = true;
|
2028
|
-
unbindTouchMove();
|
2029
|
-
}
|
2030
|
-
}).on('touchend'+ns, function(e) {
|
2031
|
-
unbindTouchMove();
|
2032
|
-
if(pointerMoved || numPointers > 1) {
|
2033
|
-
return;
|
2034
|
-
}
|
2035
|
-
lock = true;
|
2036
|
-
e.preventDefault();
|
2037
|
-
clearTimeout(timeout);
|
2038
|
-
timeout = setTimeout(function() {
|
2039
|
-
lock = false;
|
2040
|
-
}, ghostClickDelay);
|
2041
|
-
callback();
|
2042
|
-
});
|
2043
|
-
});
|
2044
|
-
|
2045
|
-
}
|
2046
|
-
|
2047
|
-
elem.on('click' + ns, function() {
|
2048
|
-
if(!lock) {
|
2049
|
-
callback();
|
2050
|
-
}
|
2051
|
-
});
|
2052
|
-
});
|
2053
|
-
};
|
2054
|
-
|
2055
|
-
$.fn.destroyMfpFastClick = function() {
|
2056
|
-
$(this).off('touchstart' + ns + ' click' + ns);
|
2057
|
-
if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
|
2058
|
-
};
|
2059
|
-
})();
|
2060
|
-
|
2061
|
-
/*>>fastclick*/
|
2062
1860
|
_checkInstance(); }));
|
@@ -8,8 +8,7 @@
|
|
8
8
|
overflow: hidden;
|
9
9
|
position: fixed;
|
10
10
|
background: #0b0b0b;
|
11
|
-
opacity: 0.8;
|
12
|
-
filter: alpha(opacity=80); }
|
11
|
+
opacity: 0.8; }
|
13
12
|
|
14
13
|
.mfp-wrap {
|
15
14
|
top: 0;
|
@@ -29,8 +28,6 @@
|
|
29
28
|
left: 0;
|
30
29
|
top: 0;
|
31
30
|
padding: 0 8px;
|
32
|
-
-webkit-box-sizing: border-box;
|
33
|
-
-moz-box-sizing: border-box;
|
34
31
|
box-sizing: border-box; }
|
35
32
|
|
36
33
|
.mfp-container:before {
|
@@ -118,8 +115,8 @@ button.mfp-arrow {
|
|
118
115
|
outline: none;
|
119
116
|
padding: 0;
|
120
117
|
z-index: 1046;
|
121
|
-
|
122
|
-
|
118
|
+
box-shadow: none;
|
119
|
+
touch-action: manipulation; }
|
123
120
|
|
124
121
|
button::-moz-focus-inner {
|
125
122
|
padding: 0;
|
@@ -135,7 +132,6 @@ button::-moz-focus-inner {
|
|
135
132
|
text-decoration: none;
|
136
133
|
text-align: center;
|
137
134
|
opacity: 0.65;
|
138
|
-
filter: alpha(opacity=65);
|
139
135
|
padding: 0 0 18px 10px;
|
140
136
|
color: #FFF;
|
141
137
|
font-style: normal;
|
@@ -143,8 +139,7 @@ button::-moz-focus-inner {
|
|
143
139
|
font-family: Arial, Baskerville, monospace; }
|
144
140
|
.mfp-close:hover,
|
145
141
|
.mfp-close:focus {
|
146
|
-
opacity: 1;
|
147
|
-
filter: alpha(opacity=100); }
|
142
|
+
opacity: 1; }
|
148
143
|
.mfp-close:active {
|
149
144
|
top: 1px; }
|
150
145
|
|
@@ -171,7 +166,6 @@ button::-moz-focus-inner {
|
|
171
166
|
.mfp-arrow {
|
172
167
|
position: absolute;
|
173
168
|
opacity: 0.65;
|
174
|
-
filter: alpha(opacity=65);
|
175
169
|
margin: 0;
|
176
170
|
top: 50%;
|
177
171
|
margin-top: -55px;
|
@@ -183,12 +177,9 @@ button::-moz-focus-inner {
|
|
183
177
|
margin-top: -54px; }
|
184
178
|
.mfp-arrow:hover,
|
185
179
|
.mfp-arrow:focus {
|
186
|
-
opacity: 1;
|
187
|
-
filter: alpha(opacity=100); }
|
180
|
+
opacity: 1; }
|
188
181
|
.mfp-arrow:before,
|
189
|
-
.mfp-arrow:after
|
190
|
-
.mfp-arrow .mfp-b,
|
191
|
-
.mfp-arrow .mfp-a {
|
182
|
+
.mfp-arrow:after {
|
192
183
|
content: '';
|
193
184
|
display: block;
|
194
185
|
width: 0;
|
@@ -199,36 +190,30 @@ button::-moz-focus-inner {
|
|
199
190
|
margin-top: 35px;
|
200
191
|
margin-left: 35px;
|
201
192
|
border: medium inset transparent; }
|
202
|
-
.mfp-arrow:after
|
203
|
-
.mfp-arrow .mfp-a {
|
193
|
+
.mfp-arrow:after {
|
204
194
|
border-top-width: 13px;
|
205
195
|
border-bottom-width: 13px;
|
206
196
|
top: 8px; }
|
207
|
-
.mfp-arrow:before
|
208
|
-
.mfp-arrow .mfp-b {
|
197
|
+
.mfp-arrow:before {
|
209
198
|
border-top-width: 21px;
|
210
199
|
border-bottom-width: 21px;
|
211
200
|
opacity: 0.7; }
|
212
201
|
|
213
202
|
.mfp-arrow-left {
|
214
203
|
left: 0; }
|
215
|
-
.mfp-arrow-left:after
|
216
|
-
.mfp-arrow-left .mfp-a {
|
204
|
+
.mfp-arrow-left:after {
|
217
205
|
border-right: 17px solid #FFF;
|
218
206
|
margin-left: 31px; }
|
219
|
-
.mfp-arrow-left:before
|
220
|
-
.mfp-arrow-left .mfp-b {
|
207
|
+
.mfp-arrow-left:before {
|
221
208
|
margin-left: 25px;
|
222
209
|
border-right: 27px solid #3F3F3F; }
|
223
210
|
|
224
211
|
.mfp-arrow-right {
|
225
212
|
right: 0; }
|
226
|
-
.mfp-arrow-right:after
|
227
|
-
.mfp-arrow-right .mfp-a {
|
213
|
+
.mfp-arrow-right:after {
|
228
214
|
border-left: 17px solid #FFF;
|
229
215
|
margin-left: 39px; }
|
230
|
-
.mfp-arrow-right:before
|
231
|
-
.mfp-arrow-right .mfp-b {
|
216
|
+
.mfp-arrow-right:before {
|
232
217
|
border-left: 27px solid #3F3F3F; }
|
233
218
|
|
234
219
|
.mfp-iframe-holder {
|
@@ -263,8 +248,6 @@ img.mfp-img {
|
|
263
248
|
height: auto;
|
264
249
|
display: block;
|
265
250
|
line-height: 0;
|
266
|
-
-webkit-box-sizing: border-box;
|
267
|
-
-moz-box-sizing: border-box;
|
268
251
|
box-sizing: border-box;
|
269
252
|
padding: 40px 0 40px;
|
270
253
|
margin: 0 auto; }
|
@@ -336,8 +319,6 @@ img.mfp-img {
|
|
336
319
|
top: auto;
|
337
320
|
padding: 3px 5px;
|
338
321
|
position: fixed;
|
339
|
-
-webkit-box-sizing: border-box;
|
340
|
-
-moz-box-sizing: border-box;
|
341
322
|
box-sizing: border-box; }
|
342
323
|
.mfp-img-mobile .mfp-bottom-bar:empty {
|
343
324
|
padding: 0; }
|
@@ -368,24 +349,3 @@ img.mfp-img {
|
|
368
349
|
.mfp-container {
|
369
350
|
padding-left: 6px;
|
370
351
|
padding-right: 6px; } }
|
371
|
-
|
372
|
-
.mfp-ie7 .mfp-img {
|
373
|
-
padding: 0; }
|
374
|
-
|
375
|
-
.mfp-ie7 .mfp-bottom-bar {
|
376
|
-
width: 600px;
|
377
|
-
left: 50%;
|
378
|
-
margin-left: -300px;
|
379
|
-
margin-top: 5px;
|
380
|
-
padding-bottom: 5px; }
|
381
|
-
|
382
|
-
.mfp-ie7 .mfp-container {
|
383
|
-
padding: 0; }
|
384
|
-
|
385
|
-
.mfp-ie7 .mfp-content {
|
386
|
-
padding-top: 44px; }
|
387
|
-
|
388
|
-
.mfp-ie7 .mfp-close {
|
389
|
-
top: 0;
|
390
|
-
right: 0;
|
391
|
-
padding-top: 0; }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magnific-popup-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Jansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Magnific Popup is a free responsive jQuery lightbox plugin that is focused
|
14
14
|
on performance and providing best experience for user with any device
|