You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/03/15 11:40:57 UTC
svn commit: r1300896 [3/3] - in
/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp:
css/bootstrap.2.0.1.css css/bootstrap.2.0.2.css index-dev.html index.html
js/archiva/startup.js js/bootstrap.2.0.1.js js/bootstrap.2.0.2.js
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/bootstrap.2.0.2.css
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/bootstrap.2.0.2.css
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index-dev.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index-dev.html?rev=1300896&r1=1300895&r2=1300896&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index-dev.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index-dev.html Thu Mar 15 10:40:56 2012
@@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css"/>
- <link rel="stylesheet" href="css/bootstrap.css">
+ <link rel="stylesheet" href="css/bootstrap.2.0.2.css">
<link rel="stylesheet" href="css/archiva.css">
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html?rev=1300896&r1=1300895&r2=1300896&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html Thu Mar 15 10:40:56 2012
@@ -3,7 +3,7 @@
<head>
<link rel="stylesheet" href="css/chosen.css"/>
<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css"/>
- <link rel="stylesheet" href="css/bootstrap.2.0.1.css">
+ <link rel="stylesheet" href="css/bootstrap.2.0.2.css">
<link rel="stylesheet" href="css/archiva.css">
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js?rev=1300896&r1=1300895&r2=1300896&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js Thu Mar 15 10:40:56 2012
@@ -91,7 +91,7 @@ $(function() {
.script(buildLoadJsUrl("archiva/search.js")).wait()
.script(buildLoadJsUrl("redback/redback-tmpl.js")).wait()
.script("chosen.jquery.js" )
- .script("bootstrap.2.0.1.js" )
+ .script("bootstrap.2.0.2.js" )
.script(buildLoadJsUrl("knockout.simpleGrid.js"))
.script(buildLoadJsUrl("knockout-sortable.js"))
//.script("knockout.mapping-latest.debug.js")
Copied: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js (from r1300354, archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.1.js)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js?p2=archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js&p1=archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.1.js&r1=1300354&r2=1300896&rev=1300896&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.1.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js Thu Mar 15 10:40:56 2012
@@ -1,5 +1,5 @@
/* ===================================================
- * bootstrap-transition.js v2.0.1
+ * bootstrap-transition.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
@@ -48,11 +48,10 @@
})
-}( window.jQuery );
-/* =========================================================
- * bootstrap-modal.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#modals
- * =========================================================
+}( window.jQuery );/* ==========================================================
+ * bootstrap-alert.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,203 +65,185 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ========================================================= */
+ * ========================================================== */
!function( $ ){
"use strict"
- /* MODAL CLASS DEFINITION
+ /* ALERT CLASS DEFINITION
* ====================== */
- var Modal = function ( content, options ) {
- this.options = options
- this.$element = $(content)
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
- }
-
- Modal.prototype = {
-
- constructor: Modal
-
- , toggle: function () {
- return this[!this.isShown ? 'show' : 'hide']()
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function ( el ) {
+ $(el).on('click', dismiss, this.close)
}
- , show: function () {
- var that = this
-
- if (this.isShown) return
-
- $('body').addClass('modal-open')
+ Alert.prototype = {
- this.isShown = true
- this.$element.trigger('show')
+ constructor: Alert
- escape.call(this)
- backdrop.call(this, function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
+ , close: function ( e ) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
- !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
- that.$element
- .show()
+ $parent = $(selector)
+ $parent.trigger('close')
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
+ e && e.preventDefault()
- that.$element.addClass('in')
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
- transition ?
- that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
- that.$element.trigger('shown')
+ $parent
+ .trigger('close')
+ .removeClass('in')
- })
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
}
- , hide: function ( e ) {
- e && e.preventDefault()
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
- if (!this.isShown) return
+ }
- var that = this
- this.isShown = false
- $('body').removeClass('modal-open')
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
- escape.call(this)
+ $.fn.alert = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
- this.$element
- .trigger('hide')
- .removeClass('in')
+ $.fn.alert.Constructor = Alert
- $.support.transition && this.$element.hasClass('fade') ?
- hideWithTransition.call(this) :
- hideModal.call(this)
- }
- }
+ /* ALERT DATA-API
+ * ============== */
+ $(function () {
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ })
- /* MODAL PRIVATE METHODS
- * ===================== */
+}( window.jQuery );/* ============================================================
+ * bootstrap-button.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * 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.
+ * ============================================================ */
- function hideWithTransition() {
- var that = this
- , timeout = setTimeout(function () {
- that.$element.off($.support.transition.end)
- hideModal.call(that)
- }, 500)
+!function( $ ){
- this.$element.one($.support.transition.end, function () {
- clearTimeout(timeout)
- hideModal.call(that)
- })
- }
+ "use strict"
- function hideModal( that ) {
- this.$element
- .hide()
- .trigger('hidden')
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
- backdrop.call(this)
+ var Button = function ( element, options ) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
}
- function backdrop( callback ) {
- var that = this
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
-
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
-
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
- .appendTo(document.body)
+ Button.prototype = {
- if (this.options.backdrop != 'static') {
- this.$backdrop.click($.proxy(this.hide, this))
- }
+ constructor: Button
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+ , setState: function ( state ) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
- this.$backdrop.addClass('in')
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
- doAnimate ?
- this.$backdrop.one($.support.transition.end, callback) :
- callback()
+ $el[val](data[state] || this.options[state])
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
+ // 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)
+ }
- $.support.transition && this.$element.hasClass('fade')?
- this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
- removeBackdrop.call(this)
+ , toggle: function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
- } else if (callback) {
- callback()
- }
- }
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
- function removeBackdrop() {
- this.$backdrop.remove()
- this.$backdrop = null
- }
+ this.$element.toggleClass('active')
+ }
- function escape() {
- var that = this
- if (this.isShown && this.options.keyboard) {
- $(document).on('keyup.dismiss.modal', function ( e ) {
- e.which == 27 && that.hide()
- })
- } else if (!this.isShown) {
- $(document).off('keyup.dismiss.modal')
- }
}
- /* MODAL PLUGIN DEFINITION
- * ======================= */
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
- $.fn.modal = function ( option ) {
+ $.fn.button = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('modal')
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
- if (!data) $this.data('modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
})
}
- $.fn.modal.defaults = {
- backdrop: true
- , keyboard: true
- , show: true
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
}
- $.fn.modal.Constructor = Modal
+ $.fn.button.Constructor = Button
- /* MODAL DATA-API
- * ============== */
+ /* BUTTON DATA-API
+ * =============== */
$(function () {
- $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
- var $this = $(this), href
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
-
- e.preventDefault()
- $target.modal(option)
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
})
})
-}( window.jQuery );
-/* ============================================================
- * bootstrap-dropdown.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
- * ============================================================
+}( window.jQuery );/* ==========================================================
+ * bootstrap-carousel.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -276,84 +257,152 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============================================================ */
+ * ========================================================== */
!function( $ ){
"use strict"
- /* DROPDOWN CLASS DEFINITION
+ /* CAROUSEL CLASS DEFINITION
* ========================= */
- 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')
- })
- }
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.carousel.defaults, options)
+ this.options.slide && this.slide(this.options.slide)
+ this.options.pause == 'hover' && this.$element
+ .on('mouseenter', $.proxy(this.pause, this))
+ .on('mouseleave', $.proxy(this.cycle, this))
+ }
- Dropdown.prototype = {
+ Carousel.prototype = {
- constructor: Dropdown
+ cycle: function () {
+ this.interval = setInterval($.proxy(this.next, this), this.options.interval)
+ return this
+ }
- , toggle: function ( e ) {
- var $this = $(this)
- , selector = $this.attr('data-target')
- , $parent
- , isActive
+ , to: function (pos) {
+ var $active = this.$element.find('.active')
+ , children = $active.parent().children()
+ , activePos = children.index($active)
+ , that = this
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ if (pos > (children.length - 1) || pos < 0) return
+
+ if (this.sliding) {
+ return this.$element.one('slid', function () {
+ that.to(pos)
+ })
}
- $parent = $(selector)
- $parent.length || ($parent = $this.parent())
+ if (activePos == pos) {
+ return this.pause().cycle()
+ }
- isActive = $parent.hasClass('open')
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
+ }
- clearMenus()
- !isActive && $parent.toggleClass('open')
+ , pause: function () {
+ clearInterval(this.interval)
+ this.interval = null
+ return this
+ }
- return false
+ , next: function () {
+ if (this.sliding) return
+ return this.slide('next')
}
- }
+ , prev: function () {
+ if (this.sliding) return
+ return this.slide('prev')
+ }
+
+ , slide: function (type, next) {
+ var $active = this.$element.find('.active')
+ , $next = next || $active[type]()
+ , isCycling = this.interval
+ , direction = type == 'next' ? 'left' : 'right'
+ , fallback = type == 'next' ? 'first' : 'last'
+ , that = this
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+ if ($next.hasClass('active')) return
+
+ if (!$.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger('slide')
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger('slid')
+ } else {
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ this.$element.trigger('slide')
+ this.$element.one($.support.transition.end, function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
+ })
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
- function clearMenus() {
- $(toggle).parent().removeClass('open')
}
- /* DROPDOWN PLUGIN DEFINITION
- * ========================== */
+ /* CAROUSEL PLUGIN DEFINITION
+ * ========================== */
- $.fn.dropdown = function ( option ) {
+ $.fn.carousel = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('dropdown')
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
- if (typeof option == 'string') data[option].call($this)
+ , data = $this.data('carousel')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
+ else data.cycle()
})
}
- $.fn.dropdown.Constructor = Dropdown
+ $.fn.carousel.defaults = {
+ interval: 5000
+ , pause: 'hover'
+ }
+ $.fn.carousel.Constructor = Carousel
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
- * =================================== */
+
+ /* CAROUSEL DATA-API
+ * ================= */
$(function () {
- $('html').on('click.dropdown.data-api', clearMenus)
- $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
+ $target.carousel(options)
+ e.preventDefault()
+ })
})
-}( window.jQuery );
-/* =============================================================
- * bootstrap-scrollspy.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+}( window.jQuery );/* =============================================================
+ * bootstrap-collapse.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
*
@@ -368,118 +417,221 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============================================================== */
+ * ============================================================ */
-!function ( $ ) {
+!function( $ ){
"use strict"
- /* SCROLLSPY CLASS DEFINITION
- * ========================== */
+ var Collapse = function ( element, options ) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
- function ScrollSpy( element, options) {
- var process = $.proxy(this.process, this)
- , $element = $(element).is('body') ? $(window) : $(element)
- , href
- this.options = $.extend({}, $.fn.scrollspy.defaults, options)
- this.$scrollElement = $element.on('scroll.scroll.data-api', process)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.$body = $('body').on('click.scroll.data-api', this.selector, process)
- this.refresh()
- this.process()
+ if (this.options["parent"]) {
+ this.$parent = $(this.options["parent"])
+ }
+
+ this.options.toggle && this.toggle()
}
- ScrollSpy.prototype = {
+ Collapse.prototype = {
- constructor: ScrollSpy
+ constructor: Collapse
- , refresh: function () {
- this.targets = this.$body
- .find(this.selector)
- .map(function () {
- var href = $(this).attr('href')
- return /^#\w/.test(href) && $(href).length ? href : null
- })
+ , dimension: function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
- this.offsets = $.map(this.targets, function (id) {
- return $(id).position().top
+ , show: function () {
+ var dimension = this.dimension()
+ , scroll = $.camelCase(['scroll', dimension].join('-'))
+ , actives = this.$parent && this.$parent.find('.in')
+ , hasData
+
+ if (actives && actives.length) {
+ hasData = actives.data('collapse')
+ actives.collapse('hide')
+ hasData || actives.data('collapse', null)
+ }
+
+ this.$element[dimension](0)
+ this.transition('addClass', 'show', 'shown')
+ this.$element[dimension](this.$element[0][scroll])
+
+ }
+
+ , hide: function () {
+ var dimension = this.dimension()
+ this.reset(this.$element[dimension]())
+ this.transition('removeClass', 'hide', 'hidden')
+ this.$element[dimension](0)
+ }
+
+ , reset: function ( size ) {
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ [dimension](size || 'auto')
+ [0].offsetWidth
+
+ this.$element[size ? 'addClass' : 'removeClass']('collapse')
+
+ return this
+ }
+
+ , transition: function ( method, startEvent, completeEvent ) {
+ var that = this
+ , complete = function () {
+ if (startEvent == 'show') that.reset()
+ that.$element.trigger(completeEvent)
+ }
+
+ this.$element
+ .trigger(startEvent)
+ [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']()
+ }
+
+ }
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
+ * ============================== */
+
+ $.fn.collapse = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('collapse')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.collapse.defaults = {
+ toggle: true
+ }
+
+ $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSIBLE DATA-API
+ * ==================== */
+
+ $(function () {
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $(target).collapse(option)
+ })
+ })
+
+}( window.jQuery );/* ============================================================
+ * bootstrap-dropdown.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#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.
+ * ============================================================ */
+
+
+!function( $ ){
+
+ "use strict"
+
+ /* DROPDOWN CLASS DEFINITION
+ * ========================= */
+
+ 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')
})
}
- , process: function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- , offsets = this.offsets
- , targets = this.targets
- , activeTarget = this.activeTarget
- , i
+ Dropdown.prototype = {
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
+ constructor: Dropdown
+
+ , toggle: function ( e ) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+ , isActive
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
- , activate: function (target) {
- var active
+ $parent = $(selector)
+ $parent.length || ($parent = $this.parent())
- this.activeTarget = target
+ isActive = $parent.hasClass('open')
- this.$body
- .find(this.selector).parent('.active')
- .removeClass('active')
+ clearMenus()
+ !isActive && $parent.toggleClass('open')
- active = this.$body
- .find(this.selector + '[href="' + target + '"]')
- .parent('li')
- .addClass('active')
+ return false
+ }
- if ( active.parent('.dropdown-menu') ) {
- active.closest('li.dropdown').addClass('active')
- }
- }
+ }
+ function clearMenus() {
+ $(toggle).parent().removeClass('open')
}
- /* SCROLLSPY PLUGIN DEFINITION
- * =========================== */
+ /* DROPDOWN PLUGIN DEFINITION
+ * ========================== */
- $.fn.scrollspy = function ( option ) {
+ $.fn.dropdown = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('scrollspy')
- , options = typeof option == 'object' && option
- if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
- if (typeof option == 'string') data[option]()
+ , data = $this.data('dropdown')
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
})
}
- $.fn.scrollspy.Constructor = ScrollSpy
-
- $.fn.scrollspy.defaults = {
- offset: 10
- }
+ $.fn.dropdown.Constructor = Dropdown
- /* SCROLLSPY DATA-API
- * ================== */
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
+ * =================================== */
$(function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
+ $('html').on('click.dropdown.data-api', clearMenus)
+ $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
-}( window.jQuery );
-/* ========================================================
- * bootstrap-tab.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
+}( window.jQuery );/* =========================================================
+ * bootstrap-modal.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -493,121 +645,200 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ======================================================== */
+ * ========================================================= */
!function( $ ){
"use strict"
- /* TAB CLASS DEFINITION
- * ==================== */
+ /* MODAL CLASS DEFINITION
+ * ====================== */
- var Tab = function ( element ) {
- this.element = $(element)
+ var Modal = function ( content, options ) {
+ this.options = options
+ this.$element = $(content)
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
}
- Tab.prototype = {
-
- constructor: Tab
+ Modal.prototype = {
- , show: function () {
- var $this = this.element
- , $ul = $this.closest('ul:not(.dropdown-menu)')
- , selector = $this.attr('data-target')
- , previous
- , $target
+ constructor: Modal
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ , toggle: function () {
+ return this[!this.isShown ? 'show' : 'hide']()
}
- if ( $this.parent('li').hasClass('active') ) return
+ , show: function () {
+ var that = this
- previous = $ul.find('.active a').last()[0]
+ if (this.isShown) return
- $this.trigger({
- type: 'show'
- , relatedTarget: previous
- })
+ $('body').addClass('modal-open')
- $target = $(selector)
+ this.isShown = true
+ this.$element.trigger('show')
+
+ escape.call(this)
+ backdrop.call(this, function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
+
+ that.$element
+ .show()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element.addClass('in')
+
+ transition ?
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
+ that.$element.trigger('shown')
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown'
- , relatedTarget: previous
})
- })
- }
+ }
- , activate: function ( element, container, callback) {
- var $active = container.find('> .active')
- , transition = callback
- && $.support.transition
- && $active.hasClass('fade')
+ , hide: function ( e ) {
+ e && e.preventDefault()
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
+ if (!this.isShown) return
- element.addClass('active')
+ var that = this
+ this.isShown = false
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
+ $('body').removeClass('modal-open')
- if ( element.parent('.dropdown-menu') ) {
- element.closest('li.dropdown').addClass('active')
- }
+ escape.call(this)
- callback && callback()
+ this.$element
+ .trigger('hide')
+ .removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ hideWithTransition.call(this) :
+ hideModal.call(this)
}
- transition ?
- $active.one($.support.transition.end, next) :
- next()
+ }
- $active.removeClass('in')
+
+ /* MODAL PRIVATE METHODS
+ * ===================== */
+
+ function hideWithTransition() {
+ var that = this
+ , timeout = setTimeout(function () {
+ that.$element.off($.support.transition.end)
+ hideModal.call(that)
+ }, 500)
+
+ this.$element.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ hideModal.call(that)
+ })
+ }
+
+ function hideModal( that ) {
+ this.$element
+ .hide()
+ .trigger('hidden')
+
+ backdrop.call(this)
+ }
+
+ function backdrop( callback ) {
+ var that = this
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+ .appendTo(document.body)
+
+ if (this.options.backdrop != 'static') {
+ this.$backdrop.click($.proxy(this.hide, this))
+ }
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ doAnimate ?
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade')?
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
+ removeBackdrop.call(this)
+
+ } else if (callback) {
+ callback()
}
}
+ function removeBackdrop() {
+ this.$backdrop.remove()
+ this.$backdrop = null
+ }
- /* TAB PLUGIN DEFINITION
- * ===================== */
+ function escape() {
+ var that = this
+ if (this.isShown && this.options.keyboard) {
+ $(document).on('keyup.dismiss.modal', function ( e ) {
+ e.which == 27 && that.hide()
+ })
+ } else if (!this.isShown) {
+ $(document).off('keyup.dismiss.modal')
+ }
+ }
- $.fn.tab = function ( option ) {
+
+ /* MODAL PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.modal = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('tab')
- if (!data) $this.data('tab', (data = new Tab(this)))
+ , data = $this.data('modal')
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
+ else if (options.show) data.show()
})
}
- $.fn.tab.Constructor = Tab
+ $.fn.modal.defaults = {
+ backdrop: true
+ , keyboard: true
+ , show: true
+ }
+ $.fn.modal.Constructor = Modal
- /* TAB DATA-API
- * ============ */
+
+ /* MODAL DATA-API
+ * ============== */
$(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
e.preventDefault()
- $(this).tab('show')
+ $target.modal(option)
})
})
-}( window.jQuery );
-/* ===========================================================
- * bootstrap-tooltip.js v2.0.1
+}( window.jQuery );/* ===========================================================
+ * bootstrap-tooltip.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
@@ -814,7 +1045,7 @@
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
- title = title.toString().replace(/(^\s*|\s*$)/, "")
+ title = (title || '').toString().replace(/(^\s*|\s*$)/, "")
return title
}
@@ -875,9 +1106,8 @@
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
}
-}( window.jQuery );
-/* ===========================================================
- * bootstrap-popover.js v2.0.1
+}( window.jQuery );/* ===========================================================
+ * bootstrap-popover.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#popovers
* ===========================================================
* Copyright 2012 Twitter, Inc.
@@ -970,202 +1200,9 @@
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
})
-}( window.jQuery );
-/* ==========================================================
- * bootstrap-alert.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#alerts
- * ==========================================================
- * 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.
- * ========================================================== */
-
-
-!function( $ ){
-
- "use strict"
-
- /* ALERT CLASS DEFINITION
- * ====================== */
-
- var dismiss = '[data-dismiss="alert"]'
- , Alert = function ( el ) {
- $(el).on('click', dismiss, this.close)
- }
-
- Alert.prototype = {
-
- constructor: Alert
-
- , close: function ( e ) {
- var $this = $(this)
- , selector = $this.attr('data-target')
- , $parent
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- $parent = $(selector)
- $parent.trigger('close')
-
- e && e.preventDefault()
-
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
-
- $parent
- .trigger('close')
- .removeClass('in')
-
- function removeElement() {
- $parent
- .trigger('closed')
- .remove()
- }
-
- $.support.transition && $parent.hasClass('fade') ?
- $parent.on($.support.transition.end, removeElement) :
- removeElement()
- }
-
- }
-
-
- /* ALERT PLUGIN DEFINITION
- * ======================= */
-
- $.fn.alert = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('alert')
- if (!data) $this.data('alert', (data = new Alert(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.alert.Constructor = Alert
-
-
- /* ALERT DATA-API
- * ============== */
-
- $(function () {
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
- })
-
-}( window.jQuery );
-/* ============================================================
- * bootstrap-button.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#buttons
- * ============================================================
- * 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.
- * ============================================================ */
-
-!function( $ ){
-
- "use strict"
-
- /* BUTTON PUBLIC CLASS DEFINITION
- * ============================== */
-
- var Button = function ( element, options ) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.button.defaults, options)
- }
-
- Button.prototype = {
-
- constructor: Button
-
- , setState: function ( state ) {
- var d = 'disabled'
- , $el = this.$element
- , data = $el.data()
- , val = $el.is('input') ? 'val' : 'html'
-
- state = state + 'Text'
- data.resetText || $el.data('resetText', $el[val]())
-
- $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)
- }
-
- , toggle: function () {
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
-
- $parent && $parent
- .find('.active')
- .removeClass('active')
-
- this.$element.toggleClass('active')
- }
-
- }
-
-
- /* BUTTON PLUGIN DEFINITION
- * ======================== */
-
- $.fn.button = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('button')
- , options = typeof option == 'object' && option
- if (!data) $this.data('button', (data = new Button(this, options)))
- if (option == 'toggle') data.toggle()
- else if (option) data.setState(option)
- })
- }
-
- $.fn.button.defaults = {
- loadingText: 'loading...'
- }
-
- $.fn.button.Constructor = Button
-
-
- /* BUTTON DATA-API
- * =============== */
-
- $(function () {
- $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
- $(e.currentTarget).button('toggle')
- })
- })
-
-}( window.jQuery );
-/* =============================================================
- * bootstrap-collapse.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#collapse
+}( window.jQuery );/* =============================================================
+ * bootstrap-scrollspy.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
@@ -1180,129 +1217,117 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============================================================ */
+ * ============================================================== */
-!function( $ ){
+!function ( $ ) {
"use strict"
- var Collapse = function ( element, options ) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.collapse.defaults, options)
-
- if (this.options["parent"]) {
- this.$parent = $(this.options["parent"])
- }
+ /* SCROLLSPY CLASS DEFINITION
+ * ========================== */
- this.options.toggle && this.toggle()
+ function ScrollSpy( element, options) {
+ var process = $.proxy(this.process, this)
+ , $element = $(element).is('body') ? $(window) : $(element)
+ , href
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
+ this.selector = (this.options.target
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ || '') + ' .nav li > a'
+ this.$body = $('body').on('click.scroll.data-api', this.selector, process)
+ this.refresh()
+ this.process()
}
- Collapse.prototype = {
-
- constructor: Collapse
+ ScrollSpy.prototype = {
- , dimension: function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
+ constructor: ScrollSpy
- , show: function () {
- var dimension = this.dimension()
- , scroll = $.camelCase(['scroll', dimension].join('-'))
- , actives = this.$parent && this.$parent.find('.in')
- , hasData
+ , refresh: function () {
+ this.targets = this.$body
+ .find(this.selector)
+ .map(function () {
+ var href = $(this).attr('href')
+ return /^#\w/.test(href) && $(href).length ? href : null
+ })
- if (actives && actives.length) {
- hasData = actives.data('collapse')
- actives.collapse('hide')
- hasData || actives.data('collapse', null)
+ this.offsets = $.map(this.targets, function (id) {
+ return $(id).position().top
+ })
}
- this.$element[dimension](0)
- this.transition('addClass', 'show', 'shown')
- this.$element[dimension](this.$element[0][scroll])
-
- }
-
- , hide: function () {
- var dimension = this.dimension()
- this.reset(this.$element[dimension]())
- this.transition('removeClass', 'hide', 'hidden')
- this.$element[dimension](0)
- }
-
- , reset: function ( size ) {
- var dimension = this.dimension()
+ , process: function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , offsets = this.offsets
+ , targets = this.targets
+ , activeTarget = this.activeTarget
+ , i
- this.$element
- .removeClass('collapse')
- [dimension](size || 'auto')
- [0].offsetWidth
+ for (i = offsets.length; i--;) {
+ activeTarget != targets[i]
+ && scrollTop >= offsets[i]
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+ && this.activate( targets[i] )
+ }
+ }
- this.$element.addClass('collapse')
- }
+ , activate: function (target) {
+ var active
- , transition: function ( method, startEvent, completeEvent ) {
- var that = this
- , complete = function () {
- if (startEvent == 'show') that.reset()
- that.$element.trigger(completeEvent)
- }
+ this.activeTarget = target
- this.$element
- .trigger(startEvent)
- [method]('in')
+ this.$body
+ .find(this.selector).parent('.active')
+ .removeClass('active')
- $.support.transition && this.$element.hasClass('collapse') ?
- this.$element.one($.support.transition.end, complete) :
- complete()
- }
+ active = this.$body
+ .find(this.selector + '[href="' + target + '"]')
+ .parent('li')
+ .addClass('active')
- , toggle: function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
+ if ( active.parent('.dropdown-menu') ) {
+ active.closest('li.dropdown').addClass('active')
+ }
+ }
}
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
- $.fn.collapse = function ( option ) {
+ /* SCROLLSPY PLUGIN DEFINITION
+ * =========================== */
+
+ $.fn.scrollspy = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('collapse')
+ , data = $this.data('scrollspy')
, options = typeof option == 'object' && option
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
}
- $.fn.collapse.defaults = {
- toggle: true
- }
+ $.fn.scrollspy.Constructor = ScrollSpy
- $.fn.collapse.Constructor = Collapse
+ $.fn.scrollspy.defaults = {
+ offset: 10
+ }
- /* COLLAPSIBLE DATA-API
- * ==================== */
+ /* SCROLLSPY DATA-API
+ * ================== */
$(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $(target).collapse(option)
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ $spy.scrollspy($spy.data())
})
})
-}( window.jQuery );
-/* ==========================================================
- * bootstrap-carousel.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#carousel
- * ==========================================================
+}( window.jQuery );/* ========================================================
+ * bootstrap-tab.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -1316,148 +1341,120 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ========================================================== */
+ * ======================================================== */
!function( $ ){
"use strict"
- /* CAROUSEL CLASS DEFINITION
- * ========================= */
+ /* TAB CLASS DEFINITION
+ * ==================== */
- var Carousel = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.carousel.defaults, options)
- this.options.slide && this.slide(this.options.slide)
+ var Tab = function ( element ) {
+ this.element = $(element)
}
- Carousel.prototype = {
-
- cycle: function () {
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
- return this
- }
+ Tab.prototype = {
- , to: function (pos) {
- var $active = this.$element.find('.active')
- , children = $active.parent().children()
- , activePos = children.index($active)
- , that = this
+ constructor: Tab
- if (pos > (children.length - 1) || pos < 0) return
+ , show: function () {
+ var $this = this.element
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
+ , selector = $this.attr('data-target')
+ , previous
+ , $target
- if (this.sliding) {
- return this.$element.one('slid', function () {
- that.to(pos)
- })
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
- if (activePos == pos) {
- return this.pause().cycle()
- }
+ if ( $this.parent('li').hasClass('active') ) return
- return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
- }
+ previous = $ul.find('.active a').last()[0]
- , pause: function () {
- clearInterval(this.interval)
- this.interval = null
- return this
- }
+ $this.trigger({
+ type: 'show'
+ , relatedTarget: previous
+ })
- , next: function () {
- if (this.sliding) return
- return this.slide('next')
- }
+ $target = $(selector)
- , prev: function () {
- if (this.sliding) return
- return this.slide('prev')
+ this.activate($this.parent('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $this.trigger({
+ type: 'shown'
+ , relatedTarget: previous
+ })
+ })
}
- , slide: function (type, next) {
- var $active = this.$element.find('.active')
- , $next = next || $active[type]()
- , isCycling = this.interval
- , direction = type == 'next' ? 'left' : 'right'
- , fallback = type == 'next' ? 'first' : 'last'
- , that = this
+ , activate: function ( element, container, callback) {
+ var $active = container.find('> .active')
+ , transition = callback
+ && $.support.transition
+ && $active.hasClass('fade')
- if (!$next.length) return
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
- this.sliding = true
+ element.addClass('active')
- isCycling && this.pause()
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+ if ( element.parent('.dropdown-menu') ) {
+ element.closest('li.dropdown').addClass('active')
+ }
- if (!$.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger('slide')
- $active.removeClass('active')
- $next.addClass('active')
- this.sliding = false
- this.$element.trigger('slid')
- } else {
- $next.addClass(type)
- $next[0].offsetWidth // force reflow
- $active.addClass(direction)
- $next.addClass(direction)
- this.$element.trigger('slide')
- this.$element.one($.support.transition.end, function () {
- $next.removeClass([type, direction].join(' ')).addClass('active')
- $active.removeClass(['active', direction].join(' '))
- that.sliding = false
- setTimeout(function () { that.$element.trigger('slid') }, 0)
- })
+ callback && callback()
}
- isCycling && this.cycle()
+ transition ?
+ $active.one($.support.transition.end, next) :
+ next()
- return this
+ $active.removeClass('in')
}
-
}
- /* CAROUSEL PLUGIN DEFINITION
- * ========================== */
+ /* TAB PLUGIN DEFINITION
+ * ===================== */
- $.fn.carousel = function ( option ) {
+ $.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
- , data = $this.data('carousel')
- , options = typeof option == 'object' && option
- if (!data) $this.data('carousel', (data = new Carousel(this, options)))
- if (typeof option == 'number') data.to(option)
- else if (typeof option == 'string' || (option = options.slide)) data[option]()
- else data.cycle()
+ , data = $this.data('tab')
+ if (!data) $this.data('tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
})
}
- $.fn.carousel.defaults = {
- interval: 5000
- }
-
- $.fn.carousel.Constructor = Carousel
+ $.fn.tab.Constructor = Tab
- /* CAROUSEL DATA-API
- * ================= */
+ /* TAB DATA-API
+ * ============ */
$(function () {
- $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
- var $this = $(this), href
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
- $target.carousel(options)
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
+ $(this).tab('show')
})
})
-}( window.jQuery );
-/* =============================================================
- * bootstrap-typeahead.js v2.0.1
+}( window.jQuery );/* =============================================================
+ * bootstrap-typeahead.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
@@ -1498,6 +1495,7 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element.val(val)
+ this.$element.change();
return this.hide()
}
@@ -1623,9 +1621,6 @@
}
, keyup: function (e) {
- e.stopPropagation()
- e.preventDefault()
-
switch(e.keyCode) {
case 40: // down arrow
case 38: // up arrow
@@ -1638,6 +1633,7 @@
break
case 27: // escape
+ if (!this.shown) return
this.hide()
break
@@ -1645,10 +1641,11 @@
this.lookup()
}
+ e.stopPropagation()
+ e.preventDefault()
}
, keypress: function (e) {
- e.stopPropagation()
if (!this.shown) return
switch(e.keyCode) {
@@ -1668,12 +1665,12 @@
this.next()
break
}
+
+ e.stopPropagation()
}
, blur: function (e) {
var that = this
- e.stopPropagation()
- e.preventDefault()
setTimeout(function () { that.hide() }, 150)
}
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/bootstrap.2.0.2.js
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision