Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

a bit of strapon action

  • Loading branch information...
commit 6051a3ae5d3370b1431d90fe7e58667c07cf5db0 1 parent cf98512
matt authored
Showing with 18,144 additions and 0 deletions.
  1. +71 −0 .gitignore
  2. +17 −0 Gemfile
  3. +133 −0 Gemfile.lock
  4. +20 −0 MIT-LICENSE
  5. +3 −0  README.rdoc
  6. +38 −0 Rakefile
  7. BIN  app/assets/images/glyphicons-halflings-white.png
  8. BIN  app/assets/images/glyphicons-halflings.png
  9. 0  app/assets/images/ricco/.gitkeep
  10. BIN  app/assets/images/ricco/Airplane.png
  11. BIN  app/assets/images/ricco/Anchor.png
  12. BIN  app/assets/images/ricco/Bucket.png
  13. BIN  app/assets/images/ricco/CD case.png
  14. BIN  app/assets/images/ricco/Clock Radio.png
  15. BIN  app/assets/images/ricco/Cloud.png
  16. BIN  app/assets/images/ricco/Comment Bubble.png
  17. BIN  app/assets/images/ricco/Copy.png
  18. BIN  app/assets/images/ricco/Files Empty.png
  19. BIN  app/assets/images/ricco/Files Full.png
  20. BIN  app/assets/images/ricco/Film Print.png
  21. BIN  app/assets/images/ricco/Gears 2.png
  22. BIN  app/assets/images/ricco/Gears.png
  23. BIN  app/assets/images/ricco/Heart.png
  24. BIN  app/assets/images/ricco/Home.png
  25. BIN  app/assets/images/ricco/Notes.png
  26. BIN  app/assets/images/ricco/Office Phone.png
  27. BIN  app/assets/images/ricco/Paper folded.png
  28. BIN  app/assets/images/ricco/Paper plane.png
  29. BIN  app/assets/images/ricco/Paperclip.png
  30. BIN  app/assets/images/ricco/Present.png
  31. BIN  app/assets/images/ricco/Ribbon.png
  32. BIN  app/assets/images/ricco/Screen.png
  33. BIN  app/assets/images/ricco/Search.png
  34. BIN  app/assets/images/ricco/Stats 1.png
  35. BIN  app/assets/images/ricco/Stats Down.png
  36. BIN  app/assets/images/ricco/Stats Up.png
  37. BIN  app/assets/images/ricco/TV.png
  38. BIN  app/assets/images/ricco/Views.png
  39. BIN  app/assets/images/ricco/calender.png
  40. BIN  app/assets/images/ricco/check.png
  41. BIN  app/assets/images/ricco/comments.png
  42. BIN  app/assets/images/ricco/cursor - mouse.png
  43. BIN  app/assets/images/ricco/down.png
  44. BIN  app/assets/images/ricco/external-link-grey-dark.png
  45. BIN  app/assets/images/ricco/female.png
  46. BIN  app/assets/images/ricco/formalize/button.png
  47. BIN  app/assets/images/ricco/formalize/select_arrow.gif
  48. BIN  app/assets/images/ricco/iPad.png
  49. BIN  app/assets/images/ricco/iPod.png
  50. BIN  app/assets/images/ricco/images.png
  51. BIN  app/assets/images/ricco/left.png
  52. BIN  app/assets/images/ricco/list view.png
  53. BIN  app/assets/images/ricco/male.png
  54. BIN  app/assets/images/ricco/misc/button-gloss.png
  55. BIN  app/assets/images/ricco/misc/button-overlay.png
  56. BIN  app/assets/images/ricco/misc/custom-form-sprites.png
  57. BIN  app/assets/images/ricco/misc/input-bg-outset.png
  58. BIN  app/assets/images/ricco/misc/input-bg.png
  59. BIN  app/assets/images/ricco/misc/modal-gloss.png
  60. BIN  app/assets/images/ricco/misc/table-sorter.png
  61. BIN  app/assets/images/ricco/rails.png
  62. BIN  app/assets/images/ricco/refresh.png
  63. BIN  app/assets/images/ricco/right.png
  64. BIN  app/assets/images/ricco/sprites/fancy_drop_down.png
  65. BIN  app/assets/images/ricco/star.png
  66. BIN  app/assets/images/ricco/stats 2.png
  67. BIN  app/assets/images/ricco/tag 2.png
  68. BIN  app/assets/images/ricco/tag.png
  69. BIN  app/assets/images/ricco/up.png
  70. +94 −0 app/assets/javascripts/bootstrap/bootstrap-alert.js
  71. +100 −0 app/assets/javascripts/bootstrap/bootstrap-button.js
  72. +161 −0 app/assets/javascripts/bootstrap/bootstrap-carousel.js
  73. +138 −0 app/assets/javascripts/bootstrap/bootstrap-collapse.js
  74. +92 −0 app/assets/javascripts/bootstrap/bootstrap-dropdown.js
  75. +210 −0 app/assets/javascripts/bootstrap/bootstrap-modal.js
  76. +95 −0 app/assets/javascripts/bootstrap/bootstrap-popover.js
  77. +125 −0 app/assets/javascripts/bootstrap/bootstrap-scrollspy.js
  78. +130 −0 app/assets/javascripts/bootstrap/bootstrap-tab.js
  79. +270 −0 app/assets/javascripts/bootstrap/bootstrap-tooltip.js
  80. +51 −0 app/assets/javascripts/bootstrap/bootstrap-transition.js
  81. +271 −0 app/assets/javascripts/bootstrap/bootstrap-typeahead.js
  82. +12 −0 app/assets/javascripts/bootstrap/bootstrap.js
  83. +146 −0 app/assets/javascripts/vendor/320-up/helper.js
  84. +61 −0 app/assets/javascripts/vendor/320-up/imgSizer.js
  85. +13 −0 app/assets/javascripts/vendor/dd_belatedpng.js
  86. +11 −0 app/assets/javascripts/vendor/formalize/README.txt
  87. +158 −0 app/assets/javascripts/vendor/formalize/jquery.formalize.js
  88. +4 −0 app/assets/javascripts/vendor/modernizr-2.0.min.js
  89. +4 −0 app/assets/javascripts/vendor/modernizr_webfonts.js
  90. +58 −0 app/assets/javascripts/vendor/plugins.js
  91. +5,815 −0 app/assets/javascripts/vendor/raphael.js
  92. +7 −0 app/assets/javascripts/vendor/respond.min.js
  93. +5 −0 app/assets/javascripts/vendor/selectivizr-min.js
  94. +5 −0 app/assets/javascripts/vendor/selectivizr.js
  95. +99 −0 app/assets/javascripts/vendor/survival-kit-source.jquery.js
  96. +28 −0 app/assets/stylesheets/bootstrap/_accordion.scss
  97. +56 −0 app/assets/stylesheets/bootstrap/_alerts.scss
  98. +36 −0 app/assets/stylesheets/bootstrap/_badges.scss
  99. +24 −0 app/assets/stylesheets/bootstrap/_breadcrumbs.scss
  100. +158 −0 app/assets/stylesheets/bootstrap/_button-groups.scss
  101. +167 −0 app/assets/stylesheets/bootstrap/_buttons.scss
  102. +116 −0 app/assets/stylesheets/bootstrap/_carousel.scss
  103. +18 −0 app/assets/stylesheets/bootstrap/_close.scss
  104. +56 −0 app/assets/stylesheets/bootstrap/_code.scss
  105. +20 −0 app/assets/stylesheets/bootstrap/_component-animations.scss
  106. +143 −0 app/assets/stylesheets/bootstrap/_dropdowns.scss
  107. +486 −0 app/assets/stylesheets/bootstrap/_forms.scss
  108. +5 −0 app/assets/stylesheets/bootstrap/_grid.scss
  109. +22 −0 app/assets/stylesheets/bootstrap/_hero-unit.scss
  110. +38 −0 app/assets/stylesheets/bootstrap/_labels.scss
  111. +17 −0 app/assets/stylesheets/bootstrap/_layouts.scss
  112. +572 −0 app/assets/stylesheets/bootstrap/_mixins.scss
  113. +90 −0 app/assets/stylesheets/bootstrap/_modals.scss
  114. +318 −0 app/assets/stylesheets/bootstrap/_navbar.scss
  115. +339 −0 app/assets/stylesheets/bootstrap/_navs.scss
  116. +35 −0 app/assets/stylesheets/bootstrap/_pager.scss
  117. +53 −0 app/assets/stylesheets/bootstrap/_pagination.scss
  118. +49 −0 app/assets/stylesheets/bootstrap/_popovers.scss
  119. +109 −0 app/assets/stylesheets/bootstrap/_progress-bars.scss
  120. +105 −0 app/assets/stylesheets/bootstrap/_reset.scss
  121. +29 −0 app/assets/stylesheets/bootstrap/_scaffolding.scss
  122. +157 −0 app/assets/stylesheets/bootstrap/_sprites.scss
  123. +122 −0 app/assets/stylesheets/bootstrap/_tables.scss
  124. +35 −0 app/assets/stylesheets/bootstrap/_thumbnails.scss
  125. +35 −0 app/assets/stylesheets/bootstrap/_tooltip.scss
  126. +226 −0 app/assets/stylesheets/bootstrap/_type.scss
  127. +23 −0 app/assets/stylesheets/bootstrap/_utilities.scss
  128. +191 −0 app/assets/stylesheets/bootstrap/_variables.scss
  129. +27 −0 app/assets/stylesheets/bootstrap/_wells.scss
  130. +2 −0  app/assets/stylesheets/ricco/extend/_all.sass
  131. +28 −0 app/assets/stylesheets/ricco/extend/_helpers.sass
  132. +18 −0 app/assets/stylesheets/ricco/extend/_sticky_footer.sass
  133. +3 −0  app/assets/stylesheets/ricco/functions/_all.sass
  134. +19 −0 app/assets/stylesheets/ricco/functions/_calculations.css.sass
  135. +182 −0 app/assets/stylesheets/ricco/functions/_color_schemer.css.sass
  136. +142 −0 app/assets/stylesheets/ricco/functions/_modular_scale.css.sass
  137. +109 −0 app/assets/stylesheets/ricco/kickoff/_kickoff.sass
  138. +5 −0 app/assets/stylesheets/ricco/mixins/_all.sass
  139. +46 −0 app/assets/stylesheets/ricco/mixins/_helpers.css.sass
  140. +19 −0 app/assets/stylesheets/ricco/mixins/_layout.css.sass
  141. +14 −0 app/assets/stylesheets/ricco/mixins/_pseudo.css.sass
  142. +81 −0 app/assets/stylesheets/ricco/mixins/_typography.css.sass
  143. +80 −0 app/assets/stylesheets/ricco/mixins/_ui.sass
  144. +33 −0 app/assets/stylesheets/ricco/reset/_meyer.sass
  145. +342 −0 app/assets/stylesheets/ricco/reset/_normalize.sass
  146. +31 −0 app/assets/stylesheets/ricco/reset/_pixel_normalize.scss
  147. +2 −0  app/assets/stylesheets/ricco/variables/_all.sass
  148. +164 −0 app/assets/stylesheets/ricco/variables/_color_names.css.sass
  149. +6 −0 app/assets/stylesheets/ricco/variables/_helpers.sass
  150. +2 −0  config/routes.rb
  151. +12 −0 lib/generators/strapon/api/USAGE
  152. +44 −0 lib/generators/strapon/api/api_generator.rb
  153. +9 −0 lib/generators/strapon/api/templates/apis/show.rabl
  154. +11 −0 lib/generators/strapon/api/templates/apis/update.rabl
  155. +33 −0 lib/generators/strapon/api/templates/class_api_controller.rb
  156. +20 −0 lib/generators/strapon/api/templates/class_api_module.rb
  157. +9 −0 lib/generators/strapon/api/templates/spec/class_api_spec.rb
  158. +70 −0 lib/generators/strapon/html/html_generator.rb
  159. +19 −0 lib/generators/strapon/html/templates/class_controller.rb
  160. +42 −0 lib/generators/strapon/html/templates/spec/class_request_spec.rb
  161. +19 −0 lib/generators/strapon/html/templates/views/_form.html.haml
  162. +1 −0  lib/generators/strapon/html/templates/views/index.html.haml
  163. +3 −0  lib/generators/strapon/html/templates/views/new.html.haml
  164. +9 −0 lib/generators/strapon/install/USAGE
  165. +96 −0 lib/generators/strapon/install/install_generator.rb
  166. +64 −0 lib/generators/strapon/install/templates/Guardfile
  167. +15 −0 lib/generators/strapon/install/templates/application.html.haml
  168. +22 −0 lib/generators/strapon/install/templates/spec/requests/admin_sign_in_spec.rb
  169. +15 −0 lib/generators/strapon/install/templates/spec/requests/admin_sign_out_spec.rb
  170. +45 −0 lib/generators/strapon/install/templates/spec/requests/admins_spec.rb
  171. +9 −0 lib/generators/strapon/install/templates/spec/routing/routing_spec.rb
  172. +72 −0 lib/generators/strapon/install/templates/spec/spec_helper.rb
  173. +6 −0 lib/generators/strapon/install/templates/spec/support/capybara.rb
  174. +62 −0 lib/generators/strapon/install/templates/spec/support/capybara_ext.rb
  175. +9 −0 lib/generators/strapon/install/templates/spec/support/factories/admins.rb
  176. +5 −0 lib/generators/strapon/install/templates/spec/support/routes.rb
  177. +23 −0 lib/generators/strapon/install/templates/spec/support/sign_in_helpers.rb
  178. +9 −0 lib/generators/strapon/ricco/USAGE
  179. +115 −0 lib/generators/strapon/ricco/ricco_generator.rb
  180. +11 −0 lib/generators/strapon/ricco/templates/_navigation.html.haml
  181. +37 −0 lib/generators/strapon/ricco/templates/application.html.haml
  182. +87 −0 lib/generators/strapon/ricco/templates/application_helper.rb
  183. +33 −0 lib/generators/strapon/ricco/templates/empty.html.haml
  184. BIN  lib/generators/strapon/ricco/templates/files/apple-touch-icon-114x114-precomposed.png
  185. BIN  lib/generators/strapon/ricco/templates/files/apple-touch-icon-72x72-precomposed.png
  186. BIN  lib/generators/strapon/ricco/templates/files/apple-touch-icon.png
  187. BIN  lib/generators/strapon/ricco/templates/files/favicon.ico
  188. BIN  lib/generators/strapon/ricco/templates/files/favicon.png
  189. +22 −0 lib/generators/strapon/ricco/templates/files/google.yml
  190. +87 −0 lib/generators/strapon/ricco/templates/stylesheets/application.css.sass
  191. +4 −0 lib/generators/strapon/ricco/templates/stylesheets/site/00_variables/_all.sass
  192. +114 −0 lib/generators/strapon/ricco/templates/stylesheets/site/00_variables/_base.sass
  193. +225 −0 lib/generators/strapon/ricco/templates/stylesheets/site/00_variables/_colors.sass
  194. +22 −0 lib/generators/strapon/ricco/templates/stylesheets/site/00_variables/_fonts.sass
  195. +11 −0 lib/generators/strapon/ricco/templates/stylesheets/site/00_variables/_grid.sass
  196. +19 −0 lib/generators/strapon/ricco/templates/stylesheets/site/01_reset/_reset.sass
  197. +6 −0 lib/generators/strapon/ricco/templates/stylesheets/site/02_grid/_grid_system.sass
  198. +20 −0 lib/generators/strapon/ricco/templates/stylesheets/site/02_grid/_grids_blueprint.sass
  199. +40 −0 lib/generators/strapon/ricco/templates/stylesheets/site/03_typography/_typography.sass
  200. +7 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_all.sass
  201. +83 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_common.sass
  202. +6 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_edits.sass
  203. +33 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_headers.sass
  204. +14 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_images.sass
  205. +26 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_lists.sass
  206. +73 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_semantics.sass
  207. +48 −0 lib/generators/strapon/ricco/templates/stylesheets/site/04_elements/_tables.sass
  208. +6 −0 lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_all.sass
  209. +1 −0  lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_dropdowns.sass
  210. +230 −0 lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_fancy_dropdown.css.scss
  211. +57 −0 lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_form_defaults.css.sass
  212. 0  lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_form_layouts.sass
  213. +257 −0 lib/generators/strapon/ricco/templates/stylesheets/site/05_forms/_formalize.css.sass
  214. +7 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_all.sass
  215. +1 −0  lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_button_groups.sass
  216. +110 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_buttons.sass
  217. +16 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_close.sass
  218. +16 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_component_animations.sass
  219. +4 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_popovers.sass
  220. +33 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_rails_messages.sass
  221. +14 −0 lib/generators/strapon/ricco/templates/stylesheets/site/06_patterns/_wells.sass
  222. +31 −0 lib/generators/strapon/ricco/templates/stylesheets/site/07_navigation/_navigation.sass
  223. +20 −0 lib/generators/strapon/ricco/templates/stylesheets/site/08_sprites/_sprites.css.sass
  224. +7 −0 lib/generators/strapon/ricco/templates/stylesheets/site/09_plugins/_plugins.css.sass
  225. +2 −0  lib/generators/strapon/ricco/templates/stylesheets/site/10_layout_design/_all.sass
  226. +82 −0 lib/generators/strapon/ricco/templates/stylesheets/site/10_layout_design/_design.sass
  227. +102 −0 lib/generators/strapon/ricco/templates/stylesheets/site/10_layout_design/_layout.sass
  228. +158 −0 lib/generators/strapon/ricco/templates/stylesheets/site/11_styletile/_tile_design.sass
  229. +80 −0 lib/generators/strapon/ricco/templates/stylesheets/site/11_styletile/_tile_layout.sass
  230. +142 −0 lib/generators/strapon/ricco/templates/stylesheets/site/11_styletile/_tile_responsive.sass
  231. +139 −0 lib/generators/strapon/ricco/templates/stylesheets/site/12_responsive/_blueprint.sass
  232. +348 −0 lib/generators/strapon/ricco/templates/stylesheets/site/12_responsive/_bootstrap.css.scss
  233. 0  lib/generators/strapon/ricco/templates/stylesheets/site/12_responsive/_bootstrap.sass
  234. +27 −0 lib/generators/strapon/ricco/templates/stylesheets/site/12_responsive/_mixins.sass
  235. +21 −0 lib/generators/strapon/ricco/templates/stylesheets/site/13_browser_adjustments/_ie.css.sass
  236. +8 −0 lib/generators/strapon/ricco/templates/stylesheets/site/13_browser_adjustments/_modernizr.css.sass
  237. 0  lib/generators/strapon/ricco/templates/stylesheets/site/13_browser_adjustments/_selectivizr.sass
  238. +57 −0 lib/generators/strapon/ricco/templates/stylesheets/site/14_print/_print.css.sass
  239. +7 −0 lib/generators/strapon/ricco/templates/swatch.html.haml
  240. +4 −0 lib/strapon.rb
  241. +8 −0 lib/strapon/engine.rb
  242. +3 −0  lib/strapon/version.rb
  243. +24 −0 lib/tasks/strapon_tasks.rake
  244. +6 −0 script/rails
  245. +7 −0 spec/dummy/Rakefile
  246. +9 −0 spec/dummy/app/assets/javascripts/application.js
  247. +7 −0 spec/dummy/app/assets/stylesheets/application.css
  248. +3 −0  spec/dummy/app/controllers/application_controller.rb
  249. +2 −0  spec/dummy/app/helpers/application_helper.rb
  250. 0  spec/dummy/app/mailers/.gitkeep
  251. 0  spec/dummy/app/models/.gitkeep
  252. +14 −0 spec/dummy/app/views/layouts/application.html.erb
  253. +4 −0 spec/dummy/config.ru
  254. +45 −0 spec/dummy/config/application.rb
  255. +10 −0 spec/dummy/config/boot.rb
  256. +25 −0 spec/dummy/config/database.yml
  257. +5 −0 spec/dummy/config/environment.rb
  258. +30 −0 spec/dummy/config/environments/development.rb
  259. +60 −0 spec/dummy/config/environments/production.rb
  260. +39 −0 spec/dummy/config/environments/test.rb
  261. +7 −0 spec/dummy/config/initializers/backtrace_silencers.rb
  262. +10 −0 spec/dummy/config/initializers/inflections.rb
  263. +5 −0 spec/dummy/config/initializers/mime_types.rb
  264. +7 −0 spec/dummy/config/initializers/secret_token.rb
  265. +8 −0 spec/dummy/config/initializers/session_store.rb
  266. +14 −0 spec/dummy/config/initializers/wrap_parameters.rb
  267. +5 −0 spec/dummy/config/locales/en.yml
  268. +4 −0 spec/dummy/config/routes.rb
  269. 0  spec/dummy/lib/assets/.gitkeep
  270. 0  spec/dummy/log/.gitkeep
  271. +26 −0 spec/dummy/public/404.html
  272. +26 −0 spec/dummy/public/422.html
  273. +26 −0 spec/dummy/public/500.html
  274. 0  spec/dummy/public/favicon.ico
  275. +6 −0 spec/dummy/script/rails
  276. +43 −0 spec/spec_helper.rb
  277. +6 −0 spec/support/capybara.rb
  278. +62 −0 spec/support/capybara_ext.rb
  279. +7 −0 spec/support/factories/users.rb
  280. +5 −0 spec/support/routes.rb
  281. +18 −0 spec/support/sign_in_helpers.rb
  282. +25 −0 strapon.gemspec
View
71 .gitignore
@@ -0,0 +1,71 @@
+mkmf.log
+.~lock*
+.DS_Store
+.cap_tasks
+.rake_tasks
+public/assets/*
+.bundle
+db/*.sqlite3
+db/schema.rb
+db/exports/
+db/data_exports/
+db/data_export/
+log/*.log
+log/*.pid
+public/system/*
+tmp/*
+**.war
+*.rbc
+*.sassc
+.rspec
+.redcar/
+.sass-cache
+/config/config.yml
+/coverage.data
+/coverage/
+/db/*.javadb/
+/db'*.sqlite3-journal
+/doc/api/
+/doc/app/
+/doc/features.html
+/doc/specs.html
+/public/cache
+/public/stylesheets/compiled
+/public/system
+/spec'tmp/*
+/cache
+/capybara*
+/capybara-*.html
+/gems
+/rerun.txt
+Thumbs.db
+bin/
+
+# scm revert files
+**.orig
+
+# Mac finder artifacts
+.DS_Store
+
+# Netbeans project directory
+/nbproject/
+
+# Textmate project files
+/*.tmpproj
+
+# vim artifacts
+**.swp
+**.swo
+
+tmp/**/*
+.rvmrc
+doc/latex/*/*.aux
+doc/latex/*/*.log
+doc/latex/*/*.out
+doc/latex/*/*.gz
+
+pkg
+/pkg/**/*
+
+spec/dummy/tmp/cache/
+spec/dummy/tmp/cache/**/*
View
17 Gemfile
@@ -0,0 +1,17 @@
+source "http://rubygems.org"
+
+# Declare your gem's dependencies in strapon.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
+gemspec
+
+# jquery-rails is used by the dummy application
+gem "jquery-rails"
+
+# Declare any dependencies that are still in development here instead of in
+# your gemspec. These might include edge Rails or gems from your path or
+# Git. Remember to move these dependencies to your gemspec before releasing
+# your gem to rubygems.org.
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
View
133 Gemfile.lock
@@ -0,0 +1,133 @@
+PATH
+ remote: .
+ specs:
+ strapon (0.0.1)
+ jquery-rails
+ rails (~> 3.2.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.0)
+ actionpack (= 3.2.0)
+ mail (~> 2.4.0)
+ actionpack (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.0)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.1)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.0)
+ activesupport (= 3.2.0)
+ builder (~> 3.0.0)
+ activerecord (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ arel (~> 3.0.0)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ activesupport (3.2.0)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.0)
+ builder (3.0.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.3.0)
+ ffi (~> 1.0.6)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ ffi (1.0.11)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.0)
+ jquery-rails (2.0.0)
+ railties (>= 3.2.0.beta, < 5.0)
+ thor (~> 0.14)
+ json (1.6.5)
+ mail (2.4.1)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.17.2)
+ multi_json (1.0.4)
+ nokogiri (1.5.0)
+ polyglot (0.3.3)
+ rack (1.4.0)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.0)
+ actionmailer (= 3.2.0)
+ actionpack (= 3.2.0)
+ activerecord (= 3.2.0)
+ activeresource (= 3.2.0)
+ activesupport (= 3.2.0)
+ bundler (~> 1.0)
+ railties (= 3.2.0)
+ railties (3.2.0)
+ actionpack (= 3.2.0)
+ activesupport (= 3.2.0)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
+ rspec-rails (2.8.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.8.0)
+ rubyzip (0.9.5)
+ selenium-webdriver (2.17.0)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0.9)
+ multi_json (~> 1.0.4)
+ rubyzip
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.5)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.31)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ jquery-rails
+ rspec-rails (~> 2.8)
+ sqlite3
+ strapon!
View
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright 2012 YOURNAME
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
3  README.rdoc
@@ -0,0 +1,3 @@
+= Strapon
+
+This project rocks and uses MIT-LICENSE.
View
38 Rakefile
@@ -0,0 +1,38 @@
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Strapon'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
+
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
+task :default => :spec
+
+
+#desc 'Copy gem file to private server'
+#task :publish => :build do
+ #version = Strapon::VERSION
+ #puts "Publishing version #{version} on private server"
+ #system "scp pkg/strapon-#{version}.gem gems.[url]:/usr/local/www/rubygems/gems/."
+#end
+
+Bundler::GemHelper.install_tasks
View
BIN  app/assets/images/glyphicons-halflings-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/glyphicons-halflings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  app/assets/images/ricco/.gitkeep
No changes.
View
BIN  app/assets/images/ricco/Airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Anchor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Bucket.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/CD case.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Clock Radio.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Cloud.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Comment Bubble.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Copy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Files Empty.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Files Full.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Film Print.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Gears 2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Gears.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Heart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Notes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Office Phone.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Paper folded.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Paper plane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Paperclip.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Present.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Ribbon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/ricco/Search.png
Diff not rendered
View
BIN  app/assets/images/ricco/Stats 1.png
Diff not rendered
View
BIN  app/assets/images/ricco/Stats Down.png
Diff not rendered
View
BIN  app/assets/images/ricco/Stats Up.png
Diff not rendered
View
BIN  app/assets/images/ricco/TV.png
Diff not rendered
View
BIN  app/assets/images/ricco/Views.png
Diff not rendered
View
BIN  app/assets/images/ricco/calender.png
Diff not rendered
View
BIN  app/assets/images/ricco/check.png
Diff not rendered
View
BIN  app/assets/images/ricco/comments.png
Diff not rendered
View
BIN  app/assets/images/ricco/cursor - mouse.png
Diff not rendered
View
BIN  app/assets/images/ricco/down.png
Diff not rendered
View
BIN  app/assets/images/ricco/external-link-grey-dark.png
Diff not rendered
View
BIN  app/assets/images/ricco/female.png
Diff not rendered
View
BIN  app/assets/images/ricco/formalize/button.png
Diff not rendered
View
BIN  app/assets/images/ricco/formalize/select_arrow.gif
Diff not rendered
View
BIN  app/assets/images/ricco/iPad.png
Diff not rendered
View
BIN  app/assets/images/ricco/iPod.png
Diff not rendered
View
BIN  app/assets/images/ricco/images.png
Diff not rendered
View
BIN  app/assets/images/ricco/left.png
Diff not rendered
View
BIN  app/assets/images/ricco/list view.png
Diff not rendered
View
BIN  app/assets/images/ricco/male.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/button-gloss.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/button-overlay.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/custom-form-sprites.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/input-bg-outset.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/input-bg.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/modal-gloss.png
Diff not rendered
View
BIN  app/assets/images/ricco/misc/table-sorter.png
Diff not rendered
View
BIN  app/assets/images/ricco/rails.png
Diff not rendered
View
BIN  app/assets/images/ricco/refresh.png
Diff not rendered
View
BIN  app/assets/images/ricco/right.png
Diff not rendered
View
BIN  app/assets/images/ricco/sprites/fancy_drop_down.png
Diff not rendered
View
BIN  app/assets/images/ricco/star.png
Diff not rendered
View
BIN  app/assets/images/ricco/stats 2.png
Diff not rendered
View
BIN  app/assets/images/ricco/tag 2.png
Diff not rendered
View
BIN  app/assets/images/ricco/tag.png
Diff not rendered
View
BIN  app/assets/images/ricco/up.png
Diff not rendered
View
94 app/assets/javascripts/bootstrap/bootstrap-alert.js
@@ -0,0 +1,94 @@
+/* ==========================================================
+ * bootstrap-alert.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function( $ ){
+
+ "use strict"
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function ( el ) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype = {
+
+ constructor: Alert
+
+ , close: function ( e ) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+ $parent.trigger('close')
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent
+ .trigger('close')
+ .removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.alert = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ })
+
+}( window.jQuery );
View
100 app/assets/javascripts/bootstrap/bootstrap-button.js
@@ -0,0 +1,100 @@
+/* ============================================================
+ * bootstrap-button.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+!function( $ ){
+
+ "use strict"
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
+
+ var Button = function ( element, options ) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
+ }
+
+ Button.prototype = {
+
+ constructor: Button
+
+ , setState: function ( state ) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
+
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
+
+ $el[val](data[state] || this.options[state])
+
+ // push to event loop to allow forms to submit
+ setTimeout(function () {
+ state == 'loadingText' ?
+ $el.addClass(d).attr(d, d) :
+ $el.removeClass(d).removeAttr(d)
+ }, 0)
+ }
+
+ , toggle: function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+
+ this.$element.toggleClass('active')
+ }
+
+ }
+
+
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
+
+ $.fn.button = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
+ }
+
+ $.fn.button.Constructor = Button
+
+
+ /* BUTTON DATA-API
+ * =============== */
+
+ $(function () {
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
+ })
+ })
+
+}( window.jQuery );
View
161 app/assets/javascripts/bootstrap/bootstrap-carousel.js
@@ -0,0 +1,161 @@
+/* ==========================================================
+ * bootstrap-carousel.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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"
+
+ /* CAROUSEL CLASS DEFINITION
+ * ========================= */
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.carousel.defaults, options)
+ this.options.slide && this.slide(this.options.slide)
+ 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)
+ 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 () {
+ 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
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+ if ($next.hasClass('active')) return
+
+ if (!$.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger('slide')
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger('slid')
+ } else {
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ this.$element.trigger('slide')
+ this.$element.one($.support.transition.end, function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
+ })
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
+
+ }
+
+
+ /* CAROUSEL PLUGIN DEFINITION
+ * ========================== */
+
+ $.fn.carousel = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('carousel')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
+ else data.cycle()
+ })
+ }
+
+ $.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 );
View
138 app/assets/javascripts/bootstrap/bootstrap-collapse.js
@@ -0,0 +1,138 @@
+/* =============================================================
+ * bootstrap-collapse.js v2.0.2
+ * 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"
+
+ 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 = this.dimension()
+ , scroll = $.camelCase(['scroll', dimension].join('-'))
+ , actives = this.$parent && this.$parent.find('.in')
+ , hasData
+
+ if (actives && actives.length) {
+ hasData = actives.data('collapse')
+ actives.collapse('hide')
+ hasData || actives.data('collapse', null)
+ }
+
+ this.$element[dimension](0)
+ this.transition('addClass', 'show', 'shown')
+ this.$element[dimension](this.$element[0][scroll])
+
+ }
+
+ , hide: function () {
+ var dimension = this.dimension()
+ this.reset(this.$element[dimension]())
+ this.transition('removeClass', 'hide', 'hidden')
+ this.$element[dimension](0)
+ }
+
+ , reset: function ( size ) {
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ [dimension](size || 'auto')
+ [0].offsetWidth
+
+ this.$element[size ? 'addClass' : 'removeClass']('collapse')
+
+ return this
+ }
+
+ , transition: function ( method, startEvent, completeEvent ) {
+ var that = this
+ , complete = function () {
+ if (startEvent == 'show') that.reset()
+ that.$element.trigger(completeEvent)
+ }
+
+ this.$element
+ .trigger(startEvent)
+ [method]('in')
+
+ $.support.transition && this.$element.hasClass('collapse') ?
+ this.$element.one($.support.transition.end, complete) :
+ complete()
+ }
+
+ , toggle: function () {
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
+ }
+
+ }
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
+ * ============================== */
+
+ $.fn.collapse = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('collapse')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.collapse.defaults = {
+ toggle: true
+ }
+
+ $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSIBLE DATA-API
+ * ==================== */
+
+ $(function () {
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $(target).collapse(option)
+ })
+ })
+
+}( window.jQuery );
View
92 app/assets/javascripts/bootstrap/bootstrap-dropdown.js
@@ -0,0 +1,92 @@
+/* ============================================================
+ * bootstrap-dropdown.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function( $ ){
+
+ "use strict"
+
+ /* DROPDOWN CLASS DEFINITION
+ * ========================= */
+
+ var toggle = '[data-toggle="dropdown"]'
+ , Dropdown = function ( element ) {
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
+ $('html').on('click.dropdown.data-api', function () {
+ $el.parent().removeClass('open')
+ })
+ }
+
+ Dropdown.prototype = {
+
+ constructor: Dropdown
+
+ , toggle: function ( e ) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+ , isActive
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+ $parent.length || ($parent = $this.parent())
+
+ isActive = $parent.hasClass('open')
+
+ clearMenus()
+ !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.data-api', toggle, Dropdown.prototype.toggle)
+ })
+
+}( window.jQuery );
View
210 app/assets/javascripts/bootstrap/bootstrap-modal.js
@@ -0,0 +1,210 @@
+/* =========================================================
+ * bootstrap-modal.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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"
+
+ /* 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
+
+ if (this.isShown) 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
+
+ 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()
+
+ if (!this.isShown) return
+
+ var that = this
+ this.isShown = false
+
+ $('body').removeClass('modal-open')
+
+ escape.call(this)
+
+ this.$element
+ .trigger('hide')
+ .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 );
View
95 app/assets/javascripts/bootstrap/bootstrap-popover.js
@@ -0,0 +1,95 @@
+/* ===========================================================
+ * bootstrap-popover.js v2.0.2
+ * 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"
+
+ 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')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
+ $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](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)
+
+ content = content.toString().replace(/(^\s*|\s*$)/, "")
+
+ 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 );
View
125 app/assets/javascripts/bootstrap/bootstrap-scrollspy.js
@@ -0,0 +1,125 @@
+/* =============================================================
+ * bootstrap-scrollspy.js v2.0.2
+ * 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"
+
+ /* 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').on('click.scroll.data-api', this.selector, process)
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.prototype = {
+
+ constructor: ScrollSpy
+
+ , refresh: function () {
+ this.targets = this.$body
+ .find(this.selector)
+ .map(function () {
+ var href = $(this).attr('href')
+ return /^#\w/.test(href) && $(href).length ? href : null
+ })
+
+ this.offsets = $.map(this.targets, function (id) {
+ return $(id).position().top
+ })
+ }
+
+ , process: function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , offsets = this.offsets
+ , targets = this.targets
+ , activeTarget = this.activeTarget
+ , 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
+
+ this.activeTarget = target
+
+ this.$body
+ .find(this.selector).parent('.active')
+ .removeClass('active')
+
+ active = this.$body
+ .find(this.selector + '[href="' + target + '"]')
+ .parent('li')
+ .addClass('active')
+
+ if ( active.parent('.dropdown-menu') ) {
+ active.closest('li.dropdown').addClass('active')
+ }
+ }
+
+ }
+
+
+ /* 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 );
View
130 app/assets/javascripts/bootstrap/bootstrap-tab.js
@@ -0,0 +1,130 @@
+/* ========================================================
+ * bootstrap-tab.js v2.0.2
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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"
+
+ /* 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
+
+ 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]
+
+ $this.trigger({
+ type: 'show'
+ , relatedTarget: previous
+ })
+
+ $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 );
View
270 app/assets/javascripts/bootstrap/bootstrap-tooltip.js
@@ -0,0 +1,270 @@
+/* ===========================================================
+ * bootstrap-tooltip.js v2.0.2
+ * 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"
+
+ /* 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) {
+ self.show()
+ } else {
+ self.hoverState = 'in'
+ 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 (!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)
+ }
+ }
+
+ , 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')
+ }
+ }
+
+ , setContent: function () {
+ var $tip = this.tip()
+ $tip.find('.tooltip-inner').html(this.getTitle())
+ $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
+ })
+ }
+