From d4e537496ce0bd7543caa04b1c5fb53fe11dc62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Madsen?= Date: Thu, 22 May 2014 13:54:05 +0200 Subject: [PATCH] Update bootstrap-lightbox to v0.7.0 --- .../0.7.0/bootstrap-lightbox.css | 89 +++++ .../0.7.0/bootstrap-lightbox.js | 363 ++++++++++++++++++ .../0.7.0/bootstrap-lightbox.min.css | 6 + .../0.7.0/bootstrap-lightbox.min.js | 6 + ajax/libs/bootstrap-lightbox/package.json | 2 +- 5 files changed, 465 insertions(+), 1 deletion(-) create mode 100644 ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.css create mode 100644 ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.js create mode 100644 ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.min.css create mode 100644 ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.min.js diff --git a/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.css b/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.css new file mode 100644 index 000000000..81f3f8568 --- /dev/null +++ b/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.css @@ -0,0 +1,89 @@ +/*! +* bootstrap-lightbox.css v0.7.0 +* Copyright 2014 Jason Butz +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +.lightbox-open { + overflow: hidden; +} + +body.lightbox-open, +.lightbox-open .navbar-fixed-top, +.lightbox-open .navbar-fixed-bottom { + margin-right: 15px; +} + +.lightbox { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + display: none; + overflow: auto; + overflow-y: scroll; +} + +.lightbox .fade .lightbox-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} + +.lightbox .in .lightbox-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); +} + +.lightbox .lightbox-dialog { + z-index: 1050; + width: auto; + /*padding: 10px;*/ + + margin-right: auto; + margin-left: auto; +} + +.lightbox .lightbox-dialog .lightbox-header { + float: right; +} + +.lightbox .lightbox-dialog .lightbox-header .close { + margin-top: -2px; +} + +.lightbox .lightbox-dialog .lightbox-content { + position: relative; + display: inline-block; + padding: 10px; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; +} + +.lightbox .lightbox-dialog .lightbox-content .lightbox-caption { + position: absolute; + right: 8px; + bottom: 8px; + left: 10px; + padding: 2%; + font-size: 14px; + line-height: 18px; + color: white; + text-align: center; + text-shadow: 0 -1px 0 #000000; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + background: #000; + background: rgba(0, 0, 0, 0.6); +} diff --git a/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.js b/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.js new file mode 100644 index 000000000..e38f82c36 --- /dev/null +++ b/ajax/libs/bootstrap-lightbox/0.7.0/bootstrap-lightbox.js @@ -0,0 +1,363 @@ +/*! +* bootstrap-lightbox.js v0.7.0 +* Copyright 2014 Jason Butz +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ + ++function ($) { "use strict"; + + // LIGHTBOX CLASS DEFINITION + // ====================== + + var Lightbox = function (element, options) + { + this.options = options + this.$element = $(element) + this.$backdrop = null + this.isShown = null + + if (this.options.remote) this.$element.load(this.options.remote) + } + + // We depend upon Twitter Bootstrap's Modal library to simplify things here + Lightbox.prototype = $.extend({},$.fn.modal.Constructor.prototype); + + Lightbox.prototype.constructor = Lightbox; + + Lightbox.DEFAULTS = { + backdrop: true, + keyboard: true, + show: true + } + + Lightbox.prototype.show = function (_relatedTarget) + { + var that = this; + var e = $.Event('show.bs.lightbox', { relatedTarget: _relatedTarget }); + + this.$element.trigger(e); + + if (this.isShown || e.isDefaultPrevented()) return; + + this.isShown = true; + + this.escape(); + + this.$element.on('click.dismiss.lightbox', '[data-dismiss="lightbox"]', $.proxy(this.hide, this)); + + // This bit is added since we don't display until we have the size + // which prevents image jumping + this.preloadSize(function() + { + that.backdrop(function () + { + 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.show(); + + if (transition) + { + that.$element[0].offsetWidth; // force reflow + } + + that.$element + .addClass('in') + .attr('aria-hidden', false); + + that.enforceFocus(); + + var e = $.Event('shown.bs.lightbox', { relatedTarget: _relatedTarget }); + + transition ? + that.$element.find('.lightbox-dialog') // wait for modal to slide in + .one($.support.transition.end, function () + { + that.$element.focus().trigger(e); + }) + .emulateTransitionEnd(300) : + that.$element.focus().trigger(e); + }); + }); + }; + + Lightbox.prototype.hide = function (e, slide) + { + if (e) e.preventDefault(); + + e = $.Event('hide.bs.lightbox'); + + this.$element.trigger(e); + + if (!this.isShown || e.isDefaultPrevented()) return; + + this.isShown = false; + + this.escape(); + + $(document).off('focusin.bs.lightbox'); + + this.$element + .removeClass('in') + .attr('aria-hidden', true) + .off('click.dismiss.lightbox'); + + $.support.transition && this.$element.hasClass('fade') ? + this.$element + .one($.support.transition.end, $.proxy(this.hideModal(slide), this)) + .emulateTransitionEnd(300) : + this.hideModal(slide); + }; + + Lightbox.prototype.enforceFocus = function () { + $(document) + .off('focusin.bs.lightbox') // guard against infinite focus loop + .on('focusin.bs.lightbox', $.proxy(function (e) + { + if (this.$element[0] !== e.target && !this.$element.has(e.target).length) + { + this.$element.focus(); + } + }, this)); + }; + + Lightbox.prototype.escape = function () + { + if (this.isShown && this.options.keyboard) + { + this.$element.on('keyup.dismiss.bs.lightbox', $.proxy(function (e) + { + e.which == 27 && this.hide(); + }, this)); + } + else if (!this.isShown) + { + this.$element.off('keyup.dismiss.bs.lightbox'); + } + } + + Lightbox.prototype.hideModal = function (slide) + { + var that = this; + this.$element.hide(); + this.backdrop(function () + { + that.removeBackdrop(); + + // Don't trigger hidden event if sliding between lightboxes + if(!slide) that.$element.trigger('hidden.bs.lightbox'); + }); + }; + + Lightbox.prototype.backdrop = function (callback) + { + var that = this + var animate = this.$element.hasClass('fade') ? 'fade' : '' + if (this.isShown && this.options.backdrop) + { + var doAnimate = $.support.transition && animate; + + this.$backdrop = $('