diff --git a/Makefile b/Makefile index d7a06d4..47f8000 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,12 @@ build: @echo "Compiling documentation... ${CHECK} Done" @./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap-lightbox.js > docs/assets/js/bootstrap-lightbox.min.tmp.js - @echo "/*!\n* bootstrap-lightbox.js v0.6.0 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js + @echo "/*!\n* bootstrap-lightbox.js v0.6.1 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js @cat docs/assets/js/copyright.js js/bootstrap-lightbox.js > docs/assets/js/bootstrap-lightbox.js @cat docs/assets/js/copyright.js docs/assets/js/bootstrap-lightbox.min.tmp.js > docs/assets/js/bootstrap-lightbox.min.js @rm docs/assets/js/copyright.js docs/assets/js/bootstrap-lightbox.min.tmp.js - @echo "/*!\n* bootstrap-lightbox.css v0.6.0 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/css/copyright.css + @echo "/*!\n* bootstrap-lightbox.css v0.6.1 \n* Copyright 2013 Jason Butz\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/css/copyright.css @cat docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.css.tmp > docs/assets/css/bootstrap-lightbox.css @cat docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.min.css.tmp > docs/assets/css/bootstrap-lightbox.min.css @rm docs/assets/css/copyright.css docs/assets/css/bootstrap-lightbox.css.tmp docs/assets/css/bootstrap-lightbox.min.css.tmp diff --git a/docs/assets/css/bootstrap-lightbox.css b/docs/assets/css/bootstrap-lightbox.css index 24fecdc..467e4e4 100644 --- a/docs/assets/css/bootstrap-lightbox.css +++ b/docs/assets/css/bootstrap-lightbox.css @@ -1,5 +1,5 @@ /*! -* bootstrap-lightbox.css v0.6.0 +* bootstrap-lightbox.css v0.6.1 * Copyright 2013 Jason Butz * http://www.apache.org/licenses/LICENSE-2.0.txt */ diff --git a/docs/assets/css/bootstrap-lightbox.min.css b/docs/assets/css/bootstrap-lightbox.min.css index 505b4d1..bfda7ca 100644 --- a/docs/assets/css/bootstrap-lightbox.min.css +++ b/docs/assets/css/bootstrap-lightbox.min.css @@ -1,5 +1,5 @@ /*! -* bootstrap-lightbox.css v0.6.0 +* bootstrap-lightbox.css v0.6.1 * Copyright 2013 Jason Butz * http://www.apache.org/licenses/LICENSE-2.0.txt */ diff --git a/docs/assets/js/bootstrap-lightbox.js b/docs/assets/js/bootstrap-lightbox.js index ea3b57d..4353e5a 100644 --- a/docs/assets/js/bootstrap-lightbox.js +++ b/docs/assets/js/bootstrap-lightbox.js @@ -1,10 +1,10 @@ /*! -* bootstrap-lightbox.js v0.6.0 +* bootstrap-lightbox.js v0.6.1 * Copyright 2013 Jason Butz * http://www.apache.org/licenses/LICENSE-2.0.txt */ !function ($) { - "use strict"; // jshint ;_; + "use strict"; /* LIGHTBOX CLASS DEFINITION @@ -44,14 +44,14 @@ var that = this, e = $.Event('show'); - this.$element.trigger(e) + this.$element.trigger(e); - if (this.isShown || e.isDefaultPrevented()) return + if (this.isShown || e.isDefaultPrevented()) return; this.isShown = true; - this.escape() + this.escape(); // This bit is added since we don't display until we have the size // which prevents image jumping @@ -59,29 +59,29 @@ { that.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') + var transition = $.support.transition && that.$element.hasClass('fade'); if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position + that.$element.appendTo(document.body); //don't move modals dom position } - that.$element.show() + that.$element.show(); if (transition) { - that.$element[0].offsetWidth // force reflow + that.$element[0].offsetWidth; // force reflow } that.$element .addClass('in') - .attr('aria-hidden', false) + .attr('aria-hidden', false); - that.enforceFocus() + that.enforceFocus(); transition ? that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : - that.$element.focus().trigger('shown') + that.$element.focus().trigger('shown'); }); }); }; @@ -89,45 +89,45 @@ // We have to have this because of a class in it Lightbox.prototype.hide = function (e) { - e && e.preventDefault() + e && e.preventDefault(); - var that = this + var that = this; - e = $.Event('hide') + e = $.Event('hide'); - this.$element.trigger(e) + this.$element.trigger(e); - if (!this.isShown || e.isDefaultPrevented()) return + if (!this.isShown || e.isDefaultPrevented()) return; - this.isShown = false + this.isShown = false; - this.escape() + this.escape(); - $(document).off('focusin.lightbox') + $(document).off('focusin.lightbox'); this.$element .removeClass('in') - .attr('aria-hidden', true) + .attr('aria-hidden', true); $.support.transition && this.$element.hasClass('fade') ? this.hideWithTransition() : - this.hideModal() + this.hideModal(); }; // This references a class as well Lightbox.prototype.escape = function() { - var that = this + var that = this; if (this.isShown && this.options.keyboard) { this.$element.on('keyup.dismiss.lightbox', function ( e ) { - e.which == 27 && that.hide() - }) + e.which == 27 && that.hide(); + }); } else if (!this.isShown) { - this.$element.off('keyup.dismiss.lightbox') + this.$element.off('keyup.dismiss.lightbox'); } } @@ -205,7 +205,7 @@ /* LIGHTBOX PLUGIN DEFINITION * ======================= */ - var old = $.fn.lightbox + var old = $.fn.lightbox; $.fn.lightbox = function (option) { @@ -217,9 +217,9 @@ if (!data) $this.data('lightbox', (data = new Lightbox(this, options))); if (typeof option == 'string') - data[option]() + data[option](); else if (options.show) - data.show() + data.show(); }); }; @@ -235,15 +235,15 @@ * ================= */ $.fn.lightbox.noConflict = function () { - $.fn.lightbox = old - return this + $.fn.lightbox = old; + return this; } /* LIGHTBOX DATA-API * ================== */ - $(document).on('click.lightbox.data-api', '[data-toggle="lightbox"]', function (e) + $(document).on('click.lightbox.data-api', '[data-toggle*="lightbox"]', function (e) { var $this = $(this); var href = $this.attr('href'); @@ -256,7 +256,7 @@ .lightbox(option) .one('hide', function () { - $this.focus() + $this.focus(); }); }) diff --git a/docs/assets/js/bootstrap-lightbox.min.js b/docs/assets/js/bootstrap-lightbox.min.js index 5893785..3f38a46 100644 --- a/docs/assets/js/bootstrap-lightbox.min.js +++ b/docs/assets/js/bootstrap-lightbox.min.js @@ -1,6 +1,6 @@ /*! -* bootstrap-lightbox.js v0.6.0 +* bootstrap-lightbox.js v0.6.1 * Copyright 2013 Jason Butz * http://www.apache.org/licenses/LICENSE-2.0.txt */ -!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="lightbox"]',"click.dismiss.lightbox",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".lightbox-body").load(this.options.remote)};t.prototype=e.extend({},e.fn.modal.Constructor.prototype),t.prototype.constructor=t,t.prototype.enforceFocus=function(){var t=this;e(document).on("focusin.lightbox",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},t.prototype.show=function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.preloadSize(function(){t.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})})},t.prototype.hide=function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.lightbox"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},t.prototype.escape=function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.lightbox",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.lightbox")},t.prototype.preloadSize=function(t){var n=e.Callbacks();t&&n.add(t);var r=this,i,s,o,u,a,f,l,c,h,p;i=e(window).height(),s=e(window).width(),o=parseInt(r.$element.find(".lightbox-content").css("padding-top"),10),u=parseInt(r.$element.find(".lightbox-content").css("padding-bottom"),10),a=parseInt(r.$element.find(".lightbox-content").css("padding-left"),10),f=parseInt(r.$element.find(".lightbox-content").css("padding-right"),10),l=r.$element.find(".lightbox-content").find("img:first"),c=new Image,c.onload=function(){c.width+a+f>=s&&(h=c.width,p=c.height,c.width=s-a-f,c.height=p/h*c.width),c.height+o+u>=i&&(h=c.width,p=c.height,c.height=i-o-u,c.width=h/p*c.height),r.$element.css({position:"fixed",width:c.width+a+f,height:c.height+o+u,top:i/2-(c.height+o+u)/2,left:"50%","margin-left":-1*(c.width+a+f)/2}),r.$element.find(".lightbox-content").css({width:c.width,height:c.height}),n.fire()},c.src=l.attr("src")};var n=e.fn.lightbox;e.fn.lightbox=function(n){return this.each(function(){var r=e(this),i=r.data("lightbox"),s=e.extend({},e.fn.lightbox.defaults,r.data(),typeof n=="object"&&n);i||r.data("lightbox",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.lightbox.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.lightbox.Constructor=t,e.fn.lightbox.noConflict=function(){return e.fn.lightbox=n,this},e(document).on("click.lightbox.data-api",'[data-toggle="lightbox"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("lightbox")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.lightbox(s).one("hide",function(){n.focus()})})}(window.jQuery); \ No newline at end of file +!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="lightbox"]',"click.dismiss.lightbox",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".lightbox-body").load(this.options.remote)};t.prototype=e.extend({},e.fn.modal.Constructor.prototype),t.prototype.constructor=t,t.prototype.enforceFocus=function(){var t=this;e(document).on("focusin.lightbox",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},t.prototype.show=function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.preloadSize(function(){t.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})})},t.prototype.hide=function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.lightbox"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},t.prototype.escape=function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.lightbox",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.lightbox")},t.prototype.preloadSize=function(t){var n=e.Callbacks();t&&n.add(t);var r=this,i,s,o,u,a,f,l,c,h,p;i=e(window).height(),s=e(window).width(),o=parseInt(r.$element.find(".lightbox-content").css("padding-top"),10),u=parseInt(r.$element.find(".lightbox-content").css("padding-bottom"),10),a=parseInt(r.$element.find(".lightbox-content").css("padding-left"),10),f=parseInt(r.$element.find(".lightbox-content").css("padding-right"),10),l=r.$element.find(".lightbox-content").find("img:first"),c=new Image,c.onload=function(){c.width+a+f>=s&&(h=c.width,p=c.height,c.width=s-a-f,c.height=p/h*c.width),c.height+o+u>=i&&(h=c.width,p=c.height,c.height=i-o-u,c.width=h/p*c.height),r.$element.css({position:"fixed",width:c.width+a+f,height:c.height+o+u,top:i/2-(c.height+o+u)/2,left:"50%","margin-left":-1*(c.width+a+f)/2}),r.$element.find(".lightbox-content").css({width:c.width,height:c.height}),n.fire()},c.src=l.attr("src")};var n=e.fn.lightbox;e.fn.lightbox=function(n){return this.each(function(){var r=e(this),i=r.data("lightbox"),s=e.extend({},e.fn.lightbox.defaults,r.data(),typeof n=="object"&&n);i||r.data("lightbox",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.lightbox.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.lightbox.Constructor=t,e.fn.lightbox.noConflict=function(){return e.fn.lightbox=n,this},e(document).on("click.lightbox.data-api",'[data-toggle*="lightbox"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("lightbox")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.lightbox(s).one("hide",function(){n.focus()})})}(window.jQuery); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 454d13e..9caa710 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,7 @@