Permalink
Browse files

Merge branch 'refs/heads/master' into bootstrap-wp

  • Loading branch information...
2 parents e454308 + 16bc28c commit c213b41a87a1e2e2b3949f94eea3e068b8d51aee @ericrasch committed May 16, 2012
Showing with 11,117 additions and 13,049 deletions.
  1. BIN assets/img/glyphicons-halflings-white.png
  2. BIN assets/img/glyphicons-halflings.png
  3. +10 −0 assets/js/.jshintrc
  4. +9 −3 assets/js/README.md
  5. +0 −180 assets/js/application.js
  6. +28 −32 assets/js/bootstrap-alert.js
  7. +29 −33 assets/js/bootstrap-button.js
  8. +33 −21 assets/js/bootstrap-carousel.js
  9. +47 −26 assets/js/bootstrap-collapse.js
  10. +18 −10 assets/js/bootstrap-dropdown.js
  11. +25 −17 assets/js/bootstrap-modal.js
  12. +13 −10 assets/js/bootstrap-popover.js
  13. +44 −18 assets/js/bootstrap-scrollspy.js
  14. +12 −7 assets/js/bootstrap-tab.js
  15. +40 −35 assets/js/bootstrap-tooltip.js
  16. +30 −20 assets/js/bootstrap-transition.js
  17. +29 −15 assets/js/bootstrap-typeahead.js
  18. +0 −30 assets/js/google-code-prettify/prettify.css
  19. +0 −28 assets/js/google-code-prettify/prettify.js
  20. +0 −9,252 assets/js/jquery.js
  21. +6 −1 assets/js/tests/index.html
  22. +63 −0 assets/js/tests/phantom.js
  23. +14 −0 assets/js/tests/server.js
  24. +15 −0 assets/js/tests/unit/bootstrap-alert.js
  25. 0 assets/js/tests/unit/bootstrap-button.js
  26. +28 −0 assets/js/tests/unit/bootstrap-carousel.js
  27. +29 −0 assets/js/tests/unit/bootstrap-collapse.js
  28. +34 −0 assets/js/tests/unit/bootstrap-dropdown.js
  29. +29 −0 assets/js/tests/unit/bootstrap-modal.js
  30. +21 −0 assets/js/tests/unit/bootstrap-phantom.js
  31. 0 assets/js/tests/unit/bootstrap-popover.js
  32. 0 assets/js/tests/unit/bootstrap-scrollspy.js
  33. +16 −0 assets/js/tests/unit/bootstrap-tab.js
  34. +74 −0 assets/js/tests/unit/bootstrap-tooltip.js
  35. +1 −1 assets/js/tests/unit/bootstrap-transition.js
  36. +23 −3 assets/js/tests/unit/bootstrap-typeahead.js
  37. 0 assets/js/tests/vendor/jquery.js
  38. 0 assets/js/tests/vendor/qunit.css
  39. 0 assets/js/tests/vendor/qunit.js
  40. +5 −0 assets/less/bootstrap/accordion.less
  41. +2 −14 assets/less/bootstrap/alerts.less
  42. +2 −2 assets/less/bootstrap/bootstrap.less
  43. +2 −0 assets/less/bootstrap/breadcrumbs.less
  44. +76 −33 assets/less/bootstrap/button-groups.less
  45. +32 −24 assets/less/bootstrap/buttons.less
  46. 0 assets/less/bootstrap/carousel.less
  47. +12 −1 assets/less/bootstrap/close.less
  48. +6 −6 assets/less/bootstrap/code.less
  49. +9 −7 assets/less/bootstrap/component-animations.less
  50. +58 −45 assets/less/bootstrap/dropdowns.less
  51. +125 −63 assets/less/bootstrap/forms.less
  52. +2 −5 assets/less/bootstrap/grid.less
  53. +3 −1 assets/less/bootstrap/hero-unit.less
  54. +55 −0 assets/less/bootstrap/labels-badges.less
  55. +0 −32 assets/less/bootstrap/labels.less
  56. +1 −1 assets/less/bootstrap/layouts.less
  57. +218 −177 assets/less/bootstrap/mixins.less
  58. +13 −6 assets/less/bootstrap/modals.less
  59. +137 −72 assets/less/bootstrap/navbar.less
  60. +53 −43 assets/less/bootstrap/navs.less
  61. +6 −0 assets/less/bootstrap/pager.less
  62. +1 −0 assets/less/bootstrap/pagination.less
  63. 0 assets/less/bootstrap/popovers.less
  64. +27 −5 assets/less/bootstrap/progress-bars.less
  65. +3 −3 assets/less/bootstrap/reset.less
  66. +26 −0 assets/less/bootstrap/responsive-1200px-min.less
  67. +149 −0 assets/less/bootstrap/responsive-767px-max.less
  68. +17 −0 assets/less/bootstrap/responsive-768px-979px.less
  69. +146 −0 assets/less/bootstrap/responsive-navbar.less
  70. +41 −0 assets/less/bootstrap/responsive-utilities.less
  71. +14 −293 assets/less/bootstrap/responsive.less
  72. +4 −4 assets/less/bootstrap/scaffolding.less
  73. +42 −9 assets/less/bootstrap/sprites.less
  74. +46 −20 assets/less/bootstrap/tables.less
  75. +51 −0 assets/less/bootstrap/tests/css-tests.css
  76. +827 −0 assets/less/bootstrap/tests/css-tests.html
  77. +14 −2 assets/less/bootstrap/thumbnails.less
  78. 0 assets/less/bootstrap/tooltip.less
  79. +27 −10 assets/less/bootstrap/type.less
  80. 0 assets/less/bootstrap/utilities.less
  81. +105 −7 assets/less/bootstrap/variables.less
  82. +10 −0 assets/less/bootstrap/wells.less
  83. BIN docs/assets/bootstrap.zip
  84. +556 −329 docs/assets/css/bootstrap-responsive.css
  85. +2,313 −849 docs/assets/css/bootstrap.css
  86. +80 −11 docs/assets/css/docs.css
  87. BIN docs/assets/ico/apple-touch-icon-114-precomposed.png
  88. BIN docs/assets/ico/apple-touch-icon-144-precomposed.png
  89. BIN docs/assets/ico/apple-touch-icon-57-precomposed.png
  90. BIN docs/assets/ico/apple-touch-icon-72-precomposed.png
  91. BIN docs/assets/ico/bootstrap-apple-114x114.png
  92. BIN docs/assets/ico/bootstrap-apple-57x57.png
  93. BIN docs/assets/ico/bootstrap-apple-72x72.png
  94. BIN docs/assets/ico/favicon.ico
  95. 0 docs/assets/img/bird.png
  96. 0 docs/assets/img/bootstrap-mdo-sfmoma-01.jpg
  97. 0 docs/assets/img/bootstrap-mdo-sfmoma-02.jpg
  98. 0 docs/assets/img/bootstrap-mdo-sfmoma-03.jpg
  99. 0 docs/assets/img/browsers.png
  100. BIN docs/assets/img/example-diagram-01.png
  101. BIN docs/assets/img/example-diagram-02.png
  102. BIN docs/assets/img/example-diagram-03.png
  103. BIN docs/assets/img/example-sites/bartop.png
  104. BIN docs/assets/img/example-sites/fleetio.png
  105. 0 docs/assets/img/example-sites/jshint.png
  106. BIN docs/assets/img/example-sites/kippt.png
  107. BIN docs/assets/img/example-sites/railwayjs.png
  108. BIN docs/assets/img/example-sites/soundready.png
  109. BIN docs/assets/img/example-sites/totalwireframe.png
  110. 0 docs/assets/img/examples/bootstrap-example-fluid.jpg
  111. 0 docs/assets/img/examples/bootstrap-example-hero.jpg
  112. 0 docs/assets/img/examples/bootstrap-example-starter.jpg
  113. 0 docs/assets/img/github-16px.png
  114. BIN docs/assets/img/glyphicons-halflings-white.png
  115. BIN docs/assets/img/glyphicons-halflings.png
  116. 0 docs/assets/img/glyphicons/glyphicons_009_magic.png
  117. 0 docs/assets/img/glyphicons/glyphicons_042_group.png
  118. 0 docs/assets/img/glyphicons/glyphicons_079_podium.png
  119. 0 docs/assets/img/glyphicons/glyphicons_082_roundabout.png
  120. 0 docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png
  121. 0 docs/assets/img/glyphicons/glyphicons_163_iphone.png
  122. 0 docs/assets/img/glyphicons/glyphicons_214_resize_small.png
  123. 0 docs/assets/img/glyphicons/glyphicons_266_book_open.png
  124. 0 docs/assets/img/grid-18px-masked.png
  125. 0 docs/assets/img/icon-css3.png
  126. 0 docs/assets/img/icon-github.png
  127. 0 docs/assets/img/icon-html5.png
  128. 0 docs/assets/img/icon-twitter.png
  129. 0 docs/assets/img/less-logo-large.png
  130. 0 docs/assets/img/less-small.png
  131. 0 docs/assets/img/responsive-illustrations.png
  132. 0 docs/assets/js/README.md
  133. +6 −2 docs/assets/js/application.js
  134. +28 −32 docs/assets/js/bootstrap-alert.js
  135. +29 −33 docs/assets/js/bootstrap-button.js
  136. +33 −21 docs/assets/js/bootstrap-carousel.js
  137. +47 −26 docs/assets/js/bootstrap-collapse.js
  138. +18 −10 docs/assets/js/bootstrap-dropdown.js
  139. +25 −17 docs/assets/js/bootstrap-modal.js
  140. +13 −10 docs/assets/js/bootstrap-popover.js
  141. +44 −18 docs/assets/js/bootstrap-scrollspy.js
  142. +12 −7 docs/assets/js/bootstrap-tab.js
  143. +40 −35 docs/assets/js/bootstrap-tooltip.js
  144. +30 −20 docs/assets/js/bootstrap-transition.js
  145. +29 −15 docs/assets/js/bootstrap-typeahead.js
  146. +1,824 −0 docs/assets/js/bootstrap.js
  147. +6 −0 docs/assets/js/bootstrap.min.js
  148. 0 docs/assets/js/google-code-prettify/prettify.css
  149. 0 docs/assets/js/google-code-prettify/prettify.js
  150. 0 docs/assets/js/jquery.js
  151. +226 −168 docs/base-css.html
  152. +11 −0 docs/build/index.js
  153. 0 docs/build/node_modules/hogan.js/.git_ignore
  154. 0 docs/build/node_modules/hogan.js/.gitmodules
  155. 0 docs/build/node_modules/hogan.js/LICENSE
  156. 0 docs/build/node_modules/hogan.js/Makefile
  157. 0 docs/build/node_modules/hogan.js/README.md
  158. 0 docs/build/node_modules/hogan.js/lib/compiler.js
  159. 0 docs/build/node_modules/hogan.js/lib/hogan.js
  160. 0 docs/build/node_modules/hogan.js/lib/template.js
  161. 0 docs/build/node_modules/hogan.js/package.json
  162. 0 docs/build/node_modules/hogan.js/test/html/list.html
  163. 0 docs/build/node_modules/hogan.js/test/index.html
  164. 0 docs/build/node_modules/hogan.js/test/index.js
  165. 0 docs/build/node_modules/hogan.js/test/mustache.js
  166. 0 docs/build/node_modules/hogan.js/test/spec.js
  167. 0 docs/build/node_modules/hogan.js/test/spec/Changes
  168. 0 docs/build/node_modules/hogan.js/test/spec/README.md
  169. 0 docs/build/node_modules/hogan.js/test/spec/Rakefile
  170. 0 docs/build/node_modules/hogan.js/test/spec/TESTING.md
  171. 0 docs/build/node_modules/hogan.js/test/spec/specs/comments.json
  172. 0 docs/build/node_modules/hogan.js/test/spec/specs/comments.yml
  173. 0 docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json
  174. 0 docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml
  175. 0 docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json
  176. 0 docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml
  177. 0 docs/build/node_modules/hogan.js/test/spec/specs/inverted.json
  178. 0 docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml
  179. 0 docs/build/node_modules/hogan.js/test/spec/specs/partials.json
  180. 0 docs/build/node_modules/hogan.js/test/spec/specs/partials.yml
  181. 0 docs/build/node_modules/hogan.js/test/spec/specs/sections.json
  182. 0 docs/build/node_modules/hogan.js/test/spec/specs/sections.yml
  183. 0 docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json
  184. 0 docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml
  185. 0 docs/build/node_modules/hogan.js/test/templates/list.mustache
  186. 0 docs/build/node_modules/hogan.js/tools/release.js
  187. 0 docs/build/node_modules/hogan.js/tools/web_templates.js
  188. 0 docs/build/node_modules/hogan.js/web/1.0.0/hogan.js
  189. 0 docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js
  190. 0 docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js
  191. 0 docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js
  192. 0 docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js
  193. 0 docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js
  194. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js
  195. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js
  196. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js
  197. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js
  198. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.common.js
  199. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.js
  200. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.mustache.js
  201. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.mustache.js
  202. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js
  203. 0 docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js
  204. 0 docs/build/node_modules/hogan.js/web/favicon.ico
  205. 0 docs/build/node_modules/hogan.js/web/images/logo.png
  206. 0 docs/build/node_modules/hogan.js/web/images/noise.png
  207. 0 docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png
  208. 0 docs/build/node_modules/hogan.js/web/images/stripes.png
  209. 0 docs/build/node_modules/hogan.js/wrappers/amd.js.mustache
  210. 0 docs/build/node_modules/hogan.js/wrappers/common.js.mustache
  211. 0 docs/build/node_modules/hogan.js/wrappers/js.mustache
  212. 0 docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache
  213. 0 docs/build/package.json
  214. +459 −121 docs/components.html
  215. +105 −14 docs/download.html
  216. +7 −6 docs/examples.html
  217. +18 −7 docs/examples/fluid.html
  218. +6 −5 docs/examples/hero.html
  219. +6 −5 docs/examples/starter-template.html
  220. +38 −28 docs/index.html
  221. +104 −37 docs/javascript.html
  222. +325 −67 docs/less.html
  223. +182 −59 docs/scaffolding.html
  224. +6 −5 docs/templates/layout.mustache
  225. +220 −163 docs/templates/pages/base-css.mustache
  226. +453 −116 docs/templates/pages/components.mustache
  227. +99 −9 docs/templates/pages/download.mustache
  228. +1 −1 docs/templates/pages/examples.mustache
  229. +32 −23 docs/templates/pages/index.mustache
  230. +98 −32 docs/templates/pages/javascript.mustache
  231. +319 −62 docs/templates/pages/less.mustache
  232. +176 −54 docs/templates/pages/scaffolding.mustache
  233. 0 docs/templates/pages/upgrading.mustache
  234. +6 −5 docs/upgrading.html
View
BIN assets/img/glyphicons-halflings-white.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN assets/img/glyphicons-halflings.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 assets/js/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "validthis": true,
+ "laxcomma" : true,
+ "laxbreak" : true,
+ "browser" : true,
+ "debug" : true,
+ "boss" : true,
+ "expr" : true,
+ "asi" : true
+}
View
12 assets/js/README.md 100644 → 100755
@@ -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
180 assets/js/application.js
@@ -1,180 +0,0 @@
-// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
-// IT'S ALL JUST JUNK FOR OUR DOCS!
-// ++++++++++++++++++++++++++++++++++++++++++
-
-!function ($) {
-
- $(function(){
-
- // Disable certain links in docs
- $('section [href^=#]').click(function (e) {
- e.preventDefault()
- })
-
- // make code pretty
- window.prettyPrint && prettyPrint()
-
- // add-ons
- $('.add-on :checkbox').on('click', function () {
- var $this = $(this)
- , method = $this.attr('checked') ? 'addClass' : 'removeClass'
- $(this).parents('.add-on')[method]('active')
- })
-
- // position static twipsies for components page
- if ($(".twipsies a").length) {
- $(window).on('load resize', function () {
- $(".twipsies a").each(function () {
- $(this)
- .tooltip({
- placement: $(this).attr('title')
- , trigger: 'manual'
- })
- .tooltip('show')
- })
- })
- }
-
- // add tipsies to grid for scaffolding
- if ($('#grid-system').length) {
- $('#grid-system').tooltip({
- selector: '.show-grid > div'
- , title: function () { return $(this).width() + 'px' }
- })
- }
-
- // fix sub nav on scroll
- var $win = $(window)
- , $nav = $('.subnav')
- , navTop = $('.subnav').length && $('.subnav').offset().top - 40
- , isFixed = 0
-
- processScroll()
-
- $win.on('scroll', processScroll)
-
- function processScroll() {
- var i, scrollTop = $win.scrollTop()
- if (scrollTop >= navTop && !isFixed) {
- isFixed = 1
- $nav.addClass('subnav-fixed')
- } else if (scrollTop <= navTop && isFixed) {
- isFixed = 0
- $nav.removeClass('subnav-fixed')
- }
- }
-
- // tooltip demo
- $('.tooltip-demo.well').tooltip({
- selector: "a[rel=tooltip]"
- })
-
- $('.tooltip-test').tooltip()
- $('.popover-test').popover()
-
- // popover demo
- $("a[rel=popover]")
- .popover()
- .click(function(e) {
- e.preventDefault()
- })
-
- // button state demo
- $('#fat-btn')
- .click(function () {
- var btn = $(this)
- btn.button('loading')
- setTimeout(function () {
- btn.button('reset')
- }, 3000)
- })
-
- // carousel demo
- $('#myCarousel').carousel()
-
- // javascript build logic
- var inputsComponent = $("#components.download input")
- , inputsPlugin = $("#plugins.download input")
- , inputsVariables = $("#variables.download input")
-
- // toggle all plugin checkboxes
- $('#components.download .toggle-all').on('click', function (e) {
- e.preventDefault()
- inputsComponent.attr('checked', !inputsComponent.is(':checked'))
- })
-
- $('#plugins.download .toggle-all').on('click', function (e) {
- e.preventDefault()
- inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
- })
-
- $('#variables.download .toggle-all').on('click', function (e) {
- e.preventDefault()
- inputsVariables.val('')
- })
-
- // request built javascript
- $('.download-btn').on('click', function () {
-
- var css = $("#components.download input:checked")
- .map(function () { return this.value })
- .toArray()
- , js = $("#plugins.download input:checked")
- .map(function () { return this.value })
- .toArray()
- , vars = {}
- , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
-
- $("#variables.download input")
- .each(function () {
- $(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
- })
-
- $.ajax({
- type: 'POST'
- , url: 'http://bootstrap.herokuapp.com'
- , dataType: 'jsonpi'
- , params: {
- js: js
- , css: css
- , vars: vars
- , img: img
- }
- })
- })
-
- })
-
-// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
-$.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
- var url = opts.url;
-
- return {
- send: function(_, completeCallback) {
- var name = 'jQuery_iframe_' + jQuery.now()
- , iframe, form
-
- iframe = $('<iframe>')
- .attr('name', name)
- .appendTo('head')
-
- form = $('<form>')
- .attr('method', opts.type) // GET or POST
- .attr('action', url)
- .attr('target', name)
-
- $.each(opts.params, function(k, v) {
-
- $('<input>')
- .attr('type', 'hidden')
- .attr('name', k)
- .attr('value', typeof v == 'string' ? v : JSON.stringify(v))
- .appendTo(form)
- })
-
- form.appendTo('body').submit()
- }
- }
-})
-
-}(window.jQuery)
View
60 assets/js/bootstrap-alert.js 100644 → 100755
@@ -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
62 assets/js/bootstrap-button.js 100644 → 100755
@@ -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
54 assets/js/bootstrap-carousel.js 100644 → 100755
@@ -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,33 +90,36 @@
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
-
- if (!$next.length) return
+ , e = $.Event('slide')
this.sliding = true
isCycling && this.pause()
$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
73 assets/js/bootstrap-collapse.js 100644 → 100755
@@ -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,67 +47,83 @@
}
, 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
.removeClass('collapse')
[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
28 assets/js/bootstrap-dropdown.js 100644 → 100755
@@ -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
42 assets/js/bootstrap-modal.js 100644 → 100755
@@ -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,15 +119,15 @@
})
}
- function hideModal( that ) {
+ function hideModal(that) {
this.$element
.hide()
.trigger('hidden')
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
23 assets/js/bootstrap-popover.js 100644 → 100755
@@ -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
62 assets/js/bootstrap-scrollspy.js 100644 → 100755
@@ -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
19 assets/js/bootstrap-tab.js 100644 → 100755
@@ -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
75 assets/js/bootstrap-tooltip.js 100644 → 100755
@@ -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,22 +18,24 @@
* 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)
}
Tooltip.prototype = {
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
50 assets/js/bootstrap-transition.js 100644 → 100755
@@ -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
44 assets/js/bootstrap-typeahead.js 100644 → 100755
@@ -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,17 +190,19 @@
break
case 27: // escape
+ if (!this.shown) return
this.hide()
break
default:
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
30 assets/js/google-code-prettify/prettify.css
@@ -1,30 +0,0 @@
-.com { color: #93a1a1; }
-.lit { color: #195f91; }
-.pun, .opn, .clo { color: #93a1a1; }
-.fun { color: #dc322f; }
-.str, .atv { color: #D14; }
-.kwd, .linenums .tag { color: #1e347b; }
-.typ, .atn, .dec, .var { color: teal; }
-.pln { color: #48484c; }
-
-.prettyprint {
- padding: 8px;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
-}
-.prettyprint.linenums {
- -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
- -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
- box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
-}
-
-/* Specify class=linenums on a pre to get line numbering */
-ol.linenums {
- margin: 0 0 0 33px; /* IE indents via margin-left */
-}
-ol.linenums li {
- padding-left: 12px;
- color: #bebec5;