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: $('