Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new initial commit

  • Loading branch information...
commit 8b1693c341f3c4c2013ebc4e69315c2e979591f6 0 parents
@Carreau Carreau authored
Showing with 53,152 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +5 −0 .slugignore
  3. +176 −0 LICENSE-bootstrap
  4. +94 −0 Makefile
  5. +1 −0  Procfile
  6. +28 −0 README.md
  7. +101 −0 app.py
  8. +3 −0  hlog
  9. BIN  img/glyphicons-halflings-white.png
  10. BIN  img/glyphicons-halflings.png
  11. +10 −0 js/.jshintrc
  12. +112 −0 js/README.md
  13. +90 −0 js/bootstrap-alert.js
  14. +96 −0 js/bootstrap-button.js
  15. +169 −0 js/bootstrap-carousel.js
  16. +157 −0 js/bootstrap-collapse.js
  17. +100 −0 js/bootstrap-dropdown.js
  18. +218 −0 js/bootstrap-modal.js
  19. +98 −0 js/bootstrap-popover.js
  20. +151 −0 js/bootstrap-scrollspy.js
  21. +135 −0 js/bootstrap-tab.js
  22. +275 −0 js/bootstrap-tooltip.js
  23. +61 −0 js/bootstrap-transition.js
  24. +285 −0 js/bootstrap-typeahead.js
  25. +54 −0 js/tests/index.html
  26. +63 −0 js/tests/phantom.js
  27. +14 −0 js/tests/server.js
  28. +56 −0 js/tests/unit/bootstrap-alert.js
  29. +77 −0 js/tests/unit/bootstrap-button.js
  30. +28 −0 js/tests/unit/bootstrap-carousel.js
  31. +54 −0 js/tests/unit/bootstrap-collapse.js
  32. +87 −0 js/tests/unit/bootstrap-dropdown.js
  33. +114 −0 js/tests/unit/bootstrap-modal.js
  34. +21 −0 js/tests/unit/bootstrap-phantom.js
  35. +93 −0 js/tests/unit/bootstrap-popover.js
  36. +31 −0 js/tests/unit/bootstrap-scrollspy.js
  37. +61 −0 js/tests/unit/bootstrap-tab.js
  38. +155 −0 js/tests/unit/bootstrap-tooltip.js
  39. +13 −0 js/tests/unit/bootstrap-transition.js
  40. +148 −0 js/tests/unit/bootstrap-typeahead.js
  41. +9,252 −0 js/tests/vendor/jquery.js
  42. +232 −0 js/tests/vendor/qunit.css
  43. +1,510 −0 js/tests/vendor/qunit.js
  44. +33 −0 less/accordion.less
  45. +58 −0 less/alerts.less
  46. +62 −0 less/bootstrap.less
  47. +24 −0 less/breadcrumbs.less
  48. +191 −0 less/button-groups.less
  49. +191 −0 less/buttons.less
  50. +121 −0 less/carousel.less
  51. +29 −0 less/close.less
  52. +57 −0 less/code.less
  53. +20 −0 less/component-animations.less
  54. +143 −0 less/dropdowns.less
  55. +583 −0 less/forms.less
  56. +5 −0 less/grid.less
  57. +22 −0 less/hero-unit.less
  58. +55 −0 less/labels-badges.less
  59. +17 −0 less/layouts.less
  60. +646 −0 less/mixins.less
  61. +90 −0 less/modals.less
  62. +358 −0 less/navbar.less
  63. +363 −0 less/navs.less
  64. +36 −0 less/pager.less
  65. +56 −0 less/pagination.less
  66. +49 −0 less/popovers.less
  67. +117 −0 less/progress-bars.less
  68. +131 −0 less/reset.less
  69. +26 −0 less/responsive-1200px-min.less
  70. +149 −0 less/responsive-767px-max.less
  71. +17 −0 less/responsive-768px-979px.less
  72. +153 −0 less/responsive-navbar.less
  73. +41 −0 less/responsive-utilities.less
  74. +48 −0 less/responsive.less
  75. +29 −0 less/scaffolding.less
  76. +191 −0 less/sprites.less
  77. +176 −0 less/tables.less
  78. +52 −0 less/tests/css-tests.css
  79. +917 −0 less/tests/css-tests.html
  80. +179 −0 less/tests/forms.html
  81. +108 −0 less/tests/navbar.html
  82. +47 −0 less/thumbnails.less
  83. +35 −0 less/tooltip.less
  84. +232 −0 less/type.less
  85. +23 −0 less/utilities.less
  86. +206 −0 less/variables.less
  87. +27 −0 less/wells.less
  88. +4 −0 nbconvert/.gitignore
  89. +37 −0 nbconvert/README.rst
  90. 0  nbconvert/__init__.py
  91. +10 −0 nbconvert/css/static_html.css
  92. +27 −0 nbconvert/custom_converter.py
  93. +68 −0 nbconvert/decorators.py
  94. +88 −0 nbconvert/dollarmath.py
  95. +17 −0 nbconvert/js/initmathjax.js
  96. +22 −0 nbconvert/lexers.py
  97. +1,439 −0 nbconvert/nbconvert.py
  98. +59 −0 nbconvert/nbstripout.py
  99. +113 −0 nbconvert/preamble.tex
  100. +21 −0 nbconvert/rst2ipynb.py
  101. +124 −0 nbconvert/rst2ipynblib/__init__.py
  102. +210 −0 nbconvert/tests/test.ipynb
  103. +337 −0 nbconvert/tests/test_display.ipynb
  104. +24 −0 nbconvert/tests/test_nbconverter.py
  105. +28 −0 nbconvert/tests/test_rst2ipynb.py
  106. +69 −0 nbconvert/tests/test_simple.py
  107. +396 −0 nbconvert/tests/tutorial.ipynb.ref
  108. +225 −0 nbconvert/tests/tutorial.rst.ref
  109. +22 −0 nbconvert/work_flow.txt
  110. 0  nbformat/__init__.py
  111. +221 −0 nbformat/current.py
  112. 0  nbformat/tests/__init__.py
  113. +24 −0 nbformat/v1/__init__.py
  114. +16 −0 nbformat/v1/convert.py
  115. +72 −0 nbformat/v1/nbbase.py
  116. +54 −0 nbformat/v1/nbjson.py
  117. +47 −0 nbformat/v1/rwbase.py
  118. 0  nbformat/v1/tests/__init__.py
  119. +29 −0 nbformat/v1/tests/nbexamples.py
  120. +14 −0 nbformat/v1/tests/test_json.py
  121. +41 −0 nbformat/v1/tests/test_nbbase.py
  122. +78 −0 nbformat/v2/__init__.py
  123. +50 −0 nbformat/v2/convert.py
  124. +179 −0 nbformat/v2/nbbase.py
  125. +69 −0 nbformat/v2/nbjson.py
  126. +150 −0 nbformat/v2/nbpy.py
  127. +188 −0 nbformat/v2/nbxml.py
  128. +165 −0 nbformat/v2/rwbase.py
  129. 0  nbformat/v2/tests/__init__.py
  130. +109 −0 nbformat/v2/tests/nbexamples.py
  131. +34 −0 nbformat/v2/tests/test_json.py
  132. +113 −0 nbformat/v2/tests/test_nbbase.py
  133. +17 −0 nbformat/v2/tests/test_nbpy.py
  134. +74 −0 nbformat/v3/__init__.py
  135. +59 −0 nbformat/v3/convert.py
  136. +206 −0 nbformat/v3/nbbase.py
  137. +72 −0 nbformat/v3/nbjson.py
  138. +204 −0 nbformat/v3/nbpy.py
  139. +190 −0 nbformat/v3/rwbase.py
  140. 0  nbformat/v3/tests/__init__.py
  141. +63 −0 nbformat/v3/tests/formattest.py
  142. +153 −0 nbformat/v3/tests/nbexamples.py
  143. +33 −0 nbformat/v3/tests/test_json.py
  144. +143 −0 nbformat/v3/tests/test_nbbase.py
  145. +46 −0 nbformat/v3/tests/test_nbpy.py
  146. +4 −0 requirements.txt
  147. +815 −0 static/assets/css/bootstrap-responsive.css
  148. +4,983 −0 static/assets/css/bootstrap.css
  149. +845 −0 static/assets/css/docs.css
  150. BIN  static/assets/ico/apple-touch-icon-114-precomposed.png
  151. BIN  static/assets/ico/apple-touch-icon-144-precomposed.png
  152. BIN  static/assets/ico/apple-touch-icon-57-precomposed.png
  153. BIN  static/assets/ico/apple-touch-icon-72-precomposed.png
  154. BIN  static/assets/ico/favicon.ico
  155. BIN  static/assets/img/Python-logo-notext.png
  156. BIN  static/assets/img/bird.png
  157. BIN  static/assets/img/example-nb/covariance.png
  158. BIN  static/assets/img/example-nb/demo.png
  159. BIN  static/assets/img/github-16px.png
  160. BIN  static/assets/img/glyphicons-halflings-white.png
  161. BIN  static/assets/img/glyphicons-halflings.png
  162. BIN  static/assets/img/glyphicons/glyphicons_009_magic.png
  163. BIN  static/assets/img/glyphicons/glyphicons_042_group.png
  164. BIN  static/assets/img/glyphicons/glyphicons_079_podium.png
  165. BIN  static/assets/img/glyphicons/glyphicons_082_roundabout.png
  166. BIN  static/assets/img/glyphicons/glyphicons_155_show_thumbnails.png
  167. BIN  static/assets/img/glyphicons/glyphicons_163_iphone.png
  168. BIN  static/assets/img/glyphicons/glyphicons_214_resize_small.png
  169. BIN  static/assets/img/glyphicons/glyphicons_266_book_open.png
  170. BIN  static/assets/img/grid-18px-masked.png
  171. BIN  static/assets/img/icon-css3.png
  172. BIN  static/assets/img/icon-github.png
  173. BIN  static/assets/img/icon-html5.png
  174. BIN  static/assets/img/icon-twitter.png
  175. BIN  static/assets/img/less-logo-large.png
  176. BIN  static/assets/img/less-small.png
  177. BIN  static/assets/img/responsive-illustrations.png
  178. BIN  static/assets/img/th_github.jpeg
  179. +106 −0 static/assets/js/README.md
  180. +184 −0 static/assets/js/application.js
  181. +90 −0 static/assets/js/bootstrap-alert.js
  182. +96 −0 static/assets/js/bootstrap-button.js
  183. +169 −0 static/assets/js/bootstrap-carousel.js
  184. +157 −0 static/assets/js/bootstrap-collapse.js
  185. +100 −0 static/assets/js/bootstrap-dropdown.js
  186. +218 −0 static/assets/js/bootstrap-modal.js
  187. +98 −0 static/assets/js/bootstrap-popover.js
  188. +151 −0 static/assets/js/bootstrap-scrollspy.js
  189. +135 −0 static/assets/js/bootstrap-tab.js
  190. +275 −0 static/assets/js/bootstrap-tooltip.js
  191. +61 −0 static/assets/js/bootstrap-transition.js
  192. +285 −0 static/assets/js/bootstrap-typeahead.js
  193. +1,825 −0 static/assets/js/bootstrap.js
  194. +6 −0 static/assets/js/bootstrap.min.js
  195. +30 −0 static/assets/js/google-code-prettify/prettify.css
  196. +28 −0 static/assets/js/google-code-prettify/prettify.js
  197. +9,252 −0 static/assets/js/jquery.js
  198. +44 −0 static/build/index.js
  199. +93 −0 static/build/node_modules/.bin/hulk
  200. +1 −0  static/build/node_modules/hogan.js/.git_ignore
  201. +3 −0  static/build/node_modules/hogan.js/.gitmodules
  202. +177 −0 static/build/node_modules/hogan.js/LICENSE
  203. +62 −0 static/build/node_modules/hogan.js/Makefile
  204. +93 −0 static/build/node_modules/hogan.js/README.md
  205. +93 −0 static/build/node_modules/hogan.js/bin/hulk
  206. +348 −0 static/build/node_modules/hogan.js/lib/compiler.js
  207. +20 −0 static/build/node_modules/hogan.js/lib/hogan.js
  208. +233 −0 static/build/node_modules/hogan.js/lib/template.js
  209. +20 −0 static/build/node_modules/hogan.js/package.json
  210. +8 −0 static/build/node_modules/hogan.js/test/html/list.html
  211. +13 −0 static/build/node_modules/hogan.js/test/index.html
  212. +848 −0 static/build/node_modules/hogan.js/test/index.js
  213. +90 −0 static/build/node_modules/hogan.js/test/mustache.js
  214. +77 −0 static/build/node_modules/hogan.js/test/spec.js
  215. +31 −0 static/build/node_modules/hogan.js/test/spec/Changes
  216. +65 −0 static/build/node_modules/hogan.js/test/spec/README.md
  217. +27 −0 static/build/node_modules/hogan.js/test/spec/Rakefile
  218. +46 −0 static/build/node_modules/hogan.js/test/spec/TESTING.md
  219. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/comments.json
  220. +103 −0 static/build/node_modules/hogan.js/test/spec/specs/comments.yml
  221. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/delimiters.json
  222. +158 −0 static/build/node_modules/hogan.js/test/spec/specs/delimiters.yml
  223. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/interpolation.json
  224. +230 −0 static/build/node_modules/hogan.js/test/spec/specs/interpolation.yml
  225. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/inverted.json
  226. +193 −0 static/build/node_modules/hogan.js/test/spec/specs/inverted.yml
  227. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/partials.json
  228. +109 −0 static/build/node_modules/hogan.js/test/spec/specs/partials.yml
  229. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/sections.json
  230. +256 −0 static/build/node_modules/hogan.js/test/spec/specs/sections.yml
  231. +1 −0  static/build/node_modules/hogan.js/test/spec/specs/~lambdas.json
  232. +149 −0 static/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml
  233. +8 −0 static/build/node_modules/hogan.js/test/templates/list.mustache
  234. +74 −0 static/build/node_modules/hogan.js/tools/release.js
  235. +32 −0 static/build/node_modules/hogan.js/tools/web_templates.js
  236. +500 −0 static/build/node_modules/hogan.js/web/1.0.0/hogan.js
  237. +14 −0 static/build/node_modules/hogan.js/web/1.0.0/hogan.min.js
  238. +500 −0 static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js
  239. +14 −0 static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js
  240. +545 −0 static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js
  241. +5 −0 static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js
  242. +576 −0 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js
  243. +576 −0 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js
Sorry, we could not display the entire diff because it was too big.
4 .gitignore
@@ -0,0 +1,4 @@
+*.pyc
+.DS_Store
+*.un~
+*.swp
5 .slugignore
@@ -0,0 +1,5 @@
+README.md
+hlog
+LISCENCE
+less/*
+static/build/*
176 LICENSE-bootstrap
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
94 Makefile
@@ -0,0 +1,94 @@
+BOOTSTRAP = ./static/assets/css/bootstrap.css
+BOOTSTRAP_LESS = ./less/bootstrap.less
+BOOTSTRAP_RESPONSIVE = ./static/assets/css/bootstrap-responsive.css
+BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less
+DATE=$(shell date +%I:%M%p)
+CHECK=\033[32m✔\033[39m
+HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
+
+
+#
+# BUILD DOCS
+#
+
+build:
+ @echo "\n${HR}"
+ @echo "Building Bootstrap..."
+ @echo "${HR}\n"
+ @jshint js/*.js --config js/.jshintrc
+ @jshint js/tests/unit/*.js --config js/.jshintrc
+ @echo "Running JSHint on javascript... ${CHECK} Done"
+ @recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
+ @recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
+ @echo "Compiling LESS with Recess... ${CHECK} Done"
+ @node static/build
+ @cp img/* static/assets/img/
+ @cp js/*.js static/assets/js/
+ @cp js/tests/vendor/jquery.js static/assets/js/
+ @echo "Compiling documentation... ${CHECK} Done"
+ @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > static/assets/js/bootstrap.js
+ @uglifyjs -nc static/assets/js/bootstrap.js > static/assets/js/bootstrap.min.tmp.js
+ @echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > static/assets/js/copyright.js
+ @cat static/assets/js/copyright.js static/assets/js/bootstrap.min.tmp.js > static/assets/js/bootstrap.min.js
+ @rm static/assets/js/copyright.js static/assets/js/bootstrap.min.tmp.js
+ @echo "Compiling and minifying javascript... ${CHECK} Done"
+ @echo "\n${HR}"
+ @echo "Bootstrap successfully built at ${DATE}."
+ @echo "${HR}\n"
+ @echo "Thanks for using Bootstrap,"
+ @echo "<3 @mdo and @fat\n"
+
+#
+# RUN JSHINT & QUNIT TESTS IN PHANTOMJS
+#
+
+test:
+ jshint js/*.js --config js/.jshintrc
+ jshint js/tests/unit/*.js --config js/.jshintrc
+ node js/tests/server.js &
+ phantomjs js/tests/phantom.js "http://localhost:3000/js/tests"
+ kill -9 `cat js/tests/pid.txt`
+ rm js/tests/pid.txt
+
+#
+# BUILD SIMPLE BOOTSTRAP DIRECTORY
+# recess & uglifyjs are required
+#
+
+bootstrap:
+ mkdir -p bootstrap/img
+ mkdir -p bootstrap/css
+ mkdir -p bootstrap/js
+ cp img/* bootstrap/img/
+ recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
+ recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
+ recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
+ recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
+ cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
+ uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
+ echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
+ cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
+ rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
+
+#
+# MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O )
+#
+
+gh-pages: bootstrap static
+ rm -f static/assets/bootstrap.zip
+ zip -r static/assets/bootstrap.zip bootstrap
+ rm -r bootstrap
+ rm -f ../bootstrap-gh-pages/assets/bootstrap.zip
+ node static/build production
+ cp -r static/* ../bootstrap-gh-pages
+
+#
+# WATCH LESS FILES
+#
+
+watch:
+ echo "Watching less files..."; \
+ watchr -e "watch('less/.*\.less') { system 'make' }"
+
+
+.PHONY: static watch gh-pages
1  Procfile
@@ -0,0 +1 @@
+web: python app.py
28 README.md
@@ -0,0 +1,28 @@
+Quick start
+-----------
+
+install heroku toolbelt,
+and follow instruction to set up your environement.
+
+
+* Modifies template/py files
+* $ make
+* test
+* commit
+* push
+* that's it
+
+
+Detail step
+-----------
+
+all files under /static/ are statically served files.
+some of them are generate by the `$ make` step.
+
+ * template/layout.mustache contail header and footers
+ * template/pages/index.mustache contain body of index.
+
+When pushing, heroku look in `requirements.txt`to know what to install.
+shutdown and restart the application
+
+you can see stdout by doing `heroku logs` for debug
101 app.py
@@ -0,0 +1,101 @@
+import os
+from flask import Flask , request
+import nbconvert.nbconvert as nbconvert
+import requests
+from nbformat import current as nbformat
+from flask import Flask, redirect, abort
+import re
+
+app = Flask(__name__)
+
+@app.route('/')
+def hello():
+ return open('static/index.html').read()
+
+
+@app.route('/assets/<path:path>', methods=['GET'])
+def sitemap(path):
+ return open('static/assets/'+path).read()
+
+
+@app.errorhandler(404)
+def page_not_found(error):
+ return "OHNO ! it cannot be found !"
+ #return render_template('page_not_found.html'), 404
+
+@app.route('/create/',methods=['POST'])
+def login():
+ value = request.form['gistnorurl']
+ if re.match('^[0-9]+$',value):
+ return redirect('/'+value)
+
+ gist = re.search(r'^https?://gist.github.com/([0-9]+)$',value)
+ if gist:
+ return redirect('/'+gist.group(1))
+
+ if value.startswith('https://'):
+ return redirect('/urls/'+value[8:])
+
+ if value.startswith('http://'):
+ return redirect('/urls/'+value[7:])
+
+ return "don't now how to access this ipynb file..."
+
+#https !
+@app.route('/urls/<path:url>')
+def render_urls(url):
+ try:
+ r = requests.get('https://'+url)
+
+ if r.status_code != 200:
+ return None
+ print 'will init converter'
+ converter = nbconvert.ConverterHTML()
+ print 'will set json'
+ converter.nb = nbformat.reads_json(r.content)
+ print 'will convert'
+ result = converter.convert()
+ print 'will return'
+ return result
+ except ValueError :
+ abort(501)
+
+#http !
+@app.route('/url/<path:url>')
+def render_url(url):
+ try:
+ r = requests.get('http://'+url)
+
+ if r.status_code != 200:
+ return None
+
+ converter = nbconvert.ConverterHTML()
+ converter.nb = nbformat.reads_json(r.content)
+ result = converter.convert()
+ return result
+ except ValueError :
+ abort(501)
+
+@app.route('/<int:id>')
+def fetch_and_render(id):
+ """Fetch and render a post from the Github API"""
+ r = requests.get('https://api.github.com/gists/{}'.format(id))
+
+ if r.status_code != 200:
+ return None
+ try :
+ decoded = r.json.copy()
+ jsonipynb = decoded['files'].values()[0]['content']
+
+ converter = nbconvert.ConverterHTML()
+ converter.nb = nbformat.reads_json(jsonipynb)
+ result = converter.convert()
+ except ValueError as e :
+ abort(404)
+
+ return result
+
+if __name__ == '__main__':
+ # Bind to PORT if defined, otherwise default to 5000.
+ port = int(os.environ.get('PORT', 5000))
+ app.run(host='0.0.0.0', port=port)
3  hlog
@@ -0,0 +1,3 @@
+Creating secret-sands-6966... done, stack is cedar
+http://secret-sands-6966.herokuapp.com/ | git@heroku.com:secret-sands-6966.git
+Git remote heroku added
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.
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.
10 js/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "validthis": true,
+ "laxcomma" : true,
+ "laxbreak" : true,
+ "browser" : true,
+ "debug" : true,
+ "boss" : true,
+ "expr" : true,
+ "asi" : true
+}
112 js/README.md
@@ -0,0 +1,112 @@
+## 2.0 BOOTSTRAP JS PHILOSOPHY
+These are the high-level design rules which guide the development of Bootstrap's plugin apis.
+
+---
+
+### 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. This is Bootstrap's first class API.
+
+We acknowledge that this isn't always the most performant and it may sometimes 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:
+
+ $('body').off('.data-api')
+
+To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
+
+ $('body').off('.alert.data-api')
+
+---
+
+### PROGRAMATIC API
+
+We also believe you should be able to use all plugins provided by Bootstrap purely through the JavaScript API.
+
+All public APIs should be single, chainable methods, and return the collection acted upon.
+
+ $(".btn.danger").button("toggle").addClass("fat")
+
+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 no keyboard
+ $("#myModal").modal('show') // initializes and invokes show immediately
+
+---
+
+### OPTIONS
+
+Options should be sparse and add universal value. We should pick the right defaults.
+
+All plugins should have a default object which can be modified to affect all instances' default options. The defaults object should be available via `$.fn.plugin.defaults`.
+
+ $.fn.modal.defaults = { … }
+
+An options definition should take the following form:
+
+ *noun*: *adjective* - describes or modifies a quality of an instance
+
+Examples:
+
+ backdrop: true
+ keyboard: false
+ placement: 'top'
+
+---
+
+### EVENTS
+
+All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
+
+ 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
+
+Each plugin should expose its raw constructor on a `Constructor` property -- accessed in the following way:
+
+
+ $.fn.popover.Constructor
+
+---
+
+### DATA ACCESSOR
+
+Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
+
+ $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
+
+---
+
+### DATA ATTRIBUTES
+
+Data attributes should take the following form:
+
+- data-{{verb}}={{plugin}} - defines main interaction
+- data-target || href^=# - defined on "control" element (if element controls an element other than self)
+- data-{{noun}} - defines class instance options
+
+Examples:
+
+ // control other targets
+ data-toggle="modal" data-target="#foo"
+ data-toggle="collapse" data-target="#foo" data-parent="#bar"
+
+ // defined on element they control
+ data-spy="scroll"
+
+ data-dismiss="modal"
+ data-dismiss="alert"
+
+ data-toggle="dropdown"
+
+ data-toggle="button"
+ data-toggle="buttons-checkbox"
+ data-toggle="buttons-radio"
90 js/bootstrap-alert.js
@@ -0,0 +1,90 @@
+/* ==========================================================
+ * bootstrap-alert.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent.trigger(e = $.Event('close'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.alert = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ })
+
+}(window.jQuery);
96 js/bootstrap-button.js
@@ -0,0 +1,96 @@
+/* ============================================================
+ * bootstrap-button.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
+
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
+
+ $el[val](data[state] || this.options[state])
+
+ // push to event loop to allow forms to submit
+ setTimeout(function () {
+ state == 'loadingText' ?
+ $el.addClass(d).attr(d, d) :
+ $el.removeClass(d).removeAttr(d)
+ }, 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+
+ this.$element.toggleClass('active')
+ }
+
+
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
+
+ $.fn.button = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
+ }
+
+ $.fn.button.Constructor = Button
+
+
+ /* BUTTON DATA-API
+ * =============== */
+
+ $(function () {
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
+ })
+ })
+
+}(window.jQuery);
169 js/bootstrap-carousel.js
@@ -0,0 +1,169 @@
+/* ==========================================================
+ * bootstrap-carousel.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* CAROUSEL CLASS DEFINITION
+ * ========================= */
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ 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 (e) {
+ if (!e) this.paused = false
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+ return this
+ }
+
+ , to: function (pos) {
+ var $active = this.$element.find('.active')
+ , children = $active.parent().children()
+ , activePos = children.index($active)
+ , that = this
+
+ if (pos > (children.length - 1) || pos < 0) return
+
+ if (this.sliding) {
+ return this.$element.one('slid', function () {
+ that.to(pos)
+ })
+ }
+
+ if (activePos == pos) {
+ return this.pause().cycle()
+ }
+
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
+ }
+
+ , pause: function (e) {
+ if (!e) this.paused = true
+ 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 (type, next) {
+ var $active = this.$element.find('.active')
+ , $next = next || $active[type]()
+ , isCycling = this.interval
+ , direction = type == 'next' ? 'left' : 'right'
+ , fallback = type == 'next' ? 'first' : 'last'
+ , that = this
+ , e = $.Event('slide')
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+ if ($next.hasClass('active')) return
+
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ this.$element.one($.support.transition.end, function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = 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()
+
+ return this
+ }
+
+ }
+
+
+ /* CAROUSEL PLUGIN DEFINITION
+ * ========================== */
+
+ $.fn.carousel = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('carousel')
+ , 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 if (options.interval) data.cycle()
+ })
+ }
+
+ $.fn.carousel.defaults = {
+ interval: 5000
+ , pause: 'hover'
+ }
+
+ $.fn.carousel.Constructor = Carousel
+
+
+ /* CAROUSEL DATA-API
+ * ================= */
+
+ $(function () {
+ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
+ $target.carousel(options)
+ e.preventDefault()
+ })
+ })
+
+}(window.jQuery);
157 js/bootstrap-collapse.js
@@ -0,0 +1,157 @@
+/* =============================================================
+ * bootstrap-collapse.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // 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)
+ }
+
+ this.options.toggle && this.toggle()
+ }
+
+ Collapse.prototype = {
+
+ constructor: Collapse
+
+ , dimension: function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
+
+ , show: function () {
+ var dimension
+ , scroll
+ , actives
+ , hasData
+
+ if (this.transitioning) 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', $.Event('show'), 'shown')
+ this.$element[dimension](this.$element[0][scroll])
+ }
+
+ , hide: function () {
+ var dimension
+ if (this.transitioning) return
+ dimension = this.dimension()
+ this.reset(this.$element[dimension]())
+ this.transition('removeClass', $.Event('hide'), 'hidden')
+ this.$element[dimension](0)
+ }
+
+ , reset: function (size) {
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ [dimension](size || 'auto')
+ [0].offsetWidth
+
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
+
+ return this
+ }
+
+ , transition: function (method, startEvent, completeEvent) {
+ var that = this
+ , complete = function () {
+ if (startEvent.type == 'show') that.reset()
+ that.transitioning = 0
+ that.$element.trigger(completeEvent)
+ }
+
+ 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
+ * ============================== */
+
+ $.fn.collapse = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('collapse')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.collapse.defaults = {
+ toggle: true
+ }
+
+ $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSIBLE DATA-API
+ * ==================== */
+
+ $(function () {
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $(target).collapse(option)
+ })
+ })
+
+}(window.jQuery);
100 js/bootstrap-dropdown.js
@@ -0,0 +1,100 @@
+/* ============================================================
+ * bootstrap-dropdown.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* DROPDOWN CLASS DEFINITION
+ * ========================= */
+
+ var toggle = '[data-toggle="dropdown"]'
+ , Dropdown = function (element) {
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
+ $('html').on('click.dropdown.data-api', function () {
+ $el.parent().removeClass('open')
+ })
+ }
+
+ Dropdown.prototype = {
+
+ constructor: Dropdown
+
+ , toggle: function (e) {
+ var $this = $(this)
+ , $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
+ }
+
+ $parent = $(selector)
+ $parent.length || ($parent = $this.parent())
+
+ isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) $parent.toggleClass('open')
+
+ return false
+ }
+
+ }
+
+ function clearMenus() {
+ $(toggle).parent().removeClass('open')
+ }
+
+
+ /* DROPDOWN PLUGIN DEFINITION
+ * ========================== */
+
+ $.fn.dropdown = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('dropdown')
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
+ * =================================== */
+
+ $(function () {
+ $('html').on('click.dropdown.data-api', clearMenus)
+ $('body')
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ })
+
+}(window.jQuery);
218 js/bootstrap-modal.js
@@ -0,0 +1,218 @@
+/* =========================================================
+ * bootstrap-modal.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* MODAL CLASS DEFINITION
+ * ====================== */
+
+ var Modal = function (content, options) {
+ this.options = options
+ this.$element = $(content)
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
+ }
+
+ Modal.prototype = {
+
+ constructor: Modal
+
+ , toggle: function () {
+ return this[!this.isShown ? 'show' : 'hide']()
+ }
+
+ , show: function () {
+ var that = this
+ , e = $.Event('show')
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ $('body').addClass('modal-open')
+
+ this.isShown = true
+
+ escape.call(this)
+ backdrop.call(this, function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(document.body) //don't move modals dom position
+ }
+
+ that.$element
+ .show()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element.addClass('in')
+
+ transition ?
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
+ that.$element.trigger('shown')
+
+ })
+ }
+
+ , hide: function (e) {
+ e && e.preventDefault()
+
+ 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.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ hideWithTransition.call(this) :
+ hideModal.call(this)
+ }
+
+ }
+
+
+ /* MODAL PRIVATE METHODS
+ * ===================== */
+
+ function hideWithTransition() {
+ var that = this
+ , timeout = setTimeout(function () {
+ that.$element.off($.support.transition.end)
+ hideModal.call(that)
+ }, 500)
+
+ this.$element.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ hideModal.call(that)
+ })
+ }
+
+ function hideModal(that) {
+ this.$element
+ .hide()
+ .trigger('hidden')
+
+ backdrop.call(this)
+ }
+
+ function backdrop(callback) {
+ var that = this
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+ .appendTo(document.body)
+
+ if (this.options.backdrop != 'static') {
+ this.$backdrop.click($.proxy(this.hide, this))
+ }
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ doAnimate ?
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade')?
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
+ removeBackdrop.call(this)
+
+ } else if (callback) {
+ callback()
+ }
+ }
+
+ function removeBackdrop() {
+ this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ function escape() {
+ var that = this
+ if (this.isShown && this.options.keyboard) {
+ $(document).on('keyup.dismiss.modal', function ( e ) {
+ e.which == 27 && that.hide()
+ })
+ } else if (!this.isShown) {
+ $(document).off('keyup.dismiss.modal')
+ }
+ }
+
+
+ /* MODAL PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.modal = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('modal')
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option]()
+ else if (options.show) data.show()
+ })
+ }
+
+ $.fn.modal.defaults = {
+ backdrop: true
+ , keyboard: true
+ , show: true
+ }
+
+ $.fn.modal.Constructor = Modal
+
+
+ /* MODAL DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
+ e.preventDefault()
+ $target.modal(option)
+ })
+ })
+
+}(window.jQuery);
98 js/bootstrap-popover.js
@@ -0,0 +1,98 @@
+/* ===========================================================
+ * bootstrap-popover.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Popover = function ( element, options ) {
+ this.init('popover', element, options)
+ }
+
+
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
+ ========================================== */
+
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
+
+ constructor: Popover
+
+ , setContent: function () {
+ var $tip = this.tip()
+ , title = this.getTitle()
+ , content = this.getContent()
+
+ $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')
+ }
+
+ , hasContent: function () {
+ return this.getTitle() || this.getContent()
+ }
+
+ , getContent: function () {
+ var content
+ , $e = this.$element
+ , o = this.options
+
+ content = $e.attr('data-content')
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
+
+ return content
+ }
+
+ , tip: function () {
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ }
+ return this.$tip
+ }
+
+ })
+
+
+ /* POPOVER PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.popover = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('popover')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.popover.Constructor = Popover
+
+ $.fn.popover.defaults = $.extend({} , $.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);
151 js/bootstrap-scrollspy.js
@@ -0,0 +1,151 @@
+/* =============================================================
+ * bootstrap-scrollspy.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* SCROLLSPY CLASS DEFINITION
+ * ========================== */
+
+ function ScrollSpy( element, options) {
+ var process = $.proxy(this.process, this)
+ , $element = $(element).is('body') ? $(window) : $(element)
+ , href
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
+ this.selector = (this.options.target
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ || '') + ' .nav li > a'
+ this.$body = $('body')
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.prototype = {
+
+ constructor: ScrollSpy
+
+ , refresh: function () {
+ var self = this
+ , $targets
+
+ this.offsets = $([])
+ this.targets = $([])
+
+ $targets = this.$body
+ .find(this.selector)
+ .map(function () {
+ 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])
+ })
+ }
+
+ , 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]
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+ && this.activate( targets[i] )
+ }
+ }
+
+ , activate: function (target) {
+ var active
+ , selector
+
+ this.activeTarget = target
+
+ $(this.selector)
+ .parent('.active')
+ .removeClass('active')
+
+ selector = this.selector
+ + '[data-target="' + target + '"],'
+ + this.selector + '[href="' + target + '"]'
+
+ active = $(selector)
+ .parent('li')
+ .addClass('active')
+
+ if (active.parent('.dropdown-menu')) {
+ active = active.closest('li.dropdown').addClass('active')
+ }
+
+ active.trigger('activate')
+ }
+
+ }
+
+
+ /* SCROLLSPY PLUGIN DEFINITION
+ * =========================== */
+
+ $.fn.scrollspy = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('scrollspy')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.scrollspy.Constructor = ScrollSpy
+
+ $.fn.scrollspy.defaults = {
+ offset: 10
+ }
+
+
+ /* SCROLLSPY DATA-API
+ * ================== */
+
+ $(function () {
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ $spy.scrollspy($spy.data())
+ })
+ })
+
+}(window.jQuery);
135 js/bootstrap-tab.js
@@ -0,0 +1,135 @@
+/* ========================================================
+ * bootstrap-tab.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TAB CLASS DEFINITION
+ * ==================== */
+
+ var Tab = function ( element ) {
+ this.element = $(element)
+ }
+
+ Tab.prototype = {
+
+ constructor: Tab
+
+ , show: function () {
+ var $this = this.element
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
+ , selector = $this.attr('data-target')
+ , previous
+ , $target
+ , e
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ if ( $this.parent('li').hasClass('active') ) return
+
+ previous = $ul.find('.active a').last()[0]
+
+ e = $.Event('show', {
+ relatedTarget: previous
+ })
+
+ $this.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ $target = $(selector)
+
+ this.activate($this.parent('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $this.trigger({
+ type: 'shown'
+ , relatedTarget: previous
+ })
+ })
+ }
+
+ , activate: function ( element, container, callback) {
+ var $active = container.find('> .active')
+ , transition = callback
+ && $.support.transition
+ && $active.hasClass('fade')
+
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
+
+ element.addClass('active')
+
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
+
+ if ( element.parent('.dropdown-menu') ) {
+ element.closest('li.dropdown').addClass('active')
+ }
+
+ callback && callback()
+ }
+
+ transition ?
+ $active.one($.support.transition.end, next) :
+ next()
+
+ $active.removeClass('in')
+ }
+ }
+
+
+ /* TAB PLUGIN DEFINITION
+ * ===================== */
+
+ $.fn.tab = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('tab')
+ if (!data) $this.data('tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.tab.Constructor = Tab
+
+
+ /* TAB DATA-API
+ * ============ */
+
+ $(function () {
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ e.preventDefault()
+ $(this).tab('show')
+ })
+ })
+
+}(window.jQuery);
275 js/bootstrap-tooltip.js
@@ -0,0 +1,275 @@
+/* ===========================================================
+ * bootstrap-tooltip.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TOOLTIP PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Tooltip = function (element, options) {
+ this.init('tooltip', element, options)
+ }
+
+ Tooltip.prototype = {
+
+ constructor: Tooltip
+
+ , init: function (type, element, options) {
+ var eventIn
+ , eventOut
+
+ this.type = type
+ this.$element = $(element)
+ this.options = this.getOptions(options)
+ this.enabled = true
+
+ if (this.options.trigger != 'manual') {
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
+ }
+
+ this.options.selector ?
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+ this.fixTitle()
+ }
+
+ , getOptions: function (options) {
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
+
+ if (options.delay && typeof options.delay == 'number') {
+ options.delay = {
+ show: options.delay
+ , hide: options.delay
+ }
+ }
+
+ return options
+ }
+
+ , enter: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ 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) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ if (this.timeout) clearTimeout(this.timeout)
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ self.hoverState = 'out'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
+ }
+
+ , show: function () {
+ var $tip
+ , inside
+ , pos
+ , actualWidth
+ , actualHeight
+ , placement
+ , tp
+
+ if (this.hasContent() && this.enabled) {
+ $tip = this.tip()
+ this.setContent()
+
+ if (this.options.animation) {
+ $tip.addClass('fade')
+ }
+
+ placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement
+
+ inside = /in/.test(placement)
+
+ $tip
+ .remove()
+ .css({ top: 0, left: 0, display: 'block' })
+ .appendTo(inside ? this.$element : document.body)
+
+ pos = this.getPosition(inside)
+
+ actualWidth = $tip[0].offsetWidth
+ actualHeight = $tip[0].offsetHeight
+
+ switch (inside ? placement.split(' ')[1] : placement) {
+ case 'bottom':
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'top':
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'left':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
+ break
+ case 'right':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
+ break
+ }
+
+ $tip
+ .css(tp)
+ .addClass(placement)
+ .addClass('in')
+ }
+ }
+
+ , 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()
+ , title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
+ $tip.removeClass('fade in top bottom left right')
+ }
+
+ , hide: function () {
+ var that = this
+ , $tip = this.tip()
+
+ $tip.removeClass('in')
+
+ function removeWithAnimation() {
+ var timeout = setTimeout(function () {
+ $tip.off($.support.transition.end).remove()
+ }, 500)
+
+ $tip.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ $tip.remove()
+ })
+ }
+
+ $.support.transition && this.$tip.hasClass('fade') ?
+ removeWithAnimation() :
+ $tip.remove()
+ }
+
+ , fixTitle: function () {
+ var $e = this.$element
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
+ }
+ }
+
+ , hasContent: function () {
+ return this.getTitle()
+ }
+
+ , getPosition: function (inside) {
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
+ width: this.$element[0].offsetWidth
+ , height: this.$element[0].offsetHeight
+ })
+ }
+
+ , getTitle: function () {
+ var title
+ , $e = this.$element
+ , o = this.options
+
+ title = $e.attr('data-original-title')
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
+
+ return title
+ }
+
+ , tip: function () {
+ return this.$tip = this.$tip || $(this.options.template)