magnific-popup-rails 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -16
- data/README.md +7 -6
- data/app/assets/javascripts/magnific-popup.js +110 -108
- data/app/assets/stylesheets/magnific-popup.css +0 -0
- data/lib/magnific-popup-rails.rb +1 -4
- data/magnific-popup-rails.gemspec +1 -4
- metadata +4 -24
- data/Gemfile +0 -4
- data/LICENSE +0 -1
- data/Rakefile +0 -1
- data/lib/magnific-popup-rails/engine.rb +0 -7
- data/lib/magnific-popup-rails/version.rb +0 -5
- data/vendor/assets/stylesheets/magnific-popup.scss +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 500dde1240ac1a703b43679e0a03b4814a1843ae
|
4
|
+
data.tar.gz: f28913cd007e4844943f537d37902d43407f537a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5d21d8d93b4828306c24b8d2d03b0552f87563ab215255bd35c1f3ea292f4b421325f9e806c6e4aecafb6775ff9560d7a2131c38137489062130d61d90a2cb5
|
7
|
+
data.tar.gz: d6c11714905b0b74147a5183679ca0439bde9ea9f597384fba975812b1a5deb853452647774aa5e658dc5eb9dca1232a1beded7d16ebb4d06cd8a7df62887eda
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,6 @@ Magnific Popup is a free responsive jQuery lightbox plugin that is focused on pe
|
|
6
6
|
|
7
7
|
The magnific popup is created by Created by Dmitry Semenov.
|
8
8
|
|
9
|
-
I used [markmcconachie's](https://github.com/markmcconachie) [normalize-rails](https://github.com/markmcconachie/normalize-rails) gem as an example for setting up this magnific popup gem.
|
10
9
|
|
11
10
|
# For Rails 3.1+ only
|
12
11
|
|
@@ -14,7 +13,7 @@ I used [markmcconachie's](https://github.com/markmcconachie) [normalize-rails](h
|
|
14
13
|
|
15
14
|
Add this line to your application's Gemfile:
|
16
15
|
|
17
|
-
gem 'magnific-popup-rails'
|
16
|
+
gem 'magnific-popup-rails', '~> 1.0.1'
|
18
17
|
|
19
18
|
And then execute:
|
20
19
|
|
@@ -24,12 +23,14 @@ And then execute:
|
|
24
23
|
|
25
24
|
|
26
25
|
And then in your application.css
|
26
|
+
```
|
27
|
+
*= require magnific-popup
|
28
|
+
```
|
27
29
|
|
28
|
-
*= require magnific-popup
|
29
|
-
|
30
30
|
And then in your application.js
|
31
|
-
|
32
|
-
|
31
|
+
```
|
32
|
+
//= require magnific-popup
|
33
|
+
```
|
33
34
|
|
34
35
|
## Contributing
|
35
36
|
|
@@ -1,24 +1,24 @@
|
|
1
|
-
/*! Magnific Popup - v1.0.
|
1
|
+
/*! Magnific Popup - v1.0.1 - 2015-12-30
|
2
2
|
* http://dimsemenov.com/plugins/magnific-popup/
|
3
3
|
* Copyright (c) 2015 Dmitry Semenov; */
|
4
|
-
;(function (factory) {
|
5
|
-
if (typeof define === 'function' && define.amd) {
|
6
|
-
// AMD. Register as an anonymous module.
|
7
|
-
define(['jquery'], factory);
|
8
|
-
} else if (typeof exports === 'object') {
|
9
|
-
// Node/CommonJS
|
10
|
-
factory(require('jquery'));
|
11
|
-
} else {
|
12
|
-
// Browser globals
|
13
|
-
factory(window.jQuery || window.Zepto);
|
14
|
-
}
|
15
|
-
}(function($) {
|
4
|
+
;(function (factory) {
|
5
|
+
if (typeof define === 'function' && define.amd) {
|
6
|
+
// AMD. Register as an anonymous module.
|
7
|
+
define(['jquery'], factory);
|
8
|
+
} else if (typeof exports === 'object') {
|
9
|
+
// Node/CommonJS
|
10
|
+
factory(require('jquery'));
|
11
|
+
} else {
|
12
|
+
// Browser globals
|
13
|
+
factory(window.jQuery || window.Zepto);
|
14
|
+
}
|
15
|
+
}(function($) {
|
16
16
|
|
17
17
|
/*>>core*/
|
18
18
|
/**
|
19
|
-
*
|
19
|
+
*
|
20
20
|
* Magnific Popup Core JS file
|
21
|
-
*
|
21
|
+
*
|
22
22
|
*/
|
23
23
|
|
24
24
|
|
@@ -40,7 +40,7 @@ var CLOSE_EVENT = 'Close',
|
|
40
40
|
|
41
41
|
|
42
42
|
/**
|
43
|
-
* Private vars
|
43
|
+
* Private vars
|
44
44
|
*/
|
45
45
|
/*jshint -W079 */
|
46
46
|
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
|
@@ -109,15 +109,15 @@ var _mfpOn = function(name, f) {
|
|
109
109
|
v = ['ms','O','Moz','Webkit']; // 'v' for vendor
|
110
110
|
|
111
111
|
if( s['transition'] !== undefined ) {
|
112
|
-
return true;
|
112
|
+
return true;
|
113
113
|
}
|
114
|
-
|
114
|
+
|
115
115
|
while( v.length ) {
|
116
116
|
if( v.pop() + 'Transition' in s ) {
|
117
117
|
return true;
|
118
118
|
}
|
119
119
|
}
|
120
|
-
|
120
|
+
|
121
121
|
return false;
|
122
122
|
};
|
123
123
|
|
@@ -131,12 +131,12 @@ MagnificPopup.prototype = {
|
|
131
131
|
constructor: MagnificPopup,
|
132
132
|
|
133
133
|
/**
|
134
|
-
* Initializes Magnific Popup plugin.
|
134
|
+
* Initializes Magnific Popup plugin.
|
135
135
|
* This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
|
136
136
|
*/
|
137
137
|
init: function() {
|
138
138
|
var appVersion = navigator.appVersion;
|
139
|
-
mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
|
139
|
+
mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
|
140
140
|
mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
|
141
141
|
mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
|
142
142
|
mfp.isAndroid = (/android/gi).test(appVersion);
|
@@ -159,7 +159,7 @@ MagnificPopup.prototype = {
|
|
159
159
|
|
160
160
|
var i;
|
161
161
|
|
162
|
-
if(data.isObj === false) {
|
162
|
+
if(data.isObj === false) {
|
163
163
|
// convert jQuery collection to array to avoid conflicts later
|
164
164
|
mfp.items = data.items.toArray();
|
165
165
|
|
@@ -186,8 +186,8 @@ MagnificPopup.prototype = {
|
|
186
186
|
mfp.updateItemHTML();
|
187
187
|
return;
|
188
188
|
}
|
189
|
-
|
190
|
-
mfp.types = [];
|
189
|
+
|
190
|
+
mfp.types = [];
|
191
191
|
_wrapClasses = '';
|
192
192
|
if(data.mainEl && data.mainEl.length) {
|
193
193
|
mfp.ev = data.mainEl.eq(0);
|
@@ -206,7 +206,7 @@ MagnificPopup.prototype = {
|
|
206
206
|
|
207
207
|
|
208
208
|
|
209
|
-
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
209
|
+
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
210
210
|
mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
|
211
211
|
|
212
212
|
if(mfp.st.modal) {
|
@@ -215,7 +215,7 @@ MagnificPopup.prototype = {
|
|
215
215
|
mfp.st.showCloseBtn = false;
|
216
216
|
mfp.st.enableEscapeKey = false;
|
217
217
|
}
|
218
|
-
|
218
|
+
|
219
219
|
|
220
220
|
// Building markup
|
221
221
|
// main containers are created only once
|
@@ -267,7 +267,7 @@ MagnificPopup.prototype = {
|
|
267
267
|
_wrapClasses += ' mfp-align-top';
|
268
268
|
}
|
269
269
|
|
270
|
-
|
270
|
+
|
271
271
|
|
272
272
|
if(mfp.fixedContentPos) {
|
273
273
|
mfp.wrap.css({
|
@@ -276,7 +276,7 @@ MagnificPopup.prototype = {
|
|
276
276
|
overflowY: mfp.st.overflowY
|
277
277
|
});
|
278
278
|
} else {
|
279
|
-
mfp.wrap.css({
|
279
|
+
mfp.wrap.css({
|
280
280
|
top: _window.scrollTop(),
|
281
281
|
position: 'absolute'
|
282
282
|
});
|
@@ -288,7 +288,7 @@ MagnificPopup.prototype = {
|
|
288
288
|
});
|
289
289
|
}
|
290
290
|
|
291
|
-
|
291
|
+
|
292
292
|
|
293
293
|
if(mfp.st.enableEscapeKey) {
|
294
294
|
// Close on ESC key
|
@@ -307,7 +307,7 @@ MagnificPopup.prototype = {
|
|
307
307
|
if(!mfp.st.closeOnContentClick) {
|
308
308
|
_wrapClasses += ' mfp-auto-cursor';
|
309
309
|
}
|
310
|
-
|
310
|
+
|
311
311
|
if(_wrapClasses)
|
312
312
|
mfp.wrap.addClass(_wrapClasses);
|
313
313
|
|
@@ -315,7 +315,7 @@ MagnificPopup.prototype = {
|
|
315
315
|
// this triggers recalculation of layout, so we get it once to not to trigger twice
|
316
316
|
var windowHeight = mfp.wH = _window.height();
|
317
317
|
|
318
|
-
|
318
|
+
|
319
319
|
var windowStyles = {};
|
320
320
|
|
321
321
|
if( mfp.fixedContentPos ) {
|
@@ -336,8 +336,8 @@ MagnificPopup.prototype = {
|
|
336
336
|
}
|
337
337
|
}
|
338
338
|
|
339
|
-
|
340
|
-
|
339
|
+
|
340
|
+
|
341
341
|
var classesToadd = mfp.st.mainClass;
|
342
342
|
if(mfp.isIE7) {
|
343
343
|
classesToadd += ' mfp-ie7';
|
@@ -353,16 +353,16 @@ MagnificPopup.prototype = {
|
|
353
353
|
|
354
354
|
// remove scrollbar, add margin e.t.c
|
355
355
|
$('html').css(windowStyles);
|
356
|
-
|
356
|
+
|
357
357
|
// add everything to DOM
|
358
358
|
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
|
359
359
|
|
360
360
|
// Save last focused element
|
361
361
|
mfp._lastFocusedEl = document.activeElement;
|
362
|
-
|
362
|
+
|
363
363
|
// Wait for next cycle to allow CSS transition
|
364
364
|
setTimeout(function() {
|
365
|
-
|
365
|
+
|
366
366
|
if(mfp.content) {
|
367
367
|
mfp._addClassToMFP(READY_CLASS);
|
368
368
|
mfp._setFocus();
|
@@ -370,7 +370,7 @@ MagnificPopup.prototype = {
|
|
370
370
|
// if content is not defined (not loaded e.t.c) we add class only for BG
|
371
371
|
mfp.bgOverlay.addClass(READY_CLASS);
|
372
372
|
}
|
373
|
-
|
373
|
+
|
374
374
|
// Trap the focus in popup
|
375
375
|
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
|
376
376
|
|
@@ -429,7 +429,7 @@ MagnificPopup.prototype = {
|
|
429
429
|
}
|
430
430
|
$('html').css(windowStyles);
|
431
431
|
}
|
432
|
-
|
432
|
+
|
433
433
|
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
|
434
434
|
mfp.ev.off(EVENT_NS);
|
435
435
|
|
@@ -446,17 +446,17 @@ MagnificPopup.prototype = {
|
|
446
446
|
}
|
447
447
|
|
448
448
|
|
449
|
-
if(mfp._lastFocusedEl) {
|
449
|
+
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
450
450
|
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
451
451
|
}
|
452
|
-
mfp.currItem = null;
|
452
|
+
mfp.currItem = null;
|
453
453
|
mfp.content = null;
|
454
454
|
mfp.currTemplate = null;
|
455
455
|
mfp.prevHeight = 0;
|
456
456
|
|
457
457
|
_mfpTrigger(AFTER_CLOSE_EVENT);
|
458
458
|
},
|
459
|
-
|
459
|
+
|
460
460
|
updateSize: function(winHeight) {
|
461
461
|
|
462
462
|
if(mfp.isIOS) {
|
@@ -493,17 +493,17 @@ MagnificPopup.prototype = {
|
|
493
493
|
item = mfp.parseEl( mfp.index );
|
494
494
|
}
|
495
495
|
|
496
|
-
var type = item.type;
|
496
|
+
var type = item.type;
|
497
497
|
|
498
498
|
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
499
499
|
// BeforeChange event works like so:
|
500
500
|
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
501
|
-
|
501
|
+
|
502
502
|
mfp.currItem = item;
|
503
503
|
|
504
|
+
|
504
505
|
|
505
|
-
|
506
|
-
|
506
|
+
|
507
507
|
|
508
508
|
if(!mfp.currTemplate[type]) {
|
509
509
|
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
@@ -522,7 +522,7 @@ MagnificPopup.prototype = {
|
|
522
522
|
if(_prevContentType && _prevContentType !== item.type) {
|
523
523
|
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
524
524
|
}
|
525
|
-
|
525
|
+
|
526
526
|
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
527
527
|
mfp.appendContent(newContent, type);
|
528
528
|
|
@@ -530,7 +530,7 @@ MagnificPopup.prototype = {
|
|
530
530
|
|
531
531
|
_mfpTrigger(CHANGE_EVENT, item);
|
532
532
|
_prevContentType = item.type;
|
533
|
-
|
533
|
+
|
534
534
|
// Append container back after its content changed
|
535
535
|
mfp.container.prepend(mfp.contentContainer);
|
536
536
|
|
@@ -543,7 +543,7 @@ MagnificPopup.prototype = {
|
|
543
543
|
*/
|
544
544
|
appendContent: function(newContent, type) {
|
545
545
|
mfp.content = newContent;
|
546
|
-
|
546
|
+
|
547
547
|
if(newContent) {
|
548
548
|
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
549
549
|
mfp.currTemplate[type] === true) {
|
@@ -566,7 +566,7 @@ MagnificPopup.prototype = {
|
|
566
566
|
|
567
567
|
|
568
568
|
|
569
|
-
|
569
|
+
|
570
570
|
/**
|
571
571
|
* Creates Magnific Popup data object based on given data
|
572
572
|
* @param {int} index Index of item to parse
|
@@ -620,11 +620,11 @@ MagnificPopup.prototype = {
|
|
620
620
|
|
621
621
|
if(!options) {
|
622
622
|
options = {};
|
623
|
-
}
|
623
|
+
}
|
624
624
|
|
625
625
|
var eName = 'click.magnificPopup';
|
626
626
|
options.mainEl = el;
|
627
|
-
|
627
|
+
|
628
628
|
if(options.items) {
|
629
629
|
options.isObj = true;
|
630
630
|
el.off(eName).on(eName, eHandler);
|
@@ -659,7 +659,7 @@ MagnificPopup.prototype = {
|
|
659
659
|
}
|
660
660
|
}
|
661
661
|
}
|
662
|
-
|
662
|
+
|
663
663
|
if(e.type) {
|
664
664
|
e.preventDefault();
|
665
665
|
|
@@ -668,7 +668,7 @@ MagnificPopup.prototype = {
|
|
668
668
|
e.stopPropagation();
|
669
669
|
}
|
670
670
|
}
|
671
|
-
|
671
|
+
|
672
672
|
|
673
673
|
options.el = $(e.mfpEl);
|
674
674
|
if(options.delegate) {
|
@@ -836,14 +836,14 @@ $.magnificPopup = {
|
|
836
836
|
modules: [],
|
837
837
|
|
838
838
|
open: function(options, index) {
|
839
|
-
_checkInstance();
|
839
|
+
_checkInstance();
|
840
840
|
|
841
841
|
if(!options) {
|
842
842
|
options = {};
|
843
843
|
} else {
|
844
844
|
options = $.extend(true, {}, options);
|
845
845
|
}
|
846
|
-
|
846
|
+
|
847
847
|
|
848
848
|
options.isObj = true;
|
849
849
|
options.index = index || 0;
|
@@ -858,16 +858,16 @@ $.magnificPopup = {
|
|
858
858
|
if(module.options) {
|
859
859
|
$.magnificPopup.defaults[name] = module.options;
|
860
860
|
}
|
861
|
-
$.extend(this.proto, module.proto);
|
861
|
+
$.extend(this.proto, module.proto);
|
862
862
|
this.modules.push(name);
|
863
863
|
},
|
864
864
|
|
865
|
-
defaults: {
|
865
|
+
defaults: {
|
866
866
|
|
867
867
|
// Info about options is in docs:
|
868
868
|
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
869
|
-
|
870
|
-
disableOn: 0,
|
869
|
+
|
870
|
+
disableOn: 0,
|
871
871
|
|
872
872
|
key: null,
|
873
873
|
|
@@ -878,12 +878,12 @@ $.magnificPopup = {
|
|
878
878
|
preloader: true,
|
879
879
|
|
880
880
|
focus: '', // CSS selector of input to focus after popup is opened
|
881
|
-
|
881
|
+
|
882
882
|
closeOnContentClick: false,
|
883
883
|
|
884
884
|
closeOnBgClick: true,
|
885
885
|
|
886
|
-
closeBtnInside: true,
|
886
|
+
closeBtnInside: true,
|
887
887
|
|
888
888
|
showCloseBtn: true,
|
889
889
|
|
@@ -892,13 +892,13 @@ $.magnificPopup = {
|
|
892
892
|
modal: false,
|
893
893
|
|
894
894
|
alignTop: false,
|
895
|
-
|
895
|
+
|
896
896
|
removalDelay: 0,
|
897
897
|
|
898
898
|
prependTo: null,
|
899
|
-
|
900
|
-
fixedContentPos: 'auto',
|
901
|
-
|
899
|
+
|
900
|
+
fixedContentPos: 'auto',
|
901
|
+
|
902
902
|
fixedBgPos: 'auto',
|
903
903
|
|
904
904
|
overflowY: 'auto',
|
@@ -907,7 +907,9 @@ $.magnificPopup = {
|
|
907
907
|
|
908
908
|
tClose: 'Close (Esc)',
|
909
909
|
|
910
|
-
tLoading: 'Loading...'
|
910
|
+
tLoading: 'Loading...',
|
911
|
+
|
912
|
+
autoFocusLast: true
|
911
913
|
|
912
914
|
}
|
913
915
|
};
|
@@ -945,9 +947,9 @@ $.fn.magnificPopup = function(options) {
|
|
945
947
|
} else {
|
946
948
|
// clone options obj
|
947
949
|
options = $.extend(true, {}, options);
|
948
|
-
|
950
|
+
|
949
951
|
/*
|
950
|
-
* As Zepto doesn't support .data() method for objects
|
952
|
+
* As Zepto doesn't support .data() method for objects
|
951
953
|
* and it works only in normal browsers
|
952
954
|
* we assign "options" object directly to the DOM element. FTW!
|
953
955
|
*/
|
@@ -989,7 +991,7 @@ console.log('Test #2:', performance.now() - start);
|
|
989
991
|
|
990
992
|
var INLINE_NS = 'inline',
|
991
993
|
_hiddenClass,
|
992
|
-
_inlinePlaceholder,
|
994
|
+
_inlinePlaceholder,
|
993
995
|
_lastInlineElement,
|
994
996
|
_putInlineElementsBack = function() {
|
995
997
|
if(_lastInlineElement) {
|
@@ -1138,14 +1140,14 @@ $.magnificPopup.registerModule(AJAX_NS, {
|
|
1138
1140
|
|
1139
1141
|
|
1140
1142
|
|
1141
|
-
|
1143
|
+
|
1142
1144
|
|
1143
1145
|
/*>>ajax*/
|
1144
1146
|
|
1145
1147
|
/*>>image*/
|
1146
1148
|
var _imgInterval,
|
1147
1149
|
_getTitle = function(item) {
|
1148
|
-
if(item.data && item.data.title !== undefined)
|
1150
|
+
if(item.data && item.data.title !== undefined)
|
1149
1151
|
return item.data.title;
|
1150
1152
|
|
1151
1153
|
var src = mfp.st.image.titleSrc;
|
@@ -1176,7 +1178,7 @@ $.magnificPopup.registerModule('image', {
|
|
1176
1178
|
'</figure>'+
|
1177
1179
|
'</div>',
|
1178
1180
|
cursor: 'mfp-zoom-out-cur',
|
1179
|
-
titleSrc: 'title',
|
1181
|
+
titleSrc: 'title',
|
1180
1182
|
verticalFit: true,
|
1181
1183
|
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1182
1184
|
},
|
@@ -1221,13 +1223,13 @@ $.magnificPopup.registerModule('image', {
|
|
1221
1223
|
},
|
1222
1224
|
_onImageHasSize: function(item) {
|
1223
1225
|
if(item.img) {
|
1224
|
-
|
1226
|
+
|
1225
1227
|
item.hasSize = true;
|
1226
1228
|
|
1227
1229
|
if(_imgInterval) {
|
1228
1230
|
clearInterval(_imgInterval);
|
1229
1231
|
}
|
1230
|
-
|
1232
|
+
|
1231
1233
|
item.isCheckingImgSize = false;
|
1232
1234
|
|
1233
1235
|
_mfpTrigger('ImageHasSize', item);
|
@@ -1235,7 +1237,7 @@ $.magnificPopup.registerModule('image', {
|
|
1235
1237
|
if(item.imgHidden) {
|
1236
1238
|
if(mfp.content)
|
1237
1239
|
mfp.content.removeClass('mfp-loading');
|
1238
|
-
|
1240
|
+
|
1239
1241
|
item.imgHidden = false;
|
1240
1242
|
}
|
1241
1243
|
|
@@ -1288,7 +1290,7 @@ $.magnificPopup.registerModule('image', {
|
|
1288
1290
|
if(item) {
|
1289
1291
|
if (item.img[0].complete) {
|
1290
1292
|
item.img.off('.mfploader');
|
1291
|
-
|
1293
|
+
|
1292
1294
|
if(item === mfp.currItem){
|
1293
1295
|
mfp._onImageHasSize(item);
|
1294
1296
|
|
@@ -1299,7 +1301,7 @@ $.magnificPopup.registerModule('image', {
|
|
1299
1301
|
item.loaded = true;
|
1300
1302
|
|
1301
1303
|
_mfpTrigger('ImageLoadComplete');
|
1302
|
-
|
1304
|
+
|
1303
1305
|
}
|
1304
1306
|
else {
|
1305
1307
|
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
@@ -1349,7 +1351,7 @@ $.magnificPopup.registerModule('image', {
|
|
1349
1351
|
img = item.img[0];
|
1350
1352
|
if(img.naturalWidth > 0) {
|
1351
1353
|
item.hasSize = true;
|
1352
|
-
} else if(!img.width) {
|
1354
|
+
} else if(!img.width) {
|
1353
1355
|
item.hasSize = false;
|
1354
1356
|
}
|
1355
1357
|
}
|
@@ -1381,7 +1383,7 @@ $.magnificPopup.registerModule('image', {
|
|
1381
1383
|
item.imgHidden = true;
|
1382
1384
|
template.addClass('mfp-loading');
|
1383
1385
|
mfp.findImageSize(item);
|
1384
|
-
}
|
1386
|
+
}
|
1385
1387
|
|
1386
1388
|
return template;
|
1387
1389
|
}
|
@@ -1398,7 +1400,7 @@ var hasMozTransform,
|
|
1398
1400
|
if(hasMozTransform === undefined) {
|
1399
1401
|
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1400
1402
|
}
|
1401
|
-
return hasMozTransform;
|
1403
|
+
return hasMozTransform;
|
1402
1404
|
};
|
1403
1405
|
|
1404
1406
|
$.magnificPopup.registerModule('zoom', {
|
@@ -1418,7 +1420,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1418
1420
|
var zoomSt = mfp.st.zoom,
|
1419
1421
|
ns = '.zoom',
|
1420
1422
|
image;
|
1421
|
-
|
1423
|
+
|
1422
1424
|
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1423
1425
|
return;
|
1424
1426
|
}
|
@@ -1454,7 +1456,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1454
1456
|
mfp.content.css('visibility', 'hidden');
|
1455
1457
|
|
1456
1458
|
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1457
|
-
|
1459
|
+
|
1458
1460
|
image = mfp._getItemToZoom();
|
1459
1461
|
|
1460
1462
|
if(!image) {
|
@@ -1462,8 +1464,8 @@ $.magnificPopup.registerModule('zoom', {
|
|
1462
1464
|
return;
|
1463
1465
|
}
|
1464
1466
|
|
1465
|
-
animatedImg = getElToAnimate(image);
|
1466
|
-
|
1467
|
+
animatedImg = getElToAnimate(image);
|
1468
|
+
|
1467
1469
|
animatedImg.css( mfp._getOffset() );
|
1468
1470
|
|
1469
1471
|
mfp.wrap.append(animatedImg);
|
@@ -1478,7 +1480,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1478
1480
|
animatedImg.remove();
|
1479
1481
|
image = animatedImg = null;
|
1480
1482
|
_mfpTrigger('ZoomAnimationEnded');
|
1481
|
-
}, 16); // avoid blink when switching images
|
1483
|
+
}, 16); // avoid blink when switching images
|
1482
1484
|
|
1483
1485
|
}, duration); // this timeout equals animation duration
|
1484
1486
|
|
@@ -1502,12 +1504,12 @@ $.magnificPopup.registerModule('zoom', {
|
|
1502
1504
|
}
|
1503
1505
|
animatedImg = getElToAnimate(image);
|
1504
1506
|
}
|
1505
|
-
|
1506
|
-
|
1507
|
+
|
1508
|
+
|
1507
1509
|
animatedImg.css( mfp._getOffset(true) );
|
1508
1510
|
mfp.wrap.append(animatedImg);
|
1509
1511
|
mfp.content.css('visibility', 'hidden');
|
1510
|
-
|
1512
|
+
|
1511
1513
|
setTimeout(function() {
|
1512
1514
|
animatedImg.css( mfp._getOffset() );
|
1513
1515
|
}, 16);
|
@@ -1522,7 +1524,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1522
1524
|
animatedImg.remove();
|
1523
1525
|
}
|
1524
1526
|
image = null;
|
1525
|
-
}
|
1527
|
+
}
|
1526
1528
|
});
|
1527
1529
|
},
|
1528
1530
|
|
@@ -1554,7 +1556,7 @@ $.magnificPopup.registerModule('zoom', {
|
|
1554
1556
|
|
1555
1557
|
|
1556
1558
|
/*
|
1557
|
-
|
1559
|
+
|
1558
1560
|
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1559
1561
|
|
1560
1562
|
*/
|
@@ -1585,11 +1587,11 @@ $.magnificPopup.registerModule('zoom', {
|
|
1585
1587
|
|
1586
1588
|
var IFRAME_NS = 'iframe',
|
1587
1589
|
_emptyPage = '//about:blank',
|
1588
|
-
|
1590
|
+
|
1589
1591
|
_fixIframeBugs = function(isShowing) {
|
1590
1592
|
if(mfp.currTemplate[IFRAME_NS]) {
|
1591
1593
|
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1592
|
-
if(el.length) {
|
1594
|
+
if(el.length) {
|
1593
1595
|
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1594
1596
|
if(!isShowing) {
|
1595
1597
|
el[0].src = _emptyPage;
|
@@ -1616,8 +1618,8 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1616
1618
|
// we don't care and support only one default type of URL by default
|
1617
1619
|
patterns: {
|
1618
1620
|
youtube: {
|
1619
|
-
index: 'youtube.com',
|
1620
|
-
id: 'v=',
|
1621
|
+
index: 'youtube.com',
|
1622
|
+
id: 'v=',
|
1621
1623
|
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1622
1624
|
},
|
1623
1625
|
vimeo: {
|
@@ -1642,7 +1644,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1642
1644
|
_fixIframeBugs(); // iframe if removed
|
1643
1645
|
} else if(newType === IFRAME_NS) {
|
1644
1646
|
_fixIframeBugs(true); // iframe is showing
|
1645
|
-
}
|
1647
|
+
}
|
1646
1648
|
}// else {
|
1647
1649
|
// iframe source is switched, don't do anything
|
1648
1650
|
//}
|
@@ -1656,7 +1658,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1656
1658
|
getIframe: function(item, template) {
|
1657
1659
|
var embedSrc = item.src;
|
1658
1660
|
var iframeSt = mfp.st.iframe;
|
1659
|
-
|
1661
|
+
|
1660
1662
|
$.each(iframeSt.patterns, function() {
|
1661
1663
|
if(embedSrc.indexOf( this.index ) > -1) {
|
1662
1664
|
if(this.id) {
|
@@ -1670,7 +1672,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
|
|
1670
1672
|
return false; // break;
|
1671
1673
|
}
|
1672
1674
|
});
|
1673
|
-
|
1675
|
+
|
1674
1676
|
var dataObj = {};
|
1675
1677
|
if(iframeSt.srcAction) {
|
1676
1678
|
dataObj[iframeSt.srcAction] = embedSrc;
|
@@ -1727,7 +1729,7 @@ $.magnificPopup.registerModule('gallery', {
|
|
1727
1729
|
supportsFastClick = Boolean($.fn.mfpFastClick);
|
1728
1730
|
|
1729
1731
|
mfp.direction = true; // true - next, false - prev
|
1730
|
-
|
1732
|
+
|
1731
1733
|
if(!gSt || !gSt.enabled ) return false;
|
1732
1734
|
|
1733
1735
|
_wrapClasses += ' mfp-gallery';
|
@@ -1766,16 +1768,16 @@ $.magnificPopup.registerModule('gallery', {
|
|
1766
1768
|
_mfpOn('BuildControls' + ns, function() {
|
1767
1769
|
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1768
1770
|
var markup = gSt.arrowMarkup,
|
1769
|
-
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1771
|
+
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1770
1772
|
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1771
1773
|
|
1772
1774
|
var eName = supportsFastClick ? 'mfpFastClick' : 'click';
|
1773
1775
|
arrowLeft[eName](function() {
|
1774
1776
|
mfp.prev();
|
1775
|
-
});
|
1777
|
+
});
|
1776
1778
|
arrowRight[eName](function() {
|
1777
1779
|
mfp.next();
|
1778
|
-
});
|
1780
|
+
});
|
1779
1781
|
|
1780
1782
|
// Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
|
1781
1783
|
if(mfp.isIE7) {
|
@@ -1795,21 +1797,21 @@ $.magnificPopup.registerModule('gallery', {
|
|
1795
1797
|
mfp._preloadTimeout = setTimeout(function() {
|
1796
1798
|
mfp.preloadNearbyImages();
|
1797
1799
|
mfp._preloadTimeout = null;
|
1798
|
-
}, 16);
|
1800
|
+
}, 16);
|
1799
1801
|
});
|
1800
1802
|
|
1801
1803
|
|
1802
1804
|
_mfpOn(CLOSE_EVENT+ns, function() {
|
1803
1805
|
_document.off(ns);
|
1804
1806
|
mfp.wrap.off('click'+ns);
|
1805
|
-
|
1807
|
+
|
1806
1808
|
if(mfp.arrowLeft && supportsFastClick) {
|
1807
1809
|
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
|
1808
1810
|
}
|
1809
1811
|
mfp.arrowRight = mfp.arrowLeft = null;
|
1810
1812
|
});
|
1811
1813
|
|
1812
|
-
},
|
1814
|
+
},
|
1813
1815
|
next: function() {
|
1814
1816
|
mfp.direction = true;
|
1815
1817
|
mfp.index = _getLoopedId(mfp.index + 1);
|
@@ -1974,11 +1976,11 @@ $.magnificPopup.registerModule(RETINA_NS, {
|
|
1974
1976
|
*
|
1975
1977
|
* To unbind:
|
1976
1978
|
* $('.your-el').destroyMfpFastClick();
|
1977
|
-
*
|
1978
|
-
*
|
1979
|
+
*
|
1980
|
+
*
|
1979
1981
|
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
|
1980
1982
|
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
|
1981
|
-
*
|
1983
|
+
*
|
1982
1984
|
*/
|
1983
1985
|
|
1984
1986
|
(function() {
|
@@ -2057,4 +2059,4 @@ $.magnificPopup.registerModule(RETINA_NS, {
|
|
2057
2059
|
})();
|
2058
2060
|
|
2059
2061
|
/*>>fastclick*/
|
2060
|
-
_checkInstance(); }));
|
2062
|
+
_checkInstance(); }));
|
File without changes
|
data/lib/magnific-popup-rails.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/magnific-popup-rails/version', __FILE__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |gem|
|
5
4
|
gem.authors = ["Joshua Jansen"]
|
@@ -13,7 +12,5 @@ Gem::Specification.new do |gem|
|
|
13
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
13
|
gem.name = "magnific-popup-rails"
|
15
14
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version =
|
17
|
-
|
18
|
-
gem.add_development_dependency "rake"
|
15
|
+
gem.version = "1.0.1"
|
19
16
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
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.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Jansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: Magnific Popup is a free responsive jQuery lightbox plugin that is focused
|
28
14
|
on performance and providing best experience for user with any device
|
29
15
|
email:
|
@@ -33,17 +19,11 @@ extensions: []
|
|
33
19
|
extra_rdoc_files: []
|
34
20
|
files:
|
35
21
|
- ".gitignore"
|
36
|
-
- Gemfile
|
37
|
-
- LICENSE
|
38
22
|
- README.md
|
39
|
-
- Rakefile
|
40
23
|
- app/assets/javascripts/magnific-popup.js
|
41
24
|
- app/assets/stylesheets/magnific-popup.css
|
42
25
|
- lib/magnific-popup-rails.rb
|
43
|
-
- lib/magnific-popup-rails/engine.rb
|
44
|
-
- lib/magnific-popup-rails/version.rb
|
45
26
|
- magnific-popup-rails.gemspec
|
46
|
-
- vendor/assets/stylesheets/magnific-popup.scss
|
47
27
|
homepage: https://github.com/joshuajansen/magnific-popup-rails
|
48
28
|
licenses: []
|
49
29
|
metadata: {}
|
@@ -63,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
43
|
version: '0'
|
64
44
|
requirements: []
|
65
45
|
rubyforge_project:
|
66
|
-
rubygems_version: 2.4.5
|
46
|
+
rubygems_version: 2.4.5.1
|
67
47
|
signing_key:
|
68
48
|
specification_version: 4
|
69
49
|
summary: Magnific Popup displays images before they're completely loaded to take full
|
data/Gemfile
DELETED
data/LICENSE
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Public domain
|
data/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
@@ -1 +0,0 @@
|
|
1
|
-
@import 'magnific-popup/magnific-popup'
|