fotoramajs 4.4.1 → 4.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/Rakefile +5 -0
- data/lib/fotoramajs/version.rb +1 -1
- data/vendor/assets/javascripts/fotorama.js +42 -35
- data/vendor/assets/stylesheets/fotorama.css.scss +21 -20
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fotoramajs (4.4.
|
4
|
+
fotoramajs (4.4.3)
|
5
5
|
jquery-rails (>= 2.1.0)
|
6
6
|
sprockets (>= 2)
|
7
7
|
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
multi_json (~> 1.3)
|
21
21
|
thread_safe (~> 0.1)
|
22
22
|
tzinfo (~> 0.3.37)
|
23
|
-
atomic (1.1.
|
23
|
+
atomic (1.1.14)
|
24
24
|
builder (3.1.4)
|
25
25
|
erubis (2.7.0)
|
26
26
|
hike (1.2.3)
|
@@ -46,7 +46,7 @@ GEM
|
|
46
46
|
rack (~> 1.0)
|
47
47
|
tilt (~> 1.1, != 1.3.0)
|
48
48
|
thor (0.18.1)
|
49
|
-
thread_safe (0.1.
|
49
|
+
thread_safe (0.1.3)
|
50
50
|
atomic
|
51
51
|
tilt (1.4.1)
|
52
52
|
tzinfo (0.3.37)
|
data/Rakefile
CHANGED
@@ -60,6 +60,10 @@ task :update do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
def update_gemfile_lock
|
64
|
+
`#{Rake::DSL::RUBY} -S bundle`
|
65
|
+
end
|
66
|
+
|
63
67
|
puts "Fetching tags"
|
64
68
|
tag = github_tags('artpolikarpov/fotorama').last
|
65
69
|
|
@@ -71,6 +75,7 @@ task :update do
|
|
71
75
|
|
72
76
|
puts "Update gem version"
|
73
77
|
update_version(tag)
|
78
|
+
update_gemfile_lock
|
74
79
|
|
75
80
|
puts "Done"
|
76
81
|
end
|
data/lib/fotoramajs/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Fotorama 4.4.
|
2
|
+
* Fotorama 4.4.3 | http://fotorama.io/license/
|
3
3
|
*/
|
4
4
|
(function (window, document, location, $, undefined) {
|
5
5
|
"use strict";
|
@@ -1061,7 +1061,7 @@ function touch ($el, options) {
|
|
1061
1061
|
|| (lastEvent && lastEvent.type !== e.type && preventEvent)
|
1062
1062
|
|| (targetIsSelectFLAG = options.select && $target.is(options.select, el))) return targetIsSelectFLAG;
|
1063
1063
|
|
1064
|
-
touchFLAG = e.type
|
1064
|
+
touchFLAG = e.type === 'touchstart';
|
1065
1065
|
targetIsLinkFlag = $target.is('a, a *', el);
|
1066
1066
|
|
1067
1067
|
extendEvent(e);
|
@@ -1091,7 +1091,7 @@ function touch ($el, options) {
|
|
1091
1091
|
var xDiff = Math.abs(e._x - startEvent._x), // opt _x → _pageX
|
1092
1092
|
yDiff = Math.abs(e._y - startEvent._y),
|
1093
1093
|
xyDiff = xDiff - yDiff,
|
1094
|
-
xWin = (tail.go || tail.x || xyDiff
|
1094
|
+
xWin = (tail.go || tail.x || xyDiff >= 0) && !tail.noSwipe,
|
1095
1095
|
yWin = xyDiff < 0;
|
1096
1096
|
|
1097
1097
|
if (touchFLAG && !tail.checked) {
|
@@ -1124,7 +1124,7 @@ function touch ($el, options) {
|
|
1124
1124
|
preventEventTimeout = setTimeout(function () {
|
1125
1125
|
preventEvent = false;
|
1126
1126
|
}, 1000);
|
1127
|
-
(options.onEnd || noop).call(el, {moved: tail.checked, $target: $target, control: controlTouch, touch: touchFLAG, startEvent: startEvent, aborted: !e});
|
1127
|
+
(options.onEnd || noop).call(el, {moved: tail.checked, $target: $target, control: controlTouch, touch: touchFLAG, startEvent: startEvent, aborted: !e || e.type === 'MSPointerCancel'});
|
1128
1128
|
}
|
1129
1129
|
|
1130
1130
|
function onOtherStart () {
|
@@ -1322,7 +1322,7 @@ function moveOnTouch ($el, options) {
|
|
1322
1322
|
|
1323
1323
|
time *= slowFLAG ? 10 : 1;
|
1324
1324
|
|
1325
|
-
(options.onEnd || noop).call(el, $.extend(result, {pos: moveElPos, newPos: newPos, overPos: overPos, time: time, moved: longTouchFLAG ? snap : Math.abs(moveElPos - startElPos) > 3}));
|
1325
|
+
(options.onEnd || noop).call(el, $.extend(result, {pos: moveElPos, newPos: newPos, overPos: overPos, time: time, moved: longTouchFLAG ? snap : Math.abs(moveElPos - startElPos) > (snap ? 0 : 3)}));
|
1326
1326
|
}
|
1327
1327
|
|
1328
1328
|
tail = $.extend(touch(options.$wrap, {
|
@@ -1339,7 +1339,7 @@ function wheel ($el, options) {
|
|
1339
1339
|
var el = $el[0],
|
1340
1340
|
lockFLAG,
|
1341
1341
|
lastDirection,
|
1342
|
-
|
1342
|
+
lastNow,
|
1343
1343
|
tail = {
|
1344
1344
|
prevent: {}
|
1345
1345
|
};
|
@@ -1349,25 +1349,26 @@ function wheel ($el, options) {
|
|
1349
1349
|
xDelta = e.wheelDeltaX || -1 * e.deltaX || 0,
|
1350
1350
|
xWin = Math.abs(xDelta) > Math.abs(yDelta),
|
1351
1351
|
direction = getDirectionSign(xDelta < 0),
|
1352
|
-
sameDirection = lastDirection === direction
|
1353
|
-
|
1354
|
-
|
1355
|
-
//console.log('lastDirection', lastDirection);
|
1352
|
+
sameDirection = lastDirection === direction,
|
1353
|
+
now = $.now(),
|
1354
|
+
tooFast = now - lastNow < TOUCH_TIMEOUT;
|
1356
1355
|
|
1357
1356
|
lastDirection = direction;
|
1357
|
+
lastNow = now;
|
1358
1358
|
|
1359
1359
|
if (!xWin || !tail.ok || tail.prevent[direction] && !lockFLAG) {
|
1360
1360
|
return;
|
1361
1361
|
} else {
|
1362
1362
|
stopEvent(e, true);
|
1363
|
-
if (lockFLAG && sameDirection
|
1363
|
+
if (lockFLAG && sameDirection && tooFast) {
|
1364
|
+
return;
|
1365
|
+
}
|
1364
1366
|
}
|
1365
1367
|
|
1366
1368
|
if (options.shift) {
|
1367
1369
|
lockFLAG = true;
|
1368
1370
|
clearTimeout(tail.t);
|
1369
1371
|
tail.t = setTimeout(function () {
|
1370
|
-
//unlockTimestamp = $.now();
|
1371
1372
|
lockFLAG = false;
|
1372
1373
|
}, SCROLL_LOCK_TIMEOUT);
|
1373
1374
|
}
|
@@ -1399,7 +1400,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
1399
1400
|
$wrap = $(div(wrapClass)),
|
1400
1401
|
$stage = $(div(stageClass)).appendTo($wrap),
|
1401
1402
|
stage = $stage[0],
|
1402
|
-
|
1403
|
+
|
1403
1404
|
$stageShaft = $(div(stageShaftClass)).appendTo($stage),
|
1404
1405
|
$stageFrame = $(),
|
1405
1406
|
$arrPrev = $(div(arrClass + ' ' + arrPrevClass, div(arrArrClass))),
|
@@ -1710,9 +1711,6 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
1710
1711
|
|
1711
1712
|
ooooStop();
|
1712
1713
|
|
1713
|
-
// Glimpse
|
1714
|
-
$stageShaft.css({left: opts.glimpse, right: opts.glimpse, width: 'auto'});
|
1715
|
-
|
1716
1714
|
$wrap
|
1717
1715
|
.addClass(classes.add.join(' '))
|
1718
1716
|
.removeClass(classes.remove.join(' '));
|
@@ -2009,6 +2007,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2009
2007
|
toDetach[STAGE_FRAME_KEY][normalizeIndex(index)] = $frame.css($.extend({left: o_fade ? 0 : getPosByIndex(index, measures.w, opts.margin, repositionIndex)}, o_fade && getDuration(0)));
|
2010
2008
|
|
2011
2009
|
if (isDetached($frame[0])) {
|
2010
|
+
//console.log('Append', normalizeIndex(index));
|
2012
2011
|
$frame.appendTo($stageShaft);
|
2013
2012
|
unloadVideo(dataFrame.$video);
|
2014
2013
|
}
|
@@ -2182,12 +2181,16 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2182
2181
|
function detachFrames (key) {
|
2183
2182
|
var _toDetach = toDetach[key];
|
2184
2183
|
|
2184
|
+
//console.log('_toDetach', _toDetach);
|
2185
|
+
//console.log('activeIndexes', activeIndexes);
|
2186
|
+
|
2185
2187
|
$.each(activeIndexes, function (i, index) {
|
2186
|
-
delete _toDetach[index];
|
2188
|
+
delete _toDetach[normalizeIndex(index)];
|
2187
2189
|
});
|
2188
2190
|
|
2189
2191
|
$.each(_toDetach, function (index, $frame) {
|
2190
2192
|
delete _toDetach[index];
|
2193
|
+
//console.log('Detach', index);
|
2191
2194
|
$frame.detach();
|
2192
2195
|
});
|
2193
2196
|
}
|
@@ -2343,14 +2346,13 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2343
2346
|
|
2344
2347
|
that.activeFrame = activeFrame = data[activeIndex];
|
2345
2348
|
|
2346
|
-
|
2347
|
-
|
2348
|
-
|
2349
|
-
|
2350
|
-
|
2351
|
-
|
2352
|
-
|
2353
|
-
triggerEvent('show', options.direct);
|
2349
|
+
//setTimeout(function () {
|
2350
|
+
unloadVideo($videoPlaying, activeFrame.i !== data[normalizeIndex(repositionIndex)].i);
|
2351
|
+
frameDraw(activeIndexes, 'stage');
|
2352
|
+
stageFramePosition([dirtyIndex, getPrevIndex(dirtyIndex), getNextIndex(dirtyIndex)]);
|
2353
|
+
updateTouchTails('go', true);
|
2354
|
+
triggerEvent('show', options.direct);
|
2355
|
+
//}, 0);
|
2354
2356
|
|
2355
2357
|
var onEnd = that.show.onEnd = function (skipReposition) {
|
2356
2358
|
if (onEnd.ok) return;
|
@@ -2509,7 +2511,9 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2509
2511
|
width = measures.W = measures.w = $wrap.width();
|
2510
2512
|
|
2511
2513
|
if (opts.glimpse) {
|
2512
|
-
|
2514
|
+
// Glimpse
|
2515
|
+
measures.w -= Math.round((numberFromPercent(opts.glimpse) / 100 * width || numberFromMeasure(opts.glimpse)) * 2)
|
2516
|
+
$stageShaft.css({width: measures.w, marginLeft: (measures.W - measures.w) / 2});
|
2513
2517
|
}
|
2514
2518
|
|
2515
2519
|
//console.log('measures.W', measures.W);
|
@@ -2756,6 +2760,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2756
2760
|
onEnd: function (e, direction) {
|
2757
2761
|
//console.log('wheel $stage onEnd', direction);
|
2758
2762
|
onTouchStart();
|
2763
|
+
onTouchEnd();
|
2759
2764
|
that.show({index: direction, slow: e.altKey})
|
2760
2765
|
}
|
2761
2766
|
});
|
@@ -2764,6 +2769,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
|
|
2764
2769
|
onEnd: function (e, direction) {
|
2765
2770
|
//console.log('wheel $nav onEnd', direction);
|
2766
2771
|
onTouchStart();
|
2772
|
+
onTouchEnd();
|
2767
2773
|
var newPos = stop($navShaft) + direction * .25;
|
2768
2774
|
$navShaft.css(getTranslate(minMaxLimit(newPos, navShaftData.min, navShaftData.max)));
|
2769
2775
|
o_shadows && setShadow($nav, findShadowEdge(newPos, navShaftData.min, navShaftData.max));
|
@@ -2907,6 +2913,7 @@ $.fn.fotorama = function (opts) {
|
|
2907
2913
|
height: null,
|
2908
2914
|
minheight: null,
|
2909
2915
|
maxheight: null,
|
2916
|
+
|
2910
2917
|
ratio: null, // '16/9' || 500/333 || 1.5
|
2911
2918
|
|
2912
2919
|
margin: MARGIN,
|
@@ -2920,11 +2927,6 @@ $.fn.fotorama = function (opts) {
|
|
2920
2927
|
thumbmargin: MARGIN,
|
2921
2928
|
thumbborderwidth: MARGIN,
|
2922
2929
|
|
2923
|
-
arrows: true,
|
2924
|
-
click: true,
|
2925
|
-
swipe: true,
|
2926
|
-
trackpad: true,
|
2927
|
-
|
2928
2930
|
allowfullscreen: false, // true || 'native'
|
2929
2931
|
|
2930
2932
|
fit: 'contain', // 'cover' || 'scaledown' || 'none'
|
@@ -2937,18 +2939,23 @@ $.fn.fotorama = function (opts) {
|
|
2937
2939
|
hash: false,
|
2938
2940
|
startindex: 0,
|
2939
2941
|
|
2942
|
+
loop: false,
|
2943
|
+
|
2940
2944
|
autoplay: false,
|
2941
2945
|
stopautoplayontouch: true,
|
2942
2946
|
|
2943
2947
|
keyboard: false,
|
2944
2948
|
|
2945
|
-
|
2949
|
+
arrows: true,
|
2950
|
+
click: true,
|
2951
|
+
swipe: true,
|
2952
|
+
trackpad: true,
|
2946
2953
|
|
2947
2954
|
shuffle: false,
|
2948
2955
|
|
2949
|
-
|
2956
|
+
direction: 'ltr', // 'rtl'
|
2950
2957
|
|
2951
|
-
|
2958
|
+
shadows: true
|
2952
2959
|
},
|
2953
2960
|
window.fotoramaDefaults,
|
2954
2961
|
opts,
|
@@ -3007,7 +3014,7 @@ $.Fotorama.jst.video = function(v) {
|
|
3007
3014
|
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
3008
3015
|
function print() { __p += __j.call(arguments, '') }
|
3009
3016
|
__p += '<div class="fotorama__video"><iframe src="';
|
3010
|
-
print((v.type == 'youtube' ? 'http://youtube.com/embed/' + v.id +'?autoplay=1' : v.type == 'vimeo' ? 'http://player.vimeo.com/video/' + v.id + '?autoplay=1&badge=0' : v.id) + '&' + v.s) ;
|
3017
|
+
print((v.type == 'youtube' ? 'http://youtube.com/embed/' + v.id +'?autoplay=1' : v.type == 'vimeo' ? 'http://player.vimeo.com/video/' + v.id + '?autoplay=1&badge=0' : v.id) + (v.s ? '&' + v.s : '')) ;
|
3011
3018
|
__p += '" frameborder="0" allowfullscreen></iframe></div>';
|
3012
3019
|
return __p
|
3013
3020
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Fotorama 4.4.
|
2
|
+
* Fotorama 4.4.3 | http://fotorama.io/license/
|
3
3
|
*/
|
4
4
|
.fotorama__stage__shaft,
|
5
5
|
.fotorama__stage__frame,
|
@@ -22,7 +22,7 @@
|
|
22
22
|
min-height: 0 !important;
|
23
23
|
border-radius: 0 !important;
|
24
24
|
box-shadow: none !important;
|
25
|
-
padding: 0;
|
25
|
+
padding: 0 !important;
|
26
26
|
}
|
27
27
|
|
28
28
|
.fotorama__wrap .fotorama__grab {
|
@@ -96,11 +96,7 @@
|
|
96
96
|
.fotorama__arr,
|
97
97
|
.fotorama__fullscreen-icon,
|
98
98
|
.fotorama__video-play,
|
99
|
-
.fotorama__video-close
|
100
|
-
.fotorama__stage:before,
|
101
|
-
.fotorama__stage:after,
|
102
|
-
.fotorama__nav:before,
|
103
|
-
.fotorama__nav:after {
|
99
|
+
.fotorama__video-close {
|
104
100
|
-webkit-user-select: none;
|
105
101
|
-moz-user-select: none;
|
106
102
|
-ms-user-select: none;
|
@@ -228,6 +224,7 @@
|
|
228
224
|
.fotorama__wrap {
|
229
225
|
-webkit-text-size-adjust: 100%;
|
230
226
|
position: relative;
|
227
|
+
direction: ltr;
|
231
228
|
}
|
232
229
|
|
233
230
|
.fotorama__wrap--rtl .fotorama__stage__frame {
|
@@ -305,7 +302,7 @@
|
|
305
302
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
306
303
|
filter: alpha(opacity=0);
|
307
304
|
opacity: 0;
|
308
|
-
border:
|
305
|
+
border: none !important;
|
309
306
|
}
|
310
307
|
|
311
308
|
.fotorama__loaded .fotorama__img,
|
@@ -486,7 +483,7 @@
|
|
486
483
|
width: 6px;
|
487
484
|
height: 6px;
|
488
485
|
border-radius: 6px;
|
489
|
-
background-color: #
|
486
|
+
background-color: #7f7f7f;
|
490
487
|
background-color: rgba(127, 127, 127, 0.5);
|
491
488
|
}
|
492
489
|
|
@@ -505,17 +502,6 @@
|
|
505
502
|
background-color: #7f7f7f;
|
506
503
|
}
|
507
504
|
|
508
|
-
.fotorama__wrap--css3 .fotorama__stage__shaft,
|
509
|
-
.fotorama__wrap--css3 .fotorama__nav__shaft,
|
510
|
-
.fotorama__wrap--css3 .fotorama__thumb-border,
|
511
|
-
.fotorama__wrap--css3 .fotorama__stage__frame,
|
512
|
-
.fotorama__wrap--css3 .fotorama__nav__frame,
|
513
|
-
.fotorama__wrap--css3 .fotorama__img,
|
514
|
-
.fotorama__wrap--css3 .fotorama__html,
|
515
|
-
.fotorama__wrap--css3 .fotorama__caption {
|
516
|
-
-webkit-backface-visibility: hidden;
|
517
|
-
}
|
518
|
-
|
519
505
|
.fotorama__wrap--css3 .fotorama__img,
|
520
506
|
.fotorama__wrap--css3 .fotorama__html,
|
521
507
|
.fotorama__wrap--css3.fotorama__wrap--fade .fotorama__stage__frame,
|
@@ -541,6 +527,21 @@
|
|
541
527
|
z-index: 10;
|
542
528
|
}
|
543
529
|
|
530
|
+
body,
|
531
|
+
div,
|
532
|
+
article,
|
533
|
+
aside,
|
534
|
+
footer,
|
535
|
+
header,
|
536
|
+
main,
|
537
|
+
nav,
|
538
|
+
section {
|
539
|
+
/* Force improvement of webkit mobile performance on sites using fotorama */
|
540
|
+
-webkit-backface-visibility: hidden;
|
541
|
+
}
|
542
|
+
|
543
|
+
/* Strange fix of the #66 issue (Firefox bug while sliding backwards) */
|
544
|
+
|
544
545
|
@-moz-document url-prefix() {
|
545
546
|
.fotorama__active {
|
546
547
|
box-shadow: 0 0 0 transparent;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fotoramajs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
segments:
|
81
81
|
- 0
|
82
|
-
hash:
|
82
|
+
hash: 1857401499460829857
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
segments:
|
90
90
|
- 0
|
91
|
-
hash:
|
91
|
+
hash: 1857401499460829857
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
94
|
rubygems_version: 1.8.23
|