From 7197ea1facc58cbbb5a858aa20172fde2c523027 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 30 Jan 2014 20:27:19 +0100 Subject: Upgraded to Bootstrap 3.1.0. --- pyaggr3g470r/static/js/bootstrap.js | 590 +++++++++++++++++------------------- 1 file changed, 271 insertions(+), 319 deletions(-) (limited to 'pyaggr3g470r/static/js') diff --git a/pyaggr3g470r/static/js/bootstrap.js b/pyaggr3g470r/static/js/bootstrap.js index 2c642571..39ec4710 100644 --- a/pyaggr3g470r/static/js/bootstrap.js +++ b/pyaggr3g470r/static/js/bootstrap.js @@ -1,31 +1,22 @@ -/** -* bootstrap.js v3.0.0 by @fat and @mdo -* Copyright 2013 Twitter Inc. -* http://www.apache.org/licenses/LICENSE-2.0 -*/ -if (!jQuery) { throw new Error("Bootstrap requires jQuery") } +/*! + * Bootstrap v3.1.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +if (typeof jQuery === 'undefined') { throw new Error('Bootstrap requires jQuery') } /* ======================================================================== - * Bootstrap: transition.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#transitions + * Bootstrap: transition.js v3.1.0 + * http://getbootstrap.com/javascript/#transitions * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ @@ -34,10 +25,10 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } var el = document.createElement('bootstrap') var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd' - , 'MozTransition' : 'transitionend' - , 'OTransition' : 'oTransitionEnd otransitionend' - , 'transition' : 'transitionend' + 'WebkitTransition' : 'webkitTransitionEnd', + 'MozTransition' : 'transitionend', + 'OTransition' : 'oTransitionEnd otransitionend', + 'transition' : 'transitionend' } for (var name in transEndEventNames) { @@ -45,6 +36,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } return { end: transEndEventNames[name] } } } + + return false // explicit for ie8 ( ._.) } // http://blog.alexmaccaw.com/css-transitions @@ -60,29 +53,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $.support.transition = transitionEnd() }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: alert.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#alerts + * Bootstrap: alert.js v3.1.0 + * http://getbootstrap.com/javascript/#alerts * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // ALERT CLASS DEFINITION // ====================== @@ -159,36 +142,27 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: button.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#buttons + * Bootstrap: button.js v3.1.0 + * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false } Button.DEFAULTS = { @@ -208,24 +182,31 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $el[val](data[state] || this.options[state]) // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d); - }, 0) + setTimeout($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) } Button.prototype.toggle = function () { + var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') - .prop('checked', !this.$element.hasClass('active')) - .trigger('change') - if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') } - this.$element.toggleClass('active') + if (changed) this.$element.toggleClass('active') } @@ -269,29 +250,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } e.preventDefault() }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: carousel.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#carousel + * Bootstrap: carousel.js v3.1.0 + * http://getbootstrap.com/javascript/#carousel * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= @@ -312,9 +283,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } } Carousel.DEFAULTS = { - interval: 5000 - , pause: 'hover' - , wrap: true + interval: 5000, + pause: 'hover', + wrap: true } Carousel.prototype.cycle = function (e) { @@ -342,7 +313,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) @@ -351,7 +322,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } Carousel.prototype.pause = function (e) { e || (this.paused = true) - if (this.$element.find('.next, .prev').length && $.support.transition.end) { + if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) } @@ -384,25 +355,25 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $next = this.$element.find('.item')[fallback]() } - this.sliding = true - - isCycling && this.pause() + if ($next.hasClass('active')) return this.sliding = false var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + this.$element.trigger(e) + if (e.isDefaultPrevented()) return - if ($next.hasClass('active')) return + this.sliding = true + + isCycling && this.pause() if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { + this.$element.one('slid.bs.carousel', function () { var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) $nextIndicator && $nextIndicator.addClass('active') }) } if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) @@ -412,16 +383,14 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) }) - .emulateTransitionEnd(600) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger('slid') + this.$element.trigger('slid.bs.carousel') } isCycling && this.cycle() @@ -487,29 +456,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } }) }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: collapse.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#collapse + * Bootstrap: collapse.js v3.1.0 + * http://getbootstrap.com/javascript/#collapse * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ @@ -560,7 +519,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } var complete = function () { this.$element .removeClass('collapsing') - .addClass('in') + .addClass('collapse in') [dimension]('auto') this.transitioning = 0 this.$element.trigger('shown.bs.collapse') @@ -628,6 +587,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + if (!data && options.toggle && option == 'show') option = !option if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) @@ -667,29 +627,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } $target.collapse(option) }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: dropdown.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#dropdowns + * Bootstrap: dropdown.js v3.1.0 + * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= @@ -697,7 +647,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle=dropdown]' var Dropdown = function (element) { - var $el = $(element).on('click.bs.dropdown', this.toggle) + $(element).on('click.bs.dropdown', this.toggle) } Dropdown.prototype.toggle = function (e) { @@ -712,17 +662,18 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we we use a backdrop because click events don't delegate + // if mobile we use a backdrop because click events don't delegate $('