Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial Pedestal import

  • Loading branch information...
commit 4087cb19e499c11a70ee8c0338d6227b1cd69d63 0 parents
Pedestal Team authored

Showing 131 changed files with 28,170 additions and 0 deletions. Show diff stats Hide diff stats

  1. +11 0 .gitignore
  2. +39 0 chat/README.md
  3. +13 0 chat/chat-client/README.md
  4. +28 0 chat/chat-client/app/assets/fonts/mini50.dev.svg
  5. BIN  chat/chat-client/app/assets/fonts/mini50.eot
  6. +28 0 chat/chat-client/app/assets/fonts/mini50.svg
  7. BIN  chat/chat-client/app/assets/fonts/mini50.ttf
  8. BIN  chat/chat-client/app/assets/fonts/mini50.woff
  9. BIN  chat/chat-client/app/assets/images/background.png
  10. BIN  chat/chat-client/app/assets/images/favicon.ico
  11. +2,027 0 chat/chat-client/app/assets/javascripts/bootstrap.js
  12. +2 0  chat/chat-client/app/assets/javascripts/jquery-min.js
  13. +20 0 chat/chat-client/app/assets/javascripts/pedestal/js/api.js
  14. +288 0 chat/chat-client/app/assets/javascripts/xpath.js
  15. +5,774 0 chat/chat-client/app/assets/stylesheets/bootstrap.css
  16. +340 0 chat/chat-client/app/assets/stylesheets/chat-client-sample.css
  17. +77 0 chat/chat-client/app/assets/stylesheets/pedestal.css
  18. +170 0 chat/chat-client/app/src/chat_client/behavior.clj
  19. +5 0 chat/chat-client/app/src/chat_client/util.clj
  20. +21 0 chat/chat-client/app/src/chat_client/web/app.cljs
  21. +8 0 chat/chat-client/app/src/chat_client/web/html_templates.clj
  22. +97 0 chat/chat-client/app/src/chat_client/web/rendering.cljs
  23. +81 0 chat/chat-client/app/src/chat_client/web/services.cljs
  24. +35 0 chat/chat-client/app/src/chat_client/web/simulated/services.cljs
  25. +29 0 chat/chat-client/app/src/chat_client/web/simulated/start.cljs
  26. +45 0 chat/chat-client/app/templates/application.html
  27. +66 0 chat/chat-client/app/templates/chat-client/sample.html
  28. +98 0 chat/chat-client/app/templates/styleguide.html
  29. +45 0 chat/chat-client/app/templates/tooling.html
  30. +58 0 chat/chat-client/config/config.clj
  31. +50 0 chat/chat-client/config/logback.xml
  32. +116 0 chat/chat-client/config/user.clj
  33. +11 0 chat/chat-client/project.clj
  34. +26 0 chat/chat-client/tools/public/404.html
  35. +20 0 chat/chat-client/tools/public/design.html
  36. BIN  chat/chat-client/tools/public/favicon.ico
  37. +42 0 chat/chat-client/tools/public/index.html
  38. +2,027 0 chat/chat-client/tools/public/javascripts/bootstrap.js
  39. +2 0  chat/chat-client/tools/public/javascripts/jquery-min.js
  40. +20 0 chat/chat-client/tools/public/javascripts/pedestal/js/api.js
  41. +5,774 0 chat/chat-client/tools/public/stylesheets/bootstrap.css
  42. +58 0 chat/chat-client/tools/public/stylesheets/pedestal.css
  43. +2 0  chat/chat-server/.gitignore
  44. +11 0 chat/chat-server/README.md
  45. +52 0 chat/chat-server/config/logback.xml
  46. +27 0 chat/chat-server/dev/dev.clj
  47. +5 0 chat/chat-server/dev/user.clj
  48. +15 0 chat/chat-server/project.clj
  49. +34 0 chat/chat-server/src/chat_server/server.clj
  50. +108 0 chat/chat-server/src/chat_server/service.clj
  51. +13 0 chat/chat-server/test/chat_server/service_test.clj
  52. +2 0  cors/.gitignore
  53. +60 0 cors/NOTES.md
  54. +31 0 cors/README.md
  55. +52 0 cors/config/logback.xml
  56. +27 0 cors/dev/dev.clj
  57. +5 0 cors/dev/user.clj
  58. +15 0 cors/project.clj
  59. +13 0 cors/src/blob.html
  60. +34 0 cors/src/cors/server.clj
  61. +103 0 cors/src/cors/service.clj
  62. +86 0 cors/src/user.clj
  63. +9 0 cors/test/cors/service_test.clj
  64. +3 0  helloworld-ui/.gitignore
  65. +22 0 helloworld-ui/README.md
  66. +288 0 helloworld-ui/app/assets/javascripts/xpath.js
  67. +5 0 helloworld-ui/app/assets/stylesheets/helloworld-ui.css
  68. +17 0 helloworld-ui/app/src/greeting/app.cljs
  69. +40 0 helloworld-ui/app/src/greeting/behavior.clj
  70. +7 0 helloworld-ui/app/src/greeting/html_templates.clj
  71. +21 0 helloworld-ui/app/src/greeting/rendering.cljs
  72. +10 0 helloworld-ui/app/src/greeting/services.cljs
  73. +88 0 helloworld-ui/app/src/helloworld_ui/app.cljs
  74. +7 0 helloworld-ui/app/src/helloworld_ui/html_templates.clj
  75. +46 0 helloworld-ui/app/templates/application.html
  76. +13 0 helloworld-ui/app/templates/greeting.html
  77. +34 0 helloworld-ui/app/templates/helloworld-ui.html
  78. +42 0 helloworld-ui/config/config.clj
  79. +50 0 helloworld-ui/config/logback.xml
  80. +116 0 helloworld-ui/config/user.clj
  81. +11 0 helloworld-ui/project.clj
  82. +26 0 helloworld-ui/tools/public/404.html
  83. +16 0 helloworld-ui/tools/public/design.html
  84. BIN  helloworld-ui/tools/public/favicon.ico
  85. +42 0 helloworld-ui/tools/public/index.html
  86. +2,027 0 helloworld-ui/tools/public/javascripts/bootstrap.js
  87. +2 0  helloworld-ui/tools/public/javascripts/jquery-min.js
  88. +20 0 helloworld-ui/tools/public/javascripts/pedestal/js/api.js
  89. +5,774 0 helloworld-ui/tools/public/stylesheets/bootstrap.css
  90. +58 0 helloworld-ui/tools/public/stylesheets/pedestal.css
  91. BIN  images/Feeder_Behavior_Renderer_model.png
  92. BIN  images/development.png
  93. BIN  images/development_double_counter.png
  94. BIN  images/development_in_the_menu.png
  95. BIN  images/front_page.png
  96. BIN  images/javascript_console.png
  97. BIN  images/menu_on_the_lower_right.png
  98. +2 0  ring-middleware/.gitignore
  99. +38 0 ring-middleware/README.md
  100. +52 0 ring-middleware/config/logback.xml
  101. +27 0 ring-middleware/dev/dev.clj
  102. +15 0 ring-middleware/project.clj
  103. +15 0 ring-middleware/src/hello-form.html
  104. +34 0 ring-middleware/src/ring_middleware/server.clj
  105. +94 0 ring-middleware/src/ring_middleware/service.clj
  106. +13 0 ring-middleware/test/ring_middleware/service_test.clj
  107. +2 0  server-with-links/.gitignore
  108. +9 0 server-with-links/README.md
  109. +52 0 server-with-links/config/logback.xml
  110. +27 0 server-with-links/dev/dev.clj
  111. +15 0 server-with-links/project.clj
  112. +34 0 server-with-links/src/server_with_links/server.clj
  113. +47 0 server-with-links/src/server_with_links/service.clj
  114. +13 0 server-with-links/test/server_with_links/service_test.clj
  115. +21 0 square-root/README.md
  116. +5 0 square-root/project.clj
  117. +50 0 square-root/src/logback.xml
  118. +119 0 square-root/src/pedestal/app/examples/square_root.clj
  119. +121 0 square-root/src/square_root.clj
  120. +2 0  template-server/.gitignore
  121. +24 0 template-server/README.md
  122. +52 0 template-server/config/logback.xml
  123. +27 0 template-server/dev/dev.clj
  124. +5 0 template-server/dev/user.clj
  125. +20 0 template-server/project.clj
  126. +6 0 template-server/resources/public/comb.html
  127. +12 0 template-server/resources/public/enlive-template.html
  128. +10 0 template-server/resources/public/mustache-template.html
  129. +34 0 template-server/src/template_server/server.clj
  130. +113 0 template-server/src/template_server/service.clj
  131. +20 0 template-server/test/template_server/service_test.clj
11 .gitignore
... ... @@ -0,0 +1,11 @@
  1 +pom.xml
  2 +target/
  3 +.lein-deps-sum
  4 +.lein-failures
  5 +.lein-repl-history
  6 +.DS_Store
  7 +*~
  8 +out/
  9 +tmp/
  10 +logs/
  11 +generated-js/
39 chat/README.md
Source Rendered
... ... @@ -0,0 +1,39 @@
  1 +# Chat Sample
  2 +
  3 +This is a chat sample, which demonstrates the use of Pedestal with...
  4 +
  5 +- Server-Sent Events (SSE)
  6 +- Cookies
  7 +- Routing
  8 +- Interceptors
  9 +
  10 +Prerequisite: all Pedestal libraries, both server and client, must be installed.
  11 +
  12 +To run from the `chat` directory...
  13 +
  14 +```
  15 +cd chat-client
  16 +lein repl
  17 +(watch :development)
  18 +```
  19 +Open another terminal, then:
  20 +
  21 +```
  22 +cd chat-server
  23 +
  24 +mkdir resources
  25 +cd resources
  26 +
  27 +ln -s ../../chat-client/out/public
  28 +cd ..
  29 +
  30 +lein repl
  31 +(require 'dev)
  32 +(dev/start) # Launch webserver on port 8080.
  33 +```
  34 +
  35 +In a browser, navigate to http://localhost:8080/chat-client-dev.html where you will see the chat client interface.
  36 +
  37 +Use the interface to send a chat message, which you will see echoed to your local screen.
  38 +
  39 +If you play with a friend, you will both see each other's messages.
13 chat/chat-client/README.md
Source Rendered
... ... @@ -0,0 +1,13 @@
  1 +## Getting Started
  2 +
  3 +See ../README.md
  4 +
  5 +## Configuration
  6 +
  7 +To configure logging see config/logback.xml. By default, the app logs to stdout and /tmp/.
  8 +To learn more about configuring Logback, read its [documentation](http://logback.qos.ch/documentation.html).
  9 +
  10 +## Links
  11 +
  12 +* [Getting Started](https://github.com/relevance/platform/tree/master/client#usage)
  13 +* [Overview of how pedestal-client applications work](https://github.com/relevance/platform/wiki/Client-Application-Model)
28 chat/chat-client/app/assets/fonts/mini50.dev.svg
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" standalone="no"?>
  2 +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
  3 +<svg xmlns="http://www.w3.org/2000/svg">
  4 +<metadata>
  5 +This is a custom SVG font generated by IcoMoon.
  6 +<iconset grid="16"></iconset>
  7 +</metadata>
  8 +<defs>
  9 +<font id="mini50" horiz-adv-x="512" >
  10 +<font-face units-per-em="512" ascent="480" descent="-32" />
  11 +<missing-glyph horiz-adv-x="512" />
  12 +<glyph unicode="&#xe000;" d="M 512.00,272.00C 512.00,386.88, 418.88,480.00, 304.00,480.00l-96.00,0.00 C 93.12,480.00,0.00,386.88,0.00,272.00S 93.12,64.00, 208.00,64.00l 64.00,0.00 l 144.00-96.00l0.00,128.00
  13 + l-1.504,0.00 C 472.992,132.80, 512.00,197.792, 512.00,272.00z M 352.00,136.80L 352.00,128.00 l0.00-48.00 L 272.00,128.00l-64.00,0.00 C 128.48,128.00, 64.00,192.48, 64.00,272.00S 128.48,416.00, 208.00,416.00l 96.00,0.00
  14 + C 383.52,416.00, 448.00,351.52, 448.00,272.00C 448.00,209.376, 407.808,156.672, 352.00,136.80z" data-tags="comment, chat, bubble, talk" />
  15 +<glyph unicode="&#xe001;" d="M 359.328,213.056C 374.688,234.144, 384.00,259.904, 384.00,288.00L 384.00,352.00 c0.00,70.688-57.312,128.00-128.00,128.00S 128.00,422.688, 128.00,352.00l0.00-64.00 c0.00-28.096, 9.312-53.856, 24.672-74.944
  16 + C 62.784,193.184,0.00,148.288,0.00,96.00l0.00-64.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 384.00,0.00 c 35.328,0.00, 64.00,28.672, 64.00,64.00l0.00,64.00 C 512.00,148.288, 449.216,193.184, 359.328,213.056z M 192.00,352.00
  17 + c0.00,35.328, 28.672,64.00, 64.00,64.00c 35.328,0.00, 64.00-28.672, 64.00-64.00l0.00-64.00 c0.00-35.328-28.672-64.00-64.00-64.00C 220.672,224.00, 192.00,252.672, 192.00,288.00L 192.00,352.00 z M 448.00,32.00L 64.00,32.00 l0.00,64.00 c0.00,35.328, 85.984,64.00, 192.00,64.00
  18 + c 105.984,0.00, 192.00-28.672, 192.00-64.00L 448.00,32.00 z" data-tags="user, profile, persona" />
  19 +<glyph unicode="&#xe002;" d="M 467.808,124.576c-21.76,13.088-49.952,23.424-82.56,29.376C 404.064,171.456, 416.00,196.256, 416.00,224.00
  20 + L 416.00,256.00 c0.00,53.024-43.008,96.00-96.00,96.00C 308.48,352.00, 297.60,349.632, 287.328,345.92C 287.456,347.968, 288.00,349.92, 288.00,352.00L 288.00,384.00 c0.00,53.024-43.008,96.00-96.00,96.00C 138.976,480.00, 96.00,437.024, 96.00,384.00l0.00-32.00
  21 + c0.00-27.744, 11.968-52.544, 30.752-70.048C 94.112,276.00, 65.92,265.664, 44.192,252.576C 18.624,244.192,0.00,220.384,0.00,192.00l0.00-32.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 73.472,0.00
  22 + C 131.84,86.528, 128.00,75.84, 128.00,64.00l0.00-32.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 256.00,0.00 c 35.328,0.00, 64.00,28.672, 64.00,64.00l0.00,32.00 C 512.00,92.384, 493.376,116.192, 467.808,124.576z M 288.00,256.00
  23 + c0.00,17.664, 14.304,32.00, 32.00,32.00s 32.00-14.336, 32.00-32.00l0.00-64.00 c0.00-17.696-14.304-32.00-32.00-32.00S 288.00,174.304, 288.00,192.00L 288.00,256.00 z M 160.00,384.00c0.00,17.664, 14.336,32.00, 32.00,32.00s 32.00-14.336, 32.00-32.00l0.00-64.00
  24 + c0.00-17.664-14.336-32.00-32.00-32.00S 160.00,302.336, 160.00,320.00L 160.00,384.00 z M 64.00,160.00c0.00,0.00, 8.992,64.00, 128.00,64.00c 11.904,0.00, 22.40-0.768, 32.192-1.952C 224.704,198.016, 234.336,176.576, 249.408,160.00L 64.00,160.00 z
  25 + M 192.00,32.00c0.00,0.00, 8.992,64.00, 128.00,64.00s 128.00-64.00, 128.00-64.00L 192.00,32.00 z" data-tags="users, team, group, people" />
  26 +<glyph unicode="&#x20;" horiz-adv-x="256" />
  27 +<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
  28 +</font></defs></svg>
BIN  chat/chat-client/app/assets/fonts/mini50.eot
Binary file not shown
28 chat/chat-client/app/assets/fonts/mini50.svg
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" standalone="no"?>
  2 +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
  3 +<svg xmlns="http://www.w3.org/2000/svg">
  4 +<metadata>
  5 +This is a custom SVG font generated by IcoMoon.
  6 +<iconset grid="16"></iconset>
  7 +</metadata>
  8 +<defs>
  9 +<font id="mini50" horiz-adv-x="512" >
  10 +<font-face units-per-em="512" ascent="480" descent="-32" />
  11 +<missing-glyph horiz-adv-x="512" />
  12 +<glyph unicode="&#xe000;" d="M 512.00,272.00C 512.00,386.88, 418.88,480.00, 304.00,480.00l-96.00,0.00 C 93.12,480.00,0.00,386.88,0.00,272.00S 93.12,64.00, 208.00,64.00l 64.00,0.00 l 144.00-96.00l0.00,128.00
  13 + l-1.504,0.00 C 472.992,132.80, 512.00,197.792, 512.00,272.00z M 352.00,136.80L 352.00,128.00 l0.00-48.00 L 272.00,128.00l-64.00,0.00 C 128.48,128.00, 64.00,192.48, 64.00,272.00S 128.48,416.00, 208.00,416.00l 96.00,0.00
  14 + C 383.52,416.00, 448.00,351.52, 448.00,272.00C 448.00,209.376, 407.808,156.672, 352.00,136.80z" />
  15 +<glyph unicode="&#xe001;" d="M 359.328,213.056C 374.688,234.144, 384.00,259.904, 384.00,288.00L 384.00,352.00 c0.00,70.688-57.312,128.00-128.00,128.00S 128.00,422.688, 128.00,352.00l0.00-64.00 c0.00-28.096, 9.312-53.856, 24.672-74.944
  16 + C 62.784,193.184,0.00,148.288,0.00,96.00l0.00-64.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 384.00,0.00 c 35.328,0.00, 64.00,28.672, 64.00,64.00l0.00,64.00 C 512.00,148.288, 449.216,193.184, 359.328,213.056z M 192.00,352.00
  17 + c0.00,35.328, 28.672,64.00, 64.00,64.00c 35.328,0.00, 64.00-28.672, 64.00-64.00l0.00-64.00 c0.00-35.328-28.672-64.00-64.00-64.00C 220.672,224.00, 192.00,252.672, 192.00,288.00L 192.00,352.00 z M 448.00,32.00L 64.00,32.00 l0.00,64.00 c0.00,35.328, 85.984,64.00, 192.00,64.00
  18 + c 105.984,0.00, 192.00-28.672, 192.00-64.00L 448.00,32.00 z" />
  19 +<glyph unicode="&#xe002;" d="M 467.808,124.576c-21.76,13.088-49.952,23.424-82.56,29.376C 404.064,171.456, 416.00,196.256, 416.00,224.00
  20 + L 416.00,256.00 c0.00,53.024-43.008,96.00-96.00,96.00C 308.48,352.00, 297.60,349.632, 287.328,345.92C 287.456,347.968, 288.00,349.92, 288.00,352.00L 288.00,384.00 c0.00,53.024-43.008,96.00-96.00,96.00C 138.976,480.00, 96.00,437.024, 96.00,384.00l0.00-32.00
  21 + c0.00-27.744, 11.968-52.544, 30.752-70.048C 94.112,276.00, 65.92,265.664, 44.192,252.576C 18.624,244.192,0.00,220.384,0.00,192.00l0.00-32.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 73.472,0.00
  22 + C 131.84,86.528, 128.00,75.84, 128.00,64.00l0.00-32.00 c0.00-35.328, 28.672-64.00, 64.00-64.00l 256.00,0.00 c 35.328,0.00, 64.00,28.672, 64.00,64.00l0.00,32.00 C 512.00,92.384, 493.376,116.192, 467.808,124.576z M 288.00,256.00
  23 + c0.00,17.664, 14.304,32.00, 32.00,32.00s 32.00-14.336, 32.00-32.00l0.00-64.00 c0.00-17.696-14.304-32.00-32.00-32.00S 288.00,174.304, 288.00,192.00L 288.00,256.00 z M 160.00,384.00c0.00,17.664, 14.336,32.00, 32.00,32.00s 32.00-14.336, 32.00-32.00l0.00-64.00
  24 + c0.00-17.664-14.336-32.00-32.00-32.00S 160.00,302.336, 160.00,320.00L 160.00,384.00 z M 64.00,160.00c0.00,0.00, 8.992,64.00, 128.00,64.00c 11.904,0.00, 22.40-0.768, 32.192-1.952C 224.704,198.016, 234.336,176.576, 249.408,160.00L 64.00,160.00 z
  25 + M 192.00,32.00c0.00,0.00, 8.992,64.00, 128.00,64.00s 128.00-64.00, 128.00-64.00L 192.00,32.00 z" />
  26 +<glyph unicode="&#x20;" horiz-adv-x="256" />
  27 +<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
  28 +</font></defs></svg>
BIN  chat/chat-client/app/assets/fonts/mini50.ttf
Binary file not shown
BIN  chat/chat-client/app/assets/fonts/mini50.woff
Binary file not shown
BIN  chat/chat-client/app/assets/images/background.png
BIN  chat/chat-client/app/assets/images/favicon.ico
Binary file not shown
2,027 chat/chat-client/app/assets/javascripts/bootstrap.js
... ... @@ -0,0 +1,2027 @@
  1 +/* ===================================================
  2 + * bootstrap-transition.js v2.1.1
  3 + * http://twitter.github.com/bootstrap/javascript.html#transitions
  4 + * ===================================================
  5 + * Copyright 2012 Twitter, Inc.
  6 + *
  7 + * Licensed under the Apache License, Version 2.0 (the "License");
  8 + * you may not use this file except in compliance with the License.
  9 + * You may obtain a copy of the License at
  10 + *
  11 + * http://www.apache.org/licenses/LICENSE-2.0
  12 + *
  13 + * Unless required by applicable law or agreed to in writing, software
  14 + * distributed under the License is distributed on an "AS IS" BASIS,
  15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 + * See the License for the specific language governing permissions and
  17 + * limitations under the License.
  18 + * ========================================================== */
  19 +
  20 +
  21 +!function ($) {
  22 +
  23 + $(function () {
  24 +
  25 + "use strict"; // jshint ;_;
  26 +
  27 +
  28 + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
  29 + * ======================================================= */
  30 +
  31 + $.support.transition = (function () {
  32 +
  33 + var transitionEnd = (function () {
  34 +
  35 + var el = document.createElement('bootstrap')
  36 + , transEndEventNames = {
  37 + 'WebkitTransition' : 'webkitTransitionEnd'
  38 + , 'MozTransition' : 'transitionend'
  39 + , 'OTransition' : 'oTransitionEnd otransitionend'
  40 + , 'transition' : 'transitionend'
  41 + }
  42 + , name
  43 +
  44 + for (name in transEndEventNames){
  45 + if (el.style[name] !== undefined) {
  46 + return transEndEventNames[name]
  47 + }
  48 + }
  49 +
  50 + }())
  51 +
  52 + return transitionEnd && {
  53 + end: transitionEnd
  54 + }
  55 +
  56 + })()
  57 +
  58 + })
  59 +
  60 +}(window.jQuery);/* ==========================================================
  61 + * bootstrap-alert.js v2.1.1
  62 + * http://twitter.github.com/bootstrap/javascript.html#alerts
  63 + * ==========================================================
  64 + * Copyright 2012 Twitter, Inc.
  65 + *
  66 + * Licensed under the Apache License, Version 2.0 (the "License");
  67 + * you may not use this file except in compliance with the License.
  68 + * You may obtain a copy of the License at
  69 + *
  70 + * http://www.apache.org/licenses/LICENSE-2.0
  71 + *
  72 + * Unless required by applicable law or agreed to in writing, software
  73 + * distributed under the License is distributed on an "AS IS" BASIS,
  74 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  75 + * See the License for the specific language governing permissions and
  76 + * limitations under the License.
  77 + * ========================================================== */
  78 +
  79 +
  80 +!function ($) {
  81 +
  82 + "use strict"; // jshint ;_;
  83 +
  84 +
  85 + /* ALERT CLASS DEFINITION
  86 + * ====================== */
  87 +
  88 + var dismiss = '[data-dismiss="alert"]'
  89 + , Alert = function (el) {
  90 + $(el).on('click', dismiss, this.close)
  91 + }
  92 +
  93 + Alert.prototype.close = function (e) {
  94 + var $this = $(this)
  95 + , selector = $this.attr('data-target')
  96 + , $parent
  97 +
  98 + if (!selector) {
  99 + selector = $this.attr('href')
  100 + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  101 + }
  102 +
  103 + $parent = $(selector)
  104 +
  105 + e && e.preventDefault()
  106 +
  107 + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  108 +
  109 + $parent.trigger(e = $.Event('close'))
  110 +
  111 + if (e.isDefaultPrevented()) return
  112 +
  113 + $parent.removeClass('in')
  114 +
  115 + function removeElement() {
  116 + $parent
  117 + .trigger('closed')
  118 + .remove()
  119 + }
  120 +
  121 + $.support.transition && $parent.hasClass('fade') ?
  122 + $parent.on($.support.transition.end, removeElement) :
  123 + removeElement()
  124 + }
  125 +
  126 +
  127 + /* ALERT PLUGIN DEFINITION
  128 + * ======================= */
  129 +
  130 + $.fn.alert = function (option) {
  131 + return this.each(function () {
  132 + var $this = $(this)
  133 + , data = $this.data('alert')
  134 + if (!data) $this.data('alert', (data = new Alert(this)))
  135 + if (typeof option == 'string') data[option].call($this)
  136 + })
  137 + }
  138 +
  139 + $.fn.alert.Constructor = Alert
  140 +
  141 +
  142 + /* ALERT DATA-API
  143 + * ============== */
  144 +
  145 + $(function () {
  146 + $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
  147 + })
  148 +
  149 +}(window.jQuery);/* ============================================================
  150 + * bootstrap-button.js v2.1.1
  151 + * http://twitter.github.com/bootstrap/javascript.html#buttons
  152 + * ============================================================
  153 + * Copyright 2012 Twitter, Inc.
  154 + *
  155 + * Licensed under the Apache License, Version 2.0 (the "License");
  156 + * you may not use this file except in compliance with the License.
  157 + * You may obtain a copy of the License at
  158 + *
  159 + * http://www.apache.org/licenses/LICENSE-2.0
  160 + *
  161 + * Unless required by applicable law or agreed to in writing, software
  162 + * distributed under the License is distributed on an "AS IS" BASIS,
  163 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  164 + * See the License for the specific language governing permissions and
  165 + * limitations under the License.
  166 + * ============================================================ */
  167 +
  168 +
  169 +!function ($) {
  170 +
  171 + "use strict"; // jshint ;_;
  172 +
  173 +
  174 + /* BUTTON PUBLIC CLASS DEFINITION
  175 + * ============================== */
  176 +
  177 + var Button = function (element, options) {
  178 + this.$element = $(element)
  179 + this.options = $.extend({}, $.fn.button.defaults, options)
  180 + }
  181 +
  182 + Button.prototype.setState = function (state) {
  183 + var d = 'disabled'
  184 + , $el = this.$element
  185 + , data = $el.data()
  186 + , val = $el.is('input') ? 'val' : 'html'
  187 +
  188 + state = state + 'Text'
  189 + data.resetText || $el.data('resetText', $el[val]())
  190 +
  191 + $el[val](data[state] || this.options[state])
  192 +
  193 + // push to event loop to allow forms to submit
  194 + setTimeout(function () {
  195 + state == 'loadingText' ?
  196 + $el.addClass(d).attr(d, d) :
  197 + $el.removeClass(d).removeAttr(d)
  198 + }, 0)
  199 + }
  200 +
  201 + Button.prototype.toggle = function () {
  202 + var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
  203 +
  204 + $parent && $parent
  205 + .find('.active')
  206 + .removeClass('active')
  207 +
  208 + this.$element.toggleClass('active')
  209 + }
  210 +
  211 +
  212 + /* BUTTON PLUGIN DEFINITION
  213 + * ======================== */
  214 +
  215 + $.fn.button = function (option) {
  216 + return this.each(function () {
  217 + var $this = $(this)
  218 + , data = $this.data('button')
  219 + , options = typeof option == 'object' && option
  220 + if (!data) $this.data('button', (data = new Button(this, options)))
  221 + if (option == 'toggle') data.toggle()
  222 + else if (option) data.setState(option)
  223 + })
  224 + }
  225 +
  226 + $.fn.button.defaults = {
  227 + loadingText: 'loading...'
  228 + }
  229 +
  230 + $.fn.button.Constructor = Button
  231 +
  232 +
  233 + /* BUTTON DATA-API
  234 + * =============== */
  235 +
  236 + $(function () {
  237 + $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
  238 + var $btn = $(e.target)
  239 + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  240 + $btn.button('toggle')
  241 + })
  242 + })
  243 +
  244 +}(window.jQuery);/* ==========================================================
  245 + * bootstrap-carousel.js v2.1.1
  246 + * http://twitter.github.com/bootstrap/javascript.html#carousel
  247 + * ==========================================================
  248 + * Copyright 2012 Twitter, Inc.
  249 + *
  250 + * Licensed under the Apache License, Version 2.0 (the "License");
  251 + * you may not use this file except in compliance with the License.
  252 + * You may obtain a copy of the License at
  253 + *
  254 + * http://www.apache.org/licenses/LICENSE-2.0
  255 + *
  256 + * Unless required by applicable law or agreed to in writing, software
  257 + * distributed under the License is distributed on an "AS IS" BASIS,
  258 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  259 + * See the License for the specific language governing permissions and
  260 + * limitations under the License.
  261 + * ========================================================== */
  262 +
  263 +
  264 +!function ($) {
  265 +
  266 + "use strict"; // jshint ;_;
  267 +
  268 +
  269 + /* CAROUSEL CLASS DEFINITION
  270 + * ========================= */
  271 +
  272 + var Carousel = function (element, options) {
  273 + this.$element = $(element)
  274 + this.options = options
  275 + this.options.slide && this.slide(this.options.slide)
  276 + this.options.pause == 'hover' && this.$element
  277 + .on('mouseenter', $.proxy(this.pause, this))
  278 + .on('mouseleave', $.proxy(this.cycle, this))
  279 + }
  280 +
  281 + Carousel.prototype = {
  282 +
  283 + cycle: function (e) {
  284 + if (!e) this.paused = false
  285 + this.options.interval
  286 + && !this.paused
  287 + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  288 + return this
  289 + }
  290 +
  291 + , to: function (pos) {
  292 + var $active = this.$element.find('.item.active')
  293 + , children = $active.parent().children()
  294 + , activePos = children.index($active)
  295 + , that = this
  296 +
  297 + if (pos > (children.length - 1) || pos < 0) return
  298 +
  299 + if (this.sliding) {
  300 + return this.$element.one('slid', function () {
  301 + that.to(pos)
  302 + })
  303 + }
  304 +
  305 + if (activePos == pos) {
  306 + return this.pause().cycle()
  307 + }
  308 +
  309 + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
  310 + }
  311 +
  312 + , pause: function (e) {
  313 + if (!e) this.paused = true
  314 + if (this.$element.find('.next, .prev').length && $.support.transition.end) {
  315 + this.$element.trigger($.support.transition.end)
  316 + this.cycle()
  317 + }
  318 + clearInterval(this.interval)
  319 + this.interval = null
  320 + return this
  321 + }
  322 +
  323 + , next: function () {
  324 + if (this.sliding) return
  325 + return this.slide('next')
  326 + }
  327 +
  328 + , prev: function () {
  329 + if (this.sliding) return
  330 + return this.slide('prev')
  331 + }
  332 +
  333 + , slide: function (type, next) {
  334 + var $active = this.$element.find('.item.active')
  335 + , $next = next || $active[type]()
  336 + , isCycling = this.interval
  337 + , direction = type == 'next' ? 'left' : 'right'
  338 + , fallback = type == 'next' ? 'first' : 'last'
  339 + , that = this
  340 + , e = $.Event('slide', {
  341 + relatedTarget: $next[0]
  342 + })
  343 +
  344 + this.sliding = true
  345 +
  346 + isCycling && this.pause()
  347 +
  348 + $next = $next.length ? $next : this.$element.find('.item')[fallback]()
  349 +
  350 + if ($next.hasClass('active')) return
  351 +
  352 + if ($.support.transition && this.$element.hasClass('slide')) {
  353 + this.$element.trigger(e)
  354 + if (e.isDefaultPrevented()) return
  355 + $next.addClass(type)
  356 + $next[0].offsetWidth // force reflow
  357 + $active.addClass(direction)
  358 + $next.addClass(direction)
  359 + this.$element.one($.support.transition.end, function () {
  360 + $next.removeClass([type, direction].join(' ')).addClass('active')
  361 + $active.removeClass(['active', direction].join(' '))
  362 + that.sliding = false
  363 + setTimeout(function () { that.$element.trigger('slid') }, 0)
  364 + })
  365 + } else {
  366 + this.$element.trigger(e)
  367 + if (e.isDefaultPrevented()) return
  368 + $active.removeClass('active')
  369 + $next.addClass('active')
  370 + this.sliding = false
  371 + this.$element.trigger('slid')
  372 + }
  373 +
  374 + isCycling && this.cycle()
  375 +
  376 + return this
  377 + }
  378 +
  379 + }
  380 +
  381 +
  382 + /* CAROUSEL PLUGIN DEFINITION
  383 + * ========================== */
  384 +
  385 + $.fn.carousel = function (option) {
  386 + return this.each(function () {
  387 + var $this = $(this)
  388 + , data = $this.data('carousel')
  389 + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
  390 + , action = typeof option == 'string' ? option : options.slide
  391 + if (!data) $this.data('carousel', (data = new Carousel(this, options)))
  392 + if (typeof option == 'number') data.to(option)
  393 + else if (action) data[action]()
  394 + else if (options.interval) data.cycle()
  395 + })
  396 + }
  397 +
  398 + $.fn.carousel.defaults = {
  399 + interval: 5000
  400 + , pause: 'hover'
  401 + }
  402 +
  403 + $.fn.carousel.Constructor = Carousel
  404 +
  405 +
  406 + /* CAROUSEL DATA-API
  407 + * ================= */
  408 +
  409 + $(function () {
  410 + $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
  411 + var $this = $(this), href
  412 + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  413 + , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
  414 + $target.carousel(options)
  415 + e.preventDefault()
  416 + })
  417 + })
  418 +
  419 +}(window.jQuery);/* =============================================================
  420 + * bootstrap-collapse.js v2.1.1
  421 + * http://twitter.github.com/bootstrap/javascript.html#collapse
  422 + * =============================================================
  423 + * Copyright 2012 Twitter, Inc.
  424 + *
  425 + * Licensed under the Apache License, Version 2.0 (the "License");
  426 + * you may not use this file except in compliance with the License.
  427 + * You may obtain a copy of the License at
  428 + *
  429 + * http://www.apache.org/licenses/LICENSE-2.0
  430 + *
  431 + * Unless required by applicable law or agreed to in writing, software
  432 + * distributed under the License is distributed on an "AS IS" BASIS,
  433 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  434 + * See the License for the specific language governing permissions and
  435 + * limitations under the License.
  436 + * ============================================================ */
  437 +
  438 +
  439 +!function ($) {
  440 +
  441 + "use strict"; // jshint ;_;
  442 +
  443 +
  444 + /* COLLAPSE PUBLIC CLASS DEFINITION
  445 + * ================================ */
  446 +
  447 + var Collapse = function (element, options) {
  448 + this.$element = $(element)
  449 + this.options = $.extend({}, $.fn.collapse.defaults, options)
  450 +
  451 + if (this.options.parent) {
  452 + this.$parent = $(this.options.parent)
  453 + }
  454 +
  455 + this.options.toggle && this.toggle()
  456 + }
  457 +
  458 + Collapse.prototype = {
  459 +
  460 + constructor: Collapse
  461 +
  462 + , dimension: function () {
  463 + var hasWidth = this.$element.hasClass('width')
  464 + return hasWidth ? 'width' : 'height'
  465 + }
  466 +
  467 + , show: function () {
  468 + var dimension
  469 + , scroll
  470 + , actives
  471 + , hasData
  472 +
  473 + if (this.transitioning) return
  474 +
  475 + dimension = this.dimension()
  476 + scroll = $.camelCase(['scroll', dimension].join('-'))
  477 + actives = this.$parent && this.$parent.find('> .accordion-group > .in')
  478 +
  479 + if (actives && actives.length) {
  480 + hasData = actives.data('collapse')
  481 + if (hasData && hasData.transitioning) return
  482 + actives.collapse('hide')
  483 + hasData || actives.data('collapse', null)
  484 + }
  485 +
  486 + this.$element[dimension](0)
  487 + this.transition('addClass', $.Event('show'), 'shown')
  488 + $.support.transition && this.$element[dimension](this.$element[0][scroll])
  489 + }
  490 +
  491 + , hide: function () {
  492 + var dimension
  493 + if (this.transitioning) return
  494 + dimension = this.dimension()
  495 + this.reset(this.$element[dimension]())
  496 + this.transition('removeClass', $.Event('hide'), 'hidden')
  497 + this.$element[dimension](0)
  498 + }
  499 +
  500 + , reset: function (size) {
  501 + var dimension = this.dimension()
  502 +
  503 + this.$element
  504 + .removeClass('collapse')
  505 + [dimension](size || 'auto')
  506 + [0].offsetWidth
  507 +
  508 + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
  509 +
  510 + return this
  511 + }
  512 +
  513 + , transition: function (method, startEvent, completeEvent) {
  514 + var that = this
  515 + , complete = function () {
  516 + if (startEvent.type == 'show') that.reset()
  517 + that.transitioning = 0
  518 + that.$element.trigger(completeEvent)
  519 + }
  520 +
  521 + this.$element.trigger(startEvent)
  522 +
  523 + if (startEvent.isDefaultPrevented()) return
  524 +
  525 + this.transitioning = 1
  526 +
  527 + this.$element[method]('in')
  528 +
  529 + $.support.transition && this.$element.hasClass('collapse') ?
  530 + this.$element.one($.support.transition.end, complete) :
  531 + complete()
  532 + }
  533 +
  534 + , toggle: function () {
  535 + this[this.$element.hasClass('in') ? 'hide' : 'show']()
  536 + }
  537 +
  538 + }
  539 +
  540 +
  541 + /* COLLAPSIBLE PLUGIN DEFINITION
  542 + * ============================== */
  543 +
  544 + $.fn.collapse = function (option) {
  545 + return this.each(function () {
  546 + var $this = $(this)
  547 + , data = $this.data('collapse')
  548 + , options = typeof option == 'object' && option
  549 + if (!data) $this.data('collapse', (data = new Collapse(this, options)))
  550 + if (typeof option == 'string') data[option]()
  551 + })
  552 + }
  553 +
  554 + $.fn.collapse.defaults = {
  555 + toggle: true
  556 + }
  557 +
  558 + $.fn.collapse.Constructor = Collapse
  559 +
  560 +
  561 + /* COLLAPSIBLE DATA-API
  562 + * ==================== */
  563 +
  564 + $(function () {
  565 + $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
  566 + var $this = $(this), href
  567 + , target = $this.attr('data-target')
  568 + || e.preventDefault()
  569 + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
  570 + , option = $(target).data('collapse') ? 'toggle' : $this.data()
  571 + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
  572 + $(target).collapse(option)
  573 + })
  574 + })
  575 +
  576 +}(window.jQuery);/* ============================================================
  577 + * bootstrap-dropdown.js v2.1.1
  578 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns
  579 + * ============================================================
  580 + * Copyright 2012 Twitter, Inc.
  581 + *
  582 + * Licensed under the Apache License, Version 2.0 (the "License");
  583 + * you may not use this file except in compliance with the License.
  584 + * You may obtain a copy of the License at
  585 + *
  586 + * http://www.apache.org/licenses/LICENSE-2.0
  587 + *
  588 + * Unless required by applicable law or agreed to in writing, software
  589 + * distributed under the License is distributed on an "AS IS" BASIS,
  590 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  591 + * See the License for the specific language governing permissions and
  592 + * limitations under the License.
  593 + * ============================================================ */
  594 +
  595 +
  596 +!function ($) {
  597 +
  598 + "use strict"; // jshint ;_;
  599 +
  600 +
  601 + /* DROPDOWN CLASS DEFINITION
  602 + * ========================= */
  603 +
  604 + var toggle = '[data-toggle=dropdown]'
  605 + , Dropdown = function (element) {
  606 + var $el = $(element).on('click.dropdown.data-api', this.toggle)
  607 + $('html').on('click.dropdown.data-api', function () {
  608 + $el.parent().removeClass('open')
  609 + })
  610 + }
  611 +
  612 + Dropdown.prototype = {
  613 +
  614 + constructor: Dropdown
  615 +
  616 + , toggle: function (e) {
  617 + var $this = $(this)
  618 + , $parent
  619 + , isActive
  620 +
  621 + if ($this.is('.disabled, :disabled')) return
  622 +
  623 + $parent = getParent($this)
  624 +
  625 + isActive = $parent.hasClass('open')
  626 +
  627 + clearMenus()
  628 +
  629 + if (!isActive) {
  630 + $parent.toggleClass('open')
  631 + $this.focus()
  632 + }
  633 +
  634 + return false
  635 + }
  636 +
  637 + , keydown: function (e) {
  638 + var $this
  639 + , $items
  640 + , $active
  641 + , $parent
  642 + , isActive
  643 + , index
  644 +
  645 + if (!/(38|40|27)/.test(e.keyCode)) return
  646 +
  647 + $this = $(this)
  648 +
  649 + e.preventDefault()
  650 + e.stopPropagation()
  651 +
  652 + if ($this.is('.disabled, :disabled')) return
  653 +
  654 + $parent = getParent($this)
  655 +
  656 + isActive = $parent.hasClass('open')
  657 +
  658 + if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
  659 +
  660 + $items = $('[role=menu] li:not(.divider) a', $parent)
  661 +
  662 + if (!$items.length) return
  663 +
  664 + index = $items.index($items.filter(':focus'))
  665 +
  666 + if (e.keyCode == 38 && index > 0) index-- // up
  667 + if (e.keyCode == 40 && index < $items.length - 1) index++ // down
  668 + if (!~index) index = 0
  669 +
  670 + $items
  671 + .eq(index)
  672 + .focus()
  673 + }
  674 +
  675 + }
  676 +
  677 + function clearMenus() {
  678 + getParent($(toggle))
  679 + .removeClass('open')
  680 + }
  681 +
  682 + function getParent($this) {
  683 + var selector = $this.attr('data-target')
  684 + , $parent
  685 +
  686 + if (!selector) {
  687 + selector = $this.attr('href')
  688 + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  689 + }
  690 +
  691 + $parent = $(selector)
  692 + $parent.length || ($parent = $this.parent())
  693 +
  694 + return $parent
  695 + }
  696 +
  697 +
  698 + /* DROPDOWN PLUGIN DEFINITION
  699 + * ========================== */
  700 +
  701 + $.fn.dropdown = function (option) {
  702 + return this.each(function () {
  703 + var $this = $(this)
  704 + , data = $this.data('dropdown')
  705 + if (!data) $this.data('dropdown', (data = new Dropdown(this)))
  706 + if (typeof option == 'string') data[option].call($this)
  707 + })
  708 + }
  709 +
  710 + $.fn.dropdown.Constructor = Dropdown
  711 +
  712 +
  713 + /* APPLY TO STANDARD DROPDOWN ELEMENTS
  714 + * =================================== */
  715 +
  716 + $(function () {
  717 + $('html')
  718 + .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
  719 + $('body')
  720 + .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  721 + .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
  722 + .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
  723 + })
  724 +
  725 +}(window.jQuery);/* =========================================================
  726 + * bootstrap-modal.js v2.1.1
  727 + * http://twitter.github.com/bootstrap/javascript.html#modals
  728 + * =========================================================
  729 + * Copyright 2012 Twitter, Inc.
  730 + *
  731 + * Licensed under the Apache License, Version 2.0 (the "License");
  732 + * you may not use this file except in compliance with the License.
  733 + * You may obtain a copy of the License at
  734 + *
  735 + * http://www.apache.org/licenses/LICENSE-2.0
  736 + *
  737 + * Unless required by applicable law or agreed to in writing, software
  738 + * distributed under the License is distributed on an "AS IS" BASIS,
  739 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  740 + * See the License for the specific language governing permissions and
  741 + * limitations under the License.
  742 + * ========================================================= */
  743 +
  744 +
  745 +!function ($) {
  746 +
  747 + "use strict"; // jshint ;_;
  748 +
  749 +
  750 + /* MODAL CLASS DEFINITION
  751 + * ====================== */
  752 +
  753 + var Modal = function (element, options) {
  754 + this.options = options
  755 + this.$element = $(element)
  756 + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
  757 + this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
  758 + }
  759 +
  760 + Modal.prototype = {
  761 +
  762 + constructor: Modal
  763 +
  764 + , toggle: function () {
  765 + return this[!this.isShown ? 'show' : 'hide']()
  766 + }
  767 +
  768 + , show: function () {
  769 + var that = this
  770 + , e = $.Event('show')
  771 +
  772 + this.$element.trigger(e)
  773 +
  774 + if (this.isShown || e.isDefaultPrevented()) return
  775 +
  776 + $('body').addClass('modal-open')
  777 +
  778 + this.isShown = true
  779 +
  780 + this.escape()
  781 +
  782 + this.backdrop(function () {
  783 + var transition = $.support.transition && that.$element.hasClass('fade')
  784 +
  785 + if (!that.$element.parent().length) {
  786 + that.$element.appendTo(document.body) //don't move modals dom position
  787 + }
  788 +
  789 + that.$element
  790 + .show()
  791 +
  792 + if (transition) {
  793 + that.$element[0].offsetWidth // force reflow
  794 + }
  795 +
  796 + that.$element
  797 + .addClass('in')
  798 + .attr('aria-hidden', false)
  799 + .focus()
  800 +
  801 + that.enforceFocus()
  802 +
  803 + transition ?
  804 + that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
  805 + that.$element.trigger('shown')
  806 +
  807 + })
  808 + }
  809 +
  810 + , hide: function (e) {
  811 + e && e.preventDefault()
  812 +
  813 + var that = this
  814 +
  815 + e = $.Event('hide')
  816 +
  817 + this.$element.trigger(e)
  818 +
  819 + if (!this.isShown || e.isDefaultPrevented()) return
  820 +
  821 + this.isShown = false
  822 +
  823 + $('body').removeClass('modal-open')
  824 +
  825 + this.escape()
  826 +
  827 + $(document).off('focusin.modal')
  828 +
  829 + this.$element
  830 + .removeClass('in')
  831 + .attr('aria-hidden', true)
  832 +
  833 + $.support.transition && this.$element.hasClass('fade') ?
  834 + this.hideWithTransition() :
  835 + this.hideModal()
  836 + }
  837 +
  838 + , enforceFocus: function () {
  839 + var that = this
  840 + $(document).on('focusin.modal', function (e) {
  841 + if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
  842 + that.$element.focus()
  843 + }
  844 + })
  845 + }
  846 +
  847 + , escape: function () {
  848 + var that = this
  849 + if (this.isShown && this.options.keyboard) {
  850 + this.$element.on('keyup.dismiss.modal', function ( e ) {
  851 + e.which == 27 && that.hide()
  852 + })
  853 + } else if (!this.isShown) {
  854 + this.$element.off('keyup.dismiss.modal')
  855 + }
  856 + }
  857 +
  858 + , hideWithTransition: function () {
  859 + var that = this
  860 + , timeout = setTimeout(function () {
  861 + that.$element.off($.support.transition.end)
  862 + that.hideModal()
  863 + }, 500)
  864 +
  865 + this.$element.one($.support.transition.end, function () {
  866 + clearTimeout(timeout)
  867 + that.hideModal()
  868 + })
  869 + }
  870 +
  871 + , hideModal: function (that) {
  872 + this.$element
  873 + .hide()
  874 + .trigger('hidden')
  875 +
  876 + this.backdrop()
  877 + }
  878 +
  879 + , removeBackdrop: function () {