o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1368726328.078689:@value"»&{I" class:ETI"ProcessedAsset; FI"logical_path; TI"&improved-modal/bootstrap-modal.js; FI" pathname; TI"/Users/jfriesen/.rvm/gems/ruby-2.0.0-p195@curate/gems/blacklight-4.2.1/app/assets/javascripts/improved-modal/bootstrap-modal.js; FI"content_type; TI"application/javascript; TI" mtime; TI"2013-05-15T10:46:13-04:00; TI"length; Tií"I"digest; TI"%a06be9b9644e6d6bed4e02081ad3ba77; FI"source; TI"í"/* =========================================================== * bootstrap-modal.js v2.0 * =========================================================== * Copyright 2012 Jordan Schroter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ !function ($) { "use strict"; // jshint ;_; /* MODAL CLASS DEFINITION * ====================== */ var Modal = function (element, options) { this.init(element, options); } Modal.prototype = { constructor: Modal, init: function (element, options) { this.options = options; this.$element = $(element) .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)); this.options.remote && this.$element.find('.modal-body').load(this.options.remote); var manager = typeof this.options.manager === 'function' ? this.options.manager.call(this) : this.options.manager; manager = manager.appendModal ? manager : $(manager).modalmanager().data('modalmanager'); manager.appendModal(this); }, toggle: function () { return this[!this.isShown ? 'show' : 'hide'](); }, show: function () { var that = this, e = $.Event('show'); if (this.isShown) return; this.$element.triggerHandler(e); if (e.isDefaultPrevented()) return; if (this.options.width){ this.$element.css('width', this.options.width); var that = this; this.$element.css('margin-left', function () { if (/%/ig.test(that.options.width)){ return -(parseInt(that.options.width) / 2) + '%'; } else { return -($(this).width() / 2) + 'px'; } }); } var prop = this.options.height ? 'height' : 'max-height'; var value = this.options.height || this.options.maxHeight; if (value){ this.$element.find('.modal-body') .css('overflow', 'auto') .css(prop, value); } this.escape(); this.tab(); this.options.loading && this.loading(); }, hide: function (e) { e && e.preventDefault(); e = $.Event('hide'); this.$element.triggerHandler(e); if (!this.isShown || e.isDefaultPrevented()) return (this.isShown = false); this.isShown = false; this.escape(); this.tab(); this.isLoading && this.loading(); $(document).off('focusin.modal'); this.$element .removeClass('in') .removeClass('animated') .removeClass(this.options.attentionAnimation) .removeClass('modal-overflow') .attr('aria-hidden', true); $.support.transition && this.$element.hasClass('fade') ? this.hideWithTransition() : this.hideModal(); }, tab: function () { var that = this; if (this.isShown && this.options.consumeTab) { this.$element.on('keydown.tabindex.modal', '[data-tabindex]', function (e) { if (e.keyCode && e.keyCode == 9){ var $next = $(this), $rollover = $(this); that.$element.find('[data-tabindex]:enabled:not([readonly])').each(function (e) { if (!e.shiftKey){ $next = $next.data('tabindex') < $(this).data('tabindex') ? $next = $(this) : $rollover = $(this); } else { $next = $next.data('tabindex') > $(this).data('tabindex') ? $next = $(this) : $rollover = $(this); } }); $next[0] !== $(this)[0] ? $next.focus() : $rollover.focus(); e.preventDefault(); } }); } else if (!this.isShown) { this.$element.off('keydown.tabindex.modal'); } }, escape: function () { var that = this; if (this.isShown && this.options.keyboard) { if (!this.$element.attr('tabindex')) this.$element.attr('tabindex', -1); this.$element.on('keyup.dismiss.modal', function (e) { e.which == 27 && that.hide(); }); } else if (!this.isShown) { this.$element.off('keyup.dismiss.modal') } }, hideWithTransition: function () { var that = this , timeout = setTimeout(function () { that.$element.off($.support.transition.end) that.hideModal() }, 500); this.$element.one($.support.transition.end, function () { clearTimeout(timeout) that.hideModal() }); }, hideModal: function () { this.$element .hide() .triggerHandler('hidden'); var prop = this.options.height ? 'height' : 'max-height'; var value = this.options.height || this.options.maxHeight; if (value){ this.$element.find('.modal-body') .css('overflow', '') .css(prop, ''); } }, removeLoading: function () { this.$loading.remove(); this.$loading = null; this.isLoading = false; }, loading: function (callback) { callback = callback || function () {}; var animate = this.$element.hasClass('fade') ? 'fade' : ''; if (!this.isLoading) { var doAnimate = $.support.transition && animate; this.$loading = $('