mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-15 15:29:22 +01:00
add jshint support + a few minor stylistic changes
This commit is contained in:
parent
8575a45294
commit
575f18aaf4
2
Makefile
2
Makefile
@ -34,6 +34,8 @@ bootstrap:
|
|||||||
lessc --yui-compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
|
lessc --yui-compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
|
||||||
lessc ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
|
lessc ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
|
||||||
lessc --yui-compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
|
lessc --yui-compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
|
||||||
|
jshint js/*.js --config js/.jshintrc
|
||||||
|
jshint js/tests/unit/*.js --config js/.jshintrc
|
||||||
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
|
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
|
||||||
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
||||||
echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
||||||
|
@ -81,6 +81,13 @@ Developers
|
|||||||
|
|
||||||
We have included a makefile with convenience methods for working with the Bootstrap library.
|
We have included a makefile with convenience methods for working with the Bootstrap library.
|
||||||
|
|
||||||
|
+ **dependencies**
|
||||||
|
Our makefile depends on you having less, uglify.js, and jshint installed. To install, just run the following command in npm:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install less uglify-js jshint -g
|
||||||
|
```
|
||||||
|
|
||||||
+ **build** - `make`
|
+ **build** - `make`
|
||||||
Runs the LESS compiler to rebuild the `/less` files and compiles the docs pages. Requires lessc and uglify-js. <a href="http://twitter.github.com/bootstrap/less.html#compiling">Read more in our docs »</a>
|
Runs the LESS compiler to rebuild the `/less` files and compiles the docs pages. Requires lessc and uglify-js. <a href="http://twitter.github.com/bootstrap/less.html#compiling">Read more in our docs »</a>
|
||||||
|
|
||||||
|
Binary file not shown.
69
docs/assets/js/bootstrap-alert.js
vendored
69
docs/assets/js/bootstrap-alert.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* ALERT CLASS DEFINITION
|
/* ALERT CLASS DEFINITION
|
||||||
* ====================== */
|
* ====================== */
|
||||||
@ -30,43 +31,37 @@
|
|||||||
$(el).on('click', dismiss, this.close)
|
$(el).on('click', dismiss, this.close)
|
||||||
}
|
}
|
||||||
|
|
||||||
Alert.prototype = {
|
Alert.prototype.close = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
, selector = $this.attr('data-target')
|
||||||
|
, $parent
|
||||||
|
|
||||||
constructor: Alert
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
, close: function ( e ) {
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
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)
|
|
||||||
|
|
||||||
e && e.preventDefault()
|
|
||||||
|
|
||||||
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
|
||||||
|
|
||||||
$parent.trigger(e = $.Event('close'))
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$parent.removeClass('in')
|
|
||||||
|
|
||||||
function removeElement() {
|
|
||||||
$parent
|
|
||||||
.trigger('closed')
|
|
||||||
.remove()
|
|
||||||
}
|
|
||||||
|
|
||||||
$.support.transition && $parent.hasClass('fade') ?
|
|
||||||
$parent.on($.support.transition.end, removeElement) :
|
|
||||||
removeElement()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parent = $(selector)
|
||||||
|
|
||||||
|
e && e.preventDefault()
|
||||||
|
|
||||||
|
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('close'))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent.removeClass('in')
|
||||||
|
|
||||||
|
function removeElement() {
|
||||||
|
$parent
|
||||||
|
.trigger('closed')
|
||||||
|
.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && $parent.hasClass('fade') ?
|
||||||
|
$parent.on($.support.transition.end, removeElement) :
|
||||||
|
removeElement()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -92,4 +87,4 @@
|
|||||||
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
59
docs/assets/js/bootstrap-button.js
vendored
59
docs/assets/js/bootstrap-button.js
vendored
@ -18,58 +18,53 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* BUTTON PUBLIC CLASS DEFINITION
|
/* BUTTON PUBLIC CLASS DEFINITION
|
||||||
* ============================== */
|
* ============================== */
|
||||||
|
|
||||||
var Button = function ( element, options ) {
|
var Button = function (element, options) {
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.button.defaults, options)
|
this.options = $.extend({}, $.fn.button.defaults, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button.prototype = {
|
Button.prototype.setState = function (state) {
|
||||||
|
var d = 'disabled'
|
||||||
|
, $el = this.$element
|
||||||
|
, data = $el.data()
|
||||||
|
, val = $el.is('input') ? 'val' : 'html'
|
||||||
|
|
||||||
constructor: Button
|
state = state + 'Text'
|
||||||
|
data.resetText || $el.data('resetText', $el[val]())
|
||||||
|
|
||||||
, setState: function ( state ) {
|
$el[val](data[state] || this.options[state])
|
||||||
var d = 'disabled'
|
|
||||||
, $el = this.$element
|
|
||||||
, data = $el.data()
|
|
||||||
, val = $el.is('input') ? 'val' : 'html'
|
|
||||||
|
|
||||||
state = state + 'Text'
|
// push to event loop to allow forms to submit
|
||||||
data.resetText || $el.data('resetText', $el[val]())
|
setTimeout(function () {
|
||||||
|
state == 'loadingText' ?
|
||||||
|
$el.addClass(d).attr(d, d) :
|
||||||
|
$el.removeClass(d).removeAttr(d)
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
$el[val](data[state] || this.options[state])
|
Button.prototype.toggle = function () {
|
||||||
|
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
||||||
|
|
||||||
// push to event loop to allow forms to submit
|
$parent && $parent
|
||||||
setTimeout(function () {
|
.find('.active')
|
||||||
state == 'loadingText' ?
|
.removeClass('active')
|
||||||
$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')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
this.$element.toggleClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* BUTTON PLUGIN DEFINITION
|
/* BUTTON PLUGIN DEFINITION
|
||||||
* ======================== */
|
* ======================== */
|
||||||
|
|
||||||
$.fn.button = function ( option ) {
|
$.fn.button = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('button')
|
, data = $this.data('button')
|
||||||
@ -98,4 +93,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
9
docs/assets/js/bootstrap-carousel.js
vendored
9
docs/assets/js/bootstrap-carousel.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* CAROUSEL CLASS DEFINITION
|
/* CAROUSEL CLASS DEFINITION
|
||||||
* ========================= */
|
* ========================= */
|
||||||
@ -129,7 +130,7 @@
|
|||||||
/* CAROUSEL PLUGIN DEFINITION
|
/* CAROUSEL PLUGIN DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
|
|
||||||
$.fn.carousel = function ( option ) {
|
$.fn.carousel = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('carousel')
|
, data = $this.data('carousel')
|
||||||
@ -162,4 +163,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
34
docs/assets/js/bootstrap-collapse.js
vendored
34
docs/assets/js/bootstrap-collapse.js
vendored
@ -18,16 +18,20 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
var Collapse = function ( element, options ) {
|
|
||||||
this.$element = $(element)
|
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||||
|
* ================================ */
|
||||||
|
|
||||||
|
var Collapse = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||||
|
|
||||||
if (this.options["parent"]) {
|
if (this.options.parent) {
|
||||||
this.$parent = $(this.options["parent"])
|
this.$parent = $(this.options.parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.options.toggle && this.toggle()
|
this.options.toggle && this.toggle()
|
||||||
@ -53,7 +57,6 @@
|
|||||||
dimension = this.dimension()
|
dimension = this.dimension()
|
||||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||||
hasData
|
|
||||||
|
|
||||||
if (actives && actives.length) {
|
if (actives && actives.length) {
|
||||||
hasData = actives.data('collapse')
|
hasData = actives.data('collapse')
|
||||||
@ -75,7 +78,7 @@
|
|||||||
this.$element[dimension](0)
|
this.$element[dimension](0)
|
||||||
}
|
}
|
||||||
|
|
||||||
, reset: function ( size ) {
|
, reset: function (size) {
|
||||||
var dimension = this.dimension()
|
var dimension = this.dimension()
|
||||||
|
|
||||||
this.$element
|
this.$element
|
||||||
@ -83,12 +86,12 @@
|
|||||||
[dimension](size || 'auto')
|
[dimension](size || 'auto')
|
||||||
[0].offsetWidth
|
[0].offsetWidth
|
||||||
|
|
||||||
this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
|
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
, transition: function ( method, startEvent, completeEvent ) {
|
, transition: function (method, startEvent, completeEvent) {
|
||||||
var that = this
|
var that = this
|
||||||
, complete = function () {
|
, complete = function () {
|
||||||
if (startEvent == 'show') that.reset()
|
if (startEvent == 'show') that.reset()
|
||||||
@ -107,18 +110,19 @@
|
|||||||
$.support.transition && this.$element.hasClass('collapse') ?
|
$.support.transition && this.$element.hasClass('collapse') ?
|
||||||
this.$element.one($.support.transition.end, complete) :
|
this.$element.one($.support.transition.end, complete) :
|
||||||
complete()
|
complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
, toggle: function () {
|
, toggle: function () {
|
||||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* COLLAPSIBLE PLUGIN DEFINITION
|
|
||||||
|
/* COLLAPSIBLE PLUGIN DEFINITION
|
||||||
* ============================== */
|
* ============================== */
|
||||||
|
|
||||||
$.fn.collapse = function ( option ) {
|
$.fn.collapse = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('collapse')
|
, data = $this.data('collapse')
|
||||||
@ -149,4 +153,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
16
docs/assets/js/bootstrap-dropdown.js
vendored
16
docs/assets/js/bootstrap-dropdown.js
vendored
@ -18,15 +18,16 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* DROPDOWN CLASS DEFINITION
|
/* DROPDOWN CLASS DEFINITION
|
||||||
* ========================= */
|
* ========================= */
|
||||||
|
|
||||||
var toggle = '[data-toggle="dropdown"]'
|
var toggle = '[data-toggle="dropdown"]'
|
||||||
, Dropdown = function ( element ) {
|
, Dropdown = function (element) {
|
||||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||||
$('html').on('click.dropdown.data-api', function () {
|
$('html').on('click.dropdown.data-api', function () {
|
||||||
$el.parent().removeClass('open')
|
$el.parent().removeClass('open')
|
||||||
@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
constructor: Dropdown
|
constructor: Dropdown
|
||||||
|
|
||||||
, toggle: function ( e ) {
|
, toggle: function (e) {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, selector = $this.attr('data-target')
|
, selector = $this.attr('data-target')
|
||||||
, $parent
|
, $parent
|
||||||
@ -54,7 +55,8 @@
|
|||||||
isActive = $parent.hasClass('open')
|
isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
clearMenus()
|
clearMenus()
|
||||||
!isActive && $parent.toggleClass('open')
|
|
||||||
|
if (!isActive) $parent.toggleClass('open')
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -69,7 +71,7 @@
|
|||||||
/* DROPDOWN PLUGIN DEFINITION
|
/* DROPDOWN PLUGIN DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
|
|
||||||
$.fn.dropdown = function ( option ) {
|
$.fn.dropdown = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('dropdown')
|
, data = $this.data('dropdown')
|
||||||
@ -91,4 +93,4 @@
|
|||||||
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
21
docs/assets/js/bootstrap-modal.js
vendored
21
docs/assets/js/bootstrap-modal.js
vendored
@ -18,14 +18,15 @@
|
|||||||
* ========================================================= */
|
* ========================================================= */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* MODAL CLASS DEFINITION
|
/* MODAL CLASS DEFINITION
|
||||||
* ====================== */
|
* ====================== */
|
||||||
|
|
||||||
var Modal = function ( content, options ) {
|
var Modal = function (content, options) {
|
||||||
this.options = options
|
this.options = options
|
||||||
this.$element = $(content)
|
this.$element = $(content)
|
||||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||||
@ -55,7 +56,9 @@
|
|||||||
backdrop.call(this, function () {
|
backdrop.call(this, function () {
|
||||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
|
||||||
!that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
|
if (!that.$element.parent().length) {
|
||||||
|
that.$element.appendTo(document.body) //don't move modals dom position
|
||||||
|
}
|
||||||
|
|
||||||
that.$element
|
that.$element
|
||||||
.show()
|
.show()
|
||||||
@ -73,7 +76,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
, hide: function ( e ) {
|
, hide: function (e) {
|
||||||
e && e.preventDefault()
|
e && e.preventDefault()
|
||||||
|
|
||||||
var that = this
|
var that = this
|
||||||
@ -116,7 +119,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideModal( that ) {
|
function hideModal(that) {
|
||||||
this.$element
|
this.$element
|
||||||
.hide()
|
.hide()
|
||||||
.trigger('hidden')
|
.trigger('hidden')
|
||||||
@ -124,7 +127,7 @@
|
|||||||
backdrop.call(this)
|
backdrop.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
function backdrop( callback ) {
|
function backdrop(callback) {
|
||||||
var that = this
|
var that = this
|
||||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
|
||||||
@ -178,7 +181,7 @@
|
|||||||
/* MODAL PLUGIN DEFINITION
|
/* MODAL PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
$.fn.modal = function ( option ) {
|
$.fn.modal = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('modal')
|
, data = $this.data('modal')
|
||||||
@ -212,4 +215,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
15
docs/assets/js/bootstrap-popover.js
vendored
15
docs/assets/js/bootstrap-popover.js
vendored
@ -18,14 +18,19 @@
|
|||||||
* =========================================================== */
|
* =========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
|
|
||||||
|
/* POPOVER PUBLIC CLASS DEFINITION
|
||||||
|
* =============================== */
|
||||||
|
|
||||||
var Popover = function ( element, options ) {
|
var Popover = function ( element, options ) {
|
||||||
this.init('popover', element, options)
|
this.init('popover', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||||
========================================== */
|
========================================== */
|
||||||
|
|
||||||
@ -59,7 +64,7 @@
|
|||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|
||||||
, tip: function() {
|
, tip: function () {
|
||||||
if (!this.$tip) {
|
if (!this.$tip) {
|
||||||
this.$tip = $(this.options.template)
|
this.$tip = $(this.options.template)
|
||||||
}
|
}
|
||||||
@ -72,7 +77,7 @@
|
|||||||
/* POPOVER PLUGIN DEFINITION
|
/* POPOVER PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
$.fn.popover = function ( option ) {
|
$.fn.popover = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('popover')
|
, data = $this.data('popover')
|
||||||
@ -90,4 +95,4 @@
|
|||||||
, 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>'
|
, 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 );
|
}(window.jQuery);
|
7
docs/assets/js/bootstrap-scrollspy.js
vendored
7
docs/assets/js/bootstrap-scrollspy.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ============================================================== */
|
* ============================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* SCROLLSPY CLASS DEFINITION
|
/* SCROLLSPY CLASS DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
@ -142,4 +143,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
7
docs/assets/js/bootstrap-tab.js
vendored
7
docs/assets/js/bootstrap-tab.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ======================================================== */
|
* ======================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* TAB CLASS DEFINITION
|
/* TAB CLASS DEFINITION
|
||||||
* ==================== */
|
* ==================== */
|
||||||
@ -131,4 +132,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
25
docs/assets/js/bootstrap-tooltip.js
vendored
25
docs/assets/js/bootstrap-tooltip.js
vendored
@ -19,14 +19,15 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
* =============================== */
|
* =============================== */
|
||||||
|
|
||||||
var Tooltip = function ( element, options ) {
|
var Tooltip = function (element, options) {
|
||||||
this.init('tooltip', element, options)
|
this.init('tooltip', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +35,7 @@
|
|||||||
|
|
||||||
constructor: Tooltip
|
constructor: Tooltip
|
||||||
|
|
||||||
, init: function ( type, element, options ) {
|
, init: function (type, element, options) {
|
||||||
var eventIn
|
var eventIn
|
||||||
, eventOut
|
, eventOut
|
||||||
|
|
||||||
@ -55,7 +56,7 @@
|
|||||||
this.fixTitle()
|
this.fixTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
, getOptions: function ( options ) {
|
, getOptions: function (options) {
|
||||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
@ -68,7 +69,7 @@
|
|||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
, enter: function ( e ) {
|
, enter: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) {
|
if (!self.options.delay || !self.options.delay.show) {
|
||||||
@ -84,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
, leave: function ( e ) {
|
, leave: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) {
|
if (!self.options.delay || !self.options.delay.hide) {
|
||||||
@ -155,7 +156,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
, isHTML: function( text ) {
|
, isHTML: function(text) {
|
||||||
// html string detection logic adapted from jQuery
|
// html string detection logic adapted from jQuery
|
||||||
return typeof text != 'string'
|
return typeof text != 'string'
|
||||||
|| ( text.charAt(0) === "<"
|
|| ( text.charAt(0) === "<"
|
||||||
@ -271,12 +272,12 @@
|
|||||||
|
|
||||||
$.fn.tooltip.defaults = {
|
$.fn.tooltip.defaults = {
|
||||||
animation: true
|
animation: true
|
||||||
, delay: 0
|
|
||||||
, selector: false
|
|
||||||
, placement: 'top'
|
, placement: 'top'
|
||||||
|
, selector: false
|
||||||
|
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||||
, trigger: 'hover'
|
, trigger: 'hover'
|
||||||
, title: ''
|
, title: ''
|
||||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
, delay: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
7
docs/assets/js/bootstrap-transition.js
vendored
7
docs/assets/js/bootstrap-transition.js
vendored
@ -18,11 +18,12 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
||||||
* ======================================================= */
|
* ======================================================= */
|
||||||
@ -57,4 +58,4 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
16
docs/assets/js/bootstrap-typeahead.js
vendored
16
docs/assets/js/bootstrap-typeahead.js
vendored
@ -18,11 +18,15 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function( $ ){
|
!function($){
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
var Typeahead = function ( element, options ) {
|
|
||||||
|
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
||||||
|
* ================================= */
|
||||||
|
|
||||||
|
var Typeahead = function (element, options) {
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
||||||
this.matcher = this.options.matcher || this.matcher
|
this.matcher = this.options.matcher || this.matcher
|
||||||
@ -111,7 +115,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
, highlighter: function (item) {
|
, highlighter: function (item) {
|
||||||
var query = this.query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
|
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
||||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||||
return '<strong>' + match + '</strong>'
|
return '<strong>' + match + '</strong>'
|
||||||
})
|
})
|
||||||
@ -241,7 +245,7 @@
|
|||||||
/* TYPEAHEAD PLUGIN DEFINITION
|
/* TYPEAHEAD PLUGIN DEFINITION
|
||||||
* =========================== */
|
* =========================== */
|
||||||
|
|
||||||
$.fn.typeahead = function ( option ) {
|
$.fn.typeahead = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('typeahead')
|
, data = $this.data('typeahead')
|
||||||
@ -273,4 +277,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
9
js/.jshintrc
Normal file
9
js/.jshintrc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"browser" : true,
|
||||||
|
"expr" : true,
|
||||||
|
"laxbreak" : true,
|
||||||
|
"boss" : true,
|
||||||
|
"asi" : true,
|
||||||
|
"laxcomma" : true,
|
||||||
|
"validthis": true
|
||||||
|
}
|
69
js/bootstrap-alert.js
vendored
69
js/bootstrap-alert.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* ALERT CLASS DEFINITION
|
/* ALERT CLASS DEFINITION
|
||||||
* ====================== */
|
* ====================== */
|
||||||
@ -30,43 +31,37 @@
|
|||||||
$(el).on('click', dismiss, this.close)
|
$(el).on('click', dismiss, this.close)
|
||||||
}
|
}
|
||||||
|
|
||||||
Alert.prototype = {
|
Alert.prototype.close = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
, selector = $this.attr('data-target')
|
||||||
|
, $parent
|
||||||
|
|
||||||
constructor: Alert
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
, close: function ( e ) {
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
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)
|
|
||||||
|
|
||||||
e && e.preventDefault()
|
|
||||||
|
|
||||||
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
|
||||||
|
|
||||||
$parent.trigger(e = $.Event('close'))
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$parent.removeClass('in')
|
|
||||||
|
|
||||||
function removeElement() {
|
|
||||||
$parent
|
|
||||||
.trigger('closed')
|
|
||||||
.remove()
|
|
||||||
}
|
|
||||||
|
|
||||||
$.support.transition && $parent.hasClass('fade') ?
|
|
||||||
$parent.on($.support.transition.end, removeElement) :
|
|
||||||
removeElement()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parent = $(selector)
|
||||||
|
|
||||||
|
e && e.preventDefault()
|
||||||
|
|
||||||
|
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('close'))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent.removeClass('in')
|
||||||
|
|
||||||
|
function removeElement() {
|
||||||
|
$parent
|
||||||
|
.trigger('closed')
|
||||||
|
.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && $parent.hasClass('fade') ?
|
||||||
|
$parent.on($.support.transition.end, removeElement) :
|
||||||
|
removeElement()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -92,4 +87,4 @@
|
|||||||
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
59
js/bootstrap-button.js
vendored
59
js/bootstrap-button.js
vendored
@ -18,58 +18,53 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* BUTTON PUBLIC CLASS DEFINITION
|
/* BUTTON PUBLIC CLASS DEFINITION
|
||||||
* ============================== */
|
* ============================== */
|
||||||
|
|
||||||
var Button = function ( element, options ) {
|
var Button = function (element, options) {
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.button.defaults, options)
|
this.options = $.extend({}, $.fn.button.defaults, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button.prototype = {
|
Button.prototype.setState = function (state) {
|
||||||
|
var d = 'disabled'
|
||||||
|
, $el = this.$element
|
||||||
|
, data = $el.data()
|
||||||
|
, val = $el.is('input') ? 'val' : 'html'
|
||||||
|
|
||||||
constructor: Button
|
state = state + 'Text'
|
||||||
|
data.resetText || $el.data('resetText', $el[val]())
|
||||||
|
|
||||||
, setState: function ( state ) {
|
$el[val](data[state] || this.options[state])
|
||||||
var d = 'disabled'
|
|
||||||
, $el = this.$element
|
|
||||||
, data = $el.data()
|
|
||||||
, val = $el.is('input') ? 'val' : 'html'
|
|
||||||
|
|
||||||
state = state + 'Text'
|
// push to event loop to allow forms to submit
|
||||||
data.resetText || $el.data('resetText', $el[val]())
|
setTimeout(function () {
|
||||||
|
state == 'loadingText' ?
|
||||||
|
$el.addClass(d).attr(d, d) :
|
||||||
|
$el.removeClass(d).removeAttr(d)
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
$el[val](data[state] || this.options[state])
|
Button.prototype.toggle = function () {
|
||||||
|
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
||||||
|
|
||||||
// push to event loop to allow forms to submit
|
$parent && $parent
|
||||||
setTimeout(function () {
|
.find('.active')
|
||||||
state == 'loadingText' ?
|
.removeClass('active')
|
||||||
$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')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
this.$element.toggleClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* BUTTON PLUGIN DEFINITION
|
/* BUTTON PLUGIN DEFINITION
|
||||||
* ======================== */
|
* ======================== */
|
||||||
|
|
||||||
$.fn.button = function ( option ) {
|
$.fn.button = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('button')
|
, data = $this.data('button')
|
||||||
@ -98,4 +93,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
9
js/bootstrap-carousel.js
vendored
9
js/bootstrap-carousel.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* CAROUSEL CLASS DEFINITION
|
/* CAROUSEL CLASS DEFINITION
|
||||||
* ========================= */
|
* ========================= */
|
||||||
@ -129,7 +130,7 @@
|
|||||||
/* CAROUSEL PLUGIN DEFINITION
|
/* CAROUSEL PLUGIN DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
|
|
||||||
$.fn.carousel = function ( option ) {
|
$.fn.carousel = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('carousel')
|
, data = $this.data('carousel')
|
||||||
@ -162,4 +163,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
34
js/bootstrap-collapse.js
vendored
34
js/bootstrap-collapse.js
vendored
@ -18,16 +18,20 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
var Collapse = function ( element, options ) {
|
|
||||||
this.$element = $(element)
|
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||||
|
* ================================ */
|
||||||
|
|
||||||
|
var Collapse = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||||
|
|
||||||
if (this.options["parent"]) {
|
if (this.options.parent) {
|
||||||
this.$parent = $(this.options["parent"])
|
this.$parent = $(this.options.parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.options.toggle && this.toggle()
|
this.options.toggle && this.toggle()
|
||||||
@ -53,7 +57,6 @@
|
|||||||
dimension = this.dimension()
|
dimension = this.dimension()
|
||||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||||
hasData
|
|
||||||
|
|
||||||
if (actives && actives.length) {
|
if (actives && actives.length) {
|
||||||
hasData = actives.data('collapse')
|
hasData = actives.data('collapse')
|
||||||
@ -75,7 +78,7 @@
|
|||||||
this.$element[dimension](0)
|
this.$element[dimension](0)
|
||||||
}
|
}
|
||||||
|
|
||||||
, reset: function ( size ) {
|
, reset: function (size) {
|
||||||
var dimension = this.dimension()
|
var dimension = this.dimension()
|
||||||
|
|
||||||
this.$element
|
this.$element
|
||||||
@ -83,12 +86,12 @@
|
|||||||
[dimension](size || 'auto')
|
[dimension](size || 'auto')
|
||||||
[0].offsetWidth
|
[0].offsetWidth
|
||||||
|
|
||||||
this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
|
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
, transition: function ( method, startEvent, completeEvent ) {
|
, transition: function (method, startEvent, completeEvent) {
|
||||||
var that = this
|
var that = this
|
||||||
, complete = function () {
|
, complete = function () {
|
||||||
if (startEvent == 'show') that.reset()
|
if (startEvent == 'show') that.reset()
|
||||||
@ -107,18 +110,19 @@
|
|||||||
$.support.transition && this.$element.hasClass('collapse') ?
|
$.support.transition && this.$element.hasClass('collapse') ?
|
||||||
this.$element.one($.support.transition.end, complete) :
|
this.$element.one($.support.transition.end, complete) :
|
||||||
complete()
|
complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
, toggle: function () {
|
, toggle: function () {
|
||||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* COLLAPSIBLE PLUGIN DEFINITION
|
|
||||||
|
/* COLLAPSIBLE PLUGIN DEFINITION
|
||||||
* ============================== */
|
* ============================== */
|
||||||
|
|
||||||
$.fn.collapse = function ( option ) {
|
$.fn.collapse = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('collapse')
|
, data = $this.data('collapse')
|
||||||
@ -149,4 +153,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
16
js/bootstrap-dropdown.js
vendored
16
js/bootstrap-dropdown.js
vendored
@ -18,15 +18,16 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* DROPDOWN CLASS DEFINITION
|
/* DROPDOWN CLASS DEFINITION
|
||||||
* ========================= */
|
* ========================= */
|
||||||
|
|
||||||
var toggle = '[data-toggle="dropdown"]'
|
var toggle = '[data-toggle="dropdown"]'
|
||||||
, Dropdown = function ( element ) {
|
, Dropdown = function (element) {
|
||||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||||
$('html').on('click.dropdown.data-api', function () {
|
$('html').on('click.dropdown.data-api', function () {
|
||||||
$el.parent().removeClass('open')
|
$el.parent().removeClass('open')
|
||||||
@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
constructor: Dropdown
|
constructor: Dropdown
|
||||||
|
|
||||||
, toggle: function ( e ) {
|
, toggle: function (e) {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, selector = $this.attr('data-target')
|
, selector = $this.attr('data-target')
|
||||||
, $parent
|
, $parent
|
||||||
@ -54,7 +55,8 @@
|
|||||||
isActive = $parent.hasClass('open')
|
isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
clearMenus()
|
clearMenus()
|
||||||
!isActive && $parent.toggleClass('open')
|
|
||||||
|
if (!isActive) $parent.toggleClass('open')
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -69,7 +71,7 @@
|
|||||||
/* DROPDOWN PLUGIN DEFINITION
|
/* DROPDOWN PLUGIN DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
|
|
||||||
$.fn.dropdown = function ( option ) {
|
$.fn.dropdown = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('dropdown')
|
, data = $this.data('dropdown')
|
||||||
@ -91,4 +93,4 @@
|
|||||||
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
21
js/bootstrap-modal.js
vendored
21
js/bootstrap-modal.js
vendored
@ -18,14 +18,15 @@
|
|||||||
* ========================================================= */
|
* ========================================================= */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* MODAL CLASS DEFINITION
|
/* MODAL CLASS DEFINITION
|
||||||
* ====================== */
|
* ====================== */
|
||||||
|
|
||||||
var Modal = function ( content, options ) {
|
var Modal = function (content, options) {
|
||||||
this.options = options
|
this.options = options
|
||||||
this.$element = $(content)
|
this.$element = $(content)
|
||||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||||
@ -55,7 +56,9 @@
|
|||||||
backdrop.call(this, function () {
|
backdrop.call(this, function () {
|
||||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
|
||||||
!that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
|
if (!that.$element.parent().length) {
|
||||||
|
that.$element.appendTo(document.body) //don't move modals dom position
|
||||||
|
}
|
||||||
|
|
||||||
that.$element
|
that.$element
|
||||||
.show()
|
.show()
|
||||||
@ -73,7 +76,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
, hide: function ( e ) {
|
, hide: function (e) {
|
||||||
e && e.preventDefault()
|
e && e.preventDefault()
|
||||||
|
|
||||||
var that = this
|
var that = this
|
||||||
@ -116,7 +119,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideModal( that ) {
|
function hideModal(that) {
|
||||||
this.$element
|
this.$element
|
||||||
.hide()
|
.hide()
|
||||||
.trigger('hidden')
|
.trigger('hidden')
|
||||||
@ -124,7 +127,7 @@
|
|||||||
backdrop.call(this)
|
backdrop.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
function backdrop( callback ) {
|
function backdrop(callback) {
|
||||||
var that = this
|
var that = this
|
||||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
|
||||||
@ -178,7 +181,7 @@
|
|||||||
/* MODAL PLUGIN DEFINITION
|
/* MODAL PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
$.fn.modal = function ( option ) {
|
$.fn.modal = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('modal')
|
, data = $this.data('modal')
|
||||||
@ -212,4 +215,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
15
js/bootstrap-popover.js
vendored
15
js/bootstrap-popover.js
vendored
@ -18,14 +18,19 @@
|
|||||||
* =========================================================== */
|
* =========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
|
|
||||||
|
/* POPOVER PUBLIC CLASS DEFINITION
|
||||||
|
* =============================== */
|
||||||
|
|
||||||
var Popover = function ( element, options ) {
|
var Popover = function ( element, options ) {
|
||||||
this.init('popover', element, options)
|
this.init('popover', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||||
========================================== */
|
========================================== */
|
||||||
|
|
||||||
@ -59,7 +64,7 @@
|
|||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
|
||||||
, tip: function() {
|
, tip: function () {
|
||||||
if (!this.$tip) {
|
if (!this.$tip) {
|
||||||
this.$tip = $(this.options.template)
|
this.$tip = $(this.options.template)
|
||||||
}
|
}
|
||||||
@ -72,7 +77,7 @@
|
|||||||
/* POPOVER PLUGIN DEFINITION
|
/* POPOVER PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
$.fn.popover = function ( option ) {
|
$.fn.popover = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('popover')
|
, data = $this.data('popover')
|
||||||
@ -90,4 +95,4 @@
|
|||||||
, 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>'
|
, 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 );
|
}(window.jQuery);
|
7
js/bootstrap-scrollspy.js
vendored
7
js/bootstrap-scrollspy.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ============================================================== */
|
* ============================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* SCROLLSPY CLASS DEFINITION
|
/* SCROLLSPY CLASS DEFINITION
|
||||||
* ========================== */
|
* ========================== */
|
||||||
@ -142,4 +143,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
7
js/bootstrap-tab.js
vendored
7
js/bootstrap-tab.js
vendored
@ -18,9 +18,10 @@
|
|||||||
* ======================================================== */
|
* ======================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* TAB CLASS DEFINITION
|
/* TAB CLASS DEFINITION
|
||||||
* ==================== */
|
* ==================== */
|
||||||
@ -131,4 +132,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
25
js/bootstrap-tooltip.js
vendored
25
js/bootstrap-tooltip.js
vendored
@ -19,14 +19,15 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
* =============================== */
|
* =============================== */
|
||||||
|
|
||||||
var Tooltip = function ( element, options ) {
|
var Tooltip = function (element, options) {
|
||||||
this.init('tooltip', element, options)
|
this.init('tooltip', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +35,7 @@
|
|||||||
|
|
||||||
constructor: Tooltip
|
constructor: Tooltip
|
||||||
|
|
||||||
, init: function ( type, element, options ) {
|
, init: function (type, element, options) {
|
||||||
var eventIn
|
var eventIn
|
||||||
, eventOut
|
, eventOut
|
||||||
|
|
||||||
@ -55,7 +56,7 @@
|
|||||||
this.fixTitle()
|
this.fixTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
, getOptions: function ( options ) {
|
, getOptions: function (options) {
|
||||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
@ -68,7 +69,7 @@
|
|||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
, enter: function ( e ) {
|
, enter: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) {
|
if (!self.options.delay || !self.options.delay.show) {
|
||||||
@ -84,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
, leave: function ( e ) {
|
, leave: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) {
|
if (!self.options.delay || !self.options.delay.hide) {
|
||||||
@ -155,7 +156,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
, isHTML: function( text ) {
|
, isHTML: function(text) {
|
||||||
// html string detection logic adapted from jQuery
|
// html string detection logic adapted from jQuery
|
||||||
return typeof text != 'string'
|
return typeof text != 'string'
|
||||||
|| ( text.charAt(0) === "<"
|
|| ( text.charAt(0) === "<"
|
||||||
@ -271,12 +272,12 @@
|
|||||||
|
|
||||||
$.fn.tooltip.defaults = {
|
$.fn.tooltip.defaults = {
|
||||||
animation: true
|
animation: true
|
||||||
, delay: 0
|
|
||||||
, selector: false
|
|
||||||
, placement: 'top'
|
, placement: 'top'
|
||||||
|
, selector: false
|
||||||
|
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||||
, trigger: 'hover'
|
, trigger: 'hover'
|
||||||
, title: ''
|
, title: ''
|
||||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
, delay: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
7
js/bootstrap-transition.js
vendored
7
js/bootstrap-transition.js
vendored
@ -18,11 +18,12 @@
|
|||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
!function ( $ ) {
|
!function ($) {
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
||||||
* ======================================================= */
|
* ======================================================= */
|
||||||
@ -57,4 +58,4 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
16
js/bootstrap-typeahead.js
vendored
16
js/bootstrap-typeahead.js
vendored
@ -18,11 +18,15 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
|
|
||||||
!function( $ ){
|
!function($){
|
||||||
|
|
||||||
"use strict"
|
"use strict"; // jshint ;_;
|
||||||
|
|
||||||
var Typeahead = function ( element, options ) {
|
|
||||||
|
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
||||||
|
* ================================= */
|
||||||
|
|
||||||
|
var Typeahead = function (element, options) {
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
||||||
this.matcher = this.options.matcher || this.matcher
|
this.matcher = this.options.matcher || this.matcher
|
||||||
@ -111,7 +115,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
, highlighter: function (item) {
|
, highlighter: function (item) {
|
||||||
var query = this.query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
|
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
||||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||||
return '<strong>' + match + '</strong>'
|
return '<strong>' + match + '</strong>'
|
||||||
})
|
})
|
||||||
@ -241,7 +245,7 @@
|
|||||||
/* TYPEAHEAD PLUGIN DEFINITION
|
/* TYPEAHEAD PLUGIN DEFINITION
|
||||||
* =========================== */
|
* =========================== */
|
||||||
|
|
||||||
$.fn.typeahead = function ( option ) {
|
$.fn.typeahead = function (option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('typeahead')
|
, data = $this.data('typeahead')
|
||||||
@ -273,4 +277,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery );
|
}(window.jQuery);
|
2
js/tests/unit/bootstrap-transition.js
vendored
2
js/tests/unit/bootstrap-transition.js
vendored
@ -3,7 +3,7 @@ $(function () {
|
|||||||
module("bootstrap-transition")
|
module("bootstrap-transition")
|
||||||
|
|
||||||
test("should be defined on jquery support object", function () {
|
test("should be defined on jquery support object", function () {
|
||||||
ok($.support.transition != undefined, 'transition object is defined')
|
ok($.support.transition !== undefined, 'transition object is defined')
|
||||||
})
|
})
|
||||||
|
|
||||||
test("should provide an end object", function () {
|
test("should provide an end object", function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user