magnific-popup-rails 0.8.1 → 0.8.3
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 +17 -0
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/lib/magnific-popup-rails/engine.rb +2 -2
- data/lib/magnific-popup-rails/version.rb +1 -1
- data/vendor/assets/javascripts/{magnific-popup-rails → magnific-popup}/index.js +0 -0
- data/vendor/assets/javascripts/{magnific-popup-rails → magnific-popup}/jquery.magnific-popup.js +33 -16
- data/vendor/assets/stylesheets/{magnific-popup-rails → magnific-popup}/index.css +0 -0
- data/vendor/assets/stylesheets/{magnific-popup-rails → magnific-popup}/magnific-popup.css +0 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 821d3f66177fce467ec9456d4a91287c18de87c9
|
4
|
+
data.tar.gz: 65c242c690bea4fc20bf718b94c8dd2f60dd4962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84d1fccc5180eddc7c227a2bb5261fb61265dd4973f131d066bfce404aa62cb097c8c5b66b6702b0af526ea1d2847e7278e26fbbb3b9b888a5cf97c24f14946a
|
7
|
+
data.tar.gz: 4be25255d6ae041d1378204734451cee75e13a2e84fcf8667e756319307384ea207a7547d5e6aa94511bf9605e10306c51cf6bce41563b8821100f25f2915d6a
|
data/.gitignore
ADDED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ I used [markmcconachie's](https://github.com/markmcconachie) [normalize-rails](h
|
|
14
14
|
|
15
15
|
Add this line to your application's Gemfile:
|
16
16
|
|
17
|
-
gem 'magnific-popup-rails'
|
17
|
+
gem 'magnific-popup-rails'
|
18
18
|
|
19
19
|
And then execute:
|
20
20
|
|
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ desc "Download the latest magnific-popup.css and magnific-popup.js"
|
|
6
6
|
task :update do
|
7
7
|
# CSS
|
8
8
|
url = "https://raw.github.com/dimsemenov/Magnific-Popup/master/dist/magnific-popup.css"
|
9
|
-
outputfile = "vendor/assets/stylesheets/magnific-popup
|
9
|
+
outputfile = "vendor/assets/stylesheets/magnific-popup/magnific-popup.css"
|
10
10
|
|
11
11
|
open(outputfile, 'wb') do |file|
|
12
12
|
file << open(url).read
|
@@ -14,7 +14,7 @@ task :update do
|
|
14
14
|
|
15
15
|
# JS
|
16
16
|
url = "https://raw.github.com/dimsemenov/Magnific-Popup/master/dist/jquery.magnific-popup.js"
|
17
|
-
outputfile = "vendor/assets/javascripts/magnific-popup
|
17
|
+
outputfile = "vendor/assets/javascripts/magnific-popup/jquery.magnific-popup.js"
|
18
18
|
|
19
19
|
open(outputfile, 'wb') do |file|
|
20
20
|
file << open(url).read
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module MagnificPopup
|
2
2
|
module Rails
|
3
3
|
class Engine < ::Rails::Engine
|
4
|
-
initializer "configure assets of magnific-popup
|
5
|
-
app.config.assets.precompile += %w( magnific-popup
|
4
|
+
initializer "configure assets of magnific-popup", :group => :all do |app|
|
5
|
+
app.config.assets.precompile += %w( magnific-popup/*.css magnific-popup/*.js )
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
File without changes
|
data/vendor/assets/javascripts/{magnific-popup-rails → magnific-popup}/jquery.magnific-popup.js
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Magnific Popup - v0.8.
|
1
|
+
/*! Magnific Popup - v0.8.3 - 2013-05-09
|
2
2
|
* http://dimsemenov.com/plugins/magnific-popup/
|
3
3
|
* Copyright (c) 2013 Dmitry Semenov; */
|
4
4
|
;(function($) {
|
@@ -302,10 +302,10 @@ MagnificPopup.prototype = {
|
|
302
302
|
// add content
|
303
303
|
mfp.updateItemHTML();
|
304
304
|
|
305
|
-
|
306
|
-
|
305
|
+
_mfpTrigger('BuildControls');
|
307
306
|
|
308
307
|
|
308
|
+
// remove scrollbar, add padding e.t.c
|
309
309
|
_body.css(bodyStyles);
|
310
310
|
|
311
311
|
// add everything to DOM
|
@@ -406,6 +406,7 @@ MagnificPopup.prototype = {
|
|
406
406
|
if(mfp._lastFocusedEl) {
|
407
407
|
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
408
408
|
}
|
409
|
+
mfp.content = null;
|
409
410
|
mfp.currTemplate = null;
|
410
411
|
mfp.prevHeight = 0;
|
411
412
|
},
|
@@ -434,8 +435,13 @@ MagnificPopup.prototype = {
|
|
434
435
|
var item = mfp.items[mfp.index];
|
435
436
|
|
436
437
|
// Detach and perform modifications
|
438
|
+
|
439
|
+
|
437
440
|
mfp.contentContainer.detach();
|
438
441
|
|
442
|
+
if(mfp.content)
|
443
|
+
mfp.content.detach();
|
444
|
+
|
439
445
|
if(!item.parsed) {
|
440
446
|
item = mfp.parseEl( mfp.index );
|
441
447
|
}
|
@@ -445,8 +451,11 @@ MagnificPopup.prototype = {
|
|
445
451
|
var type = item.type;
|
446
452
|
if(!mfp.currTemplate[type]) {
|
447
453
|
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
454
|
+
|
455
|
+
// allows to modify markup
|
456
|
+
_mfpTrigger('FirstMarkupParse', markup);
|
457
|
+
|
448
458
|
if(markup) {
|
449
|
-
_mfpTrigger('FirstMarkupParse', markup);
|
450
459
|
mfp.currTemplate[type] = $(markup);
|
451
460
|
} else {
|
452
461
|
// if there is no markup found we just define that template is parsed
|
@@ -493,7 +502,7 @@ MagnificPopup.prototype = {
|
|
493
502
|
_mfpTrigger(BEFORE_APPEND_EVENT);
|
494
503
|
mfp.container.addClass('mfp-'+type+'-holder');
|
495
504
|
|
496
|
-
mfp.contentContainer.
|
505
|
+
mfp.contentContainer.append(mfp.content);
|
497
506
|
},
|
498
507
|
|
499
508
|
|
@@ -565,6 +574,7 @@ MagnificPopup.prototype = {
|
|
565
574
|
|
566
575
|
e.preventDefault();
|
567
576
|
options.el = $(this);
|
577
|
+
options.mainEl = el;
|
568
578
|
if(options.delegate) {
|
569
579
|
options.items = el.find(options.delegate);
|
570
580
|
}
|
@@ -1056,7 +1066,9 @@ $.magnificPopup.registerModule('image', {
|
|
1056
1066
|
_mfpTrigger('ImageHasSize', item);
|
1057
1067
|
|
1058
1068
|
if(item.imgHidden) {
|
1059
|
-
mfp.content
|
1069
|
+
if(mfp.content)
|
1070
|
+
mfp.content.removeClass('mfp-loading');
|
1071
|
+
|
1060
1072
|
item.imgHidden = false;
|
1061
1073
|
}
|
1062
1074
|
|
@@ -1361,17 +1373,8 @@ $.magnificPopup.registerModule('gallery', {
|
|
1361
1373
|
values.counter = l ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
|
1362
1374
|
});
|
1363
1375
|
|
1364
|
-
_mfpOn(
|
1365
|
-
|
1366
|
-
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1367
|
-
|
1368
|
-
mfp._preloadTimeout = setTimeout(function() {
|
1369
|
-
mfp.preloadNearbyImages();
|
1370
|
-
mfp._preloadTimeout = null;
|
1371
|
-
}, 16);
|
1372
|
-
|
1376
|
+
_mfpOn('BuildControls' + ns, function() {
|
1373
1377
|
if(gSt.arrows && !mfp.arrowLeft) {
|
1374
|
-
|
1375
1378
|
var markup = gSt.arrowMarkup,
|
1376
1379
|
arrowLeft = mfp.arrowLeft = $( markup.replace('%title%', gSt.tPrev).replace('%dir%', 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1377
1380
|
arrowRight = mfp.arrowRight = $( markup.replace('%title%', gSt.tNext).replace('%dir%', 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
@@ -1396,6 +1399,15 @@ $.magnificPopup.registerModule('gallery', {
|
|
1396
1399
|
}
|
1397
1400
|
});
|
1398
1401
|
|
1402
|
+
_mfpOn(CHANGE_EVENT+ns, function() {
|
1403
|
+
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1404
|
+
|
1405
|
+
mfp._preloadTimeout = setTimeout(function() {
|
1406
|
+
mfp.preloadNearbyImages();
|
1407
|
+
mfp._preloadTimeout = null;
|
1408
|
+
}, 16);
|
1409
|
+
});
|
1410
|
+
|
1399
1411
|
|
1400
1412
|
_mfpOn(CLOSE_EVENT+ns, function() {
|
1401
1413
|
_document.off(ns);
|
@@ -1418,6 +1430,11 @@ $.magnificPopup.registerModule('gallery', {
|
|
1418
1430
|
mfp.index = _getLoopedId(mfp.index - 1);
|
1419
1431
|
mfp.updateItemHTML();
|
1420
1432
|
},
|
1433
|
+
goTo: function(newIndex) {
|
1434
|
+
mfp.direction = (newIndex >= mfp.index);
|
1435
|
+
mfp.index = newIndex;
|
1436
|
+
mfp.updateItemHTML();
|
1437
|
+
},
|
1421
1438
|
preloadNearbyImages: function() {
|
1422
1439
|
var p = mfp.st.gallery.preload,
|
1423
1440
|
preloadBefore = Math.min(p[0], mfp.items.length),
|
File without changes
|
File without changes
|
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.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Jansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -32,6 +32,7 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- .gitignore
|
35
36
|
- Gemfile
|
36
37
|
- LICENSE
|
37
38
|
- README.md
|
@@ -40,10 +41,10 @@ files:
|
|
40
41
|
- lib/magnific-popup-rails/engine.rb
|
41
42
|
- lib/magnific-popup-rails/version.rb
|
42
43
|
- magnific-popup-rails.gemspec
|
43
|
-
- vendor/assets/javascripts/magnific-popup
|
44
|
-
- vendor/assets/javascripts/magnific-popup
|
45
|
-
- vendor/assets/stylesheets/magnific-popup
|
46
|
-
- vendor/assets/stylesheets/magnific-popup
|
44
|
+
- vendor/assets/javascripts/magnific-popup/index.js
|
45
|
+
- vendor/assets/javascripts/magnific-popup/jquery.magnific-popup.js
|
46
|
+
- vendor/assets/stylesheets/magnific-popup/index.css
|
47
|
+
- vendor/assets/stylesheets/magnific-popup/magnific-popup.css
|
47
48
|
homepage: https://github.com/joshuajansen/magnific-popup-rails
|
48
49
|
licenses: []
|
49
50
|
metadata: {}
|