Responsive Lightbox & Gallery - Version 1.4.2

Version Description

  • Fix: Final fix for IE scroll bug
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Responsive Lightbox & Gallery
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

assets/swipebox/source/jquery.swipebox.js DELETED
@@ -1,451 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
-
3
- @author Constantin Saguin - @brutaldesign
4
- @link http://bsign.co
5
- @github http://github.com/brutaldesign/swipebox
6
- @version 1.1.2
7
- @license MIT License
8
-
9
- ----------------------------------------------------------------------------------------------*/
10
-
11
- ;(function (window, document, $, undefined) {
12
-
13
- $.swipebox = function(elem, options) {
14
-
15
- var defaults = {
16
- useCSS : true,
17
- hideBarsDelay : 3000
18
- },
19
-
20
- plugin = this,
21
- $elem = $(elem),
22
- elem = elem,
23
- selector = elem.selector,
24
- $selector = $(selector),
25
- isTouch = document.createTouch !== undefined || ('ontouchstart' in window) || ('onmsgesturechange' in window) || navigator.msMaxTouchPoints,
26
- supportSVG = !!(window.SVGSVGElement),
27
- html = '<div id="swipebox-overlay">\
28
- <div id="swipebox-slider"></div>\
29
- <div id="swipebox-caption"></div>\
30
- <div id="swipebox-action">\
31
- <a id="swipebox-close"></a>\
32
- <a id="swipebox-prev"></a>\
33
- <a id="swipebox-next"></a>\
34
- </div>\
35
- </div>';
36
-
37
- plugin.settings = {}
38
-
39
- plugin.init = function(){
40
-
41
- plugin.settings = $.extend({}, defaults, options);
42
-
43
- $selector.click(function(e){
44
- e.preventDefault();
45
- e.stopPropagation();
46
- index = $elem.index($(this));
47
- ui.target = $(e.target);
48
- ui.init(index);
49
- });
50
- }
51
-
52
- var ui = {
53
-
54
- init : function(index){
55
- this.target.trigger('swipebox-start');
56
- this.build();
57
- this.openSlide(index);
58
- this.openImg(index);
59
- this.preloadImg(index+1);
60
- this.preloadImg(index-1);
61
- },
62
-
63
- build : function(){
64
- var $this = this;
65
-
66
- $('body').append(html);
67
-
68
- if($this.doCssTrans()){
69
- $('#swipebox-slider').css({
70
- '-webkit-transition' : 'left 0.4s ease',
71
- '-moz-transition' : 'left 0.4s ease',
72
- '-o-transition' : 'left 0.4s ease',
73
- '-khtml-transition' : 'left 0.4s ease',
74
- 'transition' : 'left 0.4s ease'
75
- });
76
- $('#swipebox-overlay').css({
77
- '-webkit-transition' : 'opacity 1s ease',
78
- '-moz-transition' : 'opacity 1s ease',
79
- '-o-transition' : 'opacity 1s ease',
80
- '-khtml-transition' : 'opacity 1s ease',
81
- 'transition' : 'opacity 1s ease'
82
- });
83
- $('#swipebox-action, #swipebox-caption').css({
84
- '-webkit-transition' : '0.5s',
85
- '-moz-transition' : '0.5s',
86
- '-o-transition' : '0.5s',
87
- '-khtml-transition' : '0.5s',
88
- 'transition' : '0.5s'
89
- });
90
- }
91
-
92
-
93
- if(supportSVG){
94
- var bg = $('#swipebox-action #swipebox-close').css('background-image');
95
- bg = bg.replace('png', 'svg');
96
- $('#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close').css({
97
- 'background-image' : bg
98
- });
99
- }
100
-
101
- $elem.each(function(){
102
- $('#swipebox-slider').append('<div class="slide"></div>');
103
- });
104
-
105
- $this.setDim();
106
- $this.actions();
107
- $this.keyboard();
108
- $this.gesture();
109
- $this.animBars();
110
-
111
- $(window).resize(function() {
112
- $this.setDim();
113
- }).resize();
114
- },
115
-
116
- setDim : function(){
117
- var sliderCss = {
118
- width : $(window).width(),
119
- height : window.innerHeight ? window.innerHeight : $(window).height() // fix IOS bug
120
- }
121
-
122
- $('#swipebox-overlay').css(sliderCss);
123
-
124
- },
125
-
126
- supportTransition : function() {
127
- var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split(' ');
128
- for(var i = 0; i < prefixes.length; i++) {
129
- if(document.createElement('div').style[prefixes[i]] !== undefined) {
130
- return prefixes[i];
131
- }
132
- }
133
- return false;
134
- },
135
-
136
- doCssTrans : function(){
137
- if(plugin.settings.useCSS && this.supportTransition() ){
138
- return true;
139
- }
140
- },
141
-
142
- gesture : function(){
143
- if ( isTouch ){
144
- var $this = this,
145
- distance = null,
146
- swipMinDistance = 10,
147
- startCoords = {},
148
- endCoords = {};
149
- var b = $('#swipebox-caption, #swipebox-action');
150
-
151
- b.addClass('visible-bars');
152
- $this.setTimeout();
153
-
154
- $('body').bind('touchstart', function(e){
155
-
156
- $(this).addClass('touching');
157
-
158
- endCoords = e.originalEvent.targetTouches[0];
159
- startCoords.pageX = e.originalEvent.targetTouches[0].pageX;
160
-
161
- $('.touching').bind('touchmove',function(e){
162
- e.preventDefault();
163
- e.stopPropagation();
164
- endCoords = e.originalEvent.targetTouches[0];
165
-
166
- });
167
-
168
- return false;
169
-
170
- }).bind('touchend',function(e){
171
- e.preventDefault();
172
- e.stopPropagation();
173
-
174
- distance = endCoords.pageX - startCoords.pageX;
175
-
176
- if( distance >= swipMinDistance ){
177
- // swipeLeft
178
- $this.getPrev();
179
- }
180
-
181
- else if( distance <= - swipMinDistance ){
182
- // swipeRight
183
- $this.getNext();
184
-
185
- }else{
186
- // tap
187
- if(!b.hasClass('visible-bars')){
188
- $this.showBars();
189
- $this.setTimeout();
190
- }else{
191
- $this.clearTimeout();
192
- $this.hideBars();
193
- }
194
-
195
- }
196
-
197
- $('.touching').off('touchmove').removeClass('touching');
198
-
199
- });
200
-
201
- }
202
- },
203
-
204
- setTimeout: function(){
205
- if(plugin.settings.hideBarsDelay > 0){
206
- var $this = this;
207
- $this.clearTimeout();
208
- $this.timeout = window.setTimeout( function(){
209
- $this.hideBars() },
210
- plugin.settings.hideBarsDelay
211
- );
212
- }
213
- },
214
-
215
- clearTimeout: function(){
216
- window.clearTimeout(this.timeout);
217
- this.timeout = null;
218
- },
219
-
220
- showBars : function(){
221
- var b = $('#swipebox-caption, #swipebox-action');
222
- if(this.doCssTrans()){
223
- b.addClass('visible-bars');
224
- }else{
225
- $('#swipebox-caption').animate({ top : 0 }, 500);
226
- $('#swipebox-action').animate({ bottom : 0 }, 500);
227
- setTimeout(function(){
228
- b.addClass('visible-bars');
229
- }, 1000);
230
- }
231
- },
232
-
233
- hideBars : function(){
234
- var b = $('#swipebox-caption, #swipebox-action');
235
- if(this.doCssTrans()){
236
- b.removeClass('visible-bars');
237
- }else{
238
- $('#swipebox-caption').animate({ top : '-50px' }, 500);
239
- $('#swipebox-action').animate({ bottom : '-50px' }, 500);
240
- setTimeout(function(){
241
- b.removeClass('visible-bars');
242
- }, 1000);
243
- }
244
- },
245
-
246
- animBars : function(){
247
- var $this = this;
248
- var b = $('#swipebox-caption, #swipebox-action');
249
-
250
- b.addClass('visible-bars');
251
- $this.setTimeout();
252
-
253
- $('#swipebox-slider').click(function(e){
254
- if(!b.hasClass('visible-bars')){
255
- $this.showBars();
256
- $this.setTimeout();
257
- }
258
- });
259
-
260
- $('#swipebox-action').hover(function() {
261
- $this.showBars();
262
- b.addClass('force-visible-bars');
263
- $this.clearTimeout();
264
-
265
- },function() {
266
- b.removeClass('force-visible-bars');
267
- $this.setTimeout();
268
-
269
- });
270
- },
271
-
272
- keyboard : function(){
273
- var $this = this;
274
- $(window).bind('keyup', function(e){
275
- e.preventDefault();
276
- e.stopPropagation();
277
- if (e.keyCode == 37){
278
- $this.getPrev();
279
- }
280
- else if (e.keyCode==39){
281
- $this.getNext();
282
- }
283
- else if (e.keyCode == 27) {
284
- $this.closeSlide();
285
- }
286
- });
287
- },
288
-
289
- actions : function(){
290
- var $this = this;
291
-
292
- if( $elem.length < 2 ){
293
- $('#swipebox-prev, #swipebox-next').hide();
294
- }else{
295
- $('#swipebox-prev').bind('click touchend', function(e){
296
- e.preventDefault();
297
- e.stopPropagation();
298
- $this.getPrev();
299
- $this.setTimeout();
300
- });
301
-
302
- $('#swipebox-next').bind('click touchend', function(e){
303
- e.preventDefault();
304
- e.stopPropagation();
305
- $this.getNext();
306
- $this.setTimeout();
307
- });
308
- }
309
-
310
- $('#swipebox-close').bind('click touchend', function(e){
311
- $this.closeSlide();
312
- });
313
- },
314
-
315
- setSlide : function (index, isFirst){
316
- isFirst = isFirst || false;
317
-
318
- var slider = $('#swipebox-slider');
319
-
320
- if(this.doCssTrans()){
321
- slider.css({ left : (-index*100)+'%' });
322
- }else{
323
- slider.animate({ left : (-index*100)+'%' });
324
- }
325
-
326
- $('#swipebox-slider .slide').removeClass('current');
327
- $('#swipebox-slider .slide').eq(index).addClass('current');
328
- this.setTitle(index);
329
-
330
- if( isFirst ){
331
- slider.fadeIn();
332
- }
333
-
334
- $('#swipebox-prev, #swipebox-next').removeClass('disabled');
335
- if(index == 0){
336
- $('#swipebox-prev').addClass('disabled');
337
- }else if( index == $elem.length - 1 ){
338
- $('#swipebox-next').addClass('disabled');
339
- }
340
- },
341
-
342
- openSlide : function (index){
343
-
344
- $('html').addClass('swipebox');
345
- $(window).trigger('resize'); // fix scroll bar visibility on desktop
346
- this.setSlide(index, true);
347
- },
348
-
349
- preloadImg : function (index){
350
- var $this = this;
351
- setTimeout(function(){
352
- $this.openImg(index);
353
- }, 1000);
354
- },
355
-
356
- openImg : function (index){
357
- var $this = this;
358
- if(index < 0 || index >= $elem.length){
359
- return false;
360
- }
361
-
362
- $this.loadImg($elem.eq(index).attr('href'), function(){
363
- $('#swipebox-slider .slide').eq(index).html(this);
364
- });
365
- },
366
-
367
-
368
- setTitle : function(index, isFirst){
369
- $('#swipebox-caption').empty();
370
-
371
- if($elem.eq(index).attr('title')){
372
- $('#swipebox-caption').append($elem.eq(index).attr('title'));
373
- }
374
- },
375
-
376
- loadImg : function (src, callback){
377
- var img = $('<img>').on('load', function(){
378
- callback.call(img);
379
- });
380
-
381
- img.attr('src',src);
382
- },
383
-
384
- getNext : function (){
385
- var $this = this;
386
- index = $('#swipebox-slider .slide').index($('#swipebox-slider .slide.current'));
387
- if(index+1 < $elem.length){
388
- index++;
389
- $this.setSlide(index);
390
- $this.preloadImg(index+1);
391
- }
392
- else{
393
-
394
- $('#swipebox-slider').addClass('rightSpring');
395
- setTimeout(function(){
396
- $('#swipebox-slider').removeClass('rightSpring');
397
- },500);
398
- }
399
- },
400
-
401
- getPrev : function (){
402
- var $this = this;
403
- index = $('#swipebox-slider .slide').index($('#swipebox-slider .slide.current'));
404
- if(index > 0){
405
- index--;
406
- $this.setSlide(index);
407
- $this.preloadImg(index-1);
408
- }
409
- else{
410
-
411
- $('#swipebox-slider').addClass('leftSpring');
412
- setTimeout(function(){
413
- $('#swipebox-slider').removeClass('leftSpring');
414
- },500);
415
- }
416
- },
417
-
418
-
419
- closeSlide : function (){
420
- var $this = this;
421
- $(window).trigger('resize');
422
- $('html').removeClass('swipebox');
423
- $this.destroy();
424
- },
425
-
426
- destroy : function(){
427
- var $this = this;
428
- $(window).unbind('keyup');
429
- $('body').unbind('touchstart');
430
- $('body').unbind('touchmove');
431
- $('body').unbind('touchend');
432
- $('#swipebox-slider').unbind();
433
- $('#swipebox-overlay').remove();
434
- $elem.removeData('_swipebox');
435
- $this.target.trigger('swipebox-destroy');
436
- }
437
-
438
- }
439
-
440
- plugin.init();
441
-
442
- }
443
-
444
- $.fn.swipebox = function(options){
445
- if (!$.data(this, "_swipebox")) {
446
- var swipebox = new $.swipebox(this, options);
447
- this.data('_swipebox', swipebox);
448
- }
449
- }
450
-
451
- }(window, document, jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/swipebox/source/jquery.swipebox.min.js CHANGED
@@ -8,5 +8,5 @@
8
  * @github https://github.com/arnowelzel/swipebox
9
  * @version 1.2.1
10
  * @license MIT License
11
- */
12
- (function(e,t,n,r){n.swipebox=function(i,s){var o={useCSS:true,initialIndexOnArray:0,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"CCCCCC",beforeOpen:null,afterClose:null},u=this,a=[],i=i,f=i.selector,l=n(f),c=t.createTouch!==r||"ontouchstart"in e||"onmsgesturechange"in e||navigator.msMaxTouchPoints,h=!!e.SVGSVGElement,p=e.innerWidth?e.innerWidth:n(e).width(),d=e.innerHeight?e.innerHeight:n(e).height(),v='<div id="swipebox-overlay"> <div id="swipebox-slider"></div> <div id="swipebox-caption"></div> <div id="swipebox-action"> <a id="swipebox-close"></a> <a id="swipebox-prev"></a> <a id="swipebox-next"></a> </div> </div>';u.settings={};u.init=function(){u.settings=n.extend({},o,s);if(n.isArray(i)){a=i;m.target=n(e);m.init(u.settings.initialIndexOnArray)}else{l.click(function(e){u.refresh();a=[];var t,r,i;if(!i){r="rel";i=n(this).attr(r)}if(i&&i!==""&&i!=="nofollow"){$elem=l.filter("["+r+'="'+i+'"]')}else{$elem=n(f)}$elem.each(function(){var e=null,t=null;if(n(this).attr("title"))e=n(this).attr("title");else if(n(this).children("img").attr("alt"))e=n(this).children("img").attr("alt");if(n(this).attr("href"))t=n(this).attr("href");a.push({href:t,title:e})});t=$elem.index(n(this));e.preventDefault();e.stopPropagation();m.target=n(e.target);m.init(t)})}};u.refresh=function(){if(!n.isArray(i)){m.destroy();$elem=n(f);m.actions()}};var m={init:function(e){if(u.settings.beforeOpen)u.settings.beforeOpen();this.target.trigger("swipebox-start");n.swipebox.isOpen=true;this.build();this.openSlide(e);this.openMedia(e);this.preloadMedia(e+1);this.preloadMedia(e-1)},build:function(){var e=this;n("body").append(v);if(e.doCssTrans()){n("#swipebox-slider").css({"-webkit-transition":"left 0.4s ease","-moz-transition":"left 0.4s ease","-o-transition":"left 0.4s ease","-khtml-transition":"left 0.4s ease",transition:"left 0.4s ease"});n("#swipebox-overlay").css({"-webkit-transition":"opacity 1s ease","-moz-transition":"opacity 1s ease","-o-transition":"opacity 1s ease","-khtml-transition":"opacity 1s ease",transition:"opacity 1s ease"});n("#swipebox-action, #swipebox-caption").css({"-webkit-transition":"0.5s","-moz-transition":"0.5s","-o-transition":"0.5s","-khtml-transition":"0.5s",transition:"0.5s"})}if(h){var t=n("#swipebox-action #swipebox-close").css("background-image");t=t.replace("png","svg");n("#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close").css({"background-image":t})}n.each(a,function(){n("#swipebox-slider").append('<div class="slide"></div>')});e.setDim();e.actions();e.keyboard();e.gesture();e.animBars();e.resize();scrollTimer=setInterval(function(){window.scrollTo(window.scrollX,window.scrollY)},1e3)},setDim:function(){var t,r,i={};if("onorientationchange"in e){e.addEventListener("orientationchange",function(){if(e.orientation==0){t=p;r=d}else if(e.orientation==90||e.orientation==-90){t=d;r=p}},false)}else{t=e.innerWidth?e.innerWidth:n(e).width();r=e.innerHeight?e.innerHeight:n(e).height()}i={width:t,height:r};n("#swipebox-overlay").css(i)},resize:function(){var t=this;n(e).resize(function(){t.setDim()}).resize()},supportTransition:function(){var e="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(var n=0;n<e.length;n++){if(t.createElement("div").style[e[n]]!==r){return e[n]}}return false},doCssTrans:function(){if(u.settings.useCSS&&this.supportTransition()){return true}},gesture:function(){if(c){var e=this,t=null,r=10,i={},s={};var o=n("#swipebox-caption, #swipebox-action");o.addClass("visible-bars");e.setTimeout();n("#swipebox-slider").bind("touchstart",function(e){n(this).addClass("touching");s=e.originalEvent.targetTouches[0];i.pageX=e.originalEvent.targetTouches[0].pageX;n(".touching").bind("touchmove",function(e){e.preventDefault();e.stopPropagation();s=e.originalEvent.targetTouches[0]});return false}).bind("touchend",function(u){u.preventDefault();u.stopPropagation();t=s.pageX-i.pageX;if(t>=r){e.getPrev()}else if(t<=-r){e.getNext()}else{if(!o.hasClass("visible-bars")){e.showBars();e.setTimeout()}else{e.clearTimeout();e.hideBars()}}n(".touching").off("touchmove").removeClass("touching")})}},setTimeout:function(){if(u.settings.hideBarsDelay>0){var t=this;t.clearTimeout();t.timeout=e.setTimeout(function(){t.hideBars()},u.settings.hideBarsDelay)}},clearTimeout:function(){e.clearTimeout(this.timeout);this.timeout=null},showBars:function(){var e=n("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){e.addClass("visible-bars")}else{n("#swipebox-caption").animate({top:0},500);n("#swipebox-action").animate({bottom:0},500);setTimeout(function(){e.addClass("visible-bars")},1e3)}},hideBars:function(){var e=n("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){e.removeClass("visible-bars")}else{n("#swipebox-caption").animate({top:"-50px"},500);n("#swipebox-action").animate({bottom:"-50px"},500);setTimeout(function(){e.removeClass("visible-bars")},1e3)}},animBars:function(){var e=this;var t=n("#swipebox-caption, #swipebox-action");t.addClass("visible-bars");e.setTimeout();n("#swipebox-slider").click(function(n){if(!t.hasClass("visible-bars")){e.showBars();e.setTimeout()}else{e.clearTimeout();e.hideBars()}});n("#swipebox-action").hover(function(){e.showBars();t.addClass("force-visible-bars");e.clearTimeout()},function(){t.removeClass("force-visible-bars");e.setTimeout()})},keyboard:function(){var t=this;n(e).bind("keyup",function(e){e.preventDefault();e.stopPropagation();if(e.keyCode==37){t.getPrev()}else if(e.keyCode==39){t.getNext()}else if(e.keyCode==27){t.closeSlide()}})},actions:function(){var e=this;if(a.length<2){n("#swipebox-prev, #swipebox-next").hide()}else{n("#swipebox-prev").bind("click",function(t){t.preventDefault();t.stopPropagation();e.getPrev();e.setTimeout()});n("#swipebox-next").bind("click",function(t){t.preventDefault();t.stopPropagation();e.getNext();e.setTimeout()})}n("#swipebox-close").bind("click",function(t){e.closeSlide()})},setSlide:function(e,t){t=t||false;var r=n("#swipebox-slider");if(this.doCssTrans()){r.css({left:-e*100+"%"})}else{r.animate({left:-e*100+"%"})}n("#swipebox-slider .slide").removeClass("current");n("#swipebox-slider .slide").eq(e).addClass("current");this.setTitle(e);if(t){r.fadeIn()}n("#swipebox-prev, #swipebox-next").removeClass("disabled");if(e==0){n("#swipebox-prev").addClass("disabled")}else if(e==a.length-1){n("#swipebox-next").addClass("disabled")}},openSlide:function(t){n("html").addClass("swipebox");n(e).trigger("resize");this.setSlide(t,true)},preloadMedia:function(e){var t=this,n=null;if(a[e]!==r)n=a[e].href;if(!t.isVideo(n)){setTimeout(function(){t.openMedia(e)},1e3)}else{t.openMedia(e)}},openMedia:function(e){var t=this,i=null;if(a[e]!==r)i=a[e].href;if(e<0||e>=a.length){return false}if(!t.isVideo(i)){t.loadMedia(i,function(){n("#swipebox-slider .slide").eq(e).html(this)})}else{n("#swipebox-slider .slide").eq(e).html(t.getVideo(i))}},setTitle:function(e,t){var i=null;n("#swipebox-caption").empty();if(a[e]!==r)i=a[e].title;if(i){n("#swipebox-caption").append(i)}},isVideo:function(e){if(e){if(e.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)){return true}}},getVideo:function(e){var t="";var n="";var r=e.match(/watch\?v=([a-zA-Z0-9\-_]+)/);var i=e.match(/vimeo\.com\/([0-9]*)/);if(r){t='<iframe width="560" height="315" src="//www.youtube.com/embed/'+r[1]+'" frameborder="0" allowfullscreen></iframe>'}else if(i){t='<iframe width="560" height="315" src="http://player.vimeo.com/video/'+i[1]+"?byline=0&portrait=0&color="+u.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'}return'<div class="swipebox-video-container" style="max-width:'+u.settings.videoMaxWidth+'px"><div class="swipebox-video">'+t+"</div></div>"},loadMedia:function(e,t){if(!this.isVideo(e)){var r=n("<img>").on("load",function(){t.call(r)});r.attr("src",e)}},getNext:function(){var e=this;index=n("#swipebox-slider .slide").index(n("#swipebox-slider .slide.current"));if(index+1<a.length){index++;e.setSlide(index);e.preloadMedia(index+1)}else{n("#swipebox-slider").addClass("rightSpring");setTimeout(function(){n("#swipebox-slider").removeClass("rightSpring")},500)}},getPrev:function(){index=n("#swipebox-slider .slide").index(n("#swipebox-slider .slide.current"));if(index>0){index--;this.setSlide(index);this.preloadMedia(index-1)}else{n("#swipebox-slider").addClass("leftSpring");setTimeout(function(){n("#swipebox-slider").removeClass("leftSpring")},500)}},closeSlide:function(){n("html").removeClass("swipebox");n(e).trigger("resize");this.destroy()},destroy:function(){n(e).unbind("keyup");n("#swipebox-slider").unbind("touchstart");n("#swipebox-slider").unbind("touchmove");n("#swipebox-slider").unbind("touchend");n("#swipebox-slider").unbind();n("#swipebox-overlay").remove();if(!n.isArray(i))i.removeData("_swipebox");if(this.target)this.target.trigger("swipebox-destroy");n.swipebox.isOpen=false;if(u.settings.afterClose)u.settings.afterClose();scrollTimer=null}};u.init()};n.fn.swipebox=function(e){if(!n.data(this,"_swipebox")){var t=new n.swipebox(this,e);this.data("_swipebox",t)}return this.data("_swipebox")}})(window,document,jQuery)
8
  * @github https://github.com/arnowelzel/swipebox
9
  * @version 1.2.1
10
  * @license MIT License
11
+ */
12
+ ;(function(e,t,n,r){n.swipebox=function(i,s){var o={useCSS:true,initialIndexOnArray:0,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"CCCCCC",beforeOpen:null,afterClose:null},u=this,a=[],i=i,f=i.selector,l=n(f),c=t.createTouch!==r||"ontouchstart"in e||"onmsgesturechange"in e||navigator.msMaxTouchPoints,h=!!e.SVGSVGElement,p=e.innerWidth?e.innerWidth:n(e).width(),d=e.innerHeight?e.innerHeight:n(e).height(),v='<div id="swipebox-overlay"> <div id="swipebox-slider"></div> <div id="swipebox-caption"></div> <div id="swipebox-action"> <a id="swipebox-close"></a> <a id="swipebox-prev"></a> <a id="swipebox-next"></a> </div> </div>';u.settings={};u.init=function(){u.settings=n.extend({},o,s);if(n.isArray(i)){a=i;m.target=n(e);m.init(u.settings.initialIndexOnArray)}else{l.click(function(e){u.refresh();a=[];var t,r,i;if(!i){r="rel";i=n(this).attr(r)}if(i&&i!==""&&i!=="nofollow"){$elem=l.filter("["+r+'="'+i+'"]')}else{$elem=n(f)}$elem.each(function(){var e=null,t=null;if(n(this).attr("title"))e=n(this).attr("title");else if(n(this).children("img").attr("alt"))e=n(this).children("img").attr("alt");if(n(this).attr("href"))t=n(this).attr("href");a.push({href:t,title:e})});t=$elem.index(n(this));e.preventDefault();e.stopPropagation();m.target=n(e.target);m.init(t)})}};u.refresh=function(){if(!n.isArray(i)){m.destroy();$elem=n(f);m.actions()}};var m={init:function(e){if(u.settings.beforeOpen)u.settings.beforeOpen();this.target.trigger("swipebox-start");n.swipebox.isOpen=true;this.build();this.openSlide(e);this.openMedia(e);this.preloadMedia(e+1);this.preloadMedia(e-1)},build:function(){var e=this;n("body").append(v);if(e.doCssTrans()){n("#swipebox-slider").css({"-webkit-transition":"left 0.4s ease","-moz-transition":"left 0.4s ease","-o-transition":"left 0.4s ease","-khtml-transition":"left 0.4s ease",transition:"left 0.4s ease"});n("#swipebox-overlay").css({"-webkit-transition":"opacity 1s ease","-moz-transition":"opacity 1s ease","-o-transition":"opacity 1s ease","-khtml-transition":"opacity 1s ease",transition:"opacity 1s ease"});n("#swipebox-action, #swipebox-caption").css({"-webkit-transition":"0.5s","-moz-transition":"0.5s","-o-transition":"0.5s","-khtml-transition":"0.5s",transition:"0.5s"})}if(h){var t=n("#swipebox-action #swipebox-close").css("background-image");t=t.replace("png","svg");n("#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close").css({"background-image":t})}n.each(a,function(){n("#swipebox-slider").append('<div class="slide"></div>')});e.setDim();e.actions();e.keyboard();e.gesture();e.animBars();e.resize()},setDim:function(){var t,r,i={};if("onorientationchange"in e){e.addEventListener("orientationchange",function(){if(e.orientation==0){t=p;r=d}else if(e.orientation==90||e.orientation==-90){t=d;r=p}},false)}else{t=e.innerWidth?e.innerWidth:n(e).width();r=e.innerHeight?e.innerHeight:n(e).height()}i={width:t,height:r};n("#swipebox-overlay").css(i)},resize:function(){var t=this;n(e).resize(function(){t.setDim()}).resize()},supportTransition:function(){var e="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(var n=0;n<e.length;n++){if(t.createElement("div").style[e[n]]!==r){return e[n]}}return false},doCssTrans:function(){if(u.settings.useCSS&&this.supportTransition()){return true}},gesture:function(){if(c){var e=this,t=null,r=10,i={},s={};var o=n("#swipebox-caption, #swipebox-action");o.addClass("visible-bars");e.setTimeout();n("#swipebox-slider").bind("touchstart",function(e){n(this).addClass("touching");s=e.originalEvent.targetTouches[0];i.pageX=e.originalEvent.targetTouches[0].pageX;n(".touching").bind("touchmove",function(e){e.preventDefault();e.stopPropagation();s=e.originalEvent.targetTouches[0]});return false}).bind("touchend",function(u){u.preventDefault();u.stopPropagation();t=s.pageX-i.pageX;if(t>=r){e.getPrev()}else if(t<=-r){e.getNext()}else{if(!o.hasClass("visible-bars")){e.showBars();e.setTimeout()}else{e.clearTimeout();e.hideBars()}}n(".touching").off("touchmove").removeClass("touching")})}},setTimeout:function(){if(u.settings.hideBarsDelay>0){var t=this;t.clearTimeout();t.timeout=e.setTimeout(function(){t.hideBars()},u.settings.hideBarsDelay)}},clearTimeout:function(){e.clearTimeout(this.timeout);this.timeout=null},showBars:function(){var e=n("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){e.addClass("visible-bars")}else{n("#swipebox-caption").animate({top:0},500);n("#swipebox-action").animate({bottom:0},500);setTimeout(function(){e.addClass("visible-bars")},1e3)}},hideBars:function(){var e=n("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){e.removeClass("visible-bars")}else{n("#swipebox-caption").animate({top:"-50px"},500);n("#swipebox-action").animate({bottom:"-50px"},500);setTimeout(function(){e.removeClass("visible-bars")},1e3)}},animBars:function(){var e=this;var t=n("#swipebox-caption, #swipebox-action");t.addClass("visible-bars");e.setTimeout();n("#swipebox-slider").click(function(n){if(!t.hasClass("visible-bars")){e.showBars();e.setTimeout()}else{e.clearTimeout();e.hideBars()}});n("#swipebox-action").hover(function(){e.showBars();t.addClass("force-visible-bars");e.clearTimeout()},function(){t.removeClass("force-visible-bars");e.setTimeout()})},keyboard:function(){var t=this;n(e).bind("keyup",function(e){e.preventDefault();e.stopPropagation();if(e.keyCode==37){t.getPrev()}else if(e.keyCode==39){t.getNext()}else if(e.keyCode==27){t.closeSlide()}})},actions:function(){var e=this;if(a.length<2){n("#swipebox-prev, #swipebox-next").hide()}else{n("#swipebox-prev").bind("click",function(t){t.preventDefault();t.stopPropagation();e.getPrev();e.setTimeout()});n("#swipebox-next").bind("click",function(t){t.preventDefault();t.stopPropagation();e.getNext();e.setTimeout()})}n("#swipebox-close").bind("click",function(t){e.closeSlide()})},setSlide:function(e,t){t=t||false;var r=n("#swipebox-slider");if(this.doCssTrans()){r.css({left:-e*100+"%"})}else{r.animate({left:-e*100+"%"})}n("#swipebox-slider .slide").removeClass("current");n("#swipebox-slider .slide").eq(e).addClass("current");this.setTitle(e);if(t){r.fadeIn()}n("#swipebox-prev, #swipebox-next").removeClass("disabled");if(e==0){n("#swipebox-prev").addClass("disabled")}else if(e==a.length-1){n("#swipebox-next").addClass("disabled")}},openSlide:function(t){n("html").addClass("swipebox");n(e).trigger("resize");this.setSlide(t,true)},preloadMedia:function(e){var t=this,n=null;if(a[e]!==r)n=a[e].href;if(!t.isVideo(n)){setTimeout(function(){t.openMedia(e)},1e3)}else{t.openMedia(e)}},openMedia:function(e){var t=this,i=null;if(a[e]!==r)i=a[e].href;if(e<0||e>=a.length){return false}if(!t.isVideo(i)){t.loadMedia(i,function(){n("#swipebox-slider .slide").eq(e).html(this)})}else{n("#swipebox-slider .slide").eq(e).html(t.getVideo(i))}},setTitle:function(e,t){var i=null;n("#swipebox-caption").empty();if(a[e]!==r)i=a[e].title;if(i){n("#swipebox-caption").append(i)}},isVideo:function(e){if(e){if(e.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)){return true}}},getVideo:function(e){var t="";var n="";var r=e.match(/watch\?v=([a-zA-Z0-9\-_]+)/);var i=e.match(/vimeo\.com\/([0-9]*)/);if(r){t='<iframe width="560" height="315" src="//www.youtube.com/embed/'+r[1]+'" frameborder="0" allowfullscreen></iframe>'}else if(i){t='<iframe width="560" height="315" src="http://player.vimeo.com/video/'+i[1]+"?byline=0&portrait=0&color="+u.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'}return'<div class="swipebox-video-container" style="max-width:'+u.settings.videoMaxWidth+'px"><div class="swipebox-video">'+t+"</div></div>"},loadMedia:function(e,t){if(!this.isVideo(e)){var r=n("<img>").on("load",function(){t.call(r)});r.attr("src",e)}},getNext:function(){var e=this;index=n("#swipebox-slider .slide").index(n("#swipebox-slider .slide.current"));if(index+1<a.length){index++;e.setSlide(index);e.preloadMedia(index+1)}else{n("#swipebox-slider").addClass("rightSpring");setTimeout(function(){n("#swipebox-slider").removeClass("rightSpring")},500)}},getPrev:function(){index=n("#swipebox-slider .slide").index(n("#swipebox-slider .slide.current"));if(index>0){index--;this.setSlide(index);this.preloadMedia(index-1)}else{n("#swipebox-slider").addClass("leftSpring");setTimeout(function(){n("#swipebox-slider").removeClass("leftSpring")},500)}},closeSlide:function(){n("html").removeClass("swipebox");n(e).trigger("resize");this.destroy()},destroy:function(){n(e).unbind("keyup");n("#swipebox-slider").unbind("touchstart");n("#swipebox-slider").unbind("touchmove");n("#swipebox-slider").unbind("touchend");n("#swipebox-slider").unbind();n("#swipebox-overlay").remove();if(!n.isArray(i))i.removeData("_swipebox");if(this.target)this.target.trigger("swipebox-destroy");n.swipebox.isOpen=false;if(u.settings.afterClose)u.settings.afterClose()}};u.init()};n.fn.swipebox=function(e){if(!n.data(this,"_swipebox")){var t=new n.swipebox(this,e);this.data("_swipebox",t)}return this.data("_swipebox")}})(window,document,jQuery)
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.dfactory.eu/
4
  Tags: gallery, images, lightbox, links, photos, template, theme, photo, image, picture, slideshow, modal, overlay, YouTube, Vimeo, video, videos
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
- Stable tag: 1.4.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -60,6 +60,9 @@ No questions yet.
60
 
61
  == Changelog ==
62
 
 
 
 
63
  = 1.4.1 =
64
  * Fix: Swipebox script files inconsistency
65
 
@@ -144,5 +147,5 @@ Initial release
144
 
145
  == Upgrade Notice ==
146
 
147
- = 1.4.1 =
148
- * Fix: Swipebox script files inconsistency
4
  Tags: gallery, images, lightbox, links, photos, template, theme, photo, image, picture, slideshow, modal, overlay, YouTube, Vimeo, video, videos
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.4.2
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
60
 
61
  == Changelog ==
62
 
63
+ = 1.4.2 =
64
+ * Fix: Final fix for IE scroll bug
65
+
66
  = 1.4.1 =
67
  * Fix: Swipebox script files inconsistency
68
 
147
 
148
  == Upgrade Notice ==
149
 
150
+ = 1.4.2 =
151
+ * Fix: Final fix for IE scroll bug
responsive-lightbox.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Responsive Lightbox
4
  Description: Responsive Lightbox allows users to view larger versions of images and galleries in a lightbox (overlay) effect optimized for mobile devices.
5
- Version: 1.4.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
@@ -109,7 +109,7 @@ class Responsive_Lightbox
109
  'quit_on_document_click' => true
110
  )
111
  ),
112
- 'version' => '1.4.1'
113
  );
114
  private $scripts = array();
115
  private $options = array();
2
  /*
3
  Plugin Name: Responsive Lightbox
4
  Description: Responsive Lightbox allows users to view larger versions of images and galleries in a lightbox (overlay) effect optimized for mobile devices.
5
+ Version: 1.4.2
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
109
  'quit_on_document_click' => true
110
  )
111
  ),
112
+ 'version' => '1.4.2'
113
  );
114
  private $scripts = array();
115
  private $options = array();