Skip to content
Browse files

Updating to work with 2.0.3

  • Loading branch information...
1 parent f824710 commit 9a727b05f81e7dd2192367ff776735e2b18bf71d @adamjgrant adamjgrant committed
Showing with 4,121 additions and 2,648 deletions.
  1. +3 −1 .gitignore
  2. +1,019 −1,139 css/bootstrap.css
  3. +9 −0 extras/h5bp/font-smoothing-ck.js
  4. +0 −310 extras/settings/overrides.less
  5. BIN img/glyphicons-halflings-white.png
  6. BIN img/glyphicons-halflings.png
  7. +10 −0 js/.jshintrc
  8. +9 −3 js/README.md
  9. +28 −32 js/bootstrap-alert.js
  10. +0 −1 js/bootstrap-alert.min.js
  11. +29 −33 js/bootstrap-button.js
  12. +0 −1 js/bootstrap-button.min.js
  13. +33 −21 js/bootstrap-carousel.js
  14. +0 −1 js/bootstrap-carousel.min.js
  15. +47 −26 js/bootstrap-collapse.js
  16. +0 −1 js/bootstrap-collapse.min.js
  17. +18 −10 js/bootstrap-dropdown.js
  18. +0 −1 js/bootstrap-dropdown.min.js
  19. +25 −17 js/bootstrap-modal.js
  20. +0 −1 js/bootstrap-modal.min.js
  21. +13 −10 js/bootstrap-popover.js
  22. +0 −1 js/bootstrap-popover.min.js
  23. +44 −18 js/bootstrap-scrollspy.js
  24. +0 −1 js/bootstrap-scrollspy.min.js
  25. +12 −7 js/bootstrap-tab.js
  26. +0 −1 js/bootstrap-tab.min.js
  27. +40 −35 js/bootstrap-tooltip.js
  28. +0 −1 js/bootstrap-tooltip.min.js
  29. +30 −20 js/bootstrap-transition.js
  30. +0 −1 js/bootstrap-transition.min.js
  31. +29 −15 js/bootstrap-typeahead.js
  32. +0 −1 js/bootstrap-typeahead.min.js
  33. +0 −1 js/bootstrap.min-ck.js
  34. +0 −1 js/bootstrap.min.js
  35. +6 −1 js/tests/index.html
  36. +63 −0 js/tests/phantom.js
  37. +14 −0 js/tests/server.js
  38. +15 −0 js/tests/unit/bootstrap-alert.js
  39. +28 −0 js/tests/unit/bootstrap-carousel.js
  40. +29 −0 js/tests/unit/bootstrap-collapse.js
  41. +34 −0 js/tests/unit/bootstrap-dropdown.js
  42. +29 −0 js/tests/unit/bootstrap-modal.js
  43. +21 −0 js/tests/unit/bootstrap-phantom.js
  44. +16 −0 js/tests/unit/bootstrap-tab.js
  45. +74 −0 js/tests/unit/bootstrap-tooltip.js
  46. +1 −1 js/tests/unit/bootstrap-transition.js
  47. +23 −3 js/tests/unit/bootstrap-typeahead.js
  48. +5 −0 less/accordion.less
  49. +2 −14 less/alerts.less
  50. +3 −3 less/bootstrap.less
  51. +2 −0 less/breadcrumbs.less
  52. +76 −33 less/button-groups.less
  53. +32 −24 less/buttons.less
  54. +12 −1 less/close.less
  55. +6 −6 less/code.less
  56. +9 −7 less/component-animations.less
  57. +58 −45 less/dropdowns.less
  58. +125 −63 less/forms.less
  59. +2 −5 less/grid.less
  60. +3 −1 less/hero-unit.less
  61. +55 −0 less/labels-badges.less
  62. +0 −32 less/labels.less
  63. +1 −1 less/layouts.less
  64. +218 −177 less/mixins.less
  65. +13 −6 less/modals.less
  66. +137 −72 less/navbar.less
  67. +53 −43 less/navs.less
  68. +6 −0 less/pager.less
  69. +1 −0 less/pagination.less
  70. +29 −7 less/progress-bars.less
  71. +3 −3 less/reset.less
  72. +26 −0 less/responsive-1200px-min.less
  73. +149 −0 less/responsive-767px-max.less
  74. +17 −0 less/responsive-768px-979px.less
  75. +146 −0 less/responsive-navbar.less
  76. +41 −0 less/responsive-utilities.less
  77. +14 −337 less/responsive.less
  78. +4 −4 less/scaffolding.less
  79. +42 −9 less/sprites.less
  80. +46 −20 less/tables.less
  81. +51 −0 less/tests/css-tests.css
  82. +827 −0 less/tests/css-tests.html
  83. +14 −2 less/thumbnails.less
  84. +27 −10 less/type.less
  85. +105 −7 less/variables.less
  86. +10 −0 less/wells.less
View
4 .gitignore
@@ -21,6 +21,7 @@ Thumbs.db
nbproject
*.sublime-project
*.sublime-workspace
+queue.txt
# Komodo
*.komodoproject
@@ -30,4 +31,5 @@ nbproject
.hg
.svn
.CVS
-.idea
+.idea
+queue
View
2,158 css/bootstrap.css
1,019 additions, 1,139 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
9 extras/h5bp/font-smoothing-ck.js
@@ -0,0 +1,9 @@
+// Use this Modernizr script to detect a browser's ability to smooth fonts.
+// The following is adapted from...
+/*
+ * TypeHelpers version 1.0
+ * Zoltan Hawryluk, Nov 24 2009.
+ *
+ * Released under the MIT License. http://www.opensource.org/licenses/mit-license.php
+ *
+ */Modernizr.addTest("fontsmoothing",function(){if(typeof screen.fontSmoothingEnabled!="undefined")return screen.fontSmoothingEnabled;try{var a=document.createElement("canvas"),b=!1,c=!1,d=document.body||function(){c=!0;return document.documentElement.appendChild(document.createElement("body"))}();a.width="35";a.height="35";a.style.display="none";d.appendChild(a);var e=a.getContext("2d");e.textBaseline="top";e.font="32px Arial";e.fillStyle="black";e.strokeStyle="black";e.fillText("O",0,0);for(var f=8;f<=32;f++)for(var g=1;g<=32;g++){var h=e.getImageData(g,f,1,1).data,i=h[3];if(i!=255&&i!=0){b=!0;break}}d.removeChild(a);c&&document.documentElement.removeChild(d);return b}catch(j){d.removeChild(a);c&&document.documentElement.removeChild(d);return!1}});
View
310 extras/settings/overrides.less
@@ -270,316 +270,6 @@ ol.linenums li {
line-height: 18px;
text-shadow: 0 1px 0 #fff;
}
-
-// RESPONSIVENESS
-// --------------
-
-// Responsive.less
-// For phone and tablet devices
-// -------------------------------------------------------------
-
-// Hide from screenreaders and browsers
-// Credit: HTML5 Boilerplate
-.hidden {
- display: none;
- visibility: hidden;
-}
-
-
-
-// UP TO LANDSCAPE PHONE
-// ---------------------
-
-@media (max-width: 480px) {
-
- // Smooth out the collapsing/expanding nav
- .nav-collapse {
- -webkit-transform: translate3d(0, 0, 0); // activate the GPU
- }
-
- // Block level the page header small tag for readability
- .page-header h1 small {
- display: block;
- line-height: @baseLineHeight;
- }
-
- // Make span* classes full width
- input[class*="span"],
- select[class*="span"],
- textarea[class*="span"],
- .uneditable-input {
- display: block;
- width: 100%;
- min-height: 28px; /* Make inputs at least the height of their button counterpart */
- /* Makes inputs behave like true block-level elements */
- -webkit-box-sizing: border-box; /* Older Webkit */
- -moz-box-sizing: border-box; /* Older FF */
- -ms-box-sizing: border-box; /* IE8 */
- box-sizing: border-box; /* CSS3 spec*/
- }
- // But don't let it screw up prepend/append inputs
- .input-prepend input[class*="span"],
- .input-append input[class*="span"] {
- width: auto;
- }
-
- // Update checkboxes for iOS
- input[type="checkbox"],
- input[type="radio"] {
- border: 1px solid #ccc;
- }
-
- // Remove the horizontal form styles
- .form-horizontal .control-group > label {
- float: none;
- width: auto;
- padding-top: 0;
- text-align: left;
- }
- // Move over all input controls and content
- .form-horizontal .controls {
- margin-left: 0;
- }
- // Move the options list down to align with labels
- .form-horizontal .control-list {
- padding-top: 0; // has to be padding because margin collaspes
- }
- // Move over buttons in .form-actions to align with .controls
- .form-horizontal .form-actions {
- padding-left: 10px;
- padding-right: 10px;
- }
-
- // Modals
- .modal {
- position: absolute;
- top: 10px;
- left: 10px;
- right: 10px;
- width: auto;
- margin: 0;
- &.fade.in { top: auto; }
- }
- .modal-header .close {
- padding: 10px;
- margin: -10px;
- }
-
- // Carousel
- .carousel-caption {
- position: static;
- }
-
-}
-
-
-
-// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
-// --------------------------------------------------
-
-@media (max-width: 767px) {
- // GRID & CONTAINERS
- // -----------------
- // Remove width from containers
- .container {
- width: auto;
- padding: 0 20px;
- }
- // Fluid rows
- .row-fluid {
- width: 100%;
- }
- // Undo negative margin on rows
- .row {
- margin-left: 0;
- }
- // Make all columns even
- .row > [class*="span"],
- .row-fluid > [class*="span"] {
- float: none;
- display: block;
- width: auto;
- margin: 0;
- }
-}
-
-
-
-// PORTRAIT TABLET TO DEFAULT DESKTOP
-// ----------------------------------
-
-@media (min-width: 768px) and (max-width: 979px) {
-
- // Fixed grid
- #gridSystem > .generate(12, 42px, 20px);
-
- // Fluid grid
- #fluidGridSystem > .generate(12, 5.801104972%, 2.762430939%);
-
- // Input grid
- #inputGridSystem > .generate(12, 42px, 20px);
-
-}
-
-
-
-// TABLETS AND BELOW
-// -----------------
-@media (max-width: 979px) {
-
- // UNFIX THE TOPBAR
- // ----------------
- // Remove any padding from the body
- body {
- padding-top: 0;
- }
- // Unfix the navbar
- .navbar-fixed-top {
- position: static;
- margin-bottom: @baseLineHeight;
- }
- .navbar-fixed-top .navbar-inner {
- padding: 5px;
- }
- .navbar .container {
- width: auto;
- padding: 0;
- }
- // Account for brand name
- .navbar .brand {
- padding-left: 10px;
- padding-right: 10px;
- margin: 0 0 0 -5px;
- }
- // Nav collapse clears brand
- .navbar .nav-collapse {
- clear: left;
- }
- // Block-level the nav
- .navbar .nav {
- float: none;
- margin: 0 0 (@baseLineHeight / 2);
- }
- .navbar .nav > li {
- float: none;
- }
- .navbar .nav > li > a {
- margin-bottom: 2px;
- }
- .navbar .nav > .divider-vertical {
- display: none;
- }
- .navbar .nav .nav-header {
- color: @navbarText;
- text-shadow: none;
- }
- // Nav and dropdown links in navbar
- .navbar .nav > li > a,
- .navbar .dropdown-menu a {
- padding: 6px 15px;
- font-weight: bold;
- color: @navbarLinkColor;
- .border-radius(3px);
- }
- .navbar .dropdown-menu li + li a {
- margin-bottom: 2px;
- }
- .navbar .nav > li > a:hover,
- .navbar .dropdown-menu a:hover {
- background-color: @navbarBackground;
- }
- // Dropdowns in the navbar
- .navbar .dropdown-menu {
- position: static;
- top: auto;
- left: auto;
- float: none;
- display: block;
- max-width: none;
- margin: 0 15px;
- padding: 0;
- background-color: transparent;
- border: none;
- .border-radius(0);
- .box-shadow(none);
- }
- .navbar .dropdown-menu:before,
- .navbar .dropdown-menu:after {
- display: none;
- }
- .navbar .dropdown-menu .divider {
- display: none;
- }
- // Forms in navbar
- .navbar-form,
- .navbar-search {
- float: none;
- padding: (@baseLineHeight / 2) 15px;
- margin: (@baseLineHeight / 2) 0;
- border-top: 1px solid @navbarBackground;
- border-bottom: 1px solid @navbarBackground;
- @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
- .box-shadow(@shadow);
- }
- // Pull right (secondary) nav content
- .navbar .nav.pull-right {
- float: none;
- margin-left: 0;
- }
- // Static navbar
- .navbar-static .navbar-inner {
- padding-left: 10px;
- padding-right: 10px;
- }
- // Navbar button
- .btn-navbar {
- display: block;
- }
-
- // Hide everything in the navbar save .brand and toggle button */
- .nav-collapse {
- overflow: hidden;
- height: 0;
- }
-}
-
-
-
-// DEFAULT DESKTOP
-// ---------------
-
-@media (min-width: 980px) {
- .nav-collapse.collapse {
- height: auto !important;
- }
-}
-
-
-
-// LARGE DESKTOP & UP
-// ------------------
-
-@media (min-width: 1200px) {
-
- // Fixed grid
- #gridSystem > .generate(12, 70px, 30px);
-
- // Fluid grid
- #fluidGridSystem > .generate(12, 5.982905983%, 2.564102564%);
-
- // Input grid
- #inputGridSystem > .generate(12, 70px, 30px);
-
- // Thumbnails
- .thumbnails {
- margin-left: -30px;
- }
- .thumbnails > li {
- margin-left: 30px;
- }
-
-}
-
@import "theme.less"; // Kickstrap themes
@import "../../extras/icomoon/icomoon.less"; // Turn this on if you want even more fonts from IcoMoon.
@import "../../extras/chosen/chosen.less"; // Chosen for select boxes
View
BIN img/glyphicons-halflings-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN img/glyphicons-halflings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 js/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "validthis": true,
+ "laxcomma" : true,
+ "laxbreak" : true,
+ "browser" : true,
+ "debug" : true,
+ "boss" : true,
+ "expr" : true,
+ "asi" : true
+}
View
12 js/README.md
@@ -5,7 +5,7 @@ These are the high-level design rules which guide the development of Bootstrap's
### DATA-ATTRIBUTE API
-We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript.
+We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript. This is bootstraps first class api.
We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
@@ -28,8 +28,8 @@ All public APIs should be single, chainable methods, and return the collection a
All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
$("#myModal").modal() // initialized with defaults
- $("#myModal").modal({ keyboard: false }) // initialized with now keyboard
- $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2
+ $("#myModal").modal({ keyboard: false }) // initialized with no keyboard
+ $("#myModal").modal('show') // initializes and invokes show immediately
---
@@ -60,6 +60,12 @@ All events should have an infinitive and past participle form. The infinitive is
show | shown
hide | hidden
+All infinitive events should provide preventDefault functionality. This provides the abililty to stop the execution of an action.
+
+ $('#myModal').on('show', function (e) {
+ if (!data) return e.preventDefault() // stops modal from being shown
+ })
+
---
### CONSTRUCTORS
View
60 js/bootstrap-alert.js
@@ -1,5 +1,5 @@
/* ==========================================================
- * bootstrap-alert.js v2.0.1
+ * bootstrap-alert.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
@@ -18,61 +18,57 @@
* ========================================================== */
-!function( $ ){
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* ALERT CLASS DEFINITION
* ====================== */
var dismiss = '[data-dismiss="alert"]'
- , Alert = function ( el ) {
+ , Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
- Alert.prototype = {
-
- constructor: Alert
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
- , 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
+ }
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
+ $parent = $(selector)
- $parent = $(selector)
- $parent.trigger('close')
+ e && e.preventDefault()
- e && e.preventDefault()
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+ $parent.trigger(e = $.Event('close'))
- $parent
- .trigger('close')
- .removeClass('in')
+ if (e.isDefaultPrevented()) return
- function removeElement() {
- $parent
- .trigger('closed')
- .remove()
- }
+ $parent.removeClass('in')
- $.support.transition && $parent.hasClass('fade') ?
- $parent.on($.support.transition.end, removeElement) :
- removeElement()
+ 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 ) {
+ $.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
@@ -91,4 +87,4 @@
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-alert.min.js
@@ -1 +0,0 @@
-!function(c){var b='[data-dismiss="alert"]',a=function(d){c(d).on("click",b,this.close)};a.prototype={constructor:a,close:function(i){var h=c(this),f=h.attr("data-target"),g;if(!f){f=h.attr("href");f=f&&f.replace(/.*(?=#[^\s]*$)/,"")}g=c(f);g.trigger("close");i&&i.preventDefault();g.length||(g=h.hasClass("alert")?h:h.parent());g.trigger("close").removeClass("in");function d(){g.trigger("closed").remove()}c.support.transition&&g.hasClass("fade")?g.on(c.support.transition.end,d):d()}};c.fn.alert=function(d){return this.each(function(){var f=c(this),e=f.data("alert");if(!e){f.data("alert",(e=new a(this)))}if(typeof d=="string"){e[d].call(f)}})};c.fn.alert.Constructor=a;c(function(){c("body").on("click.alert.data-api",b,a.prototype.close)})}(window.jQuery);
View
62 js/bootstrap-button.js
@@ -1,5 +1,5 @@
/* ============================================================
- * bootstrap-button.js v2.0.1
+ * bootstrap-button.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
@@ -17,58 +17,54 @@
* limitations under the License.
* ============================================================ */
-!function( $ ){
- "use strict"
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
/* BUTTON PUBLIC CLASS DEFINITION
* ============================== */
- var Button = function ( element, options ) {
+ var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.button.defaults, options)
}
- Button.prototype = {
-
- constructor: Button
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
- , 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]())
- state = state + 'Text'
- data.resetText || $el.data('resetText', $el[val]())
+ $el[val](data[state] || this.options[state])
- $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"]')
+ // 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)
+ }
- $parent && $parent
- .find('.active')
- .removeClass('active')
+ Button.prototype.toggle = function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
- this.$element.toggleClass('active')
- }
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+ this.$element.toggleClass('active')
}
/* BUTTON PLUGIN DEFINITION
* ======================== */
- $.fn.button = function ( option ) {
+ $.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('button')
@@ -97,4 +93,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-button.min.js
@@ -1 +0,0 @@
-!function(b){var a=function(d,c){this.$element=b(d);this.options=b.extend({},b.fn.button.defaults,c)};a.prototype={constructor:a,setState:function(f){var h="disabled",c=this.$element,e=c.data(),g=c.is("input")?"val":"html";f=f+"Text";e.resetText||c.data("resetText",c[g]());c[g](e[f]||this.options[f]);setTimeout(function(){f=="loadingText"?c.addClass(h).attr(h,h):c.removeClass(h).removeAttr(h)},0)},toggle:function(){var c=this.$element.parent('[data-toggle="buttons-radio"]');c&&c.find(".active").removeClass("active");this.$element.toggleClass("active")}};b.fn.button=function(c){return this.each(function(){var f=b(this),e=f.data("button"),d=typeof c=="object"&&c;if(!e){f.data("button",(e=new a(this,d)))}if(c=="toggle"){e.toggle()}else{if(c){e.setState(c)}}})};b.fn.button.defaults={loadingText:"loading..."};b.fn.button.Constructor=a;b(function(){b("body").on("click.button.data-api","[data-toggle^=button]",function(d){var c=b(d.target);if(!c.hasClass("btn")){c=c.closest(".btn")}c.button("toggle")})})}(window.jQuery);
View
54 js/bootstrap-carousel.js
@@ -1,5 +1,5 @@
/* ==========================================================
- * bootstrap-carousel.js v2.0.1
+ * bootstrap-carousel.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#carousel
* ==========================================================
* Copyright 2012 Twitter, Inc.
@@ -18,23 +18,30 @@
* ========================================================== */
-!function( $ ){
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* CAROUSEL CLASS DEFINITION
* ========================= */
var Carousel = function (element, options) {
this.$element = $(element)
- this.options = $.extend({}, $.fn.carousel.defaults, options)
+ this.options = 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))
}
Carousel.prototype = {
- cycle: function () {
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
+ cycle: function (e) {
+ if (!e) this.paused = false
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
@@ -59,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
}
- , pause: function () {
+ , pause: function (e) {
+ if (!e) this.paused = true
clearInterval(this.interval)
this.interval = null
return this
@@ -82,8 +90,7 @@
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
-
- if (!$next.length) return
+ , e = $.Event('slide')
this.sliding = true
@@ -91,24 +98,28 @@
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
- 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 {
+ if ($next.hasClass('active')) return
+
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$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)
})
+ } else {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger('slid')
}
isCycling && this.cycle()
@@ -122,20 +133,21 @@
/* CAROUSEL PLUGIN DEFINITION
* ========================== */
- $.fn.carousel = function ( option ) {
+ $.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('carousel')
- , options = typeof option == 'object' && option
+ , options = $.extend({}, $.fn.carousel.defaults, 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()
+ else if (options.interval) data.cycle()
})
}
$.fn.carousel.defaults = {
interval: 5000
+ , pause: 'hover'
}
$.fn.carousel.Constructor = Carousel
@@ -154,4 +166,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-carousel.min.js
@@ -1 +0,0 @@
-!function(a){var b=function(d,c){this.$element=a(d);this.options=a.extend({},a.fn.carousel.defaults,c);this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){this.interval=setInterval(a.proxy(this.next,this),this.options.interval);return this},to:function(g){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(g>(d.length-1)||g<0){return}if(this.sliding){return this.$element.one("slid",function(){f.to(g)})}if(e==g){return this.pause().cycle()}return this.slide(g>e?"next":"prev",a(d[g]))},pause:function(){clearInterval(this.interval);this.interval=null;return this},next:function(){if(this.sliding){return}return this.slide("next")},prev:function(){if(this.sliding){return}return this.slide("prev")},slide:function(f,e){var c=this.$element.find(".active"),d=e||c[f](),j=this.interval,h=f=="next"?"left":"right",i=f=="next"?"first":"last",g=this;if(!d.length){return}this.sliding=true;j&&this.pause();d=d.length?d:this.$element.find(".item")[i]();if(!a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger("slide");c.removeClass("active");d.addClass("active");this.sliding=false;this.$element.trigger("slid")}else{d.addClass(f);d[0].offsetWidth;c.addClass(h);d.addClass(h);this.$element.trigger("slide");this.$element.one(a.support.transition.end,function(){d.removeClass([f,h].join(" ")).addClass("active");c.removeClass(["active",h].join(" "));g.sliding=false;setTimeout(function(){g.$element.trigger("slid")},0)})}j&&this.cycle();return this}};a.fn.carousel=function(c){return this.each(function(){var f=a(this),e=f.data("carousel"),d=typeof c=="object"&&c;if(!e){f.data("carousel",(e=new b(this,d)))}if(typeof c=="number"){e.to(c)}else{if(typeof c=="string"||(c=d.slide)){e[c]()}else{e.cycle()}}})};a.fn.carousel.defaults={interval:5000};a.fn.carousel.Constructor=b;a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(h){var g=a(this),d,c=a(g.attr("data-target")||(d=g.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!c.data("modal")&&a.extend({},c.data(),g.data());c.carousel(f);h.preventDefault()})})}(window.jQuery);
View
73 js/bootstrap-collapse.js
@@ -1,5 +1,5 @@
/* =============================================================
- * bootstrap-collapse.js v2.0.1
+ * bootstrap-collapse.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
@@ -17,16 +17,21 @@
* limitations under the License.
* ============================================================ */
-!function( $ ){
- "use strict"
+!function ($) {
- var Collapse = function ( element, options ) {
- this.$element = $(element)
+ "use strict"; // jshint ;_;
+
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+ * ================================ */
+
+ var Collapse = function (element, options) {
+ this.$element = $(element)
this.options = $.extend({}, $.fn.collapse.defaults, options)
- if (this.options["parent"]) {
- this.$parent = $(this.options["parent"])
+ if (this.options.parent) {
+ this.$parent = $(this.options.parent)
}
this.options.toggle && this.toggle()
@@ -42,31 +47,39 @@
}
, show: function () {
- var dimension = this.dimension()
- , scroll = $.camelCase(['scroll', dimension].join('-'))
- , actives = this.$parent && this.$parent.find('.in')
+ var dimension
+ , scroll
+ , actives
, hasData
+ if (this.transitioning) return
+
+ dimension = this.dimension()
+ scroll = $.camelCase(['scroll', dimension].join('-'))
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
+
if (actives && actives.length) {
hasData = actives.data('collapse')
+ if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('collapse', null)
}
this.$element[dimension](0)
- this.transition('addClass', 'show', 'shown')
+ this.transition('addClass', $.Event('show'), 'shown')
this.$element[dimension](this.$element[0][scroll])
-
}
, hide: function () {
- var dimension = this.dimension()
+ var dimension
+ if (this.transitioning) return
+ dimension = this.dimension()
this.reset(this.$element[dimension]())
- this.transition('removeClass', 'hide', 'hidden')
+ this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
}
- , reset: function ( size ) {
+ , reset: function (size) {
var dimension = this.dimension()
this.$element
@@ -74,35 +87,43 @@
[dimension](size || 'auto')
[0].offsetWidth
- this.$element.addClass('collapse')
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
+
+ return this
}
- , transition: function ( method, startEvent, completeEvent ) {
+ , transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
- if (startEvent == 'show') that.reset()
+ if (startEvent.type == 'show') that.reset()
+ that.transitioning = 0
that.$element.trigger(completeEvent)
}
- this.$element
- .trigger(startEvent)
- [method]('in')
+ this.$element.trigger(startEvent)
+
+ if (startEvent.isDefaultPrevented()) return
+
+ this.transitioning = 1
+
+ this.$element[method]('in')
$.support.transition && this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :
complete()
- }
+ }
, toggle: function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
+ }
}
- /* COLLAPSIBLE PLUGIN DEFINITION
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
* ============================== */
- $.fn.collapse = function ( option ) {
+ $.fn.collapse = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('collapse')
@@ -133,4 +154,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-collapse.min.js
@@ -1 +0,0 @@
-!function(a){var b=function(d,c){this.$element=a(d);this.options=a.extend({},a.fn.collapse.defaults,c);if(this.options.parent){this.$parent=a(this.options.parent)}this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var c=this.$element.hasClass("width");return c?"width":"height"},show:function(){var f=this.dimension(),c=a.camelCase(["scroll",f].join("-")),e=this.$parent&&this.$parent.find(".in"),d;if(e&&e.length){d=e.data("collapse");e.collapse("hide");d||e.data("collapse",null)}this.$element[f](0);this.transition("addClass","show","shown");this.$element[f](this.$element[0][c])},hide:function(){var c=this.dimension();this.reset(this.$element[c]());this.transition("removeClass","hide","hidden");this.$element[c](0)},reset:function(c){var d=this.dimension();this.$element.removeClass("collapse")[d](c||"auto")[0].offsetWidth;this.$element.addClass("collapse")},transition:function(g,d,e){var f=this,c=function(){if(d=="show"){f.reset()}f.$element.trigger(e)};this.$element.trigger(d)[g]("in");a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,c):c()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};a.fn.collapse=function(c){return this.each(function(){var f=a(this),e=f.data("collapse"),d=typeof c=="object"&&c;if(!e){f.data("collapse",(e=new b(this,d)))}if(typeof c=="string"){e[c]()}})};a.fn.collapse.defaults={toggle:true};a.fn.collapse.Constructor=b;a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(h){var g=a(this),c,f=g.attr("data-target")||h.preventDefault()||(c=g.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),d=a(f).data("collapse")?"toggle":g.data();a(f).collapse(d)})})}(window.jQuery);
View
28 js/bootstrap-dropdown.js
@@ -1,5 +1,5 @@
/* ============================================================
- * bootstrap-dropdown.js v2.0.1
+ * bootstrap-dropdown.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================
* Copyright 2012 Twitter, Inc.
@@ -18,15 +18,16 @@
* ============================================================ */
-!function( $ ){
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* DROPDOWN CLASS DEFINITION
* ========================= */
var toggle = '[data-toggle="dropdown"]'
- , Dropdown = function ( element ) {
+ , Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () {
$el.parent().removeClass('open')
@@ -37,12 +38,16 @@
constructor: Dropdown
- , toggle: function ( e ) {
+ , toggle: function (e) {
var $this = $(this)
- , selector = $this.attr('data-target')
, $parent
+ , selector
, isActive
+ if ($this.is('.disabled, :disabled')) return
+
+ selector = $this.attr('data-target')
+
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
@@ -54,7 +59,8 @@
isActive = $parent.hasClass('open')
clearMenus()
- !isActive && $parent.toggleClass('open')
+
+ if (!isActive) $parent.toggleClass('open')
return false
}
@@ -69,7 +75,7 @@
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
- $.fn.dropdown = function ( option ) {
+ $.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('dropdown')
@@ -86,7 +92,9 @@
$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
- $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ $('body')
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-dropdown.min.js
@@ -1 +0,0 @@
-!function(d){var b='[data-toggle="dropdown"]',a=function(f){var e=d(f).on("click.dropdown.data-api",this.toggle);d("html").on("click.dropdown.data-api",function(){e.parent().removeClass("open")})};a.prototype={constructor:a,toggle:function(j){var i=d(this),f=i.attr("data-target"),h,g;if(!f){f=i.attr("href");f=f&&f.replace(/.*(?=#[^\s]*$)/,"")}h=d(f);h.length||(h=i.parent());g=h.hasClass("open");c();!g&&h.toggleClass("open");return false}};function c(){d(b).parent().removeClass("open")}d.fn.dropdown=function(e){return this.each(function(){var g=d(this),f=g.data("dropdown");if(!f){g.data("dropdown",(f=new a(this)))}if(typeof e=="string"){f[e].call(g)}})};d.fn.dropdown.Constructor=a;d(function(){d("html").on("click.dropdown.data-api",c);d("body").on("click.dropdown.data-api",b,a.prototype.toggle)})}(window.jQuery);
View
42 js/bootstrap-modal.js
@@ -1,5 +1,5 @@
/* =========================================================
- * bootstrap-modal.js v2.0.1
+ * bootstrap-modal.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
@@ -18,14 +18,15 @@
* ========================================================= */
-!function( $ ){
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* MODAL CLASS DEFINITION
* ====================== */
- var Modal = function ( content, options ) {
+ var Modal = function (content, options) {
this.options = options
this.$element = $(content)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
@@ -41,19 +42,23 @@
, show: function () {
var that = this
+ , e = $.Event('show')
+
+ this.$element.trigger(e)
- if (this.isShown) return
+ if (this.isShown || e.isDefaultPrevented()) return
$('body').addClass('modal-open')
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
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(document.body) //don't move modals dom position
+ }
that.$element
.show()
@@ -71,21 +76,24 @@
})
}
- , hide: function ( e ) {
+ , hide: function (e) {
e && e.preventDefault()
- if (!this.isShown) return
-
var that = this
+
+ e = $.Event('hide')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
this.isShown = false
$('body').removeClass('modal-open')
escape.call(this)
- this.$element
- .trigger('hide')
- .removeClass('in')
+ this.$element.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) :
@@ -111,7 +119,7 @@
})
}
- function hideModal( that ) {
+ function hideModal(that) {
this.$element
.hide()
.trigger('hidden')
@@ -119,7 +127,7 @@
backdrop.call(this)
}
- function backdrop( callback ) {
+ function backdrop(callback) {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
@@ -173,7 +181,7 @@
/* MODAL PLUGIN DEFINITION
* ======================= */
- $.fn.modal = function ( option ) {
+ $.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
@@ -207,4 +215,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-modal.min.js
@@ -1 +0,0 @@
-!function(e){var a=function(i,h){this.options=h;this.$element=e(i).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this))};a.prototype={constructor:a,toggle:function(){return this[!this.isShown?"show":"hide"]()},show:function(){var h=this;if(this.isShown){return}e("body").addClass("modal-open");this.isShown=true;this.$element.trigger("show");d.call(this);c.call(this,function(){var i=e.support.transition&&h.$element.hasClass("fade");!h.$element.parent().length&&h.$element.appendTo(document.body);h.$element.show();if(i){h.$element[0].offsetWidth}h.$element.addClass("in");i?h.$element.one(e.support.transition.end,function(){h.$element.trigger("shown")}):h.$element.trigger("shown")})},hide:function(i){i&&i.preventDefault();if(!this.isShown){return}var h=this;this.isShown=false;e("body").removeClass("modal-open");d.call(this);this.$element.trigger("hide").removeClass("in");e.support.transition&&this.$element.hasClass("fade")?g.call(this):f.call(this)}};function g(){var h=this,i=setTimeout(function(){h.$element.off(e.support.transition.end);f.call(h)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(i);f.call(h)})}function f(h){this.$element.hide().trigger("hidden");c.call(this)}function c(k){var j=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var h=e.support.transition&&i;this.$backdrop=e('<div class="modal-backdrop '+i+'" />').appendTo(document.body);if(this.options.backdrop!="static"){this.$backdrop.click(e.proxy(this.hide,this))}if(h){this.$backdrop[0].offsetWidth}this.$backdrop.addClass("in");h?this.$backdrop.one(e.support.transition.end,k):k()}else{if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(b,this)):b.call(this)}else{if(k){k()}}}}function b(){this.$backdrop.remove();this.$backdrop=null}function d(){var h=this;if(this.isShown&&this.options.keyboard){e(document).on("keyup.dismiss.modal",function(i){i.which==27&&h.hide()})}else{if(!this.isShown){e(document).off("keyup.dismiss.modal")}}}e.fn.modal=function(h){return this.each(function(){var k=e(this),j=k.data("modal"),i=e.extend({},e.fn.modal.defaults,k.data(),typeof h=="object"&&h);if(!j){k.data("modal",(j=new a(this,i)))}if(typeof h=="string"){j[h]()}else{if(i.show){j.show()}}})};e.fn.modal.defaults={backdrop:true,keyboard:true,show:true};e.fn.modal.Constructor=a;e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(l){var k=e(this),i,h=e(k.attr("data-target")||(i=k.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),j=h.data("modal")?"toggle":e.extend({},h.data(),k.data());l.preventDefault();h.modal(j)})})}(window.jQuery);
View
23 js/bootstrap-popover.js
@@ -1,5 +1,5 @@
/* ===========================================================
- * bootstrap-popover.js v2.0.1
+ * bootstrap-popover.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#popovers
* ===========================================================
* Copyright 2012 Twitter, Inc.
@@ -18,14 +18,19 @@
* =========================================================== */
-!function( $ ) {
+!function ($) {
- "use strict"
+ "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+ * =============================== */
var Popover = function ( element, options ) {
this.init('popover', element, options)
}
+
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
========================================== */
@@ -38,8 +43,8 @@
, title = this.getTitle()
, content = this.getContent()
- $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
- $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content)
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
$tip.removeClass('fade top bottom left right in')
}
@@ -56,12 +61,10 @@
content = $e.attr('data-content')
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
- content = content.toString().replace(/(^\s*|\s*$)/, "")
-
return content
}
- , tip: function() {
+ , tip: function () {
if (!this.$tip) {
this.$tip = $(this.options.template)
}
@@ -74,7 +77,7 @@
/* POPOVER PLUGIN DEFINITION
* ======================= */
- $.fn.popover = function ( option ) {
+ $.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('popover')
@@ -92,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>'
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-popover.min.js
@@ -1 +0,0 @@
-!function(b){var a=function(d,c){this.init("popover",d,c)};a.prototype=b.extend({},b.fn.tooltip.Constructor.prototype,{constructor:a,setContent:function(){var e=this.tip(),d=this.getTitle(),c=this.getContent();e.find(".popover-title")[b.type(d)=="object"?"append":"html"](d);e.find(".popover-content > *")[b.type(c)=="object"?"append":"html"](c);e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var d,c=this.$element,e=this.options;d=c.attr("data-content")||(typeof e.content=="function"?e.content.call(c[0]):e.content);d=d.toString().replace(/(^\s*|\s*$)/,"");return d},tip:function(){if(!this.$tip){this.$tip=b(this.options.template)}return this.$tip}});b.fn.popover=function(c){return this.each(function(){var f=b(this),e=f.data("popover"),d=typeof c=="object"&&c;if(!e){f.data("popover",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.popover.Constructor=a;b.fn.popover.defaults=b.extend({},b.fn.tooltip.defaults,{placement:"right",content:"",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);
View
62 js/bootstrap-scrollspy.js
@@ -1,5 +1,5 @@
/* =============================================================
- * bootstrap-scrollspy.js v2.0.1
+ * bootstrap-scrollspy.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============================================================== */
-!function ( $ ) {
- "use strict"
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
/* SCROLLSPY CLASS DEFINITION
* ========================== */
@@ -33,7 +35,7 @@
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.$body = $('body')
this.refresh()
this.process()
}
@@ -43,25 +45,43 @@
constructor: ScrollSpy
, refresh: function () {
- this.targets = this.$body
+ var self = this
+ , $targets
+
+ this.offsets = $([])
+ this.targets = $([])
+
+ $targets = this.$body
.find(this.selector)
.map(function () {
- var href = $(this).attr('href')
- return /^#\w/.test(href) && $(href).length ? href : null
+ var $el = $(this)
+ , href = $el.data('target') || $el.attr('href')
+ , $href = /^#\w/.test(href) && $(href)
+ return ( $href
+ && href.length
+ && [[ $href.position().top, href ]] ) || null
+ })
+ .sort(function (a, b) { return a[0] - b[0] })
+ .each(function () {
+ self.offsets.push(this[0])
+ self.targets.push(this[1])
})
-
- this.offsets = $.map(this.targets, function (id) {
- return $(id).position().top
- })
}
, process: function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
+ , maxScroll = scrollHeight - this.$scrollElement.height()
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets.last()[0])
+ && this.activate ( i )
+ }
+
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
@@ -72,21 +92,27 @@
, activate: function (target) {
var active
+ , selector
this.activeTarget = target
- this.$body
- .find(this.selector).parent('.active')
+ $(this.selector)
+ .parent('.active')
.removeClass('active')
- active = this.$body
- .find(this.selector + '[href="' + target + '"]')
+ selector = this.selector
+ + '[data-target="' + target + '"],'
+ + this.selector + '[href="' + target + '"]'
+
+ active = $(selector)
.parent('li')
.addClass('active')
- if ( active.parent('.dropdown-menu') ) {
- active.closest('li.dropdown').addClass('active')
+ if (active.parent('.dropdown-menu')) {
+ active = active.closest('li.dropdown').addClass('active')
}
+
+ active.trigger('activate')
}
}
@@ -122,4 +148,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-scrollspy.min.js
@@ -1 +0,0 @@
-!function(b){function a(f,e){var g=b.proxy(this.process,this),c=b(f).is("body")?b(window):b(f),d;this.options=b.extend({},b.fn.scrollspy.defaults,e);this.$scrollElement=c.on("scroll.scroll.data-api",g);this.selector=(this.options.target||((d=b(f).attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""))||"")+" .nav li > a";this.$body=b("body").on("click.scroll.data-api",this.selector,g);this.refresh();this.process()}a.prototype={constructor:a,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var c=b(this).attr("href");return/^#\w/.test(c)&&b(c).length?c:null});this.offsets=b.map(this.targets,function(c){return b(c).position().top})},process:function(){var f=this.$scrollElement.scrollTop()+this.options.offset,e=this.offsets,c=this.targets,g=this.activeTarget,d;for(d=e.length;d--;){g!=c[d]&&f>=e[d]&&(!e[d+1]||f<=e[d+1])&&this.activate(c[d])}},activate:function(d){var c;this.activeTarget=d;this.$body.find(this.selector).parent(".active").removeClass("active");c=this.$body.find(this.selector+'[href="'+d+'"]').parent("li").addClass("active");if(c.parent(".dropdown-menu")){c.closest("li.dropdown").addClass("active")}}};b.fn.scrollspy=function(c){return this.each(function(){var f=b(this),e=f.data("scrollspy"),d=typeof c=="object"&&c;if(!e){f.data("scrollspy",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.scrollspy.Constructor=a;b.fn.scrollspy.defaults={offset:10};b(function(){b('[data-spy="scroll"]').each(function(){var c=b(this);c.scrollspy(c.data())})})}(window.jQuery);
View
19 js/bootstrap-tab.js
@@ -1,5 +1,5 @@
/* ========================================================
- * bootstrap-tab.js v2.0.1
+ * bootstrap-tab.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
@@ -18,9 +18,10 @@
* ======================================================== */
-!function( $ ){
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* TAB CLASS DEFINITION
* ==================== */
@@ -39,6 +40,7 @@
, selector = $this.attr('data-target')
, previous
, $target
+ , e
if (!selector) {
selector = $this.attr('href')
@@ -49,11 +51,14 @@
previous = $ul.find('.active a').last()[0]
- $this.trigger({
- type: 'show'
- , relatedTarget: previous
+ e = $.Event('show', {
+ relatedTarget: previous
})
+ $this.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
$target = $(selector)
this.activate($this.parent('li'), $ul)
@@ -127,4 +132,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-tab.min.js
@@ -1 +0,0 @@
-!function(b){var a=function(c){this.element=b(c)};a.prototype={constructor:a,show:function(){var g=this.element,e=g.closest("ul:not(.dropdown-menu)"),d=g.attr("data-target"),f,c;if(!d){d=g.attr("href");d=d&&d.replace(/.*(?=#[^\s]*$)/,"")}if(g.parent("li").hasClass("active")){return}f=e.find(".active a").last()[0];g.trigger({type:"show",relatedTarget:f});c=b(d);this.activate(g.parent("li"),e);this.activate(c,c.parent(),function(){g.trigger({type:"shown",relatedTarget:f})})},activate:function(e,d,h){var c=d.find("> .active"),g=h&&b.support.transition&&c.hasClass("fade");function f(){c.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");e.addClass("active");if(g){e[0].offsetWidth;e.addClass("in")}else{e.removeClass("fade")}if(e.parent(".dropdown-menu")){e.closest("li.dropdown").addClass("active")}h&&h()}g?c.one(b.support.transition.end,f):f();c.removeClass("in")}};b.fn.tab=function(c){return this.each(function(){var e=b(this),d=e.data("tab");if(!d){e.data("tab",(d=new a(this)))}if(typeof c=="string"){d[c]()}})};b.fn.tab.Constructor=a;b(function(){b("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault();b(this).tab("show")})})}(window.jQuery);
View
75 js/bootstrap-tooltip.js
@@ -1,5 +1,5 @@
/* ===========================================================
- * bootstrap-tooltip.js v2.0.1
+ * bootstrap-tooltip.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
@@ -18,14 +18,16 @@
* limitations under the License.
* ========================================================== */
-!function( $ ) {
- "use strict"
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
/* TOOLTIP PUBLIC CLASS DEFINITION
* =============================== */
- var Tooltip = function ( element, options ) {
+ var Tooltip = function (element, options) {
this.init('tooltip', element, options)
}
@@ -33,7 +35,7 @@
constructor: Tooltip
- , init: function ( type, element, options ) {
+ , init: function (type, element, options) {
var eventIn
, eventOut
@@ -54,7 +56,7 @@
this.fixTitle()
}
- , getOptions: function ( options ) {
+ , getOptions: function (options) {
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
if (options.delay && typeof options.delay == 'number') {
@@ -67,34 +69,28 @@
return options
}
- , enter: function ( e ) {
+ , enter: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
- if (!self.options.delay || !self.options.delay.show) {
- self.show()
- } else {
- self.hoverState = 'in'
- setTimeout(function() {
- if (self.hoverState == 'in') {
- self.show()
- }
- }, self.options.delay.show)
- }
+ if (!self.options.delay || !self.options.delay.show) return self.show()
+
+ clearTimeout(this.timeout)
+ self.hoverState = 'in'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'in') self.show()
+ }, self.options.delay.show)
}
- , leave: function ( e ) {
+ , leave: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
- if (!self.options.delay || !self.options.delay.hide) {
- self.hide()
- } else {
- self.hoverState = 'out'
- setTimeout(function() {
- if (self.hoverState == 'out') {
- self.hide()
- }
- }, self.options.delay.hide)
- }
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ clearTimeout(this.timeout)
+ self.hoverState = 'out'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
}
, show: function () {
@@ -152,9 +148,20 @@
}
}
+ , isHTML: function(text) {
+ // html string detection logic adapted from jQuery
+ return typeof text != 'string'
+ || ( text.charAt(0) === "<"
+ && text.charAt( text.length - 1 ) === ">"
+ && text.length >= 3
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
+ }
+
, setContent: function () {
var $tip = this.tip()
- $tip.find('.tooltip-inner').html(this.getTitle())
+ , title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
@@ -206,8 +213,6 @@
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
- title = title.toString().replace(/(^\s*|\s*$)/, "")
-
return title
}
@@ -259,12 +264,12 @@
$.fn.tooltip.defaults = {
animation: true
- , delay: 0
- , selector: false
, placement: 'top'
+ , selector: false
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
, trigger: 'hover'
, title: ''
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+ , delay: 0
}
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-tooltip.min.js
@@ -1 +0,0 @@
-!function(b){var a=function(d,c){this.init("tooltip",d,c)};a.prototype={constructor:a,init:function(f,e,d){var g,c;this.type=f;this.$element=b(e);this.options=this.getOptions(d);this.enabled=true;if(this.options.trigger!="manual"){g=this.options.trigger=="hover"?"mouseenter":"focus";c=this.options.trigger=="hover"?"mouseleave":"blur";this.$element.on(g,this.options.selector,b.proxy(this.enter,this));this.$element.on(c,this.options.selector,b.proxy(this.leave,this))}this.options.selector?(this._options=b.extend({},this.options,{trigger:"manual",selector:""})):this.fixTitle()},getOptions:function(c){c=b.extend({},b.fn[this.type].defaults,c,this.$element.data());if(c.delay&&typeof c.delay=="number"){c.delay={show:c.delay,hide:c.delay}}return c},enter:function(d){var c=b(d.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.show){c.show()}else{c.hoverState="in";setTimeout(function(){if(c.hoverState=="in"){c.show()}},c.options.delay.show)}},leave:function(d){var c=b(d.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.hide){c.hide()}else{c.hoverState="out";setTimeout(function(){if(c.hoverState=="out"){c.hide()}},c.options.delay.hide)}},show:function(){var g,c,i,e,h,d,f;if(this.hasContent()&&this.enabled){g=this.tip();this.setContent();if(this.options.animation){g.addClass("fade")}d=typeof this.options.placement=="function"?this.options.placement.call(this,g[0],this.$element[0]):this.options.placement;c=/in/.test(d);g.remove().css({top:0,left:0,display:"block"}).appendTo(c?this.$element:document.body);i=this.getPosition(c);e=g[0].offsetWidth;h=g[0].offsetHeight;switch(c?d.split(" ")[1]:d){case"bottom":f={top:i.top+i.height,left:i.left+i.width/2-e/2};break;case"top":f={top:i.top-h,left:i.left+i.width/2-e/2};break;case"left":f={top:i.top+i.height/2-h/2,left:i.left-e};break;case"right":f={top:i.top+i.height/2-h/2,left:i.left+i.width};break}g.css(f).addClass(d).addClass("in")}},setContent:function(){var c=this.tip();c.find(".tooltip-inner").html(this.getTitle());c.removeClass("fade in top bottom left right")},hide:function(){var c=this,d=this.tip();d.removeClass("in");function e(){var f=setTimeout(function(){d.off(b.support.transition.end).remove()},500);d.one(b.support.transition.end,function(){clearTimeout(f);d.remove()})}b.support.transition&&this.$tip.hasClass("fade")?e():d.remove()},fixTitle:function(){var c=this.$element;if(c.attr("title")||typeof(c.attr("data-original-title"))!="string"){c.attr("data-original-title",c.attr("title")||"").removeAttr("title")}},hasContent:function(){return this.getTitle()},getPosition:function(c){return b.extend({},(c?{top:0,left:0}:this.$element.offset()),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,c=this.$element,d=this.options;e=c.attr("data-original-title")||(typeof d.title=="function"?d.title.call(c[0]):d.title);e=e.toString().replace(/(^\s*|\s*$)/,"");return e},tip:function(){return this.$tip=this.$tip||b(this.options.template)},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}};b.fn.tooltip=function(c){return this.each(function(){var f=b(this),e=f.data("tooltip"),d=typeof c=="object"&&c;if(!e){f.data("tooltip",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.tooltip.Constructor=a;b.fn.tooltip.defaults={animation:true,delay:0,selector:false,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery);
View
50 js/bootstrap-transition.js
@@ -1,5 +1,5 @@
/* ===================================================
- * bootstrap-transition.js v2.0.1
+ * bootstrap-transition.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
@@ -17,35 +17,45 @@
* limitations under the License.
* ========================================================== */
-!function( $ ) {
+
+!function ($) {
$(function () {
- "use strict"
+ "use strict"; // jshint ;_;
+
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
* ======================================================= */
$.support.transition = (function () {
- var thisBody = document.body || document.documentElement
- , thisStyle = thisBody.style
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
-
- return support && {
- end: (function () {
- var transitionEnd = "TransitionEnd"
- if ( $.browser.webkit ) {
- transitionEnd = "webkitTransitionEnd"
- } else if ( $.browser.mozilla ) {
- transitionEnd = "transitionend"
- } else if ( $.browser.opera ) {
- transitionEnd = "oTransitionEnd"
+
+ var transitionEnd = (function () {
+
+ var el = document.createElement('bootstrap')
+ , transEndEventNames = {
+ 'WebkitTransition' : 'webkitTransitionEnd'
+ , 'MozTransition' : 'transitionend'
+ , 'OTransition' : 'oTransitionEnd'
+ , 'msTransition' : 'MSTransitionEnd'
+ , 'transition' : 'transitionend'
+ }
+ , name
+
+ for (name in transEndEventNames){
+ if (el.style[name] !== undefined) {
+ return transEndEventNames[name]
}
- return transitionEnd
- }())
+ }
+
+ }())
+
+ return transitionEnd && {
+ end: transitionEnd
}
+
})()
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-transition.min.js
@@ -1 +0,0 @@
-!function(a){a(function(){a.support.transition=(function(){var c=document.body||document.documentElement,d=c.style,b=d.transition!==undefined||d.WebkitTransition!==undefined||d.MozTransition!==undefined||d.MsTransition!==undefined||d.OTransition!==undefined;return b&&{end:(function(){var e="TransitionEnd";if(a.browser.webkit){e="webkitTransitionEnd"}else{if(a.browser.mozilla){e="transitionend"}else{if(a.browser.opera){e="oTransitionEnd"}}}return e}())}})()})}(window.jQuery);
View
44 js/bootstrap-typeahead.js
@@ -1,5 +1,5 @@
/* =============================================================
- * bootstrap-typeahead.js v2.0.1
+ * bootstrap-typeahead.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
@@ -17,16 +17,22 @@
* limitations under the License.
* ============================================================ */
-!function( $ ){
- "use strict"
+!function($){
- var Typeahead = function ( element, options ) {
+ "use strict"; // jshint ;_;
+
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+ * ================================= */
+
+ var Typeahead = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.typeahead.defaults, options)
this.matcher = this.options.matcher || this.matcher
this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter
+ this.updater = this.options.updater || this.updater
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source
this.shown = false
@@ -39,10 +45,16 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
- this.$element.val(val)
+ this.$element
+ .val(this.updater(val))
+ .change()
return this.hide()
}
+ , updater: function (item) {
+ return item
+ }
+
, show: function () {
var pos = $.extend({}, this.$element.offset(), {
height: this.$element[0].offsetHeight
@@ -76,7 +88,7 @@
}
items = $.grep(this.source, function (item) {
- if (that.matcher(item)) return item
+ return that.matcher(item)
})
items = this.sorter(items)
@@ -108,7 +120,8 @@
}
, highlighter: function (item) {
- return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>'
})
}
@@ -165,9 +178,6 @@
}
, keyup: function (e) {
- e.stopPropagation()
- e.preventDefault()
-
switch(e.keyCode) {
case 40: // down arrow
case 38: // up arrow
@@ -180,6 +190,7 @@
break
case 27: // escape
+ if (!this.shown) return
this.hide()
break
@@ -187,10 +198,11 @@
this.lookup()
}
+ e.stopPropagation()
+ e.preventDefault()
}
, keypress: function (e) {
- e.stopPropagation()
if (!this.shown) return
switch(e.keyCode) {
@@ -201,21 +213,23 @@
break
case 38: // up arrow
+ if (e.type != 'keydown') break
e.preventDefault()
this.prev()
break
case 40: // down arrow
+ if (e.type != 'keydown') break
e.preventDefault()
this.next()
break
}
+
+ e.stopPropagation()
}
, blur: function (e) {
var that = this
- e.stopPropagation()
- e.preventDefault()
setTimeout(function () { that.hide() }, 150)
}
@@ -236,7 +250,7 @@
/* TYPEAHEAD PLUGIN DEFINITION
* =========================== */
- $.fn.typeahead = function ( option ) {
+ $.fn.typeahead = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('typeahead')
@@ -268,4 +282,4 @@
})
})
-}( window.jQuery );
+}(window.jQuery);
View
1 js/bootstrap-typeahead.min.js
@@ -1 +0,0 @@
-!function(a){var b=function(d,c){this.$element=a(d);this.options=a.extend({},a.fn.typeahead.defaults,c);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.highlighter=this.options.highlighter||this.highlighter;this.$menu=a(this.options.menu).appendTo("body");this.source=this.options.source;this.shown=false;this.listen()};b.prototype={constructor:b,select:function(){var c=this.$menu.find(".active").attr("data-value");this.$element.val(c);return this.hide()},show:function(){var c=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});this.$menu.css({top:c.top+c.height,left:c.left});this.$menu.show();this.shown=true;return this},hide:function(){this.$menu.hide();this.shown=false;return this},lookup:function(e){var d=this,c,f;this.query=this.$element.val();if(!this.query){return this.shown?this.hide():this}c=a.grep(this.source,function(g){if(d.matcher(g)){return g}});c=this.sorter(c);if(!c.length){return this.shown?this.hide():this}return this.render(c.slice(0,this.options.items)).show()},matcher:function(c){return ~c.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var f=[],d=[],c=[],g;while(g=e.shift()){if(!g.toLowerCase().indexOf(this.query.toLowerCase())){f.push(g)}else{if(~g.indexOf(this.query)){d.push(g)}else{c.push(g)}}}return f.concat(d,c)},highlighter:function(c){return c.replace(new RegExp("("+this.query+")","ig"),function(d,e){return"<strong>"+e+"</strong>"})},render:function(c){var d=this;c=a(c).map(function(e,f){e=a(d.options.item).attr("data-value",f);e.find("a").html(d.highlighter(f));return e[0]});c.first().addClass("active");this.$menu.html(c);return this},next:function(d){var e=this.$menu.find(".active").removeClass("active"),c=e.next();if(!c.length){c=a(this.$menu.find("li")[0])}c.addClass("active")},prev:function(d){var e=this.$menu.find(".active").removeClass("active"),c=e.prev();if(!c.length){c=this.$menu.find("li").last()}c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this));if(a.browser.webkit||a.browser.msie){this.$element.on("keydown",a.proxy(this.keypress,this))}this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(c){c.stopPropagation();c.preventDefault();switch(c.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown){return}this.select();break;case 27:this.hide();break;default:this.lookup()}},keypress:function(c){c.stopPropagation();if(!this.shown){return}switch(c.keyCode){case 9:case 13:case 27:c.preventDefault();break;case 38:c.preventDefault();this.prev();break;case 40:c.preventDefault();this.next();break}},blur:function(d){var c=this;d.stopPropagation();d.preventDefault();setTimeout(function(){c.hide()},150)},click:function(c){c.stopPropagation();c.preventDefault();this.select()},mouseenter:function(c){this.$menu.find(".active").removeClass("active");a(c.currentTarget).addClass("active")}};a.fn.typeahead=function(c){return this.each(function(){var f=a(this),e=f.data("typeahead"),d=typeof c=="object"&&c;if(!e){f.data("typeahead",(e=new b(this,d)))}if(typeof c=="string"){e[c]()}})};a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'