magnific-popup-rails 0.9.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b25d0111cbe05cc7a69194e4d52dd1aa38d48a52
4
- data.tar.gz: 618e224f23b0f55014026924475f0483f16bb39e
3
+ metadata.gz: f05d7c0b616d46a89a5fe6eca042e6b6ece99975
4
+ data.tar.gz: f448dd3beff79485f96149ff6641876a13b9a63c
5
5
  SHA512:
6
- metadata.gz: 0180eb55b9e43a1978830c86bfbd7d947cfbe02e0d9ad96d53d8b3350747f5fec36d5cf31424542c1ad0e6624d24f3a0f8f6476e7ea3ced05089cab26dc2c6fd
7
- data.tar.gz: 995b4e226d25409005424ac21835bffb0cf4666f2b4bddf5e56dcbdebf1c85d070d183702a64e8f214092bcd57ac73f527df2bac3ac3203a0765a236529812f8
6
+ metadata.gz: 155f479b7be7ca7ac6fd4a4c7f585c00081dfdc34acd57713bfaa58ecadf2c79f4318f16882d798a9790ade4d7f57cd6479860e15a0ca879f17ee9f5a1405f78
7
+ data.tar.gz: 949d77560e229d2c7ec60bb1ccb9b59fa1a372cb4afb1bc37820b836dce09cbfb499350e8e3dd19cbf2f22e006d5b6d32027e4f56835e26a9c3e1b26a2982e71
data/Rakefile CHANGED
@@ -1,23 +1 @@
1
- #!/usr/bin/env rake
2
1
  require "bundler/gem_tasks"
3
- require 'open-uri'
4
-
5
- desc "Download the latest magnific-popup.css and magnific-popup.js"
6
- task :update do
7
- # CSS
8
- url = "https://raw.github.com/dimsemenov/Magnific-Popup/master/dist/magnific-popup.css"
9
- outputfile = "vendor/assets/stylesheets/magnific-popup/magnific-popup.css"
10
-
11
- open(outputfile, 'wb') do |file|
12
- file << open(url).read
13
- end
14
-
15
- # JS
16
- url = "https://raw.github.com/dimsemenov/Magnific-Popup/master/dist/jquery.magnific-popup.js"
17
- outputfile = "vendor/assets/javascripts/magnific-popup/jquery.magnific-popup.js"
18
-
19
- open(outputfile, 'wb') do |file|
20
- file << open(url).read
21
- end
22
-
23
- end
@@ -1,13 +1,24 @@
1
- /*! Magnific Popup - v0.9.9 - 2013-12-04
1
+ /*! Magnific Popup - v1.0.0 - 2015-09-17
2
2
  * http://dimsemenov.com/plugins/magnific-popup/
3
- * Copyright (c) 2013 Dmitry Semenov; */
4
- ;(function($) {
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($) {
5
16
 
6
17
  /*>>core*/
7
18
  /**
8
- *
19
+ *
9
20
  * Magnific Popup Core JS file
10
- *
21
+ *
11
22
  */
12
23
 
13
24
 
@@ -29,14 +40,14 @@ var CLOSE_EVENT = 'Close',
29
40
 
30
41
 
31
42
  /**
32
- * Private vars
43
+ * Private vars
33
44
  */
45
+ /*jshint -W079 */
34
46
  var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
35
47
  MagnificPopup = function(){},
36
48
  _isJQ = !!(window.jQuery),
37
49
  _prevStatus,
38
50
  _window = $(window),
39
- _body,
40
51
  _document,
41
52
  _prevContentType,
42
53
  _wrapClasses,
@@ -86,6 +97,7 @@ var _mfpOn = function(name, f) {
86
97
  // Initialize Magnific Popup only when called at least once
87
98
  _checkInstance = function() {
88
99
  if(!$.magnificPopup.instance) {
100
+ /*jshint -W020 */
89
101
  mfp = new MagnificPopup();
90
102
  mfp.init();
91
103
  $.magnificPopup.instance = mfp;
@@ -97,15 +109,15 @@ var _mfpOn = function(name, f) {
97
109
  v = ['ms','O','Moz','Webkit']; // 'v' for vendor
98
110
 
99
111
  if( s['transition'] !== undefined ) {
100
- return true;
112
+ return true;
101
113
  }
102
-
114
+
103
115
  while( v.length ) {
104
116
  if( v.pop() + 'Transition' in s ) {
105
117
  return true;
106
118
  }
107
119
  }
108
-
120
+
109
121
  return false;
110
122
  };
111
123
 
@@ -119,12 +131,12 @@ MagnificPopup.prototype = {
119
131
  constructor: MagnificPopup,
120
132
 
121
133
  /**
122
- * Initializes Magnific Popup plugin.
134
+ * Initializes Magnific Popup plugin.
123
135
  * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
124
136
  */
125
137
  init: function() {
126
138
  var appVersion = navigator.appVersion;
127
- mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
139
+ mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
128
140
  mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
129
141
  mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
130
142
  mfp.isAndroid = (/android/gi).test(appVersion);
@@ -145,11 +157,9 @@ MagnificPopup.prototype = {
145
157
  */
146
158
  open: function(data) {
147
159
 
148
- _body = $(document.body);
149
-
150
160
  var i;
151
161
 
152
- if(data.isObj === false) {
162
+ if(data.isObj === false) {
153
163
  // convert jQuery collection to array to avoid conflicts later
154
164
  mfp.items = data.items.toArray();
155
165
 
@@ -176,8 +186,8 @@ MagnificPopup.prototype = {
176
186
  mfp.updateItemHTML();
177
187
  return;
178
188
  }
179
-
180
- mfp.types = [];
189
+
190
+ mfp.types = [];
181
191
  _wrapClasses = '';
182
192
  if(data.mainEl && data.mainEl.length) {
183
193
  mfp.ev = data.mainEl.eq(0);
@@ -196,7 +206,7 @@ MagnificPopup.prototype = {
196
206
 
197
207
 
198
208
 
199
- mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
209
+ mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
200
210
  mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
201
211
 
202
212
  if(mfp.st.modal) {
@@ -205,7 +215,7 @@ MagnificPopup.prototype = {
205
215
  mfp.st.showCloseBtn = false;
206
216
  mfp.st.enableEscapeKey = false;
207
217
  }
208
-
218
+
209
219
 
210
220
  // Building markup
211
221
  // main containers are created only once
@@ -257,7 +267,7 @@ MagnificPopup.prototype = {
257
267
  _wrapClasses += ' mfp-align-top';
258
268
  }
259
269
 
260
-
270
+
261
271
 
262
272
  if(mfp.fixedContentPos) {
263
273
  mfp.wrap.css({
@@ -266,7 +276,7 @@ MagnificPopup.prototype = {
266
276
  overflowY: mfp.st.overflowY
267
277
  });
268
278
  } else {
269
- mfp.wrap.css({
279
+ mfp.wrap.css({
270
280
  top: _window.scrollTop(),
271
281
  position: 'absolute'
272
282
  });
@@ -278,7 +288,7 @@ MagnificPopup.prototype = {
278
288
  });
279
289
  }
280
290
 
281
-
291
+
282
292
 
283
293
  if(mfp.st.enableEscapeKey) {
284
294
  // Close on ESC key
@@ -297,7 +307,7 @@ MagnificPopup.prototype = {
297
307
  if(!mfp.st.closeOnContentClick) {
298
308
  _wrapClasses += ' mfp-auto-cursor';
299
309
  }
300
-
310
+
301
311
  if(_wrapClasses)
302
312
  mfp.wrap.addClass(_wrapClasses);
303
313
 
@@ -305,7 +315,7 @@ MagnificPopup.prototype = {
305
315
  // this triggers recalculation of layout, so we get it once to not to trigger twice
306
316
  var windowHeight = mfp.wH = _window.height();
307
317
 
308
-
318
+
309
319
  var windowStyles = {};
310
320
 
311
321
  if( mfp.fixedContentPos ) {
@@ -326,8 +336,8 @@ MagnificPopup.prototype = {
326
336
  }
327
337
  }
328
338
 
329
-
330
-
339
+
340
+
331
341
  var classesToadd = mfp.st.mainClass;
332
342
  if(mfp.isIE7) {
333
343
  classesToadd += ' mfp-ie7';
@@ -343,16 +353,16 @@ MagnificPopup.prototype = {
343
353
 
344
354
  // remove scrollbar, add margin e.t.c
345
355
  $('html').css(windowStyles);
346
-
356
+
347
357
  // add everything to DOM
348
- mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body );
358
+ mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
349
359
 
350
360
  // Save last focused element
351
361
  mfp._lastFocusedEl = document.activeElement;
352
-
362
+
353
363
  // Wait for next cycle to allow CSS transition
354
364
  setTimeout(function() {
355
-
365
+
356
366
  if(mfp.content) {
357
367
  mfp._addClassToMFP(READY_CLASS);
358
368
  mfp._setFocus();
@@ -360,7 +370,7 @@ MagnificPopup.prototype = {
360
370
  // if content is not defined (not loaded e.t.c) we add class only for BG
361
371
  mfp.bgOverlay.addClass(READY_CLASS);
362
372
  }
363
-
373
+
364
374
  // Trap the focus in popup
365
375
  _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
366
376
 
@@ -419,7 +429,7 @@ MagnificPopup.prototype = {
419
429
  }
420
430
  $('html').css(windowStyles);
421
431
  }
422
-
432
+
423
433
  _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
424
434
  mfp.ev.off(EVENT_NS);
425
435
 
@@ -439,14 +449,14 @@ MagnificPopup.prototype = {
439
449
  if(mfp._lastFocusedEl) {
440
450
  $(mfp._lastFocusedEl).focus(); // put tab focus back
441
451
  }
442
- mfp.currItem = null;
452
+ mfp.currItem = null;
443
453
  mfp.content = null;
444
454
  mfp.currTemplate = null;
445
455
  mfp.prevHeight = 0;
446
456
 
447
457
  _mfpTrigger(AFTER_CLOSE_EVENT);
448
458
  },
449
-
459
+
450
460
  updateSize: function(winHeight) {
451
461
 
452
462
  if(mfp.isIOS) {
@@ -483,17 +493,17 @@ MagnificPopup.prototype = {
483
493
  item = mfp.parseEl( mfp.index );
484
494
  }
485
495
 
486
- var type = item.type;
496
+ var type = item.type;
487
497
 
488
498
  _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
489
499
  // BeforeChange event works like so:
490
500
  // _mfpOn('BeforeChange', function(e, prevType, newType) { });
491
-
501
+
492
502
  mfp.currItem = item;
493
503
 
494
-
495
504
 
496
-
505
+
506
+
497
507
 
498
508
  if(!mfp.currTemplate[type]) {
499
509
  var markup = mfp.st[type] ? mfp.st[type].markup : false;
@@ -512,7 +522,7 @@ MagnificPopup.prototype = {
512
522
  if(_prevContentType && _prevContentType !== item.type) {
513
523
  mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
514
524
  }
515
-
525
+
516
526
  var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
517
527
  mfp.appendContent(newContent, type);
518
528
 
@@ -520,7 +530,7 @@ MagnificPopup.prototype = {
520
530
 
521
531
  _mfpTrigger(CHANGE_EVENT, item);
522
532
  _prevContentType = item.type;
523
-
533
+
524
534
  // Append container back after its content changed
525
535
  mfp.container.prepend(mfp.contentContainer);
526
536
 
@@ -533,7 +543,7 @@ MagnificPopup.prototype = {
533
543
  */
534
544
  appendContent: function(newContent, type) {
535
545
  mfp.content = newContent;
536
-
546
+
537
547
  if(newContent) {
538
548
  if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
539
549
  mfp.currTemplate[type] === true) {
@@ -556,18 +566,19 @@ MagnificPopup.prototype = {
556
566
 
557
567
 
558
568
 
559
-
569
+
560
570
  /**
561
571
  * Creates Magnific Popup data object based on given data
562
572
  * @param {int} index Index of item to parse
563
573
  */
564
574
  parseEl: function(index) {
565
575
  var item = mfp.items[index],
566
- type = item.type;
576
+ type;
567
577
 
568
578
  if(item.tagName) {
569
579
  item = { el: $(item) };
570
580
  } else {
581
+ type = item.type;
571
582
  item = { data: item, src: item.src };
572
583
  }
573
584
 
@@ -609,11 +620,11 @@ MagnificPopup.prototype = {
609
620
 
610
621
  if(!options) {
611
622
  options = {};
612
- }
623
+ }
613
624
 
614
625
  var eName = 'click.magnificPopup';
615
626
  options.mainEl = el;
616
-
627
+
617
628
  if(options.items) {
618
629
  options.isObj = true;
619
630
  el.off(eName).on(eName, eHandler);
@@ -631,7 +642,7 @@ MagnificPopup.prototype = {
631
642
  var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
632
643
 
633
644
 
634
- if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
645
+ if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
635
646
  return;
636
647
  }
637
648
 
@@ -648,7 +659,7 @@ MagnificPopup.prototype = {
648
659
  }
649
660
  }
650
661
  }
651
-
662
+
652
663
  if(e.type) {
653
664
  e.preventDefault();
654
665
 
@@ -657,7 +668,7 @@ MagnificPopup.prototype = {
657
668
  e.stopPropagation();
658
669
  }
659
670
  }
660
-
671
+
661
672
 
662
673
  options.el = $(e.mfpEl);
663
674
  if(options.delegate) {
@@ -803,7 +814,6 @@ MagnificPopup.prototype = {
803
814
  // thx David
804
815
  if(mfp.scrollbarSize === undefined) {
805
816
  var scrollDiv = document.createElement("div");
806
- scrollDiv.id = "mfp-sbm";
807
817
  scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
808
818
  document.body.appendChild(scrollDiv);
809
819
  mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
@@ -826,14 +836,14 @@ $.magnificPopup = {
826
836
  modules: [],
827
837
 
828
838
  open: function(options, index) {
829
- _checkInstance();
839
+ _checkInstance();
830
840
 
831
841
  if(!options) {
832
842
  options = {};
833
843
  } else {
834
844
  options = $.extend(true, {}, options);
835
845
  }
836
-
846
+
837
847
 
838
848
  options.isObj = true;
839
849
  options.index = index || 0;
@@ -848,16 +858,16 @@ $.magnificPopup = {
848
858
  if(module.options) {
849
859
  $.magnificPopup.defaults[name] = module.options;
850
860
  }
851
- $.extend(this.proto, module.proto);
861
+ $.extend(this.proto, module.proto);
852
862
  this.modules.push(name);
853
863
  },
854
864
 
855
- defaults: {
865
+ defaults: {
856
866
 
857
867
  // Info about options is in docs:
858
868
  // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
859
-
860
- disableOn: 0,
869
+
870
+ disableOn: 0,
861
871
 
862
872
  key: null,
863
873
 
@@ -868,12 +878,12 @@ $.magnificPopup = {
868
878
  preloader: true,
869
879
 
870
880
  focus: '', // CSS selector of input to focus after popup is opened
871
-
881
+
872
882
  closeOnContentClick: false,
873
883
 
874
884
  closeOnBgClick: true,
875
885
 
876
- closeBtnInside: true,
886
+ closeBtnInside: true,
877
887
 
878
888
  showCloseBtn: true,
879
889
 
@@ -882,18 +892,18 @@ $.magnificPopup = {
882
892
  modal: false,
883
893
 
884
894
  alignTop: false,
885
-
895
+
886
896
  removalDelay: 0,
887
897
 
888
898
  prependTo: null,
889
-
890
- fixedContentPos: 'auto',
891
-
899
+
900
+ fixedContentPos: 'auto',
901
+
892
902
  fixedBgPos: 'auto',
893
903
 
894
904
  overflowY: 'auto',
895
905
 
896
- closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
906
+ closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
897
907
 
898
908
  tClose: 'Close (Esc)',
899
909
 
@@ -935,9 +945,9 @@ $.fn.magnificPopup = function(options) {
935
945
  } else {
936
946
  // clone options obj
937
947
  options = $.extend(true, {}, options);
938
-
948
+
939
949
  /*
940
- * As Zepto doesn't support .data() method for objects
950
+ * As Zepto doesn't support .data() method for objects
941
951
  * and it works only in normal browsers
942
952
  * we assign "options" object directly to the DOM element. FTW!
943
953
  */
@@ -979,7 +989,7 @@ console.log('Test #2:', performance.now() - start);
979
989
 
980
990
  var INLINE_NS = 'inline',
981
991
  _hiddenClass,
982
- _inlinePlaceholder,
992
+ _inlinePlaceholder,
983
993
  _lastInlineElement,
984
994
  _putInlineElementsBack = function() {
985
995
  if(_lastInlineElement) {
@@ -1050,7 +1060,7 @@ var AJAX_NS = 'ajax',
1050
1060
  _ajaxCur,
1051
1061
  _removeAjaxCursor = function() {
1052
1062
  if(_ajaxCur) {
1053
- _body.removeClass(_ajaxCur);
1063
+ $(document.body).removeClass(_ajaxCur);
1054
1064
  }
1055
1065
  },
1056
1066
  _destroyAjaxRequest = function() {
@@ -1078,8 +1088,9 @@ $.magnificPopup.registerModule(AJAX_NS, {
1078
1088
  },
1079
1089
  getAjax: function(item) {
1080
1090
 
1081
- if(_ajaxCur)
1082
- _body.addClass(_ajaxCur);
1091
+ if(_ajaxCur) {
1092
+ $(document.body).addClass(_ajaxCur);
1093
+ }
1083
1094
 
1084
1095
  mfp.updateStatus('loading');
1085
1096
 
@@ -1127,14 +1138,14 @@ $.magnificPopup.registerModule(AJAX_NS, {
1127
1138
 
1128
1139
 
1129
1140
 
1130
-
1141
+
1131
1142
 
1132
1143
  /*>>ajax*/
1133
1144
 
1134
1145
  /*>>image*/
1135
1146
  var _imgInterval,
1136
1147
  _getTitle = function(item) {
1137
- if(item.data && item.data.title !== undefined)
1148
+ if(item.data && item.data.title !== undefined)
1138
1149
  return item.data.title;
1139
1150
 
1140
1151
  var src = mfp.st.image.titleSrc;
@@ -1165,7 +1176,7 @@ $.magnificPopup.registerModule('image', {
1165
1176
  '</figure>'+
1166
1177
  '</div>',
1167
1178
  cursor: 'mfp-zoom-out-cur',
1168
- titleSrc: 'title',
1179
+ titleSrc: 'title',
1169
1180
  verticalFit: true,
1170
1181
  tError: '<a href="%url%">The image</a> could not be loaded.'
1171
1182
  },
@@ -1179,13 +1190,13 @@ $.magnificPopup.registerModule('image', {
1179
1190
 
1180
1191
  _mfpOn(OPEN_EVENT+ns, function() {
1181
1192
  if(mfp.currItem.type === 'image' && imgSt.cursor) {
1182
- _body.addClass(imgSt.cursor);
1193
+ $(document.body).addClass(imgSt.cursor);
1183
1194
  }
1184
1195
  });
1185
1196
 
1186
1197
  _mfpOn(CLOSE_EVENT+ns, function() {
1187
1198
  if(imgSt.cursor) {
1188
- _body.removeClass(imgSt.cursor);
1199
+ $(document.body).removeClass(imgSt.cursor);
1189
1200
  }
1190
1201
  _window.off('resize' + EVENT_NS);
1191
1202
  });
@@ -1210,13 +1221,13 @@ $.magnificPopup.registerModule('image', {
1210
1221
  },
1211
1222
  _onImageHasSize: function(item) {
1212
1223
  if(item.img) {
1213
-
1224
+
1214
1225
  item.hasSize = true;
1215
1226
 
1216
1227
  if(_imgInterval) {
1217
1228
  clearInterval(_imgInterval);
1218
1229
  }
1219
-
1230
+
1220
1231
  item.isCheckingImgSize = false;
1221
1232
 
1222
1233
  _mfpTrigger('ImageHasSize', item);
@@ -1224,7 +1235,7 @@ $.magnificPopup.registerModule('image', {
1224
1235
  if(item.imgHidden) {
1225
1236
  if(mfp.content)
1226
1237
  mfp.content.removeClass('mfp-loading');
1227
-
1238
+
1228
1239
  item.imgHidden = false;
1229
1240
  }
1230
1241
 
@@ -1277,7 +1288,7 @@ $.magnificPopup.registerModule('image', {
1277
1288
  if(item) {
1278
1289
  if (item.img[0].complete) {
1279
1290
  item.img.off('.mfploader');
1280
-
1291
+
1281
1292
  if(item === mfp.currItem){
1282
1293
  mfp._onImageHasSize(item);
1283
1294
 
@@ -1288,7 +1299,7 @@ $.magnificPopup.registerModule('image', {
1288
1299
  item.loaded = true;
1289
1300
 
1290
1301
  _mfpTrigger('ImageLoadComplete');
1291
-
1302
+
1292
1303
  }
1293
1304
  else {
1294
1305
  // if image complete check fails 200 times (20 sec), we assume that there was an error.
@@ -1323,6 +1334,9 @@ $.magnificPopup.registerModule('image', {
1323
1334
  if(el.length) {
1324
1335
  var img = document.createElement('img');
1325
1336
  img.className = 'mfp-img';
1337
+ if(item.el && item.el.find('img').length) {
1338
+ img.alt = item.el.find('img').attr('alt');
1339
+ }
1326
1340
  item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1327
1341
  img.src = item.src;
1328
1342
 
@@ -1335,7 +1349,7 @@ $.magnificPopup.registerModule('image', {
1335
1349
  img = item.img[0];
1336
1350
  if(img.naturalWidth > 0) {
1337
1351
  item.hasSize = true;
1338
- } else if(!img.width) {
1352
+ } else if(!img.width) {
1339
1353
  item.hasSize = false;
1340
1354
  }
1341
1355
  }
@@ -1367,7 +1381,7 @@ $.magnificPopup.registerModule('image', {
1367
1381
  item.imgHidden = true;
1368
1382
  template.addClass('mfp-loading');
1369
1383
  mfp.findImageSize(item);
1370
- }
1384
+ }
1371
1385
 
1372
1386
  return template;
1373
1387
  }
@@ -1384,7 +1398,7 @@ var hasMozTransform,
1384
1398
  if(hasMozTransform === undefined) {
1385
1399
  hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1386
1400
  }
1387
- return hasMozTransform;
1401
+ return hasMozTransform;
1388
1402
  };
1389
1403
 
1390
1404
  $.magnificPopup.registerModule('zoom', {
@@ -1404,7 +1418,7 @@ $.magnificPopup.registerModule('zoom', {
1404
1418
  var zoomSt = mfp.st.zoom,
1405
1419
  ns = '.zoom',
1406
1420
  image;
1407
-
1421
+
1408
1422
  if(!zoomSt.enabled || !mfp.supportsTransition) {
1409
1423
  return;
1410
1424
  }
@@ -1440,7 +1454,7 @@ $.magnificPopup.registerModule('zoom', {
1440
1454
  mfp.content.css('visibility', 'hidden');
1441
1455
 
1442
1456
  // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1443
-
1457
+
1444
1458
  image = mfp._getItemToZoom();
1445
1459
 
1446
1460
  if(!image) {
@@ -1448,8 +1462,8 @@ $.magnificPopup.registerModule('zoom', {
1448
1462
  return;
1449
1463
  }
1450
1464
 
1451
- animatedImg = getElToAnimate(image);
1452
-
1465
+ animatedImg = getElToAnimate(image);
1466
+
1453
1467
  animatedImg.css( mfp._getOffset() );
1454
1468
 
1455
1469
  mfp.wrap.append(animatedImg);
@@ -1464,7 +1478,7 @@ $.magnificPopup.registerModule('zoom', {
1464
1478
  animatedImg.remove();
1465
1479
  image = animatedImg = null;
1466
1480
  _mfpTrigger('ZoomAnimationEnded');
1467
- }, 16); // avoid blink when switching images
1481
+ }, 16); // avoid blink when switching images
1468
1482
 
1469
1483
  }, duration); // this timeout equals animation duration
1470
1484
 
@@ -1488,12 +1502,12 @@ $.magnificPopup.registerModule('zoom', {
1488
1502
  }
1489
1503
  animatedImg = getElToAnimate(image);
1490
1504
  }
1491
-
1492
-
1505
+
1506
+
1493
1507
  animatedImg.css( mfp._getOffset(true) );
1494
1508
  mfp.wrap.append(animatedImg);
1495
1509
  mfp.content.css('visibility', 'hidden');
1496
-
1510
+
1497
1511
  setTimeout(function() {
1498
1512
  animatedImg.css( mfp._getOffset() );
1499
1513
  }, 16);
@@ -1508,7 +1522,7 @@ $.magnificPopup.registerModule('zoom', {
1508
1522
  animatedImg.remove();
1509
1523
  }
1510
1524
  image = null;
1511
- }
1525
+ }
1512
1526
  });
1513
1527
  },
1514
1528
 
@@ -1540,7 +1554,7 @@ $.magnificPopup.registerModule('zoom', {
1540
1554
 
1541
1555
 
1542
1556
  /*
1543
-
1557
+
1544
1558
  Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
1545
1559
 
1546
1560
  */
@@ -1571,11 +1585,11 @@ $.magnificPopup.registerModule('zoom', {
1571
1585
 
1572
1586
  var IFRAME_NS = 'iframe',
1573
1587
  _emptyPage = '//about:blank',
1574
-
1588
+
1575
1589
  _fixIframeBugs = function(isShowing) {
1576
1590
  if(mfp.currTemplate[IFRAME_NS]) {
1577
1591
  var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1578
- if(el.length) {
1592
+ if(el.length) {
1579
1593
  // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1580
1594
  if(!isShowing) {
1581
1595
  el[0].src = _emptyPage;
@@ -1602,8 +1616,8 @@ $.magnificPopup.registerModule(IFRAME_NS, {
1602
1616
  // we don't care and support only one default type of URL by default
1603
1617
  patterns: {
1604
1618
  youtube: {
1605
- index: 'youtube.com',
1606
- id: 'v=',
1619
+ index: 'youtube.com',
1620
+ id: 'v=',
1607
1621
  src: '//www.youtube.com/embed/%id%?autoplay=1'
1608
1622
  },
1609
1623
  vimeo: {
@@ -1628,7 +1642,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
1628
1642
  _fixIframeBugs(); // iframe if removed
1629
1643
  } else if(newType === IFRAME_NS) {
1630
1644
  _fixIframeBugs(true); // iframe is showing
1631
- }
1645
+ }
1632
1646
  }// else {
1633
1647
  // iframe source is switched, don't do anything
1634
1648
  //}
@@ -1642,7 +1656,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
1642
1656
  getIframe: function(item, template) {
1643
1657
  var embedSrc = item.src;
1644
1658
  var iframeSt = mfp.st.iframe;
1645
-
1659
+
1646
1660
  $.each(iframeSt.patterns, function() {
1647
1661
  if(embedSrc.indexOf( this.index ) > -1) {
1648
1662
  if(this.id) {
@@ -1656,7 +1670,7 @@ $.magnificPopup.registerModule(IFRAME_NS, {
1656
1670
  return false; // break;
1657
1671
  }
1658
1672
  });
1659
-
1673
+
1660
1674
  var dataObj = {};
1661
1675
  if(iframeSt.srcAction) {
1662
1676
  dataObj[iframeSt.srcAction] = embedSrc;
@@ -1713,7 +1727,7 @@ $.magnificPopup.registerModule('gallery', {
1713
1727
  supportsFastClick = Boolean($.fn.mfpFastClick);
1714
1728
 
1715
1729
  mfp.direction = true; // true - next, false - prev
1716
-
1730
+
1717
1731
  if(!gSt || !gSt.enabled ) return false;
1718
1732
 
1719
1733
  _wrapClasses += ' mfp-gallery';
@@ -1752,16 +1766,16 @@ $.magnificPopup.registerModule('gallery', {
1752
1766
  _mfpOn('BuildControls' + ns, function() {
1753
1767
  if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1754
1768
  var markup = gSt.arrowMarkup,
1755
- arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1769
+ arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1756
1770
  arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1757
1771
 
1758
1772
  var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1759
1773
  arrowLeft[eName](function() {
1760
1774
  mfp.prev();
1761
- });
1775
+ });
1762
1776
  arrowRight[eName](function() {
1763
1777
  mfp.next();
1764
- });
1778
+ });
1765
1779
 
1766
1780
  // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
1767
1781
  if(mfp.isIE7) {
@@ -1781,21 +1795,21 @@ $.magnificPopup.registerModule('gallery', {
1781
1795
  mfp._preloadTimeout = setTimeout(function() {
1782
1796
  mfp.preloadNearbyImages();
1783
1797
  mfp._preloadTimeout = null;
1784
- }, 16);
1798
+ }, 16);
1785
1799
  });
1786
1800
 
1787
1801
 
1788
1802
  _mfpOn(CLOSE_EVENT+ns, function() {
1789
1803
  _document.off(ns);
1790
1804
  mfp.wrap.off('click'+ns);
1791
-
1805
+
1792
1806
  if(mfp.arrowLeft && supportsFastClick) {
1793
1807
  mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
1794
1808
  }
1795
1809
  mfp.arrowRight = mfp.arrowLeft = null;
1796
1810
  });
1797
1811
 
1798
- },
1812
+ },
1799
1813
  next: function() {
1800
1814
  mfp.direction = true;
1801
1815
  mfp.index = _getLoopedId(mfp.index + 1);
@@ -1960,11 +1974,11 @@ $.magnificPopup.registerModule(RETINA_NS, {
1960
1974
  *
1961
1975
  * To unbind:
1962
1976
  * $('.your-el').destroyMfpFastClick();
1963
- *
1964
- *
1977
+ *
1978
+ *
1965
1979
  * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
1966
1980
  * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
1967
- *
1981
+ *
1968
1982
  */
1969
1983
 
1970
1984
  (function() {
@@ -2043,4 +2057,4 @@ $.magnificPopup.registerModule(RETINA_NS, {
2043
2057
  })();
2044
2058
 
2045
2059
  /*>>fastclick*/
2046
- _checkInstance(); })(window.jQuery || window.Zepto);
2060
+ _checkInstance(); }));
@@ -50,7 +50,8 @@
50
50
  text-align: left;
51
51
  z-index: 1045; }
52
52
 
53
- .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
53
+ .mfp-inline-holder .mfp-content,
54
+ .mfp-ajax-holder .mfp-content {
54
55
  width: 100%;
55
56
  cursor: auto; }
56
57
 
@@ -71,7 +72,10 @@
71
72
  .mfp-auto-cursor .mfp-content {
72
73
  cursor: auto; }
73
74
 
74
- .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
75
+ .mfp-close,
76
+ .mfp-arrow,
77
+ .mfp-preloader,
78
+ .mfp-counter {
75
79
  -webkit-user-select: none;
76
80
  -moz-user-select: none;
77
81
  user-select: none; }
@@ -83,7 +87,7 @@
83
87
  display: none !important; }
84
88
 
85
89
  .mfp-preloader {
86
- color: #cccccc;
90
+ color: #CCC;
87
91
  position: absolute;
88
92
  top: 50%;
89
93
  width: auto;
@@ -93,9 +97,9 @@
93
97
  right: 8px;
94
98
  z-index: 1044; }
95
99
  .mfp-preloader a {
96
- color: #cccccc; }
100
+ color: #CCC; }
97
101
  .mfp-preloader a:hover {
98
- color: white; }
102
+ color: #FFF; }
99
103
 
100
104
  .mfp-s-ready .mfp-preloader {
101
105
  display: none; }
@@ -103,7 +107,8 @@
103
107
  .mfp-s-error .mfp-content {
104
108
  display: none; }
105
109
 
106
- button.mfp-close, button.mfp-arrow {
110
+ button.mfp-close,
111
+ button.mfp-arrow {
107
112
  overflow: visible;
108
113
  cursor: pointer;
109
114
  background: transparent;
@@ -115,6 +120,7 @@ button.mfp-close, button.mfp-arrow {
115
120
  z-index: 1046;
116
121
  -webkit-box-shadow: none;
117
122
  box-shadow: none; }
123
+
118
124
  button::-moz-focus-inner {
119
125
  padding: 0;
120
126
  border: 0; }
@@ -131,21 +137,23 @@ button::-moz-focus-inner {
131
137
  opacity: 0.65;
132
138
  filter: alpha(opacity=65);
133
139
  padding: 0 0 18px 10px;
134
- color: white;
140
+ color: #FFF;
135
141
  font-style: normal;
136
142
  font-size: 28px;
137
143
  font-family: Arial, Baskerville, monospace; }
138
- .mfp-close:hover, .mfp-close:focus {
144
+ .mfp-close:hover,
145
+ .mfp-close:focus {
139
146
  opacity: 1;
140
147
  filter: alpha(opacity=100); }
141
148
  .mfp-close:active {
142
149
  top: 1px; }
143
150
 
144
151
  .mfp-close-btn-in .mfp-close {
145
- color: #333333; }
152
+ color: #333; }
146
153
 
147
- .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
148
- color: white;
154
+ .mfp-image-holder .mfp-close,
155
+ .mfp-iframe-holder .mfp-close {
156
+ color: #FFF;
149
157
  right: -6px;
150
158
  text-align: right;
151
159
  padding-right: 6px;
@@ -155,9 +163,10 @@ button::-moz-focus-inner {
155
163
  position: absolute;
156
164
  top: 0;
157
165
  right: 0;
158
- color: #cccccc;
166
+ color: #CCC;
159
167
  font-size: 12px;
160
- line-height: 18px; }
168
+ line-height: 18px;
169
+ white-space: nowrap; }
161
170
 
162
171
  .mfp-arrow {
163
172
  position: absolute;
@@ -169,13 +178,17 @@ button::-moz-focus-inner {
169
178
  padding: 0;
170
179
  width: 90px;
171
180
  height: 110px;
172
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
181
+ -webkit-tap-highlight-color: transparent; }
173
182
  .mfp-arrow:active {
174
183
  margin-top: -54px; }
175
- .mfp-arrow:hover, .mfp-arrow:focus {
184
+ .mfp-arrow:hover,
185
+ .mfp-arrow:focus {
176
186
  opacity: 1;
177
187
  filter: alpha(opacity=100); }
178
- .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
188
+ .mfp-arrow:before,
189
+ .mfp-arrow:after,
190
+ .mfp-arrow .mfp-b,
191
+ .mfp-arrow .mfp-a {
179
192
  content: '';
180
193
  display: block;
181
194
  width: 0;
@@ -186,30 +199,37 @@ button::-moz-focus-inner {
186
199
  margin-top: 35px;
187
200
  margin-left: 35px;
188
201
  border: medium inset transparent; }
189
- .mfp-arrow:after, .mfp-arrow .mfp-a {
202
+ .mfp-arrow:after,
203
+ .mfp-arrow .mfp-a {
190
204
  border-top-width: 13px;
191
205
  border-bottom-width: 13px;
192
206
  top: 8px; }
193
- .mfp-arrow:before, .mfp-arrow .mfp-b {
207
+ .mfp-arrow:before,
208
+ .mfp-arrow .mfp-b {
194
209
  border-top-width: 21px;
195
- border-bottom-width: 21px; }
210
+ border-bottom-width: 21px;
211
+ opacity: 0.7; }
196
212
 
197
213
  .mfp-arrow-left {
198
214
  left: 0; }
199
- .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
200
- border-right: 17px solid white;
215
+ .mfp-arrow-left:after,
216
+ .mfp-arrow-left .mfp-a {
217
+ border-right: 17px solid #FFF;
201
218
  margin-left: 31px; }
202
- .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
219
+ .mfp-arrow-left:before,
220
+ .mfp-arrow-left .mfp-b {
203
221
  margin-left: 25px;
204
- border-right: 27px solid #3f3f3f; }
222
+ border-right: 27px solid #3F3F3F; }
205
223
 
206
224
  .mfp-arrow-right {
207
225
  right: 0; }
208
- .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
209
- border-left: 17px solid white;
226
+ .mfp-arrow-right:after,
227
+ .mfp-arrow-right .mfp-a {
228
+ border-left: 17px solid #FFF;
210
229
  margin-left: 39px; }
211
- .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
212
- border-left: 27px solid #3f3f3f; }
230
+ .mfp-arrow-right:before,
231
+ .mfp-arrow-right .mfp-b {
232
+ border-left: 27px solid #3F3F3F; }
213
233
 
214
234
  .mfp-iframe-holder {
215
235
  padding-top: 40px;
@@ -234,7 +254,7 @@ button::-moz-focus-inner {
234
254
  width: 100%;
235
255
  height: 100%;
236
256
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
237
- background: black; }
257
+ background: #000; }
238
258
 
239
259
  /* Main image in popup */
240
260
  img.mfp-img {
@@ -264,9 +284,9 @@ img.mfp-img {
264
284
  height: auto;
265
285
  z-index: -1;
266
286
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
267
- background: #444444; }
287
+ background: #444; }
268
288
  .mfp-figure small {
269
- color: #bdbdbd;
289
+ color: #BDBDBD;
270
290
  display: block;
271
291
  font-size: 12px;
272
292
  line-height: 14px; }
@@ -284,7 +304,7 @@ img.mfp-img {
284
304
  .mfp-title {
285
305
  text-align: left;
286
306
  line-height: 18px;
287
- color: #f3f3f3;
307
+ color: #F3F3F3;
288
308
  word-wrap: break-word;
289
309
  padding-right: 36px; }
290
310
 
@@ -351,16 +371,20 @@ img.mfp-img {
351
371
 
352
372
  .mfp-ie7 .mfp-img {
353
373
  padding: 0; }
374
+
354
375
  .mfp-ie7 .mfp-bottom-bar {
355
376
  width: 600px;
356
377
  left: 50%;
357
378
  margin-left: -300px;
358
379
  margin-top: 5px;
359
380
  padding-bottom: 5px; }
381
+
360
382
  .mfp-ie7 .mfp-container {
361
383
  padding: 0; }
384
+
362
385
  .mfp-ie7 .mfp-content {
363
386
  padding-top: 44px; }
387
+
364
388
  .mfp-ie7 .mfp-close {
365
389
  top: 0;
366
390
  right: 0;
@@ -3,6 +3,5 @@ require "magnific-popup-rails/engine"
3
3
 
4
4
  module MagnificPopup
5
5
  module Rails
6
- # Your code goes here...
7
6
  end
8
7
  end
@@ -1,9 +1,7 @@
1
1
  module MagnificPopup
2
- module Rails
2
+ if defined?(Rails)
3
3
  class Engine < ::Rails::Engine
4
- initializer "configure assets of magnific-popup", :group => :all do |app|
5
- app.config.assets.precompile += %w( magnific-popup/*.css magnific-popup/*.js )
6
- end
4
+ # Rails -> use app/assets directory.
7
5
  end
8
6
  end
9
7
  end
@@ -1,5 +1,5 @@
1
1
  module MagnificPopup
2
2
  module Rails
3
- VERSION = "0.9.9.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ require File.expand_path('../lib/magnific-popup-rails/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Joshua Jansen"]
6
- gem.email = ["joshua@itflows.nl"]
6
+ gem.email = ["joshuajansen88@gmail.com"]
7
7
  gem.description = %q{Magnific Popup is a free responsive jQuery lightbox plugin that is focused on performance and providing best experience for user with any device}
8
8
  gem.summary = %q{Magnific Popup displays images before they're completely loaded to take full advantage of progressive loading. For in and out transitions CSS3 is used instead of slow JavaScript animation.}
9
9
  gem.homepage = "https://github.com/joshuajansen/magnific-popup-rails"
@@ -14,6 +14,6 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "magnific-popup-rails"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = MagnificPopup::Rails::VERSION
17
-
17
+
18
18
  gem.add_development_dependency "rake"
19
19
  end
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: 0.9.9.1
4
+ version: 1.0.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: 2014-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -27,7 +27,7 @@ dependencies:
27
27
  description: Magnific Popup is a free responsive jQuery lightbox plugin that is focused
28
28
  on performance and providing best experience for user with any device
29
29
  email:
30
- - joshua@itflows.nl
30
+ - joshuajansen88@gmail.com
31
31
  executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
@@ -37,15 +37,13 @@ files:
37
37
  - LICENSE
38
38
  - README.md
39
39
  - Rakefile
40
+ - app/assets/javascripts/magnific-popup.js
41
+ - app/assets/stylesheets/magnific-popup.css
40
42
  - lib/magnific-popup-rails.rb
41
43
  - lib/magnific-popup-rails/engine.rb
42
44
  - lib/magnific-popup-rails/version.rb
43
45
  - magnific-popup-rails.gemspec
44
- - vendor/assets/javascripts/magnific-popup/index.js
45
- - vendor/assets/javascripts/magnific-popup/jquery.magnific-popup.js
46
- - vendor/assets/stylesheets/magnific-popup.css.scss
47
- - vendor/assets/stylesheets/magnific-popup/index.css
48
- - vendor/assets/stylesheets/magnific-popup/magnific-popup.css
46
+ - vendor/assets/stylesheets/magnific-popup.scss
49
47
  homepage: https://github.com/joshuajansen/magnific-popup-rails
50
48
  licenses: []
51
49
  metadata: {}
@@ -65,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
63
  version: '0'
66
64
  requirements: []
67
65
  rubyforge_project:
68
- rubygems_version: 2.2.2
66
+ rubygems_version: 2.4.5
69
67
  signing_key:
70
68
  specification_version: 4
71
69
  summary: Magnific Popup displays images before they're completely loaded to take full
@@ -1 +0,0 @@
1
- //= require ./jquery.magnific-popup
@@ -1 +0,0 @@
1
- //= require ./magnific-popup