From a7eb9c294a575b5471ddec45ae75e1d09f7ace4c Mon Sep 17 00:00:00 2001 From: fat Date: Fri, 7 Dec 2012 17:06:01 -0500 Subject: add noConflict functionality to all bootstrap plugins --- docs/assets/js/bootstrap-affix.js | 11 +++ docs/assets/js/bootstrap-alert.js | 11 +++ docs/assets/js/bootstrap-button.js | 11 +++ docs/assets/js/bootstrap-carousel.js | 10 +++ docs/assets/js/bootstrap-collapse.js | 17 +++- docs/assets/js/bootstrap-dropdown.js | 11 +++ docs/assets/js/bootstrap-modal.js | 11 +++ docs/assets/js/bootstrap-popover.js | 13 ++- docs/assets/js/bootstrap-scrollspy.js | 11 +++ docs/assets/js/bootstrap-tab.js | 11 +++ docs/assets/js/bootstrap-tooltip.js | 11 +++ docs/assets/js/bootstrap-typeahead.js | 13 ++- docs/assets/js/bootstrap.js | 142 +++++++++++++++++++++++++++++-- docs/assets/js/bootstrap.min.js | 19 ++++- docs/javascript.html | 8 ++ docs/templates/pages/javascript.mustache | 8 ++ js/bootstrap-affix.js | 11 +++ js/bootstrap-alert.js | 11 +++ js/bootstrap-button.js | 11 +++ js/bootstrap-carousel.js | 10 +++ js/bootstrap-collapse.js | 17 +++- js/bootstrap-dropdown.js | 11 +++ js/bootstrap-modal.js | 11 +++ js/bootstrap-popover.js | 13 ++- js/bootstrap-scrollspy.js | 11 +++ js/bootstrap-tab.js | 11 +++ js/bootstrap-tooltip.js | 11 +++ js/bootstrap-typeahead.js | 13 ++- js/tests/unit/bootstrap-affix.js | 6 ++ js/tests/unit/bootstrap-alert.js | 6 ++ js/tests/unit/bootstrap-button.js | 6 ++ js/tests/unit/bootstrap-carousel.js | 6 ++ js/tests/unit/bootstrap-collapse.js | 6 ++ js/tests/unit/bootstrap-dropdown.js | 10 ++- js/tests/unit/bootstrap-modal.js | 6 ++ js/tests/unit/bootstrap-popover.js | 12 ++- js/tests/unit/bootstrap-scrollspy.js | 6 ++ js/tests/unit/bootstrap-tab.js | 6 ++ js/tests/unit/bootstrap-tooltip.js | 6 ++ js/tests/unit/bootstrap-typeahead.js | 6 ++ 40 files changed, 519 insertions(+), 22 deletions(-) diff --git a/docs/assets/js/bootstrap-affix.js b/docs/assets/js/bootstrap-affix.js index 18d4fc9ad2..6020a19a58 100644 --- a/docs/assets/js/bootstrap-affix.js +++ b/docs/assets/js/bootstrap-affix.js @@ -68,6 +68,8 @@ /* AFFIX PLUGIN DEFINITION * ======================= */ + var old = $.fn.affix + $.fn.affix = function (option) { return this.each(function () { var $this = $(this) @@ -85,6 +87,15 @@ } + /* AFFIX NO CONFLICT + * ================= */ + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + /* AFFIX DATA-API * ============== */ diff --git a/docs/assets/js/bootstrap-alert.js b/docs/assets/js/bootstrap-alert.js index dda647ec22..5bc0264491 100644 --- a/docs/assets/js/bootstrap-alert.js +++ b/docs/assets/js/bootstrap-alert.js @@ -68,6 +68,8 @@ /* ALERT PLUGIN DEFINITION * ======================= */ + var old = $.fn.alert + $.fn.alert = function (option) { return this.each(function () { var $this = $(this) @@ -80,6 +82,15 @@ $.fn.alert.Constructor = Alert + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + /* ALERT DATA-API * ============== */ diff --git a/docs/assets/js/bootstrap-button.js b/docs/assets/js/bootstrap-button.js index 619423bbc8..39b83399e9 100644 --- a/docs/assets/js/bootstrap-button.js +++ b/docs/assets/js/bootstrap-button.js @@ -64,6 +64,8 @@ /* BUTTON PLUGIN DEFINITION * ======================== */ + var old = $.fn.button + $.fn.button = function (option) { return this.each(function () { var $this = $(this) @@ -82,6 +84,15 @@ $.fn.button.Constructor = Button + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + /* BUTTON DATA-API * =============== */ diff --git a/docs/assets/js/bootstrap-carousel.js b/docs/assets/js/bootstrap-carousel.js index 099b669308..ba26a5cd49 100644 --- a/docs/assets/js/bootstrap-carousel.js +++ b/docs/assets/js/bootstrap-carousel.js @@ -141,6 +141,8 @@ /* CAROUSEL PLUGIN DEFINITION * ========================== */ + var old = $.fn.carousel + $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) @@ -162,6 +164,14 @@ $.fn.carousel.Constructor = Carousel + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + /* CAROUSEL DATA-API * ================= */ diff --git a/docs/assets/js/bootstrap-collapse.js b/docs/assets/js/bootstrap-collapse.js index a09ce10048..6ac0191a50 100644 --- a/docs/assets/js/bootstrap-collapse.js +++ b/docs/assets/js/bootstrap-collapse.js @@ -120,8 +120,10 @@ } - /* COLLAPSIBLE PLUGIN DEFINITION - * ============================== */ + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse $.fn.collapse = function (option) { return this.each(function () { @@ -140,9 +142,18 @@ $.fn.collapse.Constructor = Collapse - /* COLLAPSIBLE DATA-API + /* COLLAPSE NO CONFLICT * ==================== */ + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href , target = $this.attr('data-target') diff --git a/docs/assets/js/bootstrap-dropdown.js b/docs/assets/js/bootstrap-dropdown.js index 84e1dedb84..61f3b941a2 100644 --- a/docs/assets/js/bootstrap-dropdown.js +++ b/docs/assets/js/bootstrap-dropdown.js @@ -124,6 +124,8 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var old = $.fn.dropdown + $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) @@ -136,6 +138,15 @@ $.fn.dropdown.Constructor = Dropdown + /* DROPDOWN NO CONFLICT + * ==================== */ + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ diff --git a/docs/assets/js/bootstrap-modal.js b/docs/assets/js/bootstrap-modal.js index 6fae364366..689a414ed6 100644 --- a/docs/assets/js/bootstrap-modal.js +++ b/docs/assets/js/bootstrap-modal.js @@ -193,6 +193,8 @@ /* MODAL PLUGIN DEFINITION * ======================= */ + var old = $.fn.modal + $.fn.modal = function (option) { return this.each(function () { var $this = $(this) @@ -213,6 +215,15 @@ $.fn.modal.Constructor = Modal + /* MODAL NO CONFLICT + * ================= */ + + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } + + /* MODAL DATA-API * ============== */ diff --git a/docs/assets/js/bootstrap-popover.js b/docs/assets/js/bootstrap-popover.js index 56a63d4a24..1a4f532aa8 100644 --- a/docs/assets/js/bootstrap-popover.js +++ b/docs/assets/js/bootstrap-popover.js @@ -81,6 +81,8 @@ /* POPOVER PLUGIN DEFINITION * ======================= */ + var old = $.fn.popover + $.fn.popover = function (option) { return this.each(function () { var $this = $(this) @@ -100,4 +102,13 @@ , template: '

' }) -}(window.jQuery); + + /* POPOVER NO CONFLICT + * =================== */ + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(window.jQuery); \ No newline at end of file diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js index 34f7748684..fd82872c5c 100644 --- a/docs/assets/js/bootstrap-scrollspy.js +++ b/docs/assets/js/bootstrap-scrollspy.js @@ -121,6 +121,8 @@ /* SCROLLSPY PLUGIN DEFINITION * =========================== */ + var old = $.fn.scrollspy + $.fn.scrollspy = function (option) { return this.each(function () { var $this = $(this) @@ -138,6 +140,15 @@ } + /* SCROLLSPY NO CONFLICT + * ===================== */ + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this + } + + /* SCROLLSPY DATA-API * ================== */ diff --git a/docs/assets/js/bootstrap-tab.js b/docs/assets/js/bootstrap-tab.js index 059b39b351..84d4834a23 100644 --- a/docs/assets/js/bootstrap-tab.js +++ b/docs/assets/js/bootstrap-tab.js @@ -110,6 +110,8 @@ /* TAB PLUGIN DEFINITION * ===================== */ + var old = $.fn.tab + $.fn.tab = function ( option ) { return this.each(function () { var $this = $(this) @@ -122,6 +124,15 @@ $.fn.tab.Constructor = Tab + /* TAB NO CONFLICT + * =============== */ + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + /* TAB DATA-API * ============ */ diff --git a/docs/assets/js/bootstrap-tooltip.js b/docs/assets/js/bootstrap-tooltip.js index b3325b2380..a08952a4cf 100644 --- a/docs/assets/js/bootstrap-tooltip.js +++ b/docs/assets/js/bootstrap-tooltip.js @@ -250,6 +250,8 @@ /* TOOLTIP PLUGIN DEFINITION * ========================= */ + var old = $.fn.tooltip + $.fn.tooltip = function ( option ) { return this.each(function () { var $this = $(this) @@ -273,4 +275,13 @@ , html: false } + + /* TOOLTIP NO CONFLICT + * =================== */ + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + }(window.jQuery); \ No newline at end of file diff --git a/docs/assets/js/bootstrap-typeahead.js b/docs/assets/js/bootstrap-typeahead.js index 512d91acb4..9b123fb3fb 100644 --- a/docs/assets/js/bootstrap-typeahead.js +++ b/docs/assets/js/bootstrap-typeahead.js @@ -276,6 +276,8 @@ /* TYPEAHEAD PLUGIN DEFINITION * =========================== */ + var old = $.fn.typeahead + $.fn.typeahead = function (option) { return this.each(function () { var $this = $(this) @@ -297,7 +299,16 @@ $.fn.typeahead.Constructor = Typeahead - /* TYPEAHEAD DATA-API + /* TYPEAHEAD NO CONFLICT + * =================== */ + + $.fn.typeahead.noConflict = function () { + $.fn.typeahead = old + return this + } + + + /* TYPEAHEAD DATA-API * ================== */ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 7431e97772..ff524ce003 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -127,6 +127,8 @@ /* ALERT PLUGIN DEFINITION * ======================= */ + var old = $.fn.alert + $.fn.alert = function (option) { return this.each(function () { var $this = $(this) @@ -139,6 +141,15 @@ $.fn.alert.Constructor = Alert + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + /* ALERT DATA-API * ============== */ @@ -210,6 +221,8 @@ /* BUTTON PLUGIN DEFINITION * ======================== */ + var old = $.fn.button + $.fn.button = function (option) { return this.each(function () { var $this = $(this) @@ -228,6 +241,15 @@ $.fn.button.Constructor = Button + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + /* BUTTON DATA-API * =============== */ @@ -380,6 +402,8 @@ /* CAROUSEL PLUGIN DEFINITION * ========================== */ + var old = $.fn.carousel + $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) @@ -401,6 +425,14 @@ $.fn.carousel.Constructor = Carousel + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + /* CAROUSEL DATA-API * ================= */ @@ -534,8 +566,10 @@ } - /* COLLAPSIBLE PLUGIN DEFINITION - * ============================== */ + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse $.fn.collapse = function (option) { return this.each(function () { @@ -554,9 +588,18 @@ $.fn.collapse.Constructor = Collapse - /* COLLAPSIBLE DATA-API + /* COLLAPSE NO CONFLICT * ==================== */ + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href , target = $this.attr('data-target') @@ -693,6 +736,8 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var old = $.fn.dropdown + $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) @@ -705,6 +750,15 @@ $.fn.dropdown.Constructor = Dropdown + /* DROPDOWN NO CONFLICT + * ==================== */ + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ @@ -910,6 +964,8 @@ /* MODAL PLUGIN DEFINITION * ======================= */ + var old = $.fn.modal + $.fn.modal = function (option) { return this.each(function () { var $this = $(this) @@ -930,6 +986,15 @@ $.fn.modal.Constructor = Modal + /* MODAL NO CONFLICT + * ================= */ + + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } + + /* MODAL DATA-API * ============== */ @@ -1201,6 +1266,8 @@ /* TOOLTIP PLUGIN DEFINITION * ========================= */ + var old = $.fn.tooltip + $.fn.tooltip = function ( option ) { return this.each(function () { var $this = $(this) @@ -1224,6 +1291,15 @@ , html: false } + + /* TOOLTIP NO CONFLICT + * =================== */ + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + }(window.jQuery);/* =========================================================== * bootstrap-popover.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#popovers @@ -1307,6 +1383,8 @@ /* POPOVER PLUGIN DEFINITION * ======================= */ + var old = $.fn.popover + $.fn.popover = function (option) { return this.each(function () { var $this = $(this) @@ -1326,8 +1404,16 @@ , template: '

' }) -}(window.jQuery); -/* ============================================================= + + /* POPOVER NO CONFLICT + * =================== */ + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(window.jQuery);/* ============================================================= * bootstrap-scrollspy.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#scrollspy * ============================================================= @@ -1450,6 +1536,8 @@ /* SCROLLSPY PLUGIN DEFINITION * =========================== */ + var old = $.fn.scrollspy + $.fn.scrollspy = function (option) { return this.each(function () { var $this = $(this) @@ -1467,6 +1555,15 @@ } + /* SCROLLSPY NO CONFLICT + * ===================== */ + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this + } + + /* SCROLLSPY DATA-API * ================== */ @@ -1589,6 +1686,8 @@ /* TAB PLUGIN DEFINITION * ===================== */ + var old = $.fn.tab + $.fn.tab = function ( option ) { return this.each(function () { var $this = $(this) @@ -1601,6 +1700,15 @@ $.fn.tab.Constructor = Tab + /* TAB NO CONFLICT + * =============== */ + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + /* TAB DATA-API * ============ */ @@ -1887,6 +1995,8 @@ /* TYPEAHEAD PLUGIN DEFINITION * =========================== */ + var old = $.fn.typeahead + $.fn.typeahead = function (option) { return this.each(function () { var $this = $(this) @@ -1908,7 +2018,16 @@ $.fn.typeahead.Constructor = Typeahead - /* TYPEAHEAD DATA-API + /* TYPEAHEAD NO CONFLICT + * =================== */ + + $.fn.typeahead.noConflict = function () { + $.fn.typeahead = old + return this + } + + + /* TYPEAHEAD DATA-API * ================== */ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { @@ -1989,6 +2108,8 @@ /* AFFIX PLUGIN DEFINITION * ======================= */ + var old = $.fn.affix + $.fn.affix = function (option) { return this.each(function () { var $this = $(this) @@ -2006,6 +2127,15 @@ } + /* AFFIX NO CONFLICT + * ================= */ + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + /* AFFIX DATA-API * ============== */ diff --git a/docs/assets/js/bootstrap.min.js b/docs/assets/js/bootstrap.min.js index 62b88edc34..d0f44f669c 100644 --- a/docs/assets/js/bootstrap.min.js +++ b/docs/assets/js/bootstrap.min.js @@ -3,4 +3,21 @@ * Copyright 2012 Twitter, Inc. * http://www.apache.org/licenses/LICENSE-2.0.txt */ -!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())},$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")},$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,this.options.slide&&this.slide(this.options.slide),"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}},$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||($parent.toggleClass("open"),$this.focus()),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider) a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}},$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=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)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):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().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('