bgneal@118: /** bgneal@118: * bootstrap.js v3.0.0 by @fat and @mdo bgneal@118: * Copyright 2013 Twitter Inc. bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: */ bgneal@118: if (!jQuery) { throw new Error("Bootstrap requires jQuery") } bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: transition.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#transitions bgneal@118: * ======================================================================== bgneal@118: * Copyright 2013 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) bgneal@118: // ============================================================ bgneal@118: bgneal@118: function transitionEnd() { bgneal@118: var el = document.createElement('bootstrap') bgneal@118: bgneal@118: var transEndEventNames = { bgneal@118: 'WebkitTransition' : 'webkitTransitionEnd' bgneal@118: , 'MozTransition' : 'transitionend' bgneal@118: , 'OTransition' : 'oTransitionEnd otransitionend' bgneal@118: , 'transition' : 'transitionend' bgneal@118: } bgneal@118: bgneal@118: for (var name in transEndEventNames) { bgneal@118: if (el.style[name] !== undefined) { bgneal@118: return { end: transEndEventNames[name] } bgneal@118: } bgneal@118: } bgneal@118: } bgneal@118: bgneal@118: // http://blog.alexmaccaw.com/css-transitions bgneal@118: $.fn.emulateTransitionEnd = function (duration) { bgneal@118: var called = false, $el = this bgneal@118: $(this).one($.support.transition.end, function () { called = true }) bgneal@118: var callback = function () { if (!called) $($el).trigger($.support.transition.end) } bgneal@118: setTimeout(callback, duration) bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: $(function () { bgneal@118: $.support.transition = transitionEnd() bgneal@118: }) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: alert.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#alerts bgneal@118: * ======================================================================== bgneal@118: * Copyright 2013 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // ALERT CLASS DEFINITION bgneal@118: // ====================== bgneal@118: bgneal@118: var dismiss = '[data-dismiss="alert"]' bgneal@118: var Alert = function (el) { bgneal@118: $(el).on('click', dismiss, this.close) bgneal@118: } bgneal@118: bgneal@118: Alert.prototype.close = function (e) { bgneal@118: var $this = $(this) bgneal@118: var selector = $this.attr('data-target') bgneal@118: bgneal@118: if (!selector) { bgneal@118: selector = $this.attr('href') bgneal@118: selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 bgneal@118: } bgneal@118: bgneal@118: var $parent = $(selector) bgneal@118: bgneal@118: if (e) e.preventDefault() bgneal@118: bgneal@118: if (!$parent.length) { bgneal@118: $parent = $this.hasClass('alert') ? $this : $this.parent() bgneal@118: } bgneal@118: bgneal@118: $parent.trigger(e = $.Event('close.bs.alert')) bgneal@118: bgneal@118: if (e.isDefaultPrevented()) return bgneal@118: bgneal@118: $parent.removeClass('in') bgneal@118: bgneal@118: function removeElement() { bgneal@118: $parent.trigger('closed.bs.alert').remove() bgneal@118: } bgneal@118: bgneal@118: $.support.transition && $parent.hasClass('fade') ? bgneal@118: $parent bgneal@118: .one($.support.transition.end, removeElement) bgneal@118: .emulateTransitionEnd(150) : bgneal@118: removeElement() bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // ALERT PLUGIN DEFINITION bgneal@118: // ======================= bgneal@118: bgneal@118: var old = $.fn.alert bgneal@118: bgneal@118: $.fn.alert = function (option) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('bs.alert') bgneal@118: bgneal@118: if (!data) $this.data('bs.alert', (data = new Alert(this))) bgneal@118: if (typeof option == 'string') data[option].call($this) bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.alert.Constructor = Alert bgneal@118: bgneal@118: bgneal@118: // ALERT NO CONFLICT bgneal@118: // ================= bgneal@118: bgneal@118: $.fn.alert.noConflict = function () { bgneal@118: $.fn.alert = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // ALERT DATA-API bgneal@118: // ============== bgneal@118: bgneal@118: $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: button.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#buttons bgneal@118: * ======================================================================== bgneal@118: * Copyright 2013 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // BUTTON PUBLIC CLASS DEFINITION bgneal@118: // ============================== bgneal@118: bgneal@118: var Button = function (element, options) { bgneal@118: this.$element = $(element) bgneal@118: this.options = $.extend({}, Button.DEFAULTS, options) bgneal@118: } bgneal@118: bgneal@118: Button.DEFAULTS = { bgneal@118: loadingText: 'loading...' bgneal@118: } bgneal@118: bgneal@118: Button.prototype.setState = function (state) { bgneal@118: var d = 'disabled' bgneal@118: var $el = this.$element bgneal@118: var val = $el.is('input') ? 'val' : 'html' bgneal@118: var data = $el.data() bgneal@118: bgneal@118: state = state + 'Text' bgneal@118: bgneal@118: if (!data.resetText) $el.data('resetText', $el[val]()) bgneal@118: bgneal@118: $el[val](data[state] || this.options[state]) bgneal@118: bgneal@118: // push to event loop to allow forms to submit bgneal@118: setTimeout(function () { bgneal@118: state == 'loadingText' ? bgneal@118: $el.addClass(d).attr(d, d) : bgneal@118: $el.removeClass(d).removeAttr(d); bgneal@118: }, 0) bgneal@118: } bgneal@118: bgneal@118: Button.prototype.toggle = function () { bgneal@118: var $parent = this.$element.closest('[data-toggle="buttons"]') bgneal@118: bgneal@118: if ($parent.length) { bgneal@118: var $input = this.$element.find('input') bgneal@118: .prop('checked', !this.$element.hasClass('active')) bgneal@118: .trigger('change') bgneal@118: if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') bgneal@118: } bgneal@118: bgneal@118: this.$element.toggleClass('active') bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // BUTTON PLUGIN DEFINITION bgneal@118: // ======================== bgneal@118: bgneal@118: var old = $.fn.button bgneal@118: bgneal@118: $.fn.button = function (option) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('bs.button') bgneal@118: var options = typeof option == 'object' && option bgneal@118: bgneal@118: if (!data) $this.data('bs.button', (data = new Button(this, options))) bgneal@118: bgneal@118: if (option == 'toggle') data.toggle() bgneal@118: else if (option) data.setState(option) bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.button.Constructor = Button bgneal@118: bgneal@118: bgneal@118: // BUTTON NO CONFLICT bgneal@118: // ================== bgneal@118: bgneal@118: $.fn.button.noConflict = function () { bgneal@118: $.fn.button = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // BUTTON DATA-API bgneal@118: // =============== bgneal@118: bgneal@118: $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { bgneal@118: var $btn = $(e.target) bgneal@118: if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') bgneal@118: $btn.button('toggle') bgneal@118: e.preventDefault() bgneal@118: }) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: carousel.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#carousel bgneal@118: * ======================================================================== bgneal@118: * Copyright 2012 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // CAROUSEL CLASS DEFINITION bgneal@118: // ========================= bgneal@118: bgneal@118: var Carousel = function (element, options) { bgneal@118: this.$element = $(element) bgneal@118: this.$indicators = this.$element.find('.carousel-indicators') bgneal@118: this.options = options bgneal@118: this.paused = bgneal@118: this.sliding = bgneal@118: this.interval = bgneal@118: this.$active = bgneal@118: this.$items = null bgneal@118: bgneal@118: this.options.pause == 'hover' && this.$element bgneal@118: .on('mouseenter', $.proxy(this.pause, this)) bgneal@118: .on('mouseleave', $.proxy(this.cycle, this)) bgneal@118: } bgneal@118: bgneal@118: Carousel.DEFAULTS = { bgneal@118: interval: 5000 bgneal@118: , pause: 'hover' bgneal@118: , wrap: true bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.cycle = function (e) { bgneal@118: e || (this.paused = false) bgneal@118: bgneal@118: this.interval && clearInterval(this.interval) bgneal@118: bgneal@118: this.options.interval bgneal@118: && !this.paused bgneal@118: && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) bgneal@118: bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.getActiveIndex = function () { bgneal@118: this.$active = this.$element.find('.item.active') bgneal@118: this.$items = this.$active.parent().children() bgneal@118: bgneal@118: return this.$items.index(this.$active) bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.to = function (pos) { bgneal@118: var that = this bgneal@118: var activeIndex = this.getActiveIndex() bgneal@118: bgneal@118: if (pos > (this.$items.length - 1) || pos < 0) return bgneal@118: bgneal@118: if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) bgneal@118: if (activeIndex == pos) return this.pause().cycle() bgneal@118: bgneal@118: return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.pause = function (e) { bgneal@118: e || (this.paused = true) bgneal@118: bgneal@118: if (this.$element.find('.next, .prev').length && $.support.transition.end) { bgneal@118: this.$element.trigger($.support.transition.end) bgneal@118: this.cycle(true) bgneal@118: } bgneal@118: bgneal@118: this.interval = clearInterval(this.interval) bgneal@118: bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.next = function () { bgneal@118: if (this.sliding) return bgneal@118: return this.slide('next') bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.prev = function () { bgneal@118: if (this.sliding) return bgneal@118: return this.slide('prev') bgneal@118: } bgneal@118: bgneal@118: Carousel.prototype.slide = function (type, next) { bgneal@118: var $active = this.$element.find('.item.active') bgneal@118: var $next = next || $active[type]() bgneal@118: var isCycling = this.interval bgneal@118: var direction = type == 'next' ? 'left' : 'right' bgneal@118: var fallback = type == 'next' ? 'first' : 'last' bgneal@118: var that = this bgneal@118: bgneal@118: if (!$next.length) { bgneal@118: if (!this.options.wrap) return bgneal@118: $next = this.$element.find('.item')[fallback]() bgneal@118: } bgneal@118: bgneal@118: this.sliding = true bgneal@118: bgneal@118: isCycling && this.pause() bgneal@118: bgneal@118: var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) bgneal@118: bgneal@118: if ($next.hasClass('active')) return bgneal@118: bgneal@118: if (this.$indicators.length) { bgneal@118: this.$indicators.find('.active').removeClass('active') bgneal@118: this.$element.one('slid', function () { bgneal@118: var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) bgneal@118: $nextIndicator && $nextIndicator.addClass('active') bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: if ($.support.transition && this.$element.hasClass('slide')) { bgneal@118: this.$element.trigger(e) bgneal@118: if (e.isDefaultPrevented()) return bgneal@118: $next.addClass(type) bgneal@118: $next[0].offsetWidth // force reflow bgneal@118: $active.addClass(direction) bgneal@118: $next.addClass(direction) bgneal@118: $active bgneal@118: .one($.support.transition.end, function () { bgneal@118: $next.removeClass([type, direction].join(' ')).addClass('active') bgneal@118: $active.removeClass(['active', direction].join(' ')) bgneal@118: that.sliding = false bgneal@118: setTimeout(function () { that.$element.trigger('slid') }, 0) bgneal@118: }) bgneal@118: .emulateTransitionEnd(600) bgneal@118: } else { bgneal@118: this.$element.trigger(e) bgneal@118: if (e.isDefaultPrevented()) return bgneal@118: $active.removeClass('active') bgneal@118: $next.addClass('active') bgneal@118: this.sliding = false bgneal@118: this.$element.trigger('slid') bgneal@118: } bgneal@118: bgneal@118: isCycling && this.cycle() bgneal@118: bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // CAROUSEL PLUGIN DEFINITION bgneal@118: // ========================== bgneal@118: bgneal@118: var old = $.fn.carousel bgneal@118: bgneal@118: $.fn.carousel = function (option) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('bs.carousel') bgneal@118: var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) bgneal@118: var action = typeof option == 'string' ? option : options.slide bgneal@118: bgneal@118: if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) bgneal@118: if (typeof option == 'number') data.to(option) bgneal@118: else if (action) data[action]() bgneal@118: else if (options.interval) data.pause().cycle() bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.carousel.Constructor = Carousel bgneal@118: bgneal@118: bgneal@118: // CAROUSEL NO CONFLICT bgneal@118: // ==================== bgneal@118: bgneal@118: $.fn.carousel.noConflict = function () { bgneal@118: $.fn.carousel = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // CAROUSEL DATA-API bgneal@118: // ================= bgneal@118: bgneal@118: $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { bgneal@118: var $this = $(this), href bgneal@118: var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 bgneal@118: var options = $.extend({}, $target.data(), $this.data()) bgneal@118: var slideIndex = $this.attr('data-slide-to') bgneal@118: if (slideIndex) options.interval = false bgneal@118: bgneal@118: $target.carousel(options) bgneal@118: bgneal@118: if (slideIndex = $this.attr('data-slide-to')) { bgneal@118: $target.data('bs.carousel').to(slideIndex) bgneal@118: } bgneal@118: bgneal@118: e.preventDefault() bgneal@118: }) bgneal@118: bgneal@118: $(window).on('load', function () { bgneal@118: $('[data-ride="carousel"]').each(function () { bgneal@118: var $carousel = $(this) bgneal@118: $carousel.carousel($carousel.data()) bgneal@118: }) bgneal@118: }) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: collapse.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#collapse bgneal@118: * ======================================================================== bgneal@118: * Copyright 2012 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // COLLAPSE PUBLIC CLASS DEFINITION bgneal@118: // ================================ bgneal@118: bgneal@118: var Collapse = function (element, options) { bgneal@118: this.$element = $(element) bgneal@118: this.options = $.extend({}, Collapse.DEFAULTS, options) bgneal@118: this.transitioning = null bgneal@118: bgneal@118: if (this.options.parent) this.$parent = $(this.options.parent) bgneal@118: if (this.options.toggle) this.toggle() bgneal@118: } bgneal@118: bgneal@118: Collapse.DEFAULTS = { bgneal@118: toggle: true bgneal@118: } bgneal@118: bgneal@118: Collapse.prototype.dimension = function () { bgneal@118: var hasWidth = this.$element.hasClass('width') bgneal@118: return hasWidth ? 'width' : 'height' bgneal@118: } bgneal@118: bgneal@118: Collapse.prototype.show = function () { bgneal@118: if (this.transitioning || this.$element.hasClass('in')) return bgneal@118: bgneal@118: var startEvent = $.Event('show.bs.collapse') bgneal@118: this.$element.trigger(startEvent) bgneal@118: if (startEvent.isDefaultPrevented()) return bgneal@118: bgneal@118: var actives = this.$parent && this.$parent.find('> .panel > .in') bgneal@118: bgneal@118: if (actives && actives.length) { bgneal@118: var hasData = actives.data('bs.collapse') bgneal@118: if (hasData && hasData.transitioning) return bgneal@118: actives.collapse('hide') bgneal@118: hasData || actives.data('bs.collapse', null) bgneal@118: } bgneal@118: bgneal@118: var dimension = this.dimension() bgneal@118: bgneal@118: this.$element bgneal@118: .removeClass('collapse') bgneal@118: .addClass('collapsing') bgneal@118: [dimension](0) bgneal@118: bgneal@118: this.transitioning = 1 bgneal@118: bgneal@118: var complete = function () { bgneal@118: this.$element bgneal@118: .removeClass('collapsing') bgneal@118: .addClass('in') bgneal@118: [dimension]('auto') bgneal@118: this.transitioning = 0 bgneal@118: this.$element.trigger('shown.bs.collapse') bgneal@118: } bgneal@118: bgneal@118: if (!$.support.transition) return complete.call(this) bgneal@118: bgneal@118: var scrollSize = $.camelCase(['scroll', dimension].join('-')) bgneal@118: bgneal@118: this.$element bgneal@118: .one($.support.transition.end, $.proxy(complete, this)) bgneal@118: .emulateTransitionEnd(350) bgneal@118: [dimension](this.$element[0][scrollSize]) bgneal@118: } bgneal@118: bgneal@118: Collapse.prototype.hide = function () { bgneal@118: if (this.transitioning || !this.$element.hasClass('in')) return bgneal@118: bgneal@118: var startEvent = $.Event('hide.bs.collapse') bgneal@118: this.$element.trigger(startEvent) bgneal@118: if (startEvent.isDefaultPrevented()) return bgneal@118: bgneal@118: var dimension = this.dimension() bgneal@118: bgneal@118: this.$element bgneal@118: [dimension](this.$element[dimension]()) bgneal@118: [0].offsetHeight bgneal@118: bgneal@118: this.$element bgneal@118: .addClass('collapsing') bgneal@118: .removeClass('collapse') bgneal@118: .removeClass('in') bgneal@118: bgneal@118: this.transitioning = 1 bgneal@118: bgneal@118: var complete = function () { bgneal@118: this.transitioning = 0 bgneal@118: this.$element bgneal@118: .trigger('hidden.bs.collapse') bgneal@118: .removeClass('collapsing') bgneal@118: .addClass('collapse') bgneal@118: } bgneal@118: bgneal@118: if (!$.support.transition) return complete.call(this) bgneal@118: bgneal@118: this.$element bgneal@118: [dimension](0) bgneal@118: .one($.support.transition.end, $.proxy(complete, this)) bgneal@118: .emulateTransitionEnd(350) bgneal@118: } bgneal@118: bgneal@118: Collapse.prototype.toggle = function () { bgneal@118: this[this.$element.hasClass('in') ? 'hide' : 'show']() bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // COLLAPSE PLUGIN DEFINITION bgneal@118: // ========================== bgneal@118: bgneal@118: var old = $.fn.collapse bgneal@118: bgneal@118: $.fn.collapse = function (option) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('bs.collapse') bgneal@118: var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) bgneal@118: bgneal@118: if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) bgneal@118: if (typeof option == 'string') data[option]() bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.collapse.Constructor = Collapse bgneal@118: bgneal@118: bgneal@118: // COLLAPSE NO CONFLICT bgneal@118: // ==================== bgneal@118: bgneal@118: $.fn.collapse.noConflict = function () { bgneal@118: $.fn.collapse = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // COLLAPSE DATA-API bgneal@118: // ================= bgneal@118: bgneal@118: $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { bgneal@118: var $this = $(this), href bgneal@118: var target = $this.attr('data-target') bgneal@118: || e.preventDefault() bgneal@118: || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 bgneal@118: var $target = $(target) bgneal@118: var data = $target.data('bs.collapse') bgneal@118: var option = data ? 'toggle' : $this.data() bgneal@118: var parent = $this.attr('data-parent') bgneal@118: var $parent = parent && $(parent) bgneal@118: bgneal@118: if (!data || !data.transitioning) { bgneal@118: if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') bgneal@118: $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') bgneal@118: } bgneal@118: bgneal@118: $target.collapse(option) bgneal@118: }) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: dropdown.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#dropdowns bgneal@118: * ======================================================================== bgneal@118: * Copyright 2012 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // DROPDOWN CLASS DEFINITION bgneal@118: // ========================= bgneal@118: bgneal@118: var backdrop = '.dropdown-backdrop' bgneal@118: var toggle = '[data-toggle=dropdown]' bgneal@118: var Dropdown = function (element) { bgneal@118: var $el = $(element).on('click.bs.dropdown', this.toggle) bgneal@118: } bgneal@118: bgneal@118: Dropdown.prototype.toggle = function (e) { bgneal@118: var $this = $(this) bgneal@118: bgneal@118: if ($this.is('.disabled, :disabled')) return bgneal@118: bgneal@118: var $parent = getParent($this) bgneal@118: var isActive = $parent.hasClass('open') bgneal@118: bgneal@118: clearMenus() bgneal@118: bgneal@118: if (!isActive) { bgneal@118: if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { bgneal@118: // if mobile we we use a backdrop because click events don't delegate bgneal@118: $('
').insertAfter($(this)).on('click', clearMenus) bgneal@118: } bgneal@118: bgneal@118: $parent.trigger(e = $.Event('show.bs.dropdown')) bgneal@118: bgneal@118: if (e.isDefaultPrevented()) return bgneal@118: bgneal@118: $parent bgneal@118: .toggleClass('open') bgneal@118: .trigger('shown.bs.dropdown') bgneal@118: bgneal@118: $this.focus() bgneal@118: } bgneal@118: bgneal@118: return false bgneal@118: } bgneal@118: bgneal@118: Dropdown.prototype.keydown = function (e) { bgneal@118: if (!/(38|40|27)/.test(e.keyCode)) return bgneal@118: bgneal@118: var $this = $(this) bgneal@118: bgneal@118: e.preventDefault() bgneal@118: e.stopPropagation() bgneal@118: bgneal@118: if ($this.is('.disabled, :disabled')) return bgneal@118: bgneal@118: var $parent = getParent($this) bgneal@118: var isActive = $parent.hasClass('open') bgneal@118: bgneal@118: if (!isActive || (isActive && e.keyCode == 27)) { bgneal@118: if (e.which == 27) $parent.find(toggle).focus() bgneal@118: return $this.click() bgneal@118: } bgneal@118: bgneal@118: var $items = $('[role=menu] li:not(.divider):visible a', $parent) bgneal@118: bgneal@118: if (!$items.length) return bgneal@118: bgneal@118: var index = $items.index($items.filter(':focus')) bgneal@118: bgneal@118: if (e.keyCode == 38 && index > 0) index-- // up bgneal@118: if (e.keyCode == 40 && index < $items.length - 1) index++ // down bgneal@118: if (!~index) index=0 bgneal@118: bgneal@118: $items.eq(index).focus() bgneal@118: } bgneal@118: bgneal@118: function clearMenus() { bgneal@118: $(backdrop).remove() bgneal@118: $(toggle).each(function (e) { bgneal@118: var $parent = getParent($(this)) bgneal@118: if (!$parent.hasClass('open')) return bgneal@118: $parent.trigger(e = $.Event('hide.bs.dropdown')) bgneal@118: if (e.isDefaultPrevented()) return bgneal@118: $parent.removeClass('open').trigger('hidden.bs.dropdown') bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: function getParent($this) { bgneal@118: var selector = $this.attr('data-target') bgneal@118: bgneal@118: if (!selector) { bgneal@118: selector = $this.attr('href') bgneal@118: selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 bgneal@118: } bgneal@118: bgneal@118: var $parent = selector && $(selector) bgneal@118: bgneal@118: return $parent && $parent.length ? $parent : $this.parent() bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // DROPDOWN PLUGIN DEFINITION bgneal@118: // ========================== bgneal@118: bgneal@118: var old = $.fn.dropdown bgneal@118: bgneal@118: $.fn.dropdown = function (option) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('dropdown') bgneal@118: bgneal@118: if (!data) $this.data('dropdown', (data = new Dropdown(this))) bgneal@118: if (typeof option == 'string') data[option].call($this) bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.dropdown.Constructor = Dropdown bgneal@118: bgneal@118: bgneal@118: // DROPDOWN NO CONFLICT bgneal@118: // ==================== bgneal@118: bgneal@118: $.fn.dropdown.noConflict = function () { bgneal@118: $.fn.dropdown = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // APPLY TO STANDARD DROPDOWN ELEMENTS bgneal@118: // =================================== bgneal@118: bgneal@118: $(document) bgneal@118: .on('click.bs.dropdown.data-api', clearMenus) bgneal@118: .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) bgneal@118: .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle) bgneal@118: .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: modal.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#modals bgneal@118: * ======================================================================== bgneal@118: * Copyright 2012 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // MODAL CLASS DEFINITION bgneal@118: // ====================== bgneal@118: bgneal@118: var Modal = function (element, options) { bgneal@118: this.options = options bgneal@118: this.$element = $(element) bgneal@118: this.$backdrop = bgneal@118: this.isShown = null bgneal@118: bgneal@118: if (this.options.remote) this.$element.load(this.options.remote) bgneal@118: } bgneal@118: bgneal@118: Modal.DEFAULTS = { bgneal@118: backdrop: true bgneal@118: , keyboard: true bgneal@118: , show: true bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.toggle = function (_relatedTarget) { bgneal@118: return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.show = function (_relatedTarget) { bgneal@118: var that = this bgneal@118: var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) bgneal@118: bgneal@118: this.$element.trigger(e) bgneal@118: bgneal@118: if (this.isShown || e.isDefaultPrevented()) return bgneal@118: bgneal@118: this.isShown = true bgneal@118: bgneal@118: this.escape() bgneal@118: bgneal@118: this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) bgneal@118: bgneal@118: this.backdrop(function () { bgneal@118: var transition = $.support.transition && that.$element.hasClass('fade') bgneal@118: bgneal@118: if (!that.$element.parent().length) { bgneal@118: that.$element.appendTo(document.body) // don't move modals dom position bgneal@118: } bgneal@118: bgneal@118: that.$element.show() bgneal@118: bgneal@118: if (transition) { bgneal@118: that.$element[0].offsetWidth // force reflow bgneal@118: } bgneal@118: bgneal@118: that.$element bgneal@118: .addClass('in') bgneal@118: .attr('aria-hidden', false) bgneal@118: bgneal@118: that.enforceFocus() bgneal@118: bgneal@118: var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) bgneal@118: bgneal@118: transition ? bgneal@118: that.$element.find('.modal-dialog') // wait for modal to slide in bgneal@118: .one($.support.transition.end, function () { bgneal@118: that.$element.focus().trigger(e) bgneal@118: }) bgneal@118: .emulateTransitionEnd(300) : bgneal@118: that.$element.focus().trigger(e) bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.hide = function (e) { bgneal@118: if (e) e.preventDefault() bgneal@118: bgneal@118: e = $.Event('hide.bs.modal') bgneal@118: bgneal@118: this.$element.trigger(e) bgneal@118: bgneal@118: if (!this.isShown || e.isDefaultPrevented()) return bgneal@118: bgneal@118: this.isShown = false bgneal@118: bgneal@118: this.escape() bgneal@118: bgneal@118: $(document).off('focusin.bs.modal') bgneal@118: bgneal@118: this.$element bgneal@118: .removeClass('in') bgneal@118: .attr('aria-hidden', true) bgneal@118: .off('click.dismiss.modal') bgneal@118: bgneal@118: $.support.transition && this.$element.hasClass('fade') ? bgneal@118: this.$element bgneal@118: .one($.support.transition.end, $.proxy(this.hideModal, this)) bgneal@118: .emulateTransitionEnd(300) : bgneal@118: this.hideModal() bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.enforceFocus = function () { bgneal@118: $(document) bgneal@118: .off('focusin.bs.modal') // guard against infinite focus loop bgneal@118: .on('focusin.bs.modal', $.proxy(function (e) { bgneal@118: if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { bgneal@118: this.$element.focus() bgneal@118: } bgneal@118: }, this)) bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.escape = function () { bgneal@118: if (this.isShown && this.options.keyboard) { bgneal@118: this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { bgneal@118: e.which == 27 && this.hide() bgneal@118: }, this)) bgneal@118: } else if (!this.isShown) { bgneal@118: this.$element.off('keyup.dismiss.bs.modal') bgneal@118: } bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.hideModal = function () { bgneal@118: var that = this bgneal@118: this.$element.hide() bgneal@118: this.backdrop(function () { bgneal@118: that.removeBackdrop() bgneal@118: that.$element.trigger('hidden.bs.modal') bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.removeBackdrop = function () { bgneal@118: this.$backdrop && this.$backdrop.remove() bgneal@118: this.$backdrop = null bgneal@118: } bgneal@118: bgneal@118: Modal.prototype.backdrop = function (callback) { bgneal@118: var that = this bgneal@118: var animate = this.$element.hasClass('fade') ? 'fade' : '' bgneal@118: bgneal@118: if (this.isShown && this.options.backdrop) { bgneal@118: var doAnimate = $.support.transition && animate bgneal@118: bgneal@118: this.$backdrop = $('') bgneal@118: .appendTo(document.body) bgneal@118: bgneal@118: this.$element.on('click.dismiss.modal', $.proxy(function (e) { bgneal@118: if (e.target !== e.currentTarget) return bgneal@118: this.options.backdrop == 'static' bgneal@118: ? this.$element[0].focus.call(this.$element[0]) bgneal@118: : this.hide.call(this) bgneal@118: }, this)) bgneal@118: bgneal@118: if (doAnimate) this.$backdrop[0].offsetWidth // force reflow bgneal@118: bgneal@118: this.$backdrop.addClass('in') bgneal@118: bgneal@118: if (!callback) return bgneal@118: bgneal@118: doAnimate ? bgneal@118: this.$backdrop bgneal@118: .one($.support.transition.end, callback) bgneal@118: .emulateTransitionEnd(150) : bgneal@118: callback() bgneal@118: bgneal@118: } else if (!this.isShown && this.$backdrop) { bgneal@118: this.$backdrop.removeClass('in') bgneal@118: bgneal@118: $.support.transition && this.$element.hasClass('fade')? bgneal@118: this.$backdrop bgneal@118: .one($.support.transition.end, callback) bgneal@118: .emulateTransitionEnd(150) : bgneal@118: callback() bgneal@118: bgneal@118: } else if (callback) { bgneal@118: callback() bgneal@118: } bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // MODAL PLUGIN DEFINITION bgneal@118: // ======================= bgneal@118: bgneal@118: var old = $.fn.modal bgneal@118: bgneal@118: $.fn.modal = function (option, _relatedTarget) { bgneal@118: return this.each(function () { bgneal@118: var $this = $(this) bgneal@118: var data = $this.data('bs.modal') bgneal@118: var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) bgneal@118: bgneal@118: if (!data) $this.data('bs.modal', (data = new Modal(this, options))) bgneal@118: if (typeof option == 'string') data[option](_relatedTarget) bgneal@118: else if (options.show) data.show(_relatedTarget) bgneal@118: }) bgneal@118: } bgneal@118: bgneal@118: $.fn.modal.Constructor = Modal bgneal@118: bgneal@118: bgneal@118: // MODAL NO CONFLICT bgneal@118: // ================= bgneal@118: bgneal@118: $.fn.modal.noConflict = function () { bgneal@118: $.fn.modal = old bgneal@118: return this bgneal@118: } bgneal@118: bgneal@118: bgneal@118: // MODAL DATA-API bgneal@118: // ============== bgneal@118: bgneal@118: $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { bgneal@118: var $this = $(this) bgneal@118: var href = $this.attr('href') bgneal@118: var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 bgneal@118: var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) bgneal@118: bgneal@118: e.preventDefault() bgneal@118: bgneal@118: $target bgneal@118: .modal(option, this) bgneal@118: .one('hide', function () { bgneal@118: $this.is(':visible') && $this.focus() bgneal@118: }) bgneal@118: }) bgneal@118: bgneal@118: $(document) bgneal@118: .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) bgneal@118: .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) bgneal@118: bgneal@118: }(window.jQuery); bgneal@118: bgneal@118: /* ======================================================================== bgneal@118: * Bootstrap: tooltip.js v3.0.0 bgneal@118: * http://twbs.github.com/bootstrap/javascript.html#tooltip bgneal@118: * Inspired by the original jQuery.tipsy by Jason Frame bgneal@118: * ======================================================================== bgneal@118: * Copyright 2012 Twitter, Inc. bgneal@118: * bgneal@118: * Licensed under the Apache License, Version 2.0 (the "License"); bgneal@118: * you may not use this file except in compliance with the License. bgneal@118: * You may obtain a copy of the License at bgneal@118: * bgneal@118: * http://www.apache.org/licenses/LICENSE-2.0 bgneal@118: * bgneal@118: * Unless required by applicable law or agreed to in writing, software bgneal@118: * distributed under the License is distributed on an "AS IS" BASIS, bgneal@118: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bgneal@118: * See the License for the specific language governing permissions and bgneal@118: * limitations under the License. bgneal@118: * ======================================================================== */ bgneal@118: bgneal@118: bgneal@118: +function ($) { "use strict"; bgneal@118: bgneal@118: // TOOLTIP PUBLIC CLASS DEFINITION bgneal@118: // =============================== bgneal@118: bgneal@118: var Tooltip = function (element, options) { bgneal@118: this.type = bgneal@118: this.options = bgneal@118: this.enabled = bgneal@118: this.timeout = bgneal@118: this.hoverState = bgneal@118: this.$element = null bgneal@118: bgneal@118: this.init('tooltip', element, options) bgneal@118: } bgneal@118: bgneal@118: Tooltip.DEFAULTS = { bgneal@118: animation: true bgneal@118: , placement: 'top' bgneal@118: , selector: false bgneal@118: , template: '