fotoramajs 4.4.5 → 4.4.6

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: f56a4a09e7d03468fe08f76f5e87c80e709ccfd5
4
- data.tar.gz: 1354434441490a5dfe5ae5f8b59db8aa08be3349
3
+ metadata.gz: 781b1f3e103c750f7c8a0070ca13ccacab9cc8e0
4
+ data.tar.gz: e1b56b0ba874834336df95300263a4d3560b8a3f
5
5
  SHA512:
6
- metadata.gz: b3117fb71a09d6a0355877eb753a3e6d1a80a5dcb8084e34642e72c504a3e763dc2668d20135e411f15948982eed9d567ce8ab1ca4aceced09df12d3b8656ff9
7
- data.tar.gz: 29cec6cb0b8cb562d00f5cc670d613f4076125c13ae668133464c737bcc62a06fa7741d2061249f0a3534fc4bd9e8a868105489188c2adfd0fd9db527eb617d2
6
+ metadata.gz: 100bee579eda7b6be4395904ec423ad162ec635312d613d81bc473d1858aba033921533429a1e3530c33562be0eedad3418ee15b11bc1093ef73bd1862eb0ac3
7
+ data.tar.gz: baeea1ef6017e9db66f757c4e1b0caf4ad03b407817da133384abba22488922bc6e9592b6f5c026fd36a89500c161fb75f58f0375daa3ebd57eb80cfd972d678
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fotoramajs (4.4.5)
4
+ fotoramajs (4.4.6)
5
5
  sprockets (>= 2)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module Fotoramajs
2
- VERSION = "4.4.5"
2
+ VERSION = "4.4.6"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Fotorama 4.4.5 | http://fotorama.io/license/
2
+ * Fotorama 4.4.6 | http://fotorama.io/license/
3
3
  */
4
4
  (function (window, document, location, $, undefined) {
5
5
  "use strict";
@@ -88,7 +88,7 @@ var JQUERY_VERSION = $ && $.fn.jquery.split('.');
88
88
  if (!JQUERY_VERSION
89
89
  || JQUERY_VERSION[0] < 1
90
90
  || (JQUERY_VERSION[0] == 1 && JQUERY_VERSION[1] < 8)) {
91
- throw new Error('Fotorama requires jQuery 1.8 or later and will not run without it.');
91
+ throw 'Fotorama requires jQuery 1.8 or later and will not run without it.';
92
92
  return;
93
93
  }
94
94
  // My Underscore :-)
@@ -785,12 +785,14 @@ function waitFor (test, fn, timeout) {
785
785
  }
786
786
 
787
787
  function setHash (hash) {
788
+ //console.time('setHash ' + hash);
788
789
  location.replace(location.protocol
789
790
  + '//'
790
791
  + location.host
791
792
  + location.pathname.replace(/^\/?/, '/')
792
793
  + location.search
793
794
  + '#' + hash);
795
+ //console.timeEnd('setHash ' + hash);
794
796
  }
795
797
 
796
798
  function fit ($el, measuresToFit, method) {
@@ -975,12 +977,16 @@ function slide ($el, options) {
975
977
  };
976
978
  }
977
979
 
978
- var translate = $.extend(getTranslate(elPos, options._001), {width: options.width});
980
+ //console.time('var translate = $.extend');
981
+ var translate = $.extend(getTranslate(elPos, options._001), options.width && {width: options.width});
982
+ //console.timeEnd('var translate = $.extend');
979
983
 
980
984
  if (CSS3) {
981
985
  $el.css($.extend(getDuration(options.time), translate));
982
986
  if (options.time > 10) {
987
+ //console.time('afterTransition');
983
988
  afterTransition($el, 'transform', onEndFn, options.time);
989
+ //console.timeEnd('afterTransition');
984
990
  } else {
985
991
  onEndFn();
986
992
  }
@@ -1109,6 +1115,7 @@ function touch ($el, options) {
1109
1115
  }
1110
1116
 
1111
1117
  function onEnd (e) {
1118
+ ////console.time('touch.js onEnd');
1112
1119
  var _touchEnabledFLAG = touchEnabledFLAG;
1113
1120
  tail.control = touchEnabledFLAG = false;
1114
1121
 
@@ -1126,6 +1133,7 @@ function touch ($el, options) {
1126
1133
  preventEvent = false;
1127
1134
  }, 1000);
1128
1135
  (options.onEnd || noop).call(el, {moved: tail.checked, $target: $target, control: controlTouch, touch: touchFLAG, startEvent: startEvent, aborted: !e || e.type === 'MSPointerCancel'});
1136
+ ////console.timeEnd('touch.js onEnd');
1129
1137
  }
1130
1138
 
1131
1139
  function onOtherStart () {
@@ -1199,7 +1207,7 @@ function moveOnTouch ($el, options) {
1199
1207
  [startTime, startCoo]
1200
1208
  ];
1201
1209
 
1202
- startElPos = moveElPos = tail.noMove ? 0 : stop($el, options.getPos && options.getPos(), options._001);
1210
+ startElPos = moveElPos = tail.noMove ? 0 : stop($el, (options.getPos || noop)(), options._001);
1203
1211
 
1204
1212
  // startTime - endTime < TOUCH_TIMEOUT * 3 && e.preventDefault(); // double tap
1205
1213
 
@@ -1256,6 +1264,7 @@ function moveOnTouch ($el, options) {
1256
1264
  }
1257
1265
 
1258
1266
  function onEnd (result) {
1267
+ ////console.time('moveontouch.js onEnd');
1259
1268
  if (controlFLAG) return;
1260
1269
 
1261
1270
  result.touch || MS_POINTER || $el.removeClass(grabbingClass);
@@ -1324,6 +1333,7 @@ function moveOnTouch ($el, options) {
1324
1333
  time *= slowFLAG ? 10 : 1;
1325
1334
 
1326
1335
  (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)}));
1336
+ ////console.timeEnd('moveontouch.js onEnd');
1327
1337
  }
1328
1338
 
1329
1339
  tail = $.extend(touch(options.$wrap, {
@@ -2004,7 +2014,6 @@ jQuery.Fotorama = function ($fotorama, opts) {
2004
2014
  toDetach[STAGE_FRAME_KEY][normalizeIndex(index)] = $frame.css($.extend({left: o_fade ? 0 : getPosByIndex(index, measures.w, opts.margin, repositionIndex)}, o_fade && getDuration(0)));
2005
2015
 
2006
2016
  if (isDetached($frame[0])) {
2007
- //console.log('Append', normalizeIndex(index));
2008
2017
  $frame.appendTo($stageShaft);
2009
2018
  unloadVideo(dataFrame.$video);
2010
2019
  }
@@ -2017,6 +2026,8 @@ jQuery.Fotorama = function ($fotorama, opts) {
2017
2026
  }
2018
2027
 
2019
2028
  function thumbsDraw (pos, loadFLAG) {
2029
+
2030
+
2020
2031
  if (o_nav !== 'thumbs' || isNaN(pos)) return;
2021
2032
 
2022
2033
  var leftLimit = -pos,
@@ -2155,9 +2166,9 @@ jQuery.Fotorama = function ($fotorama, opts) {
2155
2166
  }
2156
2167
  });
2157
2168
 
2158
- if (time) thumbsDraw(pos);
2159
- setShadow($nav, findShadowEdge(pos, navShaftData.min, navShaftData.max));
2169
+ //if (time) thumbsDraw(pos);
2160
2170
 
2171
+ setShadow($nav, findShadowEdge(pos, navShaftData.min, navShaftData.max));
2161
2172
  slideNavShaft.l = l;
2162
2173
  }
2163
2174
  }
@@ -2178,8 +2189,8 @@ jQuery.Fotorama = function ($fotorama, opts) {
2178
2189
  function detachFrames (key) {
2179
2190
  var _toDetach = toDetach[key];
2180
2191
 
2181
- //console.log('_toDetach', _toDetach);
2182
- //console.log('activeIndexes', activeIndexes);
2192
+ ////console.log('_toDetach', _toDetach);
2193
+ ////console.log('activeIndexes', activeIndexes);
2183
2194
 
2184
2195
  $.each(activeIndexes, function (i, index) {
2185
2196
  delete _toDetach[normalizeIndex(index)];
@@ -2187,7 +2198,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2187
2198
 
2188
2199
  $.each(_toDetach, function (index, $frame) {
2189
2200
  delete _toDetach[index];
2190
- //console.log('Detach', index);
2201
+ ////console.log('Detach', index);
2191
2202
  $frame.detach();
2192
2203
  });
2193
2204
  }
@@ -2255,9 +2266,11 @@ jQuery.Fotorama = function ($fotorama, opts) {
2255
2266
  }
2256
2267
 
2257
2268
  function onTouchEnd () {
2269
+ ////console.time('onTouchEnd');
2258
2270
  onTouchEnd.t = setTimeout(function () {
2259
2271
  touchedFLAG = 0;
2260
2272
  }, TRANSITION_DURATION + TOUCH_TIMEOUT);
2273
+ ////console.timeEnd('onTouchEnd');
2261
2274
  }
2262
2275
 
2263
2276
  function releaseAutoplay () {
@@ -2313,6 +2326,8 @@ jQuery.Fotorama = function ($fotorama, opts) {
2313
2326
  };
2314
2327
 
2315
2328
  that.show = function (options) {
2329
+ ////console.time('that.show');
2330
+ ////console.time('that.show prepare');
2316
2331
  var index;
2317
2332
 
2318
2333
  if (typeof options !== 'object') {
@@ -2342,18 +2357,30 @@ jQuery.Fotorama = function ($fotorama, opts) {
2342
2357
  if (options.slow) time *= 10;
2343
2358
 
2344
2359
  that.activeFrame = activeFrame = data[activeIndex];
2360
+ ////console.timeEnd('that.show prepare');
2345
2361
 
2346
2362
  //setTimeout(function () {
2347
- unloadVideo($videoPlaying, activeFrame.i !== data[normalizeIndex(repositionIndex)].i);
2348
- frameDraw(activeIndexes, 'stage');
2349
- stageFramePosition([dirtyIndex, getPrevIndex(dirtyIndex), getNextIndex(dirtyIndex)]);
2350
- updateTouchTails('go', true);
2351
- triggerEvent('show', {
2352
- user: options.user,
2353
- time: time
2354
- });
2363
+ ////console.time('unloadVideo');
2364
+ unloadVideo($videoPlaying, activeFrame.i !== data[normalizeIndex(repositionIndex)].i);
2365
+ ////console.timeEnd('unloadVideo');
2366
+ ////console.time('frameDraw');
2367
+ frameDraw(activeIndexes, 'stage');
2368
+ ////console.timeEnd('frameDraw');
2369
+ ////console.time('stageFramePosition');
2370
+ stageFramePosition(SLOW ? [dirtyIndex] : [dirtyIndex, getPrevIndex(dirtyIndex), getNextIndex(dirtyIndex)]);
2371
+ ////console.timeEnd('stageFramePosition');
2372
+ ////console.time('updateTouchTails');
2373
+ updateTouchTails('go', true);
2374
+ ////console.timeEnd('updateTouchTails');
2375
+ ////console.time('triggerEvent');
2376
+ triggerEvent('show', {
2377
+ user: options.user,
2378
+ time: time
2379
+ });
2380
+ ////console.timeEnd('triggerEvent');
2355
2381
  //}, 0);
2356
2382
 
2383
+ ////console.time('bind onEnd');
2357
2384
  var onEnd = that.show.onEnd = function (skipReposition) {
2358
2385
  if (onEnd.ok) return;
2359
2386
  onEnd.ok = true;
@@ -2373,8 +2400,10 @@ jQuery.Fotorama = function ($fotorama, opts) {
2373
2400
  releaseAutoplay();
2374
2401
  changeAutoplay();
2375
2402
  };
2403
+ ////console.timeEnd('bind onEnd');
2376
2404
 
2377
2405
  if (!o_fade) {
2406
+ ////console.time('slide');
2378
2407
  slide($stageShaft, {
2379
2408
  pos: -getPosByIndex(dirtyIndex, measures.w, opts.margin, repositionIndex),
2380
2409
  overPos: overPos,
@@ -2382,6 +2411,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2382
2411
  onEnd: onEnd,
2383
2412
  _001: true
2384
2413
  });
2414
+ ////console.timeEnd('slide');
2385
2415
  } else {
2386
2416
  var $activeFrame = activeFrame[STAGE_FRAME_KEY],
2387
2417
  $prevActiveFrame = activeIndex !== lastActiveIndex ? data[lastActiveIndex][STAGE_FRAME_KEY] : null;
@@ -2393,21 +2423,32 @@ jQuery.Fotorama = function ($fotorama, opts) {
2393
2423
  }, fadeStack);
2394
2424
  }
2395
2425
 
2426
+ ////console.time('arrsUpdate');
2396
2427
  arrsUpdate();
2428
+ ////console.timeEnd('arrsUpdate');
2397
2429
 
2398
2430
  if (o_nav) {
2431
+ ////console.time('navUpdate');
2399
2432
  navUpdate();
2433
+ ////console.timeEnd('navUpdate');
2400
2434
 
2435
+ ////console.time('slideNavShaft');
2401
2436
  var guessIndex = limitIndex(activeIndex + minMaxLimit(dirtyIndex - lastActiveIndex, -1, 1));
2402
-
2403
2437
  slideNavShaft({time: time, coo: guessIndex !== activeIndex && options.coo, guessIndex: typeof options.coo !== 'undefined' ? guessIndex : activeIndex});
2438
+ ////console.timeEnd('slideNavShaft');
2404
2439
 
2440
+ ////console.time('slideThumbBorder');
2405
2441
  if (o_navThumbs) slideThumbBorder(time);
2442
+ ////console.timeEnd('slideThumbBorder');
2406
2443
  }
2407
2444
 
2445
+ ////console.time('that.show end');
2408
2446
  showedFLAG = typeof lastActiveIndex !== 'undefined' && lastActiveIndex !== activeIndex;
2409
2447
  lastActiveIndex = activeIndex;
2410
2448
  opts.hash && showedFLAG && !that.eq && setHash(activeFrame.id || activeIndex + 1);
2449
+ ////console.timeEnd('that.show end');
2450
+
2451
+ ////console.timeEnd('that.show');
2411
2452
 
2412
2453
  return this;
2413
2454
  };
@@ -2519,8 +2560,8 @@ jQuery.Fotorama = function ($fotorama, opts) {
2519
2560
 
2520
2561
  $stageShaft.css({width: measures.w, marginLeft: (measures.W - measures.w) / 2});
2521
2562
 
2522
- //console.log('measures.W', measures.W);
2523
- //console.log('measures.w', measures.w);
2563
+ ////console.log('measures.W', measures.W);
2564
+ ////console.log('measures.w', measures.w);
2524
2565
 
2525
2566
  height = numberFromPercent(height) / 100 * windowHeight || numberFromMeasure(height);
2526
2567
 
@@ -2569,10 +2610,12 @@ jQuery.Fotorama = function ($fotorama, opts) {
2569
2610
  };
2570
2611
 
2571
2612
  function setShadow ($el, edge) {
2613
+ ////console.time('setShadow');
2572
2614
  if (o_shadows) {
2573
2615
  $el.removeClass(shadowsLeftClass + ' ' + shadowsRightClass);
2574
2616
  edge && !$videoPlaying && $el.addClass(edge.replace(/^|\s/g, ' ' + shadowsClass + '--'));
2575
2617
  }
2618
+ ////console.timeEnd('setShadow');
2576
2619
  }
2577
2620
 
2578
2621
  that.destroy = function () {
@@ -2662,13 +2705,14 @@ jQuery.Fotorama = function ($fotorama, opts) {
2662
2705
  $stage.on('mousemove', stageCursor);
2663
2706
 
2664
2707
  function onStageTap (e, toggleControlsFLAG) {
2708
+ ////console.time('onStageTap');
2665
2709
  var target = e.target,
2666
2710
  $target = $(target);
2667
2711
 
2668
2712
  if ($target.hasClass(videoPlayClass)) {
2669
2713
  that.playVideo();
2670
2714
  } else if (target === fullscreenIcon) {
2671
- that[(that.fullScreen ? 'cancel' : 'request') +'FullScreen']();
2715
+ that[(that.fullScreen ? 'cancel' : 'request') + 'FullScreen']();
2672
2716
  } else if ($videoPlaying) {
2673
2717
  target === videoClose && unloadVideo($videoPlaying, true, true);
2674
2718
  } else {
@@ -2680,6 +2724,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2680
2724
  }
2681
2725
  });
2682
2726
  }
2727
+ ////console.timeEnd('onStageTap');
2683
2728
  }
2684
2729
 
2685
2730
  function updateTouchTails (key, value) {
@@ -2692,6 +2737,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2692
2737
  setShadow($stage, result.edge);
2693
2738
  },
2694
2739
  onEnd: function (result) {
2740
+ ////console.time('stageShaftTouchTail.onEnd');
2695
2741
  setShadow($stage);
2696
2742
 
2697
2743
  onTouchEnd();
@@ -2709,6 +2755,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2709
2755
  } else if (!result.aborted) {
2710
2756
  onStageTap(result.startEvent, toggleControlsFLAG);
2711
2757
  }
2758
+ ////console.timeEnd('stageShaftTouchTail.onEnd');
2712
2759
  },
2713
2760
  getPos: function () {
2714
2761
  return -getPosByIndex(dirtyIndex, measures.w, opts.margin, repositionIndex);
@@ -2761,7 +2808,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2761
2808
  stageWheelTail = wheel($stage, {
2762
2809
  shift: true,
2763
2810
  onEnd: function (e, direction) {
2764
- //console.log('wheel $stage onEnd', direction);
2811
+ ////console.log('wheel $stage onEnd', direction);
2765
2812
  onTouchStart();
2766
2813
  onTouchEnd();
2767
2814
  that.show({index: direction, slow: e.altKey})
@@ -2770,7 +2817,7 @@ jQuery.Fotorama = function ($fotorama, opts) {
2770
2817
 
2771
2818
  navWheelTail = wheel($nav, {
2772
2819
  onEnd: function (e, direction) {
2773
- //console.log('wheel $nav onEnd', direction);
2820
+ ////console.log('wheel $nav onEnd', direction);
2774
2821
  onTouchStart();
2775
2822
  onTouchEnd();
2776
2823
  var newPos = stop($navShaft) + direction * .25;
@@ -2835,9 +2882,9 @@ jQuery.Fotorama = function ($fotorama, opts) {
2835
2882
  }
2836
2883
 
2837
2884
  if (size) {
2838
- //console.log('activeIndex', activeIndex);
2885
+ ////console.log('activeIndex', activeIndex);
2839
2886
  if (changeToRtl()) return;
2840
- //console.log('No changeToRtl, activeIndex is', activeIndex);
2887
+ ////console.log('No changeToRtl, activeIndex is', activeIndex);
2841
2888
 
2842
2889
  if ($videoPlaying) {
2843
2890
  unloadVideo($videoPlaying, true);
@@ -2854,11 +2901,11 @@ jQuery.Fotorama = function ($fotorama, opts) {
2854
2901
  }
2855
2902
 
2856
2903
  function changeToRtl () {
2857
- //console.log('changeToRtl');
2904
+ ////console.log('changeToRtl');
2858
2905
  if (!changeToRtl.f === o_rtl) {
2859
2906
  changeToRtl.f = o_rtl;
2860
2907
  activeIndex = size - 1 - activeIndex;
2861
- //console.log('changeToRtl execute, activeIndex is', activeIndex);
2908
+ ////console.log('changeToRtl execute, activeIndex is', activeIndex);
2862
2909
  that.reverse();
2863
2910
 
2864
2911
  return true;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Fotorama 4.4.5 | http://fotorama.io/license/
2
+ * Fotorama 4.4.6 | http://fotorama.io/license/
3
3
  */
4
4
  .fotorama__stage__shaft,
5
5
  .fotorama__stage__frame,
@@ -59,15 +59,21 @@
59
59
  .fotorama__wrap--css3 .fotorama__stage__shaft,
60
60
  .fotorama__wrap--css3 .fotorama__nav__shaft,
61
61
  .fotorama__wrap--css3 .fotorama__thumb-border,
62
- .fotorama__arr,
62
+ .fotorama__wrap--css3 .fotorama__arr,
63
+ .fotorama__wrap--css3
63
64
  .fotorama__fullscreen-icon,
65
+ .fotorama__wrap--css3
64
66
  .fotorama__video-play,
67
+ .fotorama__wrap--css3
65
68
  .fotorama__video-close {
66
69
  -webkit-transform: translate3d(0, 0, 0);
67
70
  -ms-transform: translate3d(0, 0, 0);
68
71
  transform: translate3d(0, 0, 0);
69
72
  }
70
73
 
74
+ .fotorama__oooo,
75
+ .fotorama__oooo:before,
76
+ .fotorama__oooo:after,
71
77
  .fotorama__wrap--css3 .fotorama__stage,
72
78
  .fotorama__wrap--css3 .fotorama__nav,
73
79
  .fotorama__wrap--css3 .fotorama__stage__frame,
@@ -516,7 +522,7 @@
516
522
  background-color: #7f7f7f;
517
523
  }
518
524
 
519
- .fotorama__wrap--css3 .fotorama__img,
525
+ .fotorama__wrap--css3 .fotorama__stage .fotorama__img,
520
526
  .fotorama__wrap--css3 .fotorama__html,
521
527
  .fotorama__wrap--css3 .fotorama__caption {
522
528
  -webkit-transition-property: opacity;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fotoramajs
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.5
4
+ version: 4.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Polikarpov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-16 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets