Responsive Lightbox & Gallery - Version 1.7.1

Version Description

  • New: Tos "R" Us overlay close option
  • Fix: License activation issues
  • Tweak: Featherlight script update to 1.7.0
  • Tweak: Imagelightbox script update
Download this release

Release Info

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

Code changes from version 1.7.0 to 1.7.1

assets/featherlight/featherlight.gallery.min.css CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
- * Version 1.5.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- @media all{.featherlight-next,.featherlight-previous{display:block;position:absolute;top:25px;right:25px;bottom:0;left:80%;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:rgba(0,0,0,0)}.featherlight-previous{left:25px;right:80%}.featherlight-next:hover,.featherlight-previous:hover{background:rgba(255,255,255,.25)}.featherlight-next span,.featherlight-previous span{display:none;position:absolute;top:50%;left:5%;width:82%;text-align:center;font-size:80px;line-height:80px;margin-top:-40px;text-shadow:0 0 5px #fff;color:#fff;font-style:normal;font-weight:400}.featherlight-next span{right:5%;left:auto}.featherlight-next:hover span,.featherlight-previous:hover span{display:inline-block}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous{display:none}}@media only screen and (max-device-width:1024px){.featherlight-next:hover,.featherlight-previous:hover{background:0 0}.featherlight-next span,.featherlight-previous span{display:block}}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}.featherlight-previous{left:10px;right:85%}.featherlight-next span,.featherlight-previous span{margin-top:-30px;font-size:40px}}
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ @media all{.featherlight-next,.featherlight-previous{display:block;position:absolute;top:25px;right:25px;bottom:0;left:80%;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:rgba(0,0,0,0)}.featherlight-previous{left:25px;right:80%}.featherlight-next:hover,.featherlight-previous:hover{background:rgba(255,255,255,.25)}.featherlight-next span,.featherlight-previous span{display:none;position:absolute;top:50%;left:5%;width:82%;text-align:center;font-size:80px;line-height:80px;margin-top:-40px;text-shadow:0 0 5px #fff;color:#fff;font-style:normal;font-weight:400}.featherlight-next span{right:5%;left:auto}.featherlight-next:hover span,.featherlight-previous:hover span{display:inline-block}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous,.featherlight-swipe-aware .featherlight-next,.featherlight-swipe-aware .featherlight-previous{display:none}}@media only screen and (max-device-width:1024px){.featherlight-next:hover,.featherlight-previous:hover{background:0 0}.featherlight-next span,.featherlight-previous span{display:block}}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}.featherlight-previous{left:10px;right:85%}.featherlight-next span,.featherlight-previous span{margin-top:-30px;font-size:40px}}
assets/featherlight/featherlight.gallery.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
- * Version 1.5.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
- **/!function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g?c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}):c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},beforeContent:function(a,b){var c=this.currentNavigation(),d=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===c).toggleClass(this.namespace+"-last-slide",c===d-1),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(){a(this).trigger(b+"."+c.namespace)})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a)},a(document).ready(function(){b._onReady()})}(jQuery);
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
+ **/!function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g&&(c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}),c.$instance.addClass(this.namespace+"-swipe-aware",g)),c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},beforeContent:function(a,b){var c=this.currentNavigation(),d=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===c).toggleClass(this.namespace+"-last-slide",c===d-1),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(){a(this).trigger(b+"."+c.namespace)})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a)},a(document).ready(function(){b._onReady()})}(jQuery);
assets/featherlight/featherlight.min.css CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.5.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- @media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:10px;margin-right:10px;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ @media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch;overflow-y:scroll}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
assets/featherlight/featherlight.min.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.5.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
- !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var c=[],d=function(b){return c=a.grep(c,function(a){return a!==b&&a.$instance.closest("body").length>0})},e=function(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c},f={keyup:"onKeyUp",resize:"onResize"},g=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[f[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},h=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(f,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,g)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<span class="'+e+"-close-icon "+d.namespace+'-close">',d.closeIcon,"</span>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var d=this;if(d.$instance.hide().appendTo(d.root),!(b&&b.isDefaultPrevented()||d.beforeOpen(b)===!1)){b&&b.preventDefault();var e=d.getContent();if(e)return c.push(d),h(!0),d.$instance.fadeIn(d.openSpeed),d.beforeContent(b),a.when(e).always(function(a){d.setContent(a),d.afterContent(b)}).then(d.$instance.promise()).done(function(){d.afterOpen(b)})}return d.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,e=a.Deferred();return c.beforeClose(b)===!1?e.reject():(0===d(c).length&&h(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),e.resolve()})),e.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(parseInt(this.$content.parent().css("width"),10)-1),b/(parseInt(this.$content.parent().css("height"),10)-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var c=new a.Deferred,d=a("<iframe/>").hide().attr("src",b).css(e(this,"iframe")).on("load",function(){c.resolve(d.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return c.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=a.parseJSON(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d);return b.on(h.openTrigger+"."+h.namespace,h.filter,function(g){var i=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],h.namespace),e.readElementConfig(this,h.namespace),d),j=f||a(this).data("featherlight-persisted")||new e(c,i);"shared"===j.persist?f=j:j.persist!==!1&&a(this).data("featherlight-persisted",j),i.$currentTarget.blur(),j.open(g)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return d(),a.grep(c,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;b.autoBind&&(a(b.autoBind).each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(c){c.isDefaultPrevented()||"featherlight"===c.namespace||(c.preventDefault(),b.attach(a(c.currentTarget)),a(c.target).trigger("click.featherlight"))}))},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery);
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.0 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2016, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
7
  **/
8
+ !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,name:1,referrerpolicy:1,scrolling:1,sandbox:1,src:1,srcdoc:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(parseInt(this.$content.parent().css("width"),10)-1),b/(parseInt(this.$content.parent().css("height"),10)-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d);return b.on(h.openTrigger+"."+h.namespace,h.filter,function(g){var i=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],h.namespace),e.readElementConfig(this,h.namespace),d),j=f||a(this).data("featherlight-persisted")||new e(c,i);"shared"===j.persist?f=j:j.persist!==!1&&a(this).data("featherlight-persisted",j),i.$currentTarget.blur(),j.open(g)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;b.autoBind&&(a(b.autoBind).each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(c){c.isDefaultPrevented()||"featherlight"===c.namespace||(c.preventDefault(),b.attach(a(c.currentTarget)),a(c.target).trigger("click.featherlight"))}))},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur(),b(c)},afterClose:function(b,c){var d=b(c),e=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",e._previousWithTabIndices[b])}),this._previouslyActive.focus(),d},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery);
assets/imagelightbox/js/imagelightbox.min.js CHANGED
@@ -3,4 +3,4 @@
3
  Available for use under the MIT License
4
  */
5
 
6
- !function(n,t,e,i){"use strict";var o=function(){var n=e.body||e.documentElement,n=n.style;return""==n.WebkitTransition?"-webkit-":""==n.MozTransition?"-moz-":""==n.OTransition?"-o-":""==n.transition?"":!1},r=o()===!1?!1:!0,a=function(n,t,e){var i={},r=o();i[r+"transform"]="translateX("+t+")",i[r+"transition"]=r+"transform "+e+"s linear",n.css(i)},u="ontouchstart"in t,d=t.navigator.pointerEnabled||t.navigator.msPointerEnabled,c=function(n){if(u)return!0;if(!d||"undefined"==typeof n||"undefined"==typeof n.pointerType)return!1;if("undefined"!=typeof n.MSPOINTER_TYPE_MOUSE){if(n.MSPOINTER_TYPE_MOUSE!=n.pointerType)return!0}else if("mouse"!=n.pointerType)return!0;return!1};n.fn.imageLightbox=function(i){var i=n.extend({selector:'id="imagelightbox"',animationSpeed:250,preloadNext:!0,enableKeyboard:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0,onStart:!1,onEnd:!1,onLoadStart:!1,onLoadEnd:!1},i),o=n([]),f=n(),l=n(),p=0,g=0,s=0,h=!1,m=function(){if(!l.length)return!0;var e=.8*n(t).width(),i=.9*n(t).height(),o=new Image;o.src=l.attr("src"),o.onload=function(){if(p=o.width,g=o.height,p>e||g>i){var r=p/g>e/i?p/e:g/i;p/=r,g/=r}l.css({width:p+"px",height:g+"px",top:(n(t).height()-g)/2+"px",left:(n(t).width()-p)/2+"px"})}},v=function(t){if(h)return!1;if(t="undefined"==typeof t?!1:"left"==t?1:-1,l.length){if(t!==!1&&(o.length<2||i.quitOnEnd===!0&&(-1===t&&0==o.index(f)||1===t&&o.index(f)==o.length-1)))return E(),!1;var e={opacity:0};r?a(l,100*t-s+"px",i.animationSpeed/1e3):e.left=parseInt(l.css("left"))+100*t+"px",l.animate(e,i.animationSpeed,function(){x()}),s=0}h=!0,i.onLoadStart!==!1&&i.onLoadStart(),setTimeout(function(){l=n("<img "+i.selector+" />").attr("src",f.attr("href")).on("load",function(){l.appendTo("body"),m();var e={opacity:1};if(l.css("opacity",0),r)a(l,-100*t+"px",0),setTimeout(function(){a(l,"0px",i.animationSpeed/1e3)},50);else{var u=parseInt(l.css("left"));e.left=u+"px",l.css("left",u-100*t+"px")}if(l.animate(e,i.animationSpeed,function(){h=!1,i.onLoadEnd!==!1&&i.onLoadEnd()}),i.preloadNext){var d=o.eq(o.index(f)+1);d.length||(d=o.eq(0)),n("<img />").attr("src",d.attr("href"))}}).on("error",function(){i.onLoadEnd!==!1&&i.onLoadEnd()});var e=0,u=0,g=0;l.on(d?"pointerup MSPointerUp":"click",function(n){if(n.preventDefault(),i.quitOnImgClick)return E(),!1;if(c(n.originalEvent))return!0;var t=(n.pageX||n.originalEvent.pageX)-n.target.offsetLeft;f=o.eq(o.index(f)-(p/2>t?1:-1)),f.length||(f=o.eq(p/2>t?o.length:0)),v(p/2>t?"left":"right")}).on("touchstart pointerdown MSPointerDown",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:(r&&(g=parseInt(l.css("left"))),void(e=n.originalEvent.pageX||n.originalEvent.touches[0].pageX))}).on("touchmove pointermove MSPointerMove",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:(n.preventDefault(),u=n.originalEvent.pageX||n.originalEvent.touches[0].pageX,s=e-u,void(r?a(l,-s+"px",0):l.css("left",g-s+"px")))}).on("touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel",function(n){return!c(n.originalEvent)||i.quitOnImgClick?!0:void(Math.abs(s)>50?(f=o.eq(o.index(f)-(0>s?1:-1)),f.length||(f=o.eq(0>s?o.length:0)),v(s>0?"right":"left")):r?a(l,"0px",i.animationSpeed/1e3):l.animate({left:g+"px"},i.animationSpeed/2))})},i.animationSpeed+100)},x=function(){return l.length?(l.remove(),void(l=n())):!1},E=function(){return l.length?void l.animate({opacity:0},i.animationSpeed,function(){x(),h=!1,i.onEnd!==!1&&i.onEnd()}):!1},y=function(t){t.each(function(){o=o.add(n(this))}),t.on("click.imageLightbox",function(t){return t.preventDefault(),h?!1:(h=!1,i.onStart!==!1&&i.onStart(),f=n(this),void v())})};return n(t).on("resize",m),i.quitOnDocClick&&n(e).on(u?"touchend":"click",function(t){l.length&&!n(t.target).is(l)&&E()}),i.enableKeyboard&&n(e).on("keyup",function(n){return l.length?(n.preventDefault(),27==n.keyCode&&E(),void((37==n.keyCode||39==n.keyCode)&&(f=o.eq(o.index(f)-(37==n.keyCode?1:-1)),f.length||(f=o.eq(37==n.keyCode?o.length:0)),v(37==n.keyCode?"left":"right")))):!0}),y(n(this)),this.switchImageLightbox=function(n){var t=o.eq(n);if(t.length){var e=o.index(f);f=t,v(e>n?"left":"right")}return this},this.addToImageLightbox=function(n){y(n)},this.quitImageLightbox=function(){return E(),this},this}}(jQuery,window,document);
3
  Available for use under the MIT License
4
  */
5
 
6
+ ;(function(e,t,n,r){"use strict";var i=function(){var e=n.body||n.documentElement,e=e.style;if(e.WebkitTransition=="")return"-webkit-";if(e.MozTransition=="")return"-moz-";if(e.OTransition=="")return"-o-";if(e.transition=="")return"";return false},s=i()===false?false:true,o=function(e,t,n){var r={},s=i();r[s+"transform"]="translateX("+t+")";r[s+"transition"]=s+"transform "+n+"s linear";e.css(r)},u="ontouchstart"in t,a=t.navigator.pointerEnabled||t.navigator.msPointerEnabled,f=function(e){if(u)return true;if(!a||typeof e==="undefined"||typeof e.pointerType==="undefined")return false;if(typeof e.MSPOINTER_TYPE_MOUSE!=="undefined"){if(e.MSPOINTER_TYPE_MOUSE!=e.pointerType)return true}else if(e.pointerType!="mouse")return true;return false};e.fn.imageLightbox=function(r){var r=e.extend({selector:'id="imagelightbox"',allowedTypes:"png|jpg|jpeg|gif",animationSpeed:250,preloadNext:true,enableKeyboard:true,quitOnEnd:false,quitOnImgClick:false,quitOnDocClick:true,onStart:false,onEnd:false,onLoadStart:false,onLoadEnd:false},r),i=e([]),l=e(),c=e(),h=0,p=0,d=0,v=false,m=function(t){return e(t).prop("tagName").toLowerCase()=="a"&&(new RegExp(".("+r.allowedTypes+")$","i")).test(e(t).attr("href"))},g=function(){if(!c.length)return true;var n=e(t).width()*.8,r=e(t).height()*.9,i=new Image;i.src=c.attr("src");i.onload=function(){h=i.width;p=i.height;if(h>n||p>r){var s=h/p>n/r?h/n:p/r;h/=s;p/=s}c.css({width:h+"px",height:p+"px",top:(e(t).height()-p)/2+"px",left:(e(t).width()-h)/2+"px"})}},y=function(t){if(v)return false;t=typeof t==="undefined"?false:t=="left"?1:-1;if(c.length){if(t!==false&&(i.length<2||r.quitOnEnd===true&&(t===-1&&i.index(l)==0||t===1&&i.index(l)==i.length-1))){w();return false}var n={opacity:0};if(s)o(c,100*t-d+"px",r.animationSpeed/1e3);else n.left=parseInt(c.css("left"))+100*t+"px";c.animate(n,r.animationSpeed,function(){b()});d=0}v=true;if(r.onLoadStart!==false)r.onLoadStart();setTimeout(function(){c=e("<img "+r.selector+" />").attr("src",l.attr("href")).load(function(){c.appendTo("body");g();var n={opacity:1};c.css("opacity",0);if(s){o(c,-100*t+"px",0);setTimeout(function(){o(c,0+"px",r.animationSpeed/1e3)},50)}else{var u=parseInt(c.css("left"));n.left=u+"px";c.css("left",u-100*t+"px")}c.animate(n,r.animationSpeed,function(){v=false;if(r.onLoadEnd!==false)r.onLoadEnd()});if(r.preloadNext){var a=i.eq(i.index(l)+1);if(!a.length)a=i.eq(0);e("<img />").attr("src",a.attr("href")).load()}}).error(function(){if(r.onLoadEnd!==false)r.onLoadEnd()});var n=0,u=0,p=0;c.on(a?"pointerup MSPointerUp":"click",function(e){e.preventDefault();if(r.quitOnImgClick){w();return false}if(f(e.originalEvent))return true;var t=(e.pageX||e.originalEvent.pageX)-e.target.offsetLeft;l=i.eq(i.index(l)-(h/2>t?1:-1));if(!l.length)l=i.eq(h/2>t?i.length:0);y(h/2>t?"left":"right")}).on("touchstart pointerdown MSPointerDown",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;if(s)p=parseInt(c.css("left"));n=e.originalEvent.pageX||e.originalEvent.touches[0].pageX}).on("touchmove pointermove MSPointerMove",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;e.preventDefault();u=e.originalEvent.pageX||e.originalEvent.touches[0].pageX;d=n-u;if(s)o(c,-d+"px",0);else c.css("left",p-d+"px")}).on("touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel",function(e){if(!f(e.originalEvent)||r.quitOnImgClick)return true;if(Math.abs(d)>50){l=i.eq(i.index(l)-(d<0?1:-1));if(!l.length)l=i.eq(d<0?i.length:0);y(d>0?"right":"left")}else{if(s)o(c,0+"px",r.animationSpeed/1e3);else c.animate({left:p+"px"},r.animationSpeed/2)}})},r.animationSpeed+100)},b=function(){if(!c.length)return false;c.remove();c=e()},w=function(){if(!c.length)return false;c.animate({opacity:0},r.animationSpeed,function(){b();v=false;if(r.onEnd!==false)r.onEnd()})};e(t).on("resize",g);if(r.quitOnDocClick){e(n).on(u?"touchend":"click",function(t){if(c.length&&!e(t.target).is(c))w()})}if(r.enableKeyboard){e(n).on("keyup",function(e){if(!c.length)return true;e.preventDefault();if(e.keyCode==27)w();if(e.keyCode==37||e.keyCode==39){l=i.eq(i.index(l)-(e.keyCode==37?1:-1));if(!l.length)l=i.eq(e.keyCode==37?i.length:0);y(e.keyCode==37?"left":"right")}})}e(n).on("click",this.selector,function(t){if(!m(this))return true;t.preventDefault();if(v)return false;v=false;if(r.onStart!==false)r.onStart();l=e(this);y()});this.each(function(){if(!m(this))return true;i=i.add(e(this))});this.switchImageLightbox=function(e){var t=i.eq(e);if(t.length){var n=i.index(l);l=t;y(e<n?"left":"right")}return this};this.quitImageLightbox=function(){w();return this};return this}})(jQuery,window,document);
includes/class-settings.php CHANGED
@@ -978,6 +978,13 @@ class Responsive_Lightbox_Settings {
978
  'parent' => 'tosrus'
979
  )
980
  )
 
 
 
 
 
 
 
981
  )
982
  );
983
 
@@ -1620,6 +1627,7 @@ class Responsive_Lightbox_Settings {
1620
  // save settings
1621
  if ( isset( $_POST['save_rl_licenses'] ) ) {
1622
  $licenses = get_option( 'responsive_lightbox_licenses' );
 
1623
 
1624
  foreach ( $extensions as $extension ) {
1625
  if ( ! isset( $_POST['responsive_lightbox_licenses'][$extension['id']] ) )
@@ -1636,13 +1644,11 @@ class Responsive_Lightbox_Settings {
1636
  );
1637
  // request
1638
  $response = $this->license_request( $request_args );
1639
-
1640
- echo '<pre>'; print_r( $response ); echo '</pre>';
1641
 
1642
  // validate request
1643
  if ( is_wp_error( $response ) ) {
1644
  $input[$extension['id']['status']] = false;
1645
- add_settings_error( 'rl_licenses_settings', 'license_activation_failed', __( 'License activation failed.', 'responsive-lightbox' ), 'error' );
1646
  } else {
1647
  // decode the license data
1648
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
@@ -1651,22 +1657,32 @@ class Responsive_Lightbox_Settings {
1651
  if ( $license_data->license == 'valid' ) {
1652
  $input[$extension['id']]['status'] = true;
1653
 
1654
- if ( $status === false )
1655
- add_settings_error( 'rl_licenses_settings', 'license_activated', __( 'License successfully activated.', 'responsive-lightbox' ), 'updated' );
 
1656
  } else {
1657
  $input[$extension['id']]['status'] = false;
1658
- add_settings_error( 'rl_licenses_settings', 'license_activation_failed', __( 'License activation failed.', 'responsive-lightbox' ), 'error' );
1659
  }
1660
  }
1661
  }
 
 
 
 
 
 
 
 
1662
  } elseif ( isset( $_POST['reset_rl_licenses'] ) ) {
1663
  $licenses = get_option( 'responsive_lightbox_licenses' );
 
1664
 
1665
  foreach ( $extensions as $extension ) {
1666
  $license = ! empty( $licenses ) && isset( $licenses[$extension['id']]['license'] ) ? $licenses[$extension['id']]['license'] : '';
1667
  $status = ! empty( $licenses ) && ! empty( $licenses[$extension['id']]['status'] ) ? true : false;
1668
 
1669
- if ( $status === true ) {
1670
  // request data
1671
  $request_args = array(
1672
  'action' => 'deactivate_license',
@@ -1675,12 +1691,10 @@ class Responsive_Lightbox_Settings {
1675
  );
1676
  // request
1677
  $response = $this->license_request( $request_args );
1678
-
1679
- // echo '<pre>'; print_r( $response ); echo '</pre>';
1680
 
1681
  // validate request
1682
  if ( is_wp_error( $response ) ) {
1683
- add_settings_error( 'rl_licenses_settings', 'license_activation_failed', __( 'License activation failed.', 'responsive-lightbox' ), 'error' );
1684
  } else {
1685
  // decode the license data
1686
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
@@ -1689,13 +1703,21 @@ class Responsive_Lightbox_Settings {
1689
  if ( $license_data->license == 'deactivated' ) {
1690
  $input[$extension['id']]['license'] = '';
1691
  $input[$extension['id']]['status'] = false;
1692
- add_settings_error( 'rl_licenses_settings', 'license_deactivated', __( 'License successfully deactivated.', 'responsive-lightbox' ), 'updated' );
1693
  } else {
1694
- add_settings_error( 'rl_licenses_settings', 'license_deactivation_failed', __( 'License activation failed.', 'responsive-lightbox' ), 'error' );
1695
  }
1696
  }
1697
  }
1698
  }
 
 
 
 
 
 
 
 
1699
  }
1700
 
1701
  return $input;
@@ -1715,7 +1737,7 @@ class Responsive_Lightbox_Settings {
1715
  'item_name' => urlencode( $args['item_name'] ),
1716
  // 'item_id' => $args['item_id'],
1717
  'url' => home_url(),
1718
- 'timeout' => 15,
1719
  'sslverify' => false
1720
  );
1721
  // call the custom API.
978
  'parent' => 'tosrus'
979
  )
980
  )
981
+ ),
982
+ 'close_on_click' => array(
983
+ 'title' => __( 'Overlay close', 'responsive-lightbox' ),
984
+ 'section' => 'responsive_lightbox_configuration',
985
+ 'type' => 'boolean',
986
+ 'label' => __( 'Enable to close lightbox on overlay click.', 'responsive-lightbox' ),
987
+ 'parent' => 'tosrus'
988
  )
989
  );
990
 
1627
  // save settings
1628
  if ( isset( $_POST['save_rl_licenses'] ) ) {
1629
  $licenses = get_option( 'responsive_lightbox_licenses' );
1630
+ $statuses = array( 'updated' => 0, 'error' => 0 );
1631
 
1632
  foreach ( $extensions as $extension ) {
1633
  if ( ! isset( $_POST['responsive_lightbox_licenses'][$extension['id']] ) )
1644
  );
1645
  // request
1646
  $response = $this->license_request( $request_args );
 
 
1647
 
1648
  // validate request
1649
  if ( is_wp_error( $response ) ) {
1650
  $input[$extension['id']['status']] = false;
1651
+ $statuses['error']++;
1652
  } else {
1653
  // decode the license data
1654
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
1657
  if ( $license_data->license == 'valid' ) {
1658
  $input[$extension['id']]['status'] = true;
1659
 
1660
+ if ( $status === false ) {
1661
+ $statuses['updated']++;
1662
+ }
1663
  } else {
1664
  $input[$extension['id']]['status'] = false;
1665
+ $statuses['error']++;
1666
  }
1667
  }
1668
  }
1669
+
1670
+ // success notice
1671
+ if ( $statuses['updated'] > 0 )
1672
+ add_settings_error( 'rl_licenses_settings', 'license_activated', sprintf( _n( '%s license successfully activated.', '%s licenses successfully activated.', (int) $statuses['updated'], 'responsive-lightbox' ), (int) $statuses['updated'] ), 'updated' );
1673
+ // failed notice
1674
+ if ( $statuses['error'] > 0 )
1675
+ add_settings_error( 'rl_licenses_settings', 'license_activation_failed', sprintf( _n( '%s license activation failed.', '%s licenses activation failed.', (int) $statuses['error'], 'responsive-lightbox' ), (int) $statuses['error'] ), 'error' );
1676
+
1677
  } elseif ( isset( $_POST['reset_rl_licenses'] ) ) {
1678
  $licenses = get_option( 'responsive_lightbox_licenses' );
1679
+ $statuses = array( 'updated' => 0, 'error' => 0 );
1680
 
1681
  foreach ( $extensions as $extension ) {
1682
  $license = ! empty( $licenses ) && isset( $licenses[$extension['id']]['license'] ) ? $licenses[$extension['id']]['license'] : '';
1683
  $status = ! empty( $licenses ) && ! empty( $licenses[$extension['id']]['status'] ) ? true : false;
1684
 
1685
+ if ( $status === true || ( $status === false && ! empty( $license ) ) ) {
1686
  // request data
1687
  $request_args = array(
1688
  'action' => 'deactivate_license',
1691
  );
1692
  // request
1693
  $response = $this->license_request( $request_args );
 
 
1694
 
1695
  // validate request
1696
  if ( is_wp_error( $response ) ) {
1697
+ $statuses['error']++;
1698
  } else {
1699
  // decode the license data
1700
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
1703
  if ( $license_data->license == 'deactivated' ) {
1704
  $input[$extension['id']]['license'] = '';
1705
  $input[$extension['id']]['status'] = false;
1706
+ $statuses['updated']++;
1707
  } else {
1708
+ $statuses['error']++;
1709
  }
1710
  }
1711
  }
1712
  }
1713
+
1714
+ // success notice
1715
+ if ( $statuses['updated'] > 0 )
1716
+ add_settings_error( 'rl_licenses_settings', 'license_deactivated', sprintf( _n( '%s license successfully deactivated.', '%s licenses successfully deactivated.', (int) $statuses['updated'], 'responsive-lightbox' ), (int) $statuses['updated'] ), 'updated' );
1717
+ // failed notice
1718
+ if ( $statuses['error'] > 0 )
1719
+ add_settings_error( 'rl_licenses_settings', 'license_deactivation_failed', sprintf( _n( '%s license deactivation failed.', '%s licenses deactivation failed.', (int) $statuses['error'], 'responsive-lightbox' ), (int) $statuses['error'] ), 'error' );
1720
+
1721
  }
1722
 
1723
  return $input;
1737
  'item_name' => urlencode( $args['item_name'] ),
1738
  // 'item_id' => $args['item_id'],
1739
  'url' => home_url(),
1740
+ 'timeout' => 60,
1741
  'sslverify' => false
1742
  );
1743
  // call the custom API.
js/front.js CHANGED
@@ -1,570 +1,573 @@
1
  ( function ( $ ) {
2
 
3
- $( document ).on( 'ready' + rlArgs.customEvents, function () {
4
-
5
- // initialise event
6
- $.event.trigger( {
7
- type: 'doResponsiveLightbox',
8
- script: rlArgs.script,
9
- selector: rlArgs.selector,
10
- args: rlArgs
11
- } );
12
- } );
13
-
14
- // this is similar to the WP function add_action();
15
- $( document ).on( 'doResponsiveLightbox', function ( event ) {
16
-
17
- var script = event.script,
18
- selector = event.selector,
19
- args = event.args;
20
-
21
- if ( typeof script === 'undefined' || typeof selector === 'undefined' ) {
22
- return false;
23
- }
24
-
25
- var observe_script_dom = ( function () {
26
- var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
27
- eventListenerSupported = window.addEventListener;
28
-
29
- return function ( obj, only_added, callback ) {
30
- if ( MutationObserver ) {
31
- // define a new observer
32
- var obs = new MutationObserver( function ( mutations, observer ) {
33
- if ( only_added ) {
34
- if ( mutations[0].addedNodes.length )
35
- callback();
36
- } else {
37
- if ( mutations[0].addedNodes.length || mutations[0].removedNodes.length )
38
- callback();
39
- }
40
- } );
41
-
42
- // have the observer observe for changes in children
43
- obs.observe( obj, { childList: true, subtree: true } );
44
- } else if ( eventListenerSupported ) {
45
- obj.addEventListener( 'DOMNodeInserted', callback, false );
46
-
47
- if ( !only_added ) {
48
- obj.addEventListener( 'DOMNodeRemoved', callback, false );
49
- }
50
- }
51
- }
52
- } )();
53
-
54
- rl_view_image = function ( script, url ) {
55
- $.event.trigger( {
56
- type: 'doLightboxViewImage',
57
- script: script,
58
- url: url
59
- } );
60
- }
61
-
62
- rl_hide_image = function ( script, url ) {
63
- $.event.trigger( {
64
- type: 'doLightboxHideImage',
65
- script: script,
66
- url: url
67
- } );
68
- }
69
-
70
- // WooCommerce 3.0+ compatibility
71
- setTimeout( function() {
72
- var flex = $( '.flex-viewport' );
73
-
74
- if ( rlArgs.woocommerce_gallery === '1' && flex.length ) {
75
- $( '.zoomImg' ).css( 'cursor', 'pointer' );
76
-
77
- $( document ).on( 'click', '.flex-active-slide .zoomImg', function ( e ) {
78
- e.preventDefault();
79
- e.stopPropagation();
80
-
81
- flex.find( '.flex-active-slide a[data-rel]' ).trigger( 'click' );
82
- } );
83
- }
84
- }, 10 );
85
-
86
- switch ( script ) {
87
-
88
- case 'swipebox':
89
-
90
- var slide = $( '#swipebox-overlay' ).find( '.slide.current' ),
91
- image_source = '',
92
- allow_hide = false,
93
- close_executed = false;
94
-
95
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).swipebox( {
96
- useCSS: ( rlArgs.animation === '1' ? true : false ),
97
- useSVG: ( rlArgs.useSVG === '1' ? true : false ),
98
- hideCloseButtonOnMobile: ( rlArgs.hideCloseButtonOnMobile === '1' ? true : false ),
99
- removeBarsOnMobile: ( rlArgs.removeBarsOnMobile === '1' ? true : false ),
100
- hideBarsDelay: ( rlArgs.hideBars === '1' ? parseInt( rlArgs.hideBarsDelay ) : 0 ),
101
- videoMaxWidth: parseInt( rlArgs.videoMaxWidth ),
102
- loopAtEnd: ( rlArgs.loopAtEnd === '1' ? true : false ),
103
- afterOpen: function () {
104
- close_executed = false;
105
-
106
- // update current slide container
107
- slide = $( '#swipebox-overlay' ).find( '.slide.current' );
108
-
109
- // get image source
110
- var image = slide.find( 'img' ).attr( 'src' );
111
-
112
- // valid image source?
113
- if ( typeof image !== 'undefined' ) {
114
- image_source = image;
115
-
116
- // trigger image view
117
- rl_view_image( script, image_source );
118
- } else {
119
- image_source = '';
120
- }
121
-
122
- // add current slide observer
123
- observe_script_dom( document.getElementById( 'swipebox-slider' ), false, function () {
124
- if ( image_source === '' ) {
125
- // get image source
126
- var image = slide.find( 'img' ).attr( 'src' );
127
-
128
- // valid image source?
129
- if ( typeof image !== 'undefined' ) {
130
- image_source = image;
131
-
132
- // trigger image view
133
- rl_view_image( script, image_source );
134
- } else {
135
- image_source = '';
136
- }
137
- }
138
- } );
139
- },
140
- nextSlide: function () {
141
- // update current slide container
142
- slide = $( '#swipebox-overlay' ).find( '.slide.current' );
143
-
144
- // get image source
145
- var image = slide.find( 'img' ).attr( 'src' );
146
-
147
- // valid image source?
148
- if ( typeof image !== 'undefined' ) {
149
- image_source = image;
150
-
151
- // trigger image view
152
- rl_view_image( script, image_source );
153
- } else {
154
- image_source = '';
155
- }
156
- },
157
- prevSlide: function () {
158
- // update current slide container
159
- slide = $( '#swipebox-overlay' ).find( '.slide.current' );
160
-
161
- // get image source
162
- var image = slide.find( 'img' ).attr( 'src' );
163
-
164
- // valid image source?
165
- if ( typeof image !== 'undefined' ) {
166
- image_source = image;
167
-
168
- // trigger image view
169
- rl_view_image( script, image_source );
170
- } else {
171
- image_source = '';
172
- }
173
- },
174
- afterClose: function () {
175
- // afterClose event executed
176
- close_executed = true;
177
-
178
- // allow to hide image?
179
- if ( allow_hide ) {
180
- // trigger image hide
181
- rl_hide_image( script, image_source );
182
-
183
- allow_hide = false;
184
- }
185
- }
186
- } );
187
-
188
- // additional event to prevent rl_hide_image to execure while opening modal
189
- $( window ).on( 'resize', function () {
190
- if ( !close_executed ) {
191
- allow_hide = true;
192
- }
193
  } );
 
194
 
195
- break;
196
-
197
- case 'prettyphoto':
198
-
199
- var view_disabled = false,
200
- last_image = '';
201
-
202
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).prettyPhoto( {
203
- hook: 'data-rel',
204
- animation_speed: rlArgs.animationSpeed,
205
- slideshow: ( rlArgs.slideshow === '1' ? parseInt( rlArgs.slideshowDelay ) : false ),
206
- autoplay_slideshow: ( rlArgs.slideshowAutoplay === '1' ? true : false ),
207
- opacity: rlArgs.opacity,
208
- show_title: ( rlArgs.showTitle === '1' ? true : false ),
209
- allow_resize: ( rlArgs.allowResize === '1' ? true : false ),
210
- allow_expand: ( rlArgs.allowExpand === '1' ? true : false ),
211
- default_width: parseInt( rlArgs.width ),
212
- default_height: parseInt( rlArgs.height ),
213
- counter_separator_label: rlArgs.separator,
214
- theme: rlArgs.theme,
215
- horizontal_padding: parseInt( rlArgs.horizontalPadding ),
216
- hideflash: ( rlArgs.hideFlash === '1' ? true : false ),
217
- wmode: rlArgs.wmode,
218
- autoplay: ( rlArgs.videoAutoplay === '1' ? true : false ),
219
- modal: ( rlArgs.modal === '1' ? true : false ),
220
- deeplinking: ( rlArgs.deeplinking === '1' ? true : false ),
221
- overlay_gallery: ( rlArgs.overlayGallery === '1' ? true : false ),
222
- keyboard_shortcuts: ( rlArgs.keyboardShortcuts === '1' ? true : false ),
223
- social_tools: ( rlArgs.social === '1' ? '<div class="pp_social"><div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href=' + location.href + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' : '' ),
224
- ie6_fallback: true,
225
- changepicturecallback: function () {
226
- // is view disabled?
227
- if ( view_disabled ) {
228
- // enable view
229
- view_disabled = false;
230
-
231
- return;
232
- }
233
-
234
- last_image = $( '#pp_full_res' ).find( 'img' ).attr( 'src' );
235
-
236
- // trigger image view
237
- rl_view_image( script, last_image );
238
-
239
- // is expanding allowed?
240
- if ( rlArgs.allowExpand === '1' ) {
241
- // disable changepicturecallback event after expanding
242
- $( 'a.pp_expand' ).on( 'click', function () {
243
- view_disabled = true;
244
- } );
245
- }
246
- },
247
- callback: function () {
248
- // trigger image hide
249
- rl_hide_image( script, last_image );
250
- }
251
- } );
252
-
253
- break;
254
-
255
- case 'fancybox':
256
-
257
- var last_image = '';
258
-
259
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).fancybox( {
260
- modal: ( rlArgs.modal === '1' ? true : false ),
261
- overlayShow: ( rlArgs.showOverlay === '1' ? true : false ),
262
- showCloseButton: ( rlArgs.showCloseButton === '1' ? true : false ),
263
- enableEscapeButton: ( rlArgs.enableEscapeButton === '1' ? true : false ),
264
- hideOnOverlayClick: ( rlArgs.hideOnOverlayClick === '1' ? true : false ),
265
- hideOnContentClick: ( rlArgs.hideOnContentClick === '1' ? true : false ),
266
- cyclic: ( rlArgs.cyclic === '1' ? true : false ),
267
- showNavArrows: ( rlArgs.showNavArrows === '1' ? true : false ),
268
- autoScale: ( rlArgs.autoScale === '1' ? true : false ),
269
- scrolling: rlArgs.scrolling,
270
- centerOnScroll: ( rlArgs.centerOnScroll === '1' ? true : false ),
271
- opacity: ( rlArgs.opacity === '1' ? true : false ),
272
- overlayOpacity: parseFloat( rlArgs.overlayOpacity / 100 ),
273
- overlayColor: rlArgs.overlayColor,
274
- titleShow: ( rlArgs.titleShow === '1' ? true : false ),
275
- titlePosition: rlArgs.titlePosition,
276
- transitionIn: rlArgs.transitions,
277
- transitionOut: rlArgs.transitions,
278
- easingIn: rlArgs.easings,
279
- easingOut: rlArgs.easings,
280
- speedIn: parseInt( rlArgs.speeds ),
281
- speedOut: parseInt( rlArgs.speeds ),
282
- changeSpeed: parseInt( rlArgs.changeSpeed ),
283
- changeFade: parseInt( rlArgs.changeFade ),
284
- padding: parseInt( rlArgs.padding ),
285
- margin: parseInt( rlArgs.margin ),
286
- width: parseInt( rlArgs.videoWidth ),
287
- height: parseInt( rlArgs.videoHeight ),
288
- onComplete: function () {
289
- last_image = $( '#fancybox-content' ).find( 'img' ).attr( 'src' );
290
-
291
- // trigger image view
292
- rl_view_image( script, last_image );
293
- },
294
- onClosed: function () {
295
- // trigger image hide
296
- rl_hide_image( script, last_image );
297
- }
298
- } );
299
-
300
- break;
301
-
302
- case 'nivo':
303
-
304
- $.each( $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ), function () {
305
- var attr = $( this ).attr( 'data-rel' );
306
-
307
- // check data-rel attribute first
308
- if ( typeof attr === 'undefined' || attr == false ) {
309
- // if not found then try to check rel attribute for backward compatibility
310
- attr = $( this ).attr( 'rel' );
311
- }
312
 
313
- // for some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
314
- if ( typeof attr !== 'undefined' && attr !== false ) {
315
- var match = attr.match( new RegExp( rlArgs.selector + '\\-(gallery\\-(?:[\\da-z]{1,4}))', 'ig' ) );
316
 
317
- if ( match !== null ) {
318
- $( this ).attr( 'data-lightbox-gallery', match[0] );
319
- }
320
- }
321
-
322
- } );
323
 
324
- var observer_initialized = false,
325
- change_allowed = true,
326
- last_image = '';
327
-
328
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).nivoLightbox( {
329
- effect: rlArgs.effect,
330
- clickOverlayToClose: ( rlArgs.clickOverlayToClose === '1' ? true : false ),
331
- keyboardNav: ( rlArgs.keyboardNav === '1' ? true : false ),
332
- errorMessage: rlArgs.errorMessage,
333
- afterShowLightbox: function ( lightbox ) {
334
- var content = $( lightbox )[0].find( '.nivo-lightbox-content' );
335
-
336
- // is observer initialized?
337
- if ( !observer_initialized ) {
338
- // turn it off
339
- observer_initialized = true;
340
-
341
- // add content observer
342
- observe_script_dom( document.getElementsByClassName( 'nivo-lightbox-content' )[0], true, function () {
343
- if ( change_allowed ) {
344
- last_image = content.find( '.nivo-lightbox-image img' ).attr( 'src' );
345
-
346
- // trigger image view
347
- rl_view_image( script, last_image );
348
-
349
- // disallow observer changes
350
- change_allowed = false;
351
  }
352
- } );
353
  }
354
- },
355
- afterHideLightbox: function () {
356
- // allow observer changes
357
- change_allowed = true;
358
-
359
- // trigger image hide
360
- rl_hide_image( script, last_image );
361
- },
362
- onPrev: function ( element ) {
363
- // disallow observer changes
364
- change_allowed = false;
365
-
366
- last_image = element[0].attr( 'href' );
367
-
368
- // trigger image view
369
- rl_view_image( script, last_image );
370
- },
371
- onNext: function ( element ) {
372
- // disallow observer changes
373
- change_allowed = false;
374
-
375
- last_image = element[0].attr( 'href' );
376
-
377
- // trigger image view
378
- rl_view_image( script, last_image );
379
- }
380
- } );
381
-
382
- break;
383
-
384
- case 'imagelightbox':
385
-
386
- var selectors = [ ],
387
- last_image = '';
388
-
389
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
390
- var attr = $( item ).attr( 'data-rel' );
391
-
392
- // check data-rel attribute first
393
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
394
- selectors.push( attr );
395
- // if not found then try to check rel attribute for backward compatibility
396
- else {
397
- attr = $( item ).attr( 'rel' );
398
 
399
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
400
- selectors.push( attr );
401
- }
402
- } );
403
-
404
- if ( selectors.length > 0 ) {
405
-
406
- // make unique
407
- selectors = $.unique( selectors );
408
-
409
- $( selectors ).each( function ( i, item ) {
410
- $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).imageLightbox( {
411
- animationSpeed: parseInt( rlArgs.animationSpeed ),
412
- preloadNext: ( rlArgs.preloadNext === '1' ? true : false ),
413
- enableKeyboard: ( rlArgs.enableKeyboard === '1' ? true : false ),
414
- quitOnEnd: ( rlArgs.quitOnEnd === '1' ? true : false ),
415
- quitOnImgClick: ( rlArgs.quitOnImageClick === '1' ? true : false ),
416
- quitOnDocClick: ( rlArgs.quitOnDocumentClick === '1' ? true : false ),
417
- onLoadEnd: function () {
418
- last_image = $( '#imagelightbox' ).attr( 'src' );
419
-
420
- // trigger image view
421
- rl_view_image( script, last_image );
422
- },
423
- onEnd: function () {
424
- // trigger image hide
425
- rl_hide_image( script, last_image );
426
- }
427
  } );
428
- } );
429
  }
430
 
431
- break;
432
-
433
- case 'tosrus':
434
-
435
- var selectors = [ ],
436
- last_image = '';
437
-
438
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
439
- var attr = $( item ).attr( 'data-rel' );
440
-
441
- // check data-rel attribute first
442
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
443
- selectors.push( attr );
444
- // if not found then try to check rel attribute for backward compatibility
445
- else {
446
- attr = $( item ).attr( 'rel' );
447
-
448
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
449
- selectors.push( attr );
450
- }
451
- } );
452
-
453
- if ( selectors.length > 0 ) {
454
-
455
- // make unique
456
- selectors = $.unique( selectors );
457
-
458
- $( selectors ).each( function ( i, item ) {
459
- var tos = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).tosrus( {
460
- infinite: ( rlArgs.infinite === '1' ? true : false ),
461
- autoplay: {
462
- play: ( rlArgs.autoplay === '1' ? true : false ),
463
- pauseOnHover: ( rlArgs.pauseOnHover === '1' ? true : false ),
464
- timeout: rlArgs.timeout
465
- },
466
- effect: rlArgs.effect,
467
- keys: {
468
- prev: ( rlArgs.keys === '1' ? true : false ),
469
- next: ( rlArgs.keys === '1' ? true : false ),
470
- close: ( rlArgs.keys === '1' ? true : false )
471
- },
472
- pagination: {
473
- add: ( rlArgs.pagination === '1' ? true : false ),
474
- type: rlArgs.paginationType
475
- },
476
- // forced
477
- show: false,
478
- buttons: true,
479
- caption: {
480
- add: true,
481
- attributes: [ "title" ]
482
- }
483
- } );
484
-
485
- tos.bind( 'sliding.tos', function ( event, number ) {
486
- last_image = $( $( event.target ).find( '.tos-slider .tos-slide' )[number] ).find( 'img' ).attr( 'src' );
487
-
488
- // trigger image view
489
- rl_view_image( script, last_image );
490
  } );
491
-
492
- tos.bind( 'closing.tos', function () {
493
- // trigger image hide
494
- rl_hide_image( script, last_image );
495
- } );
496
-
497
- } );
498
  }
499
 
500
- break;
 
 
501
 
502
- case 'featherlight':
 
503
 
504
- var selectors = [ ],
505
- last_image = '';
 
506
 
507
- $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
508
- var attr = $( item ).attr( 'data-rel' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
- // check data-rel attribute first
511
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
512
- selectors.push( attr );
513
- // if not found then try to check rel attribute for backward compatibility
514
- else {
515
- attr = $( item ).attr( 'rel' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
 
517
- if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
518
- selectors.push( attr );
519
- }
520
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
 
522
- if ( selectors.length > 0 ) {
523
- // make unique
524
- selectors = $.unique( selectors );
525
-
526
- // set defaults
527
- $.extend( $.featherlight.defaults, {
528
- openSpeed: parseInt( rlArgs.openSpeed ),
529
- closeSpeed: parseInt( rlArgs.closeSpeed ),
530
- closeOnClick: rlArgs.closeOnClick,
531
- closeOnEsc: ( rlArgs.closeOnEsc === '1' ? true : false ),
532
- afterOpen: function ( event ) {
533
- last_image = event.currentTarget.href;
534
-
535
- // trigger image view
536
- rl_view_image( script, last_image );
537
- },
538
- afterClose: function () {
539
- // trigger image hide
540
- rl_hide_image( script, last_image );
541
- }
542
- } );
543
-
544
- $( selectors ).each( function ( i, item ) {
545
-
546
- // gallery?
547
- if ( /-gallery-/.test( item ) ) {
548
- $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlightGallery( {
549
- galleryFadeIn: parseInt( rlArgs.galleryFadeIn ),
550
- galleryFadeOut: parseInt( rlArgs.galleryFadeOut ),
551
- previousIcon: '&#10094;',
552
- nextIcon: '&#10095;'
553
- } );
554
- // video?
555
- } else if ( /-video-/.test( item ) ) {
556
- $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
557
- // single image?
558
- } else {
559
- $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
560
- }
561
- } );
562
 
 
563
  }
564
 
565
- break;
566
- }
567
-
568
- } );
569
 
570
  } )( jQuery );
1
  ( function ( $ ) {
2
 
3
+ $( document ).on( 'ready' + rlArgs.customEvents, function () {
4
+
5
+ // initialise event
6
+ $.event.trigger( {
7
+ type: 'doResponsiveLightbox',
8
+ script: rlArgs.script,
9
+ selector: rlArgs.selector,
10
+ args: rlArgs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  } );
12
+ } );
13
 
14
+ // this is similar to the WP function add_action();
15
+ $( document ).on( 'doResponsiveLightbox', function ( event ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ var script = event.script,
18
+ selector = event.selector,
19
+ args = event.args;
20
 
21
+ if ( typeof script === 'undefined' || typeof selector === 'undefined' ) {
22
+ return false;
23
+ }
 
 
 
24
 
25
+ var observe_script_dom = ( function () {
26
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
27
+ eventListenerSupported = window.addEventListener;
28
+
29
+ return function ( obj, only_added, callback ) {
30
+ if ( MutationObserver ) {
31
+ // define a new observer
32
+ var obs = new MutationObserver( function ( mutations, observer ) {
33
+ if ( only_added ) {
34
+ if ( mutations[0].addedNodes.length )
35
+ callback();
36
+ } else {
37
+ if ( mutations[0].addedNodes.length || mutations[0].removedNodes.length )
38
+ callback();
39
+ }
40
+ } );
41
+
42
+ // have the observer observe for changes in children
43
+ obs.observe( obj, { childList: true, subtree: true } );
44
+ } else if ( eventListenerSupported ) {
45
+ obj.addEventListener( 'DOMNodeInserted', callback, false );
46
+
47
+ if ( !only_added ) {
48
+ obj.addEventListener( 'DOMNodeRemoved', callback, false );
49
+ }
 
 
50
  }
 
51
  }
52
+ } )();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
+ rl_view_image = function ( script, url ) {
55
+ $.event.trigger( {
56
+ type: 'doLightboxViewImage',
57
+ script: script,
58
+ url: url
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  } );
 
60
  }
61
 
62
+ rl_hide_image = function ( script, url ) {
63
+ $.event.trigger( {
64
+ type: 'doLightboxHideImage',
65
+ script: script,
66
+ url: url
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  } );
 
 
 
 
 
 
 
68
  }
69
 
70
+ // WooCommerce 3.0+ compatibility
71
+ setTimeout( function () {
72
+ var flex = $( '.flex-viewport' );
73
 
74
+ if ( rlArgs.woocommerce_gallery === '1' && flex.length ) {
75
+ $( '.zoomImg' ).css( 'cursor', 'pointer' );
76
 
77
+ $( document ).on( 'click', '.flex-active-slide .zoomImg', function ( e ) {
78
+ e.preventDefault();
79
+ e.stopPropagation();
80
 
81
+ flex.find( '.flex-active-slide a[data-rel]' ).trigger( 'click' );
82
+ } );
83
+ }
84
+ }, 10 );
85
+
86
+ switch ( script ) {
87
+
88
+ case 'swipebox':
89
+
90
+ var slide = $( '#swipebox-overlay' ).find( '.slide.current' ),
91
+ image_source = '',
92
+ allow_hide = false,
93
+ close_executed = false;
94
+
95
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).swipebox( {
96
+ useCSS: ( rlArgs.animation === '1' ? true : false ),
97
+ useSVG: ( rlArgs.useSVG === '1' ? true : false ),
98
+ hideCloseButtonOnMobile: ( rlArgs.hideCloseButtonOnMobile === '1' ? true : false ),
99
+ removeBarsOnMobile: ( rlArgs.removeBarsOnMobile === '1' ? true : false ),
100
+ hideBarsDelay: ( rlArgs.hideBars === '1' ? parseInt( rlArgs.hideBarsDelay ) : 0 ),
101
+ videoMaxWidth: parseInt( rlArgs.videoMaxWidth ),
102
+ loopAtEnd: ( rlArgs.loopAtEnd === '1' ? true : false ),
103
+ afterOpen: function () {
104
+ close_executed = false;
105
+
106
+ // update current slide container
107
+ slide = $( '#swipebox-overlay' ).find( '.slide.current' );
108
+
109
+ // get image source
110
+ var image = slide.find( 'img' ).attr( 'src' );
111
+
112
+ // valid image source?
113
+ if ( typeof image !== 'undefined' ) {
114
+ image_source = image;
115
+
116
+ // trigger image view
117
+ rl_view_image( script, image_source );
118
+ } else {
119
+ image_source = '';
120
+ }
121
+
122
+ // add current slide observer
123
+ observe_script_dom( document.getElementById( 'swipebox-slider' ), false, function () {
124
+ if ( image_source === '' ) {
125
+ // get image source
126
+ var image = slide.find( 'img' ).attr( 'src' );
127
+
128
+ // valid image source?
129
+ if ( typeof image !== 'undefined' ) {
130
+ image_source = image;
131
+
132
+ // trigger image view
133
+ rl_view_image( script, image_source );
134
+ } else {
135
+ image_source = '';
136
+ }
137
+ }
138
+ } );
139
+ },
140
+ nextSlide: function () {
141
+ // update current slide container
142
+ slide = $( '#swipebox-overlay' ).find( '.slide.current' );
143
+
144
+ // get image source
145
+ var image = slide.find( 'img' ).attr( 'src' );
146
+
147
+ // valid image source?
148
+ if ( typeof image !== 'undefined' ) {
149
+ image_source = image;
150
+
151
+ // trigger image view
152
+ rl_view_image( script, image_source );
153
+ } else {
154
+ image_source = '';
155
+ }
156
+ },
157
+ prevSlide: function () {
158
+ // update current slide container
159
+ slide = $( '#swipebox-overlay' ).find( '.slide.current' );
160
+
161
+ // get image source
162
+ var image = slide.find( 'img' ).attr( 'src' );
163
+
164
+ // valid image source?
165
+ if ( typeof image !== 'undefined' ) {
166
+ image_source = image;
167
+
168
+ // trigger image view
169
+ rl_view_image( script, image_source );
170
+ } else {
171
+ image_source = '';
172
+ }
173
+ },
174
+ afterClose: function () {
175
+ // afterClose event executed
176
+ close_executed = true;
177
+
178
+ // allow to hide image?
179
+ if ( allow_hide ) {
180
+ // trigger image hide
181
+ rl_hide_image( script, image_source );
182
+
183
+ allow_hide = false;
184
+ }
185
+ }
186
+ } );
187
+
188
+ // additional event to prevent rl_hide_image to execure while opening modal
189
+ $( window ).on( 'resize', function () {
190
+ if ( !close_executed ) {
191
+ allow_hide = true;
192
+ }
193
+ } );
194
+
195
+ break;
196
+
197
+ case 'prettyphoto':
198
+
199
+ var view_disabled = false,
200
+ last_image = '';
201
+
202
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).prettyPhoto( {
203
+ hook: 'data-rel',
204
+ animation_speed: rlArgs.animationSpeed,
205
+ slideshow: ( rlArgs.slideshow === '1' ? parseInt( rlArgs.slideshowDelay ) : false ),
206
+ autoplay_slideshow: ( rlArgs.slideshowAutoplay === '1' ? true : false ),
207
+ opacity: rlArgs.opacity,
208
+ show_title: ( rlArgs.showTitle === '1' ? true : false ),
209
+ allow_resize: ( rlArgs.allowResize === '1' ? true : false ),
210
+ allow_expand: ( rlArgs.allowExpand === '1' ? true : false ),
211
+ default_width: parseInt( rlArgs.width ),
212
+ default_height: parseInt( rlArgs.height ),
213
+ counter_separator_label: rlArgs.separator,
214
+ theme: rlArgs.theme,
215
+ horizontal_padding: parseInt( rlArgs.horizontalPadding ),
216
+ hideflash: ( rlArgs.hideFlash === '1' ? true : false ),
217
+ wmode: rlArgs.wmode,
218
+ autoplay: ( rlArgs.videoAutoplay === '1' ? true : false ),
219
+ modal: ( rlArgs.modal === '1' ? true : false ),
220
+ deeplinking: ( rlArgs.deeplinking === '1' ? true : false ),
221
+ overlay_gallery: ( rlArgs.overlayGallery === '1' ? true : false ),
222
+ keyboard_shortcuts: ( rlArgs.keyboardShortcuts === '1' ? true : false ),
223
+ social_tools: ( rlArgs.social === '1' ? '<div class="pp_social"><div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href=' + location.href + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' : '' ),
224
+ ie6_fallback: true,
225
+ changepicturecallback: function () {
226
+ // is view disabled?
227
+ if ( view_disabled ) {
228
+ // enable view
229
+ view_disabled = false;
230
+
231
+ return;
232
+ }
233
+
234
+ last_image = $( '#pp_full_res' ).find( 'img' ).attr( 'src' );
235
+
236
+ // trigger image view
237
+ rl_view_image( script, last_image );
238
+
239
+ // is expanding allowed?
240
+ if ( rlArgs.allowExpand === '1' ) {
241
+ // disable changepicturecallback event after expanding
242
+ $( 'a.pp_expand' ).on( 'click', function () {
243
+ view_disabled = true;
244
+ } );
245
+ }
246
+ },
247
+ callback: function () {
248
+ // trigger image hide
249
+ rl_hide_image( script, last_image );
250
+ }
251
+ } );
252
+
253
+ break;
254
+
255
+ case 'fancybox':
256
+
257
+ var last_image = '';
258
+
259
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).fancybox( {
260
+ modal: ( rlArgs.modal === '1' ? true : false ),
261
+ overlayShow: ( rlArgs.showOverlay === '1' ? true : false ),
262
+ showCloseButton: ( rlArgs.showCloseButton === '1' ? true : false ),
263
+ enableEscapeButton: ( rlArgs.enableEscapeButton === '1' ? true : false ),
264
+ hideOnOverlayClick: ( rlArgs.hideOnOverlayClick === '1' ? true : false ),
265
+ hideOnContentClick: ( rlArgs.hideOnContentClick === '1' ? true : false ),
266
+ cyclic: ( rlArgs.cyclic === '1' ? true : false ),
267
+ showNavArrows: ( rlArgs.showNavArrows === '1' ? true : false ),
268
+ autoScale: ( rlArgs.autoScale === '1' ? true : false ),
269
+ scrolling: rlArgs.scrolling,
270
+ centerOnScroll: ( rlArgs.centerOnScroll === '1' ? true : false ),
271
+ opacity: ( rlArgs.opacity === '1' ? true : false ),
272
+ overlayOpacity: parseFloat( rlArgs.overlayOpacity / 100 ),
273
+ overlayColor: rlArgs.overlayColor,
274
+ titleShow: ( rlArgs.titleShow === '1' ? true : false ),
275
+ titlePosition: rlArgs.titlePosition,
276
+ transitionIn: rlArgs.transitions,
277
+ transitionOut: rlArgs.transitions,
278
+ easingIn: rlArgs.easings,
279
+ easingOut: rlArgs.easings,
280
+ speedIn: parseInt( rlArgs.speeds ),
281
+ speedOut: parseInt( rlArgs.speeds ),
282
+ changeSpeed: parseInt( rlArgs.changeSpeed ),
283
+ changeFade: parseInt( rlArgs.changeFade ),
284
+ padding: parseInt( rlArgs.padding ),
285
+ margin: parseInt( rlArgs.margin ),
286
+ width: parseInt( rlArgs.videoWidth ),
287
+ height: parseInt( rlArgs.videoHeight ),
288
+ onComplete: function () {
289
+ last_image = $( '#fancybox-content' ).find( 'img' ).attr( 'src' );
290
+
291
+ // trigger image view
292
+ rl_view_image( script, last_image );
293
+ },
294
+ onClosed: function () {
295
+ // trigger image hide
296
+ rl_hide_image( script, last_image );
297
+ }
298
+ } );
299
+
300
+ break;
301
+
302
+ case 'nivo':
303
+
304
+ $.each( $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ), function () {
305
+ var attr = $( this ).attr( 'data-rel' );
306
+
307
+ // check data-rel attribute first
308
+ if ( typeof attr === 'undefined' || attr == false ) {
309
+ // if not found then try to check rel attribute for backward compatibility
310
+ attr = $( this ).attr( 'rel' );
311
+ }
312
+
313
+ // for some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
314
+ if ( typeof attr !== 'undefined' && attr !== false ) {
315
+ var match = attr.match( new RegExp( rlArgs.selector + '\\-(gallery\\-(?:[\\da-z]{1,4}))', 'ig' ) );
316
+
317
+ if ( match !== null ) {
318
+ $( this ).attr( 'data-lightbox-gallery', match[0] );
319
+ }
320
+ }
321
+
322
+ } );
323
+
324
+ var observer_initialized = false,
325
+ change_allowed = true,
326
+ last_image = '';
327
+
328
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).nivoLightbox( {
329
+ effect: rlArgs.effect,
330
+ clickOverlayToClose: ( rlArgs.clickOverlayToClose === '1' ? true : false ),
331
+ keyboardNav: ( rlArgs.keyboardNav === '1' ? true : false ),
332
+ errorMessage: rlArgs.errorMessage,
333
+ afterShowLightbox: function ( lightbox ) {
334
+ var content = $( lightbox )[0].find( '.nivo-lightbox-content' );
335
+
336
+ // is observer initialized?
337
+ if ( !observer_initialized ) {
338
+ // turn it off
339
+ observer_initialized = true;
340
+
341
+ // add content observer
342
+ observe_script_dom( document.getElementsByClassName( 'nivo-lightbox-content' )[0], true, function () {
343
+ if ( change_allowed ) {
344
+ last_image = content.find( '.nivo-lightbox-image img' ).attr( 'src' );
345
+
346
+ // trigger image view
347
+ rl_view_image( script, last_image );
348
+
349
+ // disallow observer changes
350
+ change_allowed = false;
351
+ }
352
+ } );
353
+ }
354
+ },
355
+ afterHideLightbox: function () {
356
+ // allow observer changes
357
+ change_allowed = true;
358
+
359
+ // trigger image hide
360
+ rl_hide_image( script, last_image );
361
+ },
362
+ onPrev: function ( element ) {
363
+ // disallow observer changes
364
+ change_allowed = false;
365
+
366
+ last_image = element[0].attr( 'href' );
367
+
368
+ // trigger image view
369
+ rl_view_image( script, last_image );
370
+ },
371
+ onNext: function ( element ) {
372
+ // disallow observer changes
373
+ change_allowed = false;
374
+
375
+ last_image = element[0].attr( 'href' );
376
+
377
+ // trigger image view
378
+ rl_view_image( script, last_image );
379
+ }
380
+ } );
381
+
382
+ break;
383
+
384
+ case 'imagelightbox':
385
+
386
+ var selectors = [ ],
387
+ last_image = '';
388
+
389
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
390
+ var attr = $( item ).attr( 'data-rel' );
391
+
392
+ // check data-rel attribute first
393
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
394
+ selectors.push( attr );
395
+ // if not found then try to check rel attribute for backward compatibility
396
+ else {
397
+ attr = $( item ).attr( 'rel' );
398
+
399
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
400
+ selectors.push( attr );
401
+ }
402
+ } );
403
+
404
+ if ( selectors.length > 0 ) {
405
+
406
+ // make unique
407
+ selectors = $.unique( selectors );
408
+
409
+ $( selectors ).each( function ( i, item ) {
410
+ $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).imageLightbox( {
411
+ animationSpeed: parseInt( rlArgs.animationSpeed ),
412
+ preloadNext: ( rlArgs.preloadNext === '1' ? true : false ),
413
+ enableKeyboard: ( rlArgs.enableKeyboard === '1' ? true : false ),
414
+ quitOnEnd: ( rlArgs.quitOnEnd === '1' ? true : false ),
415
+ quitOnImgClick: ( rlArgs.quitOnImageClick === '1' ? true : false ),
416
+ quitOnDocClick: ( rlArgs.quitOnDocumentClick === '1' ? true : false ),
417
+ onLoadEnd: function () {
418
+ last_image = $( '#imagelightbox' ).attr( 'src' );
419
+
420
+ // trigger image view
421
+ rl_view_image( script, last_image );
422
+ },
423
+ onEnd: function () {
424
+ // trigger image hide
425
+ rl_hide_image( script, last_image );
426
+ }
427
+ } );
428
+ } );
429
+ }
430
 
431
+ break;
432
+
433
+ case 'tosrus':
434
+
435
+ var selectors = [ ],
436
+ last_image = '';
437
+
438
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
439
+ var attr = $( item ).attr( 'data-rel' );
440
+
441
+ // check data-rel attribute first
442
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
443
+ selectors.push( attr );
444
+ // if not found then try to check rel attribute for backward compatibility
445
+ else {
446
+ attr = $( item ).attr( 'rel' );
447
+
448
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
449
+ selectors.push( attr );
450
+ }
451
+ } );
452
+
453
+ if ( selectors.length > 0 ) {
454
+
455
+ // make unique
456
+ selectors = $.unique( selectors );
457
+
458
+ $( selectors ).each( function ( i, item ) {
459
+ var tos = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).tosrus( {
460
+ infinite: ( rlArgs.infinite === '1' ? true : false ),
461
+ autoplay: {
462
+ play: ( rlArgs.autoplay === '1' ? true : false ),
463
+ pauseOnHover: ( rlArgs.pauseOnHover === '1' ? true : false ),
464
+ timeout: rlArgs.timeout
465
+ },
466
+ effect: rlArgs.effect,
467
+ keys: {
468
+ prev: ( rlArgs.keys === '1' ? true : false ),
469
+ next: ( rlArgs.keys === '1' ? true : false ),
470
+ close: ( rlArgs.keys === '1' ? true : false )
471
+ },
472
+ pagination: {
473
+ add: ( rlArgs.pagination === '1' ? true : false ),
474
+ type: rlArgs.paginationType
475
+ },
476
+ // forced
477
+ show: false,
478
+ buttons: true,
479
+ caption: {
480
+ add: true,
481
+ attributes: [ "title" ]
482
+ },
483
+ wrapper: {
484
+ onClick: rlArgs.closeOnClick === '1' ? 'close' : 'toggleUI'
485
+ }
486
+ } );
487
+
488
+ tos.bind( 'sliding.tos', function ( event, number ) {
489
+ last_image = $( $( event.target ).find( '.tos-slider .tos-slide' )[number] ).find( 'img' ).attr( 'src' );
490
+
491
+ // trigger image view
492
+ rl_view_image( script, last_image );
493
+ } );
494
+
495
+ tos.bind( 'closing.tos', function () {
496
+ // trigger image hide
497
+ rl_hide_image( script, last_image );
498
+ } );
499
+
500
+ } );
501
+ }
502
 
503
+ break;
504
+
505
+ case 'featherlight':
506
+
507
+ var selectors = [ ],
508
+ last_image = '';
509
+
510
+ $( 'a[rel*="' + rlArgs.selector + '"], a[data-rel*="' + rlArgs.selector + '"]' ).each( function ( i, item ) {
511
+ var attr = $( item ).attr( 'data-rel' );
512
+
513
+ // check data-rel attribute first
514
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
515
+ selectors.push( attr );
516
+ // if not found then try to check rel attribute for backward compatibility
517
+ else {
518
+ attr = $( item ).attr( 'rel' );
519
+
520
+ if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
521
+ selectors.push( attr );
522
+ }
523
+ } );
524
+
525
+ if ( selectors.length > 0 ) {
526
+ // make unique
527
+ selectors = $.unique( selectors );
528
+
529
+ // set defaults
530
+ $.extend( $.featherlight.defaults, {
531
+ openSpeed: parseInt( rlArgs.openSpeed ),
532
+ closeSpeed: parseInt( rlArgs.closeSpeed ),
533
+ closeOnClick: rlArgs.closeOnClick,
534
+ closeOnEsc: ( rlArgs.closeOnEsc === '1' ? true : false ),
535
+ afterOpen: function ( event ) {
536
+ last_image = event.currentTarget.href;
537
+
538
+ // trigger image view
539
+ rl_view_image( script, last_image );
540
+ },
541
+ afterClose: function () {
542
+ // trigger image hide
543
+ rl_hide_image( script, last_image );
544
+ }
545
+ } );
546
+
547
+ $( selectors ).each( function ( i, item ) {
548
+
549
+ // gallery?
550
+ if ( /-gallery-/.test( item ) ) {
551
+ $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlightGallery( {
552
+ galleryFadeIn: parseInt( rlArgs.galleryFadeIn ),
553
+ galleryFadeOut: parseInt( rlArgs.galleryFadeOut ),
554
+ previousIcon: '&#10094;',
555
+ nextIcon: '&#10095;'
556
+ } );
557
+ // video?
558
+ } else if ( /-video-/.test( item ) ) {
559
+ $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
560
+ // single image?
561
+ } else {
562
+ $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
563
+ }
564
+ } );
565
 
566
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
 
568
+ break;
569
  }
570
 
571
+ } );
 
 
 
572
 
573
  } )( jQuery );
languages/responsive-lightbox.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Responsive Lightbox\n"
5
- "POT-Creation-Date: 2017-05-15 16:13+0200\n"
6
  "PO-Revision-Date: 2015-05-12 12:06+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
@@ -390,7 +390,7 @@ msgstr ""
390
  msgid "Gallery"
391
  msgstr ""
392
 
393
- #: ../includes/class-settings.php:374 ../includes/class-settings.php:1262
394
  msgid "Licenses"
395
  msgstr ""
396
 
@@ -635,7 +635,7 @@ msgstr ""
635
  msgid "Enable escape button"
636
  msgstr ""
637
 
638
- #: ../includes/class-settings.php:651 ../includes/class-settings.php:1022
639
  msgid "Toggle if pressing Esc button closes lightbox."
640
  msgstr ""
641
 
@@ -816,7 +816,7 @@ msgstr ""
816
  msgid "Click overlay to close"
817
  msgstr ""
818
 
819
- #: ../includes/class-settings.php:841
820
  msgid "Enable to close lightbox on overlay click."
821
  msgstr ""
822
 
@@ -930,72 +930,76 @@ msgstr ""
930
  msgid "Thumbnails"
931
  msgstr ""
932
 
933
- #: ../includes/class-settings.php:991
 
 
 
 
934
  msgid "Opening speed"
935
  msgstr ""
936
 
937
- #: ../includes/class-settings.php:994
938
  msgid "Duration of opening animation."
939
  msgstr ""
940
 
941
- #: ../includes/class-settings.php:999
942
  msgid "Closing speed"
943
  msgstr ""
944
 
945
- #: ../includes/class-settings.php:1002
946
  msgid "Duration of closing animation."
947
  msgstr ""
948
 
949
- #: ../includes/class-settings.php:1007
950
  msgid "Close on click"
951
  msgstr ""
952
 
953
- #: ../includes/class-settings.php:1010
954
  msgid "Select how to close lightbox."
955
  msgstr ""
956
 
957
- #: ../includes/class-settings.php:1012
958
  msgid "background"
959
  msgstr ""
960
 
961
- #: ../includes/class-settings.php:1013
962
  msgid "anywhere"
963
  msgstr ""
964
 
965
- #: ../includes/class-settings.php:1014
966
  msgid "false"
967
  msgstr ""
968
 
969
- #: ../includes/class-settings.php:1019
970
  msgid "Close on Esc"
971
  msgstr ""
972
 
973
- #: ../includes/class-settings.php:1026
974
  msgid "Gallery fade in"
975
  msgstr ""
976
 
977
- #: ../includes/class-settings.php:1029
978
  msgid "Animation speed when image is loaded."
979
  msgstr ""
980
 
981
- #: ../includes/class-settings.php:1034
982
  msgid "Gallery fade out"
983
  msgstr ""
984
 
985
- #: ../includes/class-settings.php:1037
986
  msgid "Animation speed before image is loaded."
987
  msgstr ""
988
 
989
- #: ../includes/class-settings.php:1066 ../includes/class-settings.php:1081
990
- #: ../includes/class-settings.php:1094
991
  msgid "Responsive Lightbox"
992
  msgstr ""
993
 
994
- #: ../includes/class-settings.php:1096
995
  msgid "Need support?"
996
  msgstr ""
997
 
998
- #: ../includes/class-settings.php:1097
999
  #, php-format
1000
  msgid ""
1001
  "If you are having problems with this plugin, please browse it's <a href=\"%s"
@@ -1003,75 +1007,62 @@ msgid ""
1003
  "\" target=\"_blank\">Support forum</a>"
1004
  msgstr ""
1005
 
1006
- #: ../includes/class-settings.php:1099
1007
  msgid "Do you like this plugin?"
1008
  msgstr ""
1009
 
1010
- #: ../includes/class-settings.php:1100
1011
  #, php-format
1012
  msgid "<a href=\"%s\" target=\"_blank\">Rate it 5</a> on WordPress.org"
1013
  msgstr ""
1014
 
1015
- #: ../includes/class-settings.php:1101
1016
  #, php-format
1017
  msgid ""
1018
  "Blog about it & link to the <a href=\"%s\" target=\"_blank\">plugin page</a>."
1019
  msgstr ""
1020
 
1021
- #: ../includes/class-settings.php:1102
1022
  #, php-format
1023
  msgid ""
1024
  "Check out our other <a href=\"%s\" target=\"_blank\">WordPress plugins</a>."
1025
  msgstr ""
1026
 
1027
- #: ../includes/class-settings.php:1144
1028
  msgid "Reset to defaults"
1029
  msgstr ""
1030
 
1031
- #: ../includes/class-settings.php:1532
1032
  msgid "Settings restored to defaults."
1033
  msgstr ""
1034
 
1035
- #: ../includes/class-settings.php:1545
1036
  msgid "Add-ons / Extensions"
1037
  msgstr ""
1038
 
1039
- #: ../includes/class-settings.php:1546
1040
  msgid ""
1041
  "Enhance your website with these beautiful, easy to use extensions, designed "
1042
  "with Responsive Lightbox integration in mind."
1043
  msgstr ""
1044
 
1045
- #: ../includes/class-settings.php:1560
1046
  msgid ""
1047
  "There was an error retrieving the extensions list from the server. Please "
1048
  "try again later."
1049
  msgstr ""
1050
 
1051
- #: ../includes/class-settings.php:1573
1052
  msgid "A list of licenses for your Responsive Lightbox extensions."
1053
  msgstr ""
1054
 
1055
- #: ../includes/class-settings.php:1589
1056
  #, php-format
1057
  msgid ""
1058
  "Enter your license key to activate %s extension and enable automatic upgrade "
1059
  "notices."
1060
  msgstr ""
1061
 
1062
- #: ../includes/class-settings.php:1645 ../includes/class-settings.php:1658
1063
- #: ../includes/class-settings.php:1683 ../includes/class-settings.php:1694
1064
- msgid "License activation failed."
1065
- msgstr ""
1066
-
1067
- #: ../includes/class-settings.php:1655
1068
- msgid "License successfully activated."
1069
- msgstr ""
1070
-
1071
- #: ../includes/class-settings.php:1692
1072
- msgid "License successfully deactivated."
1073
- msgstr ""
1074
-
1075
  #: ../includes/class-widgets.php:47
1076
  msgid "Displays an image gallery."
1077
  msgstr ""
@@ -1114,7 +1105,7 @@ msgstr ""
1114
  msgid "Default"
1115
  msgstr ""
1116
 
1117
- #: ../includes/class-widgets.php:128 ../responsive-lightbox.php:472
1118
  msgid "Select images"
1119
  msgstr ""
1120
 
@@ -1194,7 +1185,7 @@ msgstr ""
1194
  msgid "Justify"
1195
  msgstr ""
1196
 
1197
- #: ../includes/class-widgets.php:450 ../responsive-lightbox.php:473
1198
  msgid "Select image"
1199
  msgstr ""
1200
 
@@ -1234,41 +1225,41 @@ msgstr ""
1234
  msgid "Text align"
1235
  msgstr ""
1236
 
1237
- #: ../responsive-lightbox.php:332
1238
  #, php-format
1239
  msgid ""
1240
  "Thank you for installing Responsive Lightbox version %s. <a href=\"%s"
1241
  "\">Click here</a> to check out our latest extensions!"
1242
  msgstr ""
1243
 
1244
- #: ../responsive-lightbox.php:404
1245
  msgid "Support"
1246
  msgstr ""
1247
 
1248
- #: ../responsive-lightbox.php:423
1249
  msgid "Settings"
1250
  msgstr ""
1251
 
1252
- #: ../responsive-lightbox.php:444
1253
  msgid "Are you sure you want to reset these settings to defaults?"
1254
  msgstr ""
1255
 
1256
- #: ../responsive-lightbox.php:445
1257
  msgid "Are you sure you want to reset this script settings to defaults?"
1258
  msgstr ""
1259
 
1260
- #: ../responsive-lightbox.php:446
1261
  msgid "Are you sure you want to reset this gallery settings to defaults?"
1262
  msgstr ""
1263
 
1264
- #: ../responsive-lightbox.php:471
1265
  msgid "Remove image"
1266
  msgstr ""
1267
 
1268
- #: ../responsive-lightbox.php:474
1269
  msgid "Use these images"
1270
  msgstr ""
1271
 
1272
- #: ../responsive-lightbox.php:475
1273
  msgid "Use this image"
1274
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Responsive Lightbox\n"
5
+ "POT-Creation-Date: 2017-05-31 09:33+0200\n"
6
  "PO-Revision-Date: 2015-05-12 12:06+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
390
  msgid "Gallery"
391
  msgstr ""
392
 
393
+ #: ../includes/class-settings.php:374 ../includes/class-settings.php:1269
394
  msgid "Licenses"
395
  msgstr ""
396
 
635
  msgid "Enable escape button"
636
  msgstr ""
637
 
638
+ #: ../includes/class-settings.php:651 ../includes/class-settings.php:1029
639
  msgid "Toggle if pressing Esc button closes lightbox."
640
  msgstr ""
641
 
816
  msgid "Click overlay to close"
817
  msgstr ""
818
 
819
+ #: ../includes/class-settings.php:841 ../includes/class-settings.php:986
820
  msgid "Enable to close lightbox on overlay click."
821
  msgstr ""
822
 
930
  msgid "Thumbnails"
931
  msgstr ""
932
 
933
+ #: ../includes/class-settings.php:983
934
+ msgid "Overlay close"
935
+ msgstr ""
936
+
937
+ #: ../includes/class-settings.php:998
938
  msgid "Opening speed"
939
  msgstr ""
940
 
941
+ #: ../includes/class-settings.php:1001
942
  msgid "Duration of opening animation."
943
  msgstr ""
944
 
945
+ #: ../includes/class-settings.php:1006
946
  msgid "Closing speed"
947
  msgstr ""
948
 
949
+ #: ../includes/class-settings.php:1009
950
  msgid "Duration of closing animation."
951
  msgstr ""
952
 
953
+ #: ../includes/class-settings.php:1014
954
  msgid "Close on click"
955
  msgstr ""
956
 
957
+ #: ../includes/class-settings.php:1017
958
  msgid "Select how to close lightbox."
959
  msgstr ""
960
 
961
+ #: ../includes/class-settings.php:1019
962
  msgid "background"
963
  msgstr ""
964
 
965
+ #: ../includes/class-settings.php:1020
966
  msgid "anywhere"
967
  msgstr ""
968
 
969
+ #: ../includes/class-settings.php:1021
970
  msgid "false"
971
  msgstr ""
972
 
973
+ #: ../includes/class-settings.php:1026
974
  msgid "Close on Esc"
975
  msgstr ""
976
 
977
+ #: ../includes/class-settings.php:1033
978
  msgid "Gallery fade in"
979
  msgstr ""
980
 
981
+ #: ../includes/class-settings.php:1036
982
  msgid "Animation speed when image is loaded."
983
  msgstr ""
984
 
985
+ #: ../includes/class-settings.php:1041
986
  msgid "Gallery fade out"
987
  msgstr ""
988
 
989
+ #: ../includes/class-settings.php:1044
990
  msgid "Animation speed before image is loaded."
991
  msgstr ""
992
 
993
+ #: ../includes/class-settings.php:1073 ../includes/class-settings.php:1088
994
+ #: ../includes/class-settings.php:1101
995
  msgid "Responsive Lightbox"
996
  msgstr ""
997
 
998
+ #: ../includes/class-settings.php:1103
999
  msgid "Need support?"
1000
  msgstr ""
1001
 
1002
+ #: ../includes/class-settings.php:1104
1003
  #, php-format
1004
  msgid ""
1005
  "If you are having problems with this plugin, please browse it's <a href=\"%s"
1007
  "\" target=\"_blank\">Support forum</a>"
1008
  msgstr ""
1009
 
1010
+ #: ../includes/class-settings.php:1106
1011
  msgid "Do you like this plugin?"
1012
  msgstr ""
1013
 
1014
+ #: ../includes/class-settings.php:1107
1015
  #, php-format
1016
  msgid "<a href=\"%s\" target=\"_blank\">Rate it 5</a> on WordPress.org"
1017
  msgstr ""
1018
 
1019
+ #: ../includes/class-settings.php:1108
1020
  #, php-format
1021
  msgid ""
1022
  "Blog about it & link to the <a href=\"%s\" target=\"_blank\">plugin page</a>."
1023
  msgstr ""
1024
 
1025
+ #: ../includes/class-settings.php:1109
1026
  #, php-format
1027
  msgid ""
1028
  "Check out our other <a href=\"%s\" target=\"_blank\">WordPress plugins</a>."
1029
  msgstr ""
1030
 
1031
+ #: ../includes/class-settings.php:1151
1032
  msgid "Reset to defaults"
1033
  msgstr ""
1034
 
1035
+ #: ../includes/class-settings.php:1539
1036
  msgid "Settings restored to defaults."
1037
  msgstr ""
1038
 
1039
+ #: ../includes/class-settings.php:1552
1040
  msgid "Add-ons / Extensions"
1041
  msgstr ""
1042
 
1043
+ #: ../includes/class-settings.php:1553
1044
  msgid ""
1045
  "Enhance your website with these beautiful, easy to use extensions, designed "
1046
  "with Responsive Lightbox integration in mind."
1047
  msgstr ""
1048
 
1049
+ #: ../includes/class-settings.php:1567
1050
  msgid ""
1051
  "There was an error retrieving the extensions list from the server. Please "
1052
  "try again later."
1053
  msgstr ""
1054
 
1055
+ #: ../includes/class-settings.php:1580
1056
  msgid "A list of licenses for your Responsive Lightbox extensions."
1057
  msgstr ""
1058
 
1059
+ #: ../includes/class-settings.php:1596
1060
  #, php-format
1061
  msgid ""
1062
  "Enter your license key to activate %s extension and enable automatic upgrade "
1063
  "notices."
1064
  msgstr ""
1065
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1066
  #: ../includes/class-widgets.php:47
1067
  msgid "Displays an image gallery."
1068
  msgstr ""
1105
  msgid "Default"
1106
  msgstr ""
1107
 
1108
+ #: ../includes/class-widgets.php:128 ../responsive-lightbox.php:473
1109
  msgid "Select images"
1110
  msgstr ""
1111
 
1185
  msgid "Justify"
1186
  msgstr ""
1187
 
1188
+ #: ../includes/class-widgets.php:450 ../responsive-lightbox.php:474
1189
  msgid "Select image"
1190
  msgstr ""
1191
 
1225
  msgid "Text align"
1226
  msgstr ""
1227
 
1228
+ #: ../responsive-lightbox.php:333
1229
  #, php-format
1230
  msgid ""
1231
  "Thank you for installing Responsive Lightbox version %s. <a href=\"%s"
1232
  "\">Click here</a> to check out our latest extensions!"
1233
  msgstr ""
1234
 
1235
+ #: ../responsive-lightbox.php:405
1236
  msgid "Support"
1237
  msgstr ""
1238
 
1239
+ #: ../responsive-lightbox.php:424
1240
  msgid "Settings"
1241
  msgstr ""
1242
 
1243
+ #: ../responsive-lightbox.php:445
1244
  msgid "Are you sure you want to reset these settings to defaults?"
1245
  msgstr ""
1246
 
1247
+ #: ../responsive-lightbox.php:446
1248
  msgid "Are you sure you want to reset this script settings to defaults?"
1249
  msgstr ""
1250
 
1251
+ #: ../responsive-lightbox.php:447
1252
  msgid "Are you sure you want to reset this gallery settings to defaults?"
1253
  msgstr ""
1254
 
1255
+ #: ../responsive-lightbox.php:472
1256
  msgid "Remove image"
1257
  msgstr ""
1258
 
1259
+ #: ../responsive-lightbox.php:475
1260
  msgid "Use these images"
1261
  msgstr ""
1262
 
1263
+ #: ../responsive-lightbox.php:476
1264
  msgid "Use this image"
1265
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: gallery, images, lightbox, photos, theme, photo, image, picture, slideshow, modal, overlay, video
5
  Requires at least: 4.0
6
- Tested up to: 4.7.4
7
- Stable tag: 1.7.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -70,6 +70,12 @@ No questions yet.
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
 
73
  = 1.7.0 =
74
  * New: Add lightbox to widgets content
75
  * New: Add lightbox to WordPress comments
@@ -312,10 +318,8 @@ Initial release
312
 
313
  == Upgrade Notice ==
314
 
315
- = 1.7.0 =
316
- * New: Add lightbox to widgets content
317
- * New: Add lightbox to WordPress comments
318
- * New: Gallery widget
319
- * New: Single image widget
320
- * New: Visual Composer compatibility
321
- * New: WooCommerce 3.0 compatibility
3
  Donate link: http://www.dfactory.eu/
4
  Tags: gallery, images, lightbox, photos, theme, photo, image, picture, slideshow, modal, overlay, video
5
  Requires at least: 4.0
6
+ Tested up to: 4.7.5
7
+ Stable tag: 1.7.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
70
 
71
  == Changelog ==
72
 
73
+ = 1.7.1 =
74
+ * New: Tos "R" Us overlay close option
75
+ * Fix: License activation issues
76
+ * Tweak: Featherlight script update to 1.7.0
77
+ * Tweak: Imagelightbox script update
78
+
79
  = 1.7.0 =
80
  * New: Add lightbox to widgets content
81
  * New: Add lightbox to WordPress comments
318
 
319
  == Upgrade Notice ==
320
 
321
+ = 1.7.1 =
322
+ * New: Tos "R" Us overlay close option
323
+ * Fix: License activation issues
324
+ * Tweak: Featherlight script update to 1.7.0
325
+ * Tweak: Imagelightbox script update
 
 
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.7.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
@@ -37,7 +37,7 @@ include_once( RESPONSIVE_LIGHTBOX_PATH . 'includes/class-widgets.php' );
37
  * Responsive Lightbox class.
38
  *
39
  * @class Responsive_Lightbox
40
- * @version 1.7.0
41
  */
42
  class Responsive_Lightbox {
43
 
@@ -61,8 +61,9 @@ class Responsive_Lightbox {
61
  'conditional_loading' => false,
62
  'enable_custom_events' => false,
63
  'custom_events' => 'ajaxComplete',
64
- 'update_version' => 0,
65
- 'update_notice' => true
 
66
  ),
67
  'configuration' => array(
68
  'swipebox' => array(
@@ -147,7 +148,8 @@ class Responsive_Lightbox {
147
  'pause_on_hover' => false,
148
  'timeout' => 4000,
149
  'pagination' => true,
150
- 'pagination_type' => 'thumbnails'
 
151
  ),
152
  'featherlight' => array(
153
  'open_speed' => 250,
@@ -158,7 +160,8 @@ class Responsive_Lightbox {
158
  'gallery_fade_out' => 300
159
  )
160
  ),
161
- 'version' => '1.7.0'
 
162
  );
163
  public $options = array();
164
  private $notices = array();
@@ -184,28 +187,29 @@ class Responsive_Lightbox {
184
  // change from older versions
185
  $db_version = get_option( 'responsive_lightbox_version' );
186
 
 
187
  if ( version_compare( ( $db_version === false ? '1.0.0' : $db_version ), '1.0.5', '<' ) ) {
188
- if ( ($array = get_option( 'rl_settings' )) !== false ) {
189
  update_option( 'responsive_lightbox_settings', $array );
190
  delete_option( 'rl_settings' );
191
  }
192
 
193
- if ( ($array = get_option( 'rl_configuration' )) !== false ) {
194
  update_option( 'responsive_lightbox_configuration', $array );
195
  delete_option( 'rl_configuration' );
196
  }
 
 
 
197
  }
198
 
199
- // update plugin version
200
- update_option( 'responsive_lightbox_version', $this->defaults['version'], false );
201
-
202
  $this->options['settings'] = array_merge( $this->defaults['settings'], ( ($array = get_option( 'responsive_lightbox_settings' ) ) === false ? array() : $array ) );
203
 
204
  // for multi arrays we have to merge them separately
205
  $db_conf_opts = ( ( $base = get_option( 'responsive_lightbox_configuration' ) ) === false ? array() : $base );
206
 
207
  foreach ( $this->defaults['configuration'] as $script => $settings ) {
208
- $this->options['configuration'][$script] = array_merge( $settings, (isset( $db_conf_opts[$script] ) ? $db_conf_opts[$script] : array() ) );
209
  }
210
 
211
  // actions
@@ -213,8 +217,8 @@ class Responsive_Lightbox {
213
  add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_styles' ) );
214
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts_styles' ) );
215
  add_action( 'sidebar_admin_setup', array( $this, 'sidebar_admin_setup' ) );
216
- add_action( 'admin_init', array( $this, 'update_notices' ) );
217
- add_action( 'admin_print_scripts', array( $this, 'admin_inline_js' ), 999 );
218
 
219
  // filters
220
  add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ), 10, 2 );
@@ -302,35 +306,83 @@ class Responsive_Lightbox {
302
  public function load_textdomain() {
303
  load_plugin_textdomain( 'responsive-lightbox', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
304
  }
305
-
306
  /**
307
- * Update notices.
308
  */
309
- public function update_notices() {
310
  if ( ! current_user_can( 'install_plugins' ) )
311
  return;
312
 
313
- $current_update = 1;
314
 
315
  if ( $this->options['settings']['update_version'] < $current_update ) {
316
  // check version, if update ver is lower than plugin ver, set update notice to true
317
  $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_version' => $current_update, 'update_notice' => true ) );
 
318
  update_option( 'responsive_lightbox_settings', $this->options['settings'] );
319
- } elseif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'rl-hide-notice' ) {
320
- if ( wp_verify_nonce( $_REQUEST['rl_nonce'], 'rl_action' ) ) {
321
- // hide notice, if query arg is set, before it gets displayed
322
- $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_notice' => false ) );
323
- update_option( 'responsive_lightbox_settings', $this->options['settings'] );
324
- } else {
325
- print_r( $_REQUEST );
326
  }
327
  }
328
 
329
  // display current version notice
330
- if ( $this->options['settings']['update_notice'] === true ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
- $this->add_notice( sprintf(__( 'Thank you for installing Responsive Lightbox version %s. <a href="%s">Click here</a> to check out our latest extensions!', 'responsive-lightbox'), $this->defaults['version'], wp_nonce_url( add_query_arg( array( 'action' => 'rl-hide-notice' ), admin_url( 'options-general.php' ) . '?page=responsive-lightbox&tab=addons' ), 'rl_action', 'rl_nonce' ) ), 'updated notice is-dismissible rl-notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  }
 
 
334
  }
335
 
336
  /**
@@ -345,7 +397,7 @@ class Responsive_Lightbox {
345
 
346
  add_action( 'admin_notices', array( $this, 'display_notice') );
347
 
348
- if( $network )
349
  add_action( 'network_admin_notices', array( $this, 'display_notice') );
350
  }
351
 
@@ -374,15 +426,21 @@ class Responsive_Lightbox {
374
  ( function ( $ ) {
375
  $( document ).ready( function () {
376
  // save dismiss state
377
- $( '.rl-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( e ) {
378
- e.preventDefault();
379
-
 
 
 
 
380
  $.post( ajaxurl, {
381
- action: 'rl-hide-notice',
 
382
  url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
383
- rl_nonce: '<?php echo wp_create_nonce( 'rl_action' ); ?>'
384
  } );
385
-
 
386
  } );
387
  } );
388
  } )( jQuery );
@@ -690,7 +748,8 @@ class Responsive_Lightbox {
690
  'pauseOnHover' => $this->get_boolean_value( $this->options['configuration']['tosrus']['pause_on_hover'] ),
691
  'timeout' => $this->options['configuration']['tosrus']['timeout'],
692
  'pagination' => $this->get_boolean_value( $this->options['configuration']['tosrus']['pagination'] ),
693
- 'paginationType' => $this->options['configuration']['tosrus']['pagination_type']
 
694
  )
695
  );
696
 
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.7.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
37
  * Responsive Lightbox class.
38
  *
39
  * @class Responsive_Lightbox
40
+ * @version 1.7.1
41
  */
42
  class Responsive_Lightbox {
43
 
61
  'conditional_loading' => false,
62
  'enable_custom_events' => false,
63
  'custom_events' => 'ajaxComplete',
64
+ 'update_version' => 1,
65
+ 'update_notice' => true,
66
+ 'update_delay_date' => ''
67
  ),
68
  'configuration' => array(
69
  'swipebox' => array(
148
  'pause_on_hover' => false,
149
  'timeout' => 4000,
150
  'pagination' => true,
151
+ 'pagination_type' => 'thumbnails',
152
+ 'close_on_click' => false
153
  ),
154
  'featherlight' => array(
155
  'open_speed' => 250,
160
  'gallery_fade_out' => 300
161
  )
162
  ),
163
+ 'version' => '1.7.1',
164
+ 'activation_date' => ''
165
  );
166
  public $options = array();
167
  private $notices = array();
187
  // change from older versions
188
  $db_version = get_option( 'responsive_lightbox_version' );
189
 
190
+ // legacy version update
191
  if ( version_compare( ( $db_version === false ? '1.0.0' : $db_version ), '1.0.5', '<' ) ) {
192
+ if ( ( $array = get_option( 'rl_settings' ) ) !== false ) {
193
  update_option( 'responsive_lightbox_settings', $array );
194
  delete_option( 'rl_settings' );
195
  }
196
 
197
+ if ( ( $array = get_option( 'rl_configuration' ) ) !== false ) {
198
  update_option( 'responsive_lightbox_configuration', $array );
199
  delete_option( 'rl_configuration' );
200
  }
201
+ // plugin version update
202
+ } elseif ( version_compare( ( $db_version === false ? '1.0.0' : $db_version ), $this->defaults['version'], '<' ) ) {
203
+ update_option( 'responsive_lightbox_version', $this->defaults['version'], false );
204
  }
205
 
 
 
 
206
  $this->options['settings'] = array_merge( $this->defaults['settings'], ( ($array = get_option( 'responsive_lightbox_settings' ) ) === false ? array() : $array ) );
207
 
208
  // for multi arrays we have to merge them separately
209
  $db_conf_opts = ( ( $base = get_option( 'responsive_lightbox_configuration' ) ) === false ? array() : $base );
210
 
211
  foreach ( $this->defaults['configuration'] as $script => $settings ) {
212
+ $this->options['configuration'][$script] = array_merge( $settings, ( isset( $db_conf_opts[$script] ) ? $db_conf_opts[$script] : array() ) );
213
  }
214
 
215
  // actions
217
  add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_styles' ) );
218
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts_styles' ) );
219
  add_action( 'sidebar_admin_setup', array( $this, 'sidebar_admin_setup' ) );
220
+ add_action( 'admin_init', array( $this, 'update_notice' ) );
221
+ add_action( 'wp_ajax_rl_dismiss_notice', array( $this, 'dismiss_notice' ) );
222
 
223
  // filters
224
  add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ), 10, 2 );
306
  public function load_textdomain() {
307
  load_plugin_textdomain( 'responsive-lightbox', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
308
  }
309
+
310
  /**
311
+ * Update notice.
312
  */
313
+ public function update_notice() {
314
  if ( ! current_user_can( 'install_plugins' ) )
315
  return;
316
 
317
+ $current_update = 2;
318
 
319
  if ( $this->options['settings']['update_version'] < $current_update ) {
320
  // check version, if update ver is lower than plugin ver, set update notice to true
321
  $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_version' => $current_update, 'update_notice' => true ) );
322
+
323
  update_option( 'responsive_lightbox_settings', $this->options['settings'] );
324
+
325
+ // set activation date
326
+ $activation_date = get_option( 'responsive_lightbox_activation_date' );
327
+
328
+ if ( $activation_date === false ) {
329
+ update_option( 'responsive_lightbox_activation_date', time() );
 
330
  }
331
  }
332
 
333
  // display current version notice
334
+ if ( $this->options['settings']['update_notice'] === true ) {
335
+ // include notice js, only if needed
336
+ add_action( 'admin_print_scripts', array( $this, 'admin_inline_js' ), 999 );
337
+
338
+ // get activation date
339
+ $activation_date = get_option( 'responsive_lightbox_activation_date' );
340
+ $time = time();
341
+ $delay_date = ! empty( $this->options['settings']['update_delay_date'] ) ? (int) $this->options['settings']['update_delay_date'] : $time;
342
+
343
+ if ( ( $delay_date + WEEK_IN_SECONDS ) <= $time ) {
344
+ $notice = sprintf( __( "Hey, you've been using <strong>Responsive Lightbox</strong> for more than %s", 'responsive-lightbox' ), human_time_diff( $activation_date, $time ) ) . '<br />';
345
+ $notice .= __( 'Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation.', 'responsive-lightbox' ) . '<br /><br />';
346
+ $notice .= __( 'Your help is much appreciated. Thank you very much,', 'responsive-lightbox' ) . '<br />';
347
+ $notice .= sprintf( __( '<strong>~ Bartosz Arendt</strong>, founder of <a href="%s" target="_blank">dFactory</a> plugins.', 'responsive-lightbox' ), 'https://dfactory.eu/' ) . '<br /><br />';
348
+ $notice .= sprintf( __( '<a href="%s" class="rl-dismissible-notice" target="_blank" rel="noopener">Ok, you deserve it</a><br /><a href="javascript:void(0);" class="rl-dismissible-notice rl-delay-notice" rel="noopener">Nope, maybe later</a><br /><a href="javascript:void(0);" class="rl-dismissible-notice" rel="noopener">I already did</a>', 'responsive-lightbox' ), 'https://wordpress.org/support/plugin/responsive-lightbox/reviews/?filter=5#new-post' );
349
+
350
+ // $notice .= sprintf( __( '<a href="%s">Click here</a> to check out our latest extensions!', 'responsive-lightbox' ), wp_nonce_url( add_query_arg( array( 'action' => 'rl-hide-notice' ), admin_url( 'options-general.php' ) . '?page=responsive-lightbox&tab=addons' ), 'rl_action', 'rl_nonce' ) );
351
+
352
+ $this->add_notice( $notice, 'notice notice-info is-dismissible rl-notice' );
353
+ }
354
+ }
355
+ }
356
+
357
+ /**
358
+ * Dismiss notice.
359
+ */
360
+ public function dismiss_notice() {
361
+ if ( ! current_user_can( 'install_plugins' ) )
362
+ return;
363
+
364
+ if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'rl_dismiss_notice' ) ) {
365
 
366
+ $notice_action = empty( $_REQUEST['notice_action'] ) || $_REQUEST['notice_action'] === 'hide' ? 'hide' : esc_attr( $_REQUEST['notice_action'] );
367
+
368
+ switch ( $notice_action ) {
369
+ // delay notice
370
+ case 'delay' :
371
+ // set delay period to 1 week from now
372
+ $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_delay_date' => time() + WEEK_IN_SECONDS ) );
373
+ update_option( 'responsive_lightbox_settings', $this->options['settings'] );
374
+ break;
375
+ // hide notice
376
+ default :
377
+ $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_notice' => false ) );
378
+ $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_delay_date' => '' ) );
379
+
380
+ update_option( 'responsive_lightbox_settings', $this->options['settings'] );
381
+ break;
382
+ }
383
  }
384
+
385
+ exit;
386
  }
387
 
388
  /**
397
 
398
  add_action( 'admin_notices', array( $this, 'display_notice') );
399
 
400
+ if ( $network )
401
  add_action( 'network_admin_notices', array( $this, 'display_notice') );
402
  }
403
 
426
  ( function ( $ ) {
427
  $( document ).ready( function () {
428
  // save dismiss state
429
+ $( '.rl-notice.is-dismissible' ).on( 'click', '.notice-dismiss, .rl-dismissible-notice', function ( e ) {
430
+ var notice_action = 'hide';
431
+
432
+ if ( $( e.currentTarget ).hasClass( 'rl-delay-notice' ) ) {
433
+ notice_action = 'delay'
434
+ }
435
+
436
  $.post( ajaxurl, {
437
+ action: 'rl_dismiss_notice',
438
+ notice_action: notice_action,
439
  url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
440
+ nonce: '<?php echo wp_create_nonce( 'rl_dismiss_notice' ); ?>'
441
  } );
442
+
443
+ $( e.delegateTarget ).slideUp( 'fast' );
444
  } );
445
  } );
446
  } )( jQuery );
748
  'pauseOnHover' => $this->get_boolean_value( $this->options['configuration']['tosrus']['pause_on_hover'] ),
749
  'timeout' => $this->options['configuration']['tosrus']['timeout'],
750
  'pagination' => $this->get_boolean_value( $this->options['configuration']['tosrus']['pagination'] ),
751
+ 'paginationType' => $this->options['configuration']['tosrus']['pagination_type'],
752
+ 'closeOnClick' => $this->get_boolean_value( $this->options['configuration']['tosrus']['close_on_click'] )
753
  )
754
  );
755