From 27c4d1cba425105c5052ddb4e654bd89789ffd4b Mon Sep 17 00:00:00 2001 From: Jan Sorgalla Date: Wed, 2 Dec 2015 20:16:45 +0100 Subject: [PATCH] Prepare release v1.5.1 --- CHANGELOG.md | 6 ++++++ dist/lity.css | 2 +- dist/lity.js | 4 ++-- dist/lity.min.css | 2 +- dist/lity.min.js | 4 ++-- package.json | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ab6d9..fa4e6da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Changelog All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +1.5.1 - 2015-12-02 +------------------ + +* Fixed: Better window instance detection, falls back to `this` if undefined +* Fixed: Fix wrong argument when calling configured handler + 1.5.0 - 2015-09-22 ------------------ diff --git a/dist/lity.css b/dist/lity.css index 5cdd04d..381fc27 100644 --- a/dist/lity.css +++ b/dist/lity.css @@ -1,4 +1,4 @@ -/*! Lity - v1.5.0 - 2015-12-02 +/*! Lity - v1.5.1 - 2015-12-02 * http://sorgalla.com/lity/ * Copyright (c) 2015 Jan Sorgalla; Licensed MIT */ .lity { diff --git a/dist/lity.js b/dist/lity.js index 068eaeb..3642551 100644 --- a/dist/lity.js +++ b/dist/lity.js @@ -1,4 +1,4 @@ -/*! Lity - v1.5.0 - 2015-12-02 +/*! Lity - v1.5.1 - 2015-12-02 * http://sorgalla.com/lity/ * Copyright (c) 2015 Jan Sorgalla; Licensed MIT */ (function(window, factory) { @@ -427,7 +427,7 @@ return popup.options(options); } - lity.version = '1.5.0'; + lity.version = '1.5.1'; lity.handlers = $.proxy(settings, lity, _defaultHandlers); lity.options = $.proxy(settings, lity, _defaultOptions); diff --git a/dist/lity.min.css b/dist/lity.min.css index 346f5e5..d6cb05c 100644 --- a/dist/lity.min.css +++ b/dist/lity.min.css @@ -1,3 +1,3 @@ -/*! Lity - v1.5.0 - 2015-12-02 +/*! Lity - v1.5.1 - 2015-12-02 * http://sorgalla.com/lity/ * Copyright (c) 2015 Jan Sorgalla; Licensed MIT */.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,0.9);outline:none !important;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none !important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-0.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-0.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none !important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;-o-transition:-o-transform .3s ease;transition:transform .3s ease}.lity-loading .lity-content,.lity-closed .lity-content{-webkit-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,0.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:hover,.lity-close:focus,.lity-close:active,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,0.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container{width:100%;max-width:964px}.lity-iframe-container{width:100%;height:0;overflow:hidden;padding-top:56.25%}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#000}.lity-hide{display:none} \ No newline at end of file diff --git a/dist/lity.min.js b/dist/lity.min.js index 731a84b..093a0eb 100644 --- a/dist/lity.min.js +++ b/dist/lity.min.js @@ -1,4 +1,4 @@ -/*! Lity - v1.5.0 - 2015-12-02 +/*! Lity - v1.5.1 - 2015-12-02 * http://sorgalla.com/lity/ * Copyright (c) 2015 Jan Sorgalla; Licensed MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(){p[q>0?"addClass":"removeClass"]("lity-active")}function d(a){var c=b.Deferred();return x?(a.one(x,c.resolve),setTimeout(c.resolve,500)):c.resolve(),c.promise()}function e(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if("undefined"==typeof d)return"undefined"==typeof a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function f(){return"file:"===a.location.protocol?"http:":""}function g(a){for(var b,c=decodeURI(a).split("&"),d={},e=0,f=c.length;f>e;e++)c[e]&&(b=c[e].split("="),d[b[0]]=b[1]);return d}function h(a,c){return a+(a.indexOf("?")>-1?"&":"?")+b.param(c)}function i(a){return b('').append(a)}function j(a){if(!r.test(a))return!1;var c=b(''),d=b.Deferred(),e=function(){d.reject(i("Failed loading image"))};return c.on("load",function(){return 0===this.naturalWidth?e():void d.resolve(c)}).on("error",e),d.promise()}function k(a){var c;try{c=b(a)}catch(d){return!1}if(!c.length)return!1;var e=b('');return c.after(e).on("lity:ready",function(a,b){b.one("lity:remove",function(){e.before(c.addClass("lity-hide")).remove()})})}function l(a){var c,d=a;return c=s.exec(a),c&&(d=h(f()+"//www.youtube"+(c[2]||"")+".com/embed/"+c[4],b.extend({autoplay:1},g(c[5]||"")))),c=t.exec(a),c&&(d=h(f()+"//player.vimeo.com/video/"+c[3],b.extend({autoplay:1},g(c[4]||"")))),c=u.exec(a),c&&(d=h(f()+"//www.google."+c[3]+"/maps?"+c[6],{output:c[6].indexOf("layer=c")>0?"svembed":"embed"})),'
'}function m(a){function f(a){27===a.keyCode&&k()}function g(){var a=n.documentElement.clientHeight?n.documentElement.clientHeight:Math.round(o.height());p.css("max-height",Math.floor(a)+"px").trigger("lity:resize",[m,l])}function h(a){m&&(p=b(a),o.on("resize",g),g(),m.find(".lity-loader").each(function(){var a=b(this);d(a).always(function(){a.remove()})}),m.removeClass("lity-loading").find(".lity-content").empty().append(p),p.removeClass("lity-hide").trigger("lity:ready",[m,l]),t.resolve())}function i(a,d,e){q++,c(),m=b(e.template).addClass("lity-loading").appendTo("body"),e.esc&&o.one("keyup",f),setTimeout(function(){m.addClass("lity-opened lity-"+a).on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&k()}).trigger("lity:open",[m,l]),b.when(d).always(h)},0)}function j(a,c){var d,e,f=b.extend({},v,s);if(c.handler&&f[c.handler])e=f[c.handler](a,l),d=c.handler;else{var g={};b.each(["inline","iframe"],function(a,b){f[b]&&(g[b]=f[b]),delete f[b]});var h=function(b,c){return c?(e=c(a,l),e?(d=b,!1):void 0):!0};b.each(f,h),d||b.each(g,h)}return e&&(t=b.Deferred(),b.when(k()).done(b.proxy(i,null,d,e,c))),!!e}function k(){if(m){var a=b.Deferred();return t.done(function(){q--,c(),o.off("resize",g).off("keyup",f),p.trigger("lity:close",[m,l]),m.removeClass("lity-opened").addClass("lity-closed");var b=m,e=p;m=null,p=null,d(e.add(b)).always(function(){e.trigger("lity:remove",[b,l]),b.remove(),a.resolve()})}),a.promise()}}function l(a){if(!a.preventDefault)return l.open(a);var c=b(this),d=c.data("lity-target")||c.attr("href")||c.attr("src");if(d){var e=b.extend({},w,r,c.data("lity-options")||c.data("lity"));j(d,e)&&a.preventDefault()}}var m,p,r={},s={},t=b.Deferred().resolve();return l.handlers=b.proxy(e,l,s),l.options=b.proxy(e,l,r),l.open=function(a){return j(a,b.extend({},w,r)),l},l.close=function(){return k(),l},l.options(a)}var n=a.document,o=b(a),p=b("html"),q=0,r=/\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$/i,s=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,t=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,u=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,v={image:j,inline:k,iframe:l},w={esc:!0,handler:null,template:'
Loading...
'},x=function(){var a=n.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return m.version="1.5.0",m.handlers=b.proxy(e,m,v),m.options=b.proxy(e,m,w),b(n).on("click","[data-lity]",m()),m}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(){p[q>0?"addClass":"removeClass"]("lity-active")}function d(a){var c=b.Deferred();return x?(a.one(x,c.resolve),setTimeout(c.resolve,500)):c.resolve(),c.promise()}function e(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if("undefined"==typeof d)return"undefined"==typeof a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function f(){return"file:"===a.location.protocol?"http:":""}function g(a){for(var b,c=decodeURI(a).split("&"),d={},e=0,f=c.length;f>e;e++)c[e]&&(b=c[e].split("="),d[b[0]]=b[1]);return d}function h(a,c){return a+(a.indexOf("?")>-1?"&":"?")+b.param(c)}function i(a){return b('').append(a)}function j(a){if(!r.test(a))return!1;var c=b(''),d=b.Deferred(),e=function(){d.reject(i("Failed loading image"))};return c.on("load",function(){return 0===this.naturalWidth?e():void d.resolve(c)}).on("error",e),d.promise()}function k(a){var c;try{c=b(a)}catch(d){return!1}if(!c.length)return!1;var e=b('');return c.after(e).on("lity:ready",function(a,b){b.one("lity:remove",function(){e.before(c.addClass("lity-hide")).remove()})})}function l(a){var c,d=a;return c=s.exec(a),c&&(d=h(f()+"//www.youtube"+(c[2]||"")+".com/embed/"+c[4],b.extend({autoplay:1},g(c[5]||"")))),c=t.exec(a),c&&(d=h(f()+"//player.vimeo.com/video/"+c[3],b.extend({autoplay:1},g(c[4]||"")))),c=u.exec(a),c&&(d=h(f()+"//www.google."+c[3]+"/maps?"+c[6],{output:c[6].indexOf("layer=c")>0?"svembed":"embed"})),'
'}function m(a){function f(a){27===a.keyCode&&k()}function g(){var a=n.documentElement.clientHeight?n.documentElement.clientHeight:Math.round(o.height());p.css("max-height",Math.floor(a)+"px").trigger("lity:resize",[m,l])}function h(a){m&&(p=b(a),o.on("resize",g),g(),m.find(".lity-loader").each(function(){var a=b(this);d(a).always(function(){a.remove()})}),m.removeClass("lity-loading").find(".lity-content").empty().append(p),p.removeClass("lity-hide").trigger("lity:ready",[m,l]),t.resolve())}function i(a,d,e){q++,c(),m=b(e.template).addClass("lity-loading").appendTo("body"),e.esc&&o.one("keyup",f),setTimeout(function(){m.addClass("lity-opened lity-"+a).on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&k()}).trigger("lity:open",[m,l]),b.when(d).always(h)},0)}function j(a,c){var d,e,f=b.extend({},v,s);if(c.handler&&f[c.handler])e=f[c.handler](a,l),d=c.handler;else{var g={};b.each(["inline","iframe"],function(a,b){f[b]&&(g[b]=f[b]),delete f[b]});var h=function(b,c){return c?(e=c(a,l),e?(d=b,!1):void 0):!0};b.each(f,h),d||b.each(g,h)}return e&&(t=b.Deferred(),b.when(k()).done(b.proxy(i,null,d,e,c))),!!e}function k(){if(m){var a=b.Deferred();return t.done(function(){q--,c(),o.off("resize",g).off("keyup",f),p.trigger("lity:close",[m,l]),m.removeClass("lity-opened").addClass("lity-closed");var b=m,e=p;m=null,p=null,d(e.add(b)).always(function(){e.trigger("lity:remove",[b,l]),b.remove(),a.resolve()})}),a.promise()}}function l(a){if(!a.preventDefault)return l.open(a);var c=b(this),d=c.data("lity-target")||c.attr("href")||c.attr("src");if(d){var e=b.extend({},w,r,c.data("lity-options")||c.data("lity"));j(d,e)&&a.preventDefault()}}var m,p,r={},s={},t=b.Deferred().resolve();return l.handlers=b.proxy(e,l,s),l.options=b.proxy(e,l,r),l.open=function(a){return j(a,b.extend({},w,r)),l},l.close=function(){return k(),l},l.options(a)}var n=a.document,o=b(a),p=b("html"),q=0,r=/\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$/i,s=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,t=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,u=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,v={image:j,inline:k,iframe:l},w={esc:!0,handler:null,template:'
Loading...
'},x=function(){var a=n.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return m.version="1.5.1",m.handlers=b.proxy(e,m,v),m.options=b.proxy(e,m,w),b(n).on("click","[data-lity]",m()),m}); \ No newline at end of file diff --git a/package.json b/package.json index b30efe0..93092a0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "http://sorgalla.com" }, "homepage": "http://sorgalla.com/lity/", - "version": "1.5.0", + "version": "1.5.1", "main": "dist/lity.js", "peerDependencies": { "jquery": ">=1.7"