milksteak 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. data/.gitignore +1 -14
  2. data/.rspec +2 -0
  3. data/Gemfile +1 -1
  4. data/Guardfile +8 -0
  5. data/Rakefile +0 -1
  6. data/Readme.md +37 -0
  7. data/lib/helpers.rb +0 -0
  8. data/lib/milksteak/cms.rb +17 -0
  9. data/lib/milksteak/version.rb +1 -1
  10. data/lib/milksteak.rb +52 -1
  11. data/lib/models/page.rb +73 -0
  12. data/lib/models/user.rb +5 -0
  13. data/lib/public/milksteak/codemirror2/keymap/emacs.js +29 -0
  14. data/lib/public/milksteak/codemirror2/keymap/vim.js +347 -0
  15. data/lib/public/milksteak/codemirror2/lib/codemirror.css +110 -0
  16. data/lib/public/milksteak/codemirror2/lib/codemirror.js +2887 -0
  17. data/lib/public/milksteak/codemirror2/lib/util/dialog.css +23 -0
  18. data/lib/public/milksteak/codemirror2/lib/util/dialog.js +63 -0
  19. data/lib/public/milksteak/codemirror2/lib/util/foldcode.js +186 -0
  20. data/lib/public/milksteak/codemirror2/lib/util/formatting.js +294 -0
  21. data/lib/public/milksteak/codemirror2/lib/util/javascript-hint.js +132 -0
  22. data/lib/public/milksteak/codemirror2/lib/util/match-highlighter.js +44 -0
  23. data/lib/public/milksteak/codemirror2/lib/util/overlay.js +51 -0
  24. data/lib/public/milksteak/codemirror2/lib/util/runmode.js +49 -0
  25. data/lib/public/milksteak/codemirror2/lib/util/search.js +114 -0
  26. data/lib/public/milksteak/codemirror2/lib/util/searchcursor.js +117 -0
  27. data/lib/public/milksteak/codemirror2/lib/util/simple-hint.css +16 -0
  28. data/lib/public/milksteak/codemirror2/lib/util/simple-hint.js +66 -0
  29. data/lib/public/milksteak/codemirror2/mode/clike/clike.js +234 -0
  30. data/lib/public/milksteak/codemirror2/mode/clike/index.html +101 -0
  31. data/lib/public/milksteak/codemirror2/mode/clojure/clojure.js +207 -0
  32. data/lib/public/milksteak/codemirror2/mode/clojure/index.html +66 -0
  33. data/lib/public/milksteak/codemirror2/mode/coffeescript/LICENSE +22 -0
  34. data/lib/public/milksteak/codemirror2/mode/coffeescript/coffeescript.js +341 -0
  35. data/lib/public/milksteak/codemirror2/mode/coffeescript/index.html +721 -0
  36. data/lib/public/milksteak/codemirror2/mode/css/css.js +124 -0
  37. data/lib/public/milksteak/codemirror2/mode/css/index.html +55 -0
  38. data/lib/public/milksteak/codemirror2/mode/diff/diff.css +3 -0
  39. data/lib/public/milksteak/codemirror2/mode/diff/diff.js +13 -0
  40. data/lib/public/milksteak/codemirror2/mode/diff/index.html +99 -0
  41. data/lib/public/milksteak/codemirror2/mode/ecl/ecl.js +203 -0
  42. data/lib/public/milksteak/codemirror2/mode/ecl/index.html +42 -0
  43. data/lib/public/milksteak/codemirror2/mode/gfm/gfm.js +108 -0
  44. data/lib/public/milksteak/codemirror2/mode/gfm/index.html +47 -0
  45. data/lib/public/milksteak/codemirror2/mode/go/go.js +170 -0
  46. data/lib/public/milksteak/codemirror2/mode/go/index.html +72 -0
  47. data/lib/public/milksteak/codemirror2/mode/groovy/groovy.js +210 -0
  48. data/lib/public/milksteak/codemirror2/mode/groovy/index.html +71 -0
  49. data/lib/public/milksteak/codemirror2/mode/haskell/haskell.js +242 -0
  50. data/lib/public/milksteak/codemirror2/mode/haskell/index.html +60 -0
  51. data/lib/public/milksteak/codemirror2/mode/htmlembedded/htmlembedded.js +68 -0
  52. data/lib/public/milksteak/codemirror2/mode/htmlembedded/index.html +49 -0
  53. data/lib/public/milksteak/codemirror2/mode/htmlmixed/htmlmixed.js +83 -0
  54. data/lib/public/milksteak/codemirror2/mode/htmlmixed/index.html +51 -0
  55. data/lib/public/milksteak/codemirror2/mode/javascript/index.html +77 -0
  56. data/lib/public/milksteak/codemirror2/mode/javascript/javascript.js +360 -0
  57. data/lib/public/milksteak/codemirror2/mode/jinja2/index.html +37 -0
  58. data/lib/public/milksteak/codemirror2/mode/jinja2/jinja2.js +42 -0
  59. data/lib/public/milksteak/codemirror2/mode/less/index.html +577 -0
  60. data/lib/public/milksteak/codemirror2/mode/less/less.js +186 -0
  61. data/lib/public/milksteak/codemirror2/mode/lua/index.html +72 -0
  62. data/lib/public/milksteak/codemirror2/mode/lua/lua.js +140 -0
  63. data/lib/public/milksteak/codemirror2/mode/markdown/index.html +339 -0
  64. data/lib/public/milksteak/codemirror2/mode/markdown/markdown.js +276 -0
  65. data/lib/public/milksteak/codemirror2/mode/mysql/index.html +41 -0
  66. data/lib/public/milksteak/codemirror2/mode/mysql/mysql.js +188 -0
  67. data/lib/public/milksteak/codemirror2/mode/ntriples/index.html +32 -0
  68. data/lib/public/milksteak/codemirror2/mode/ntriples/ntriples.js +172 -0
  69. data/lib/public/milksteak/codemirror2/mode/pascal/LICENSE +7 -0
  70. data/lib/public/milksteak/codemirror2/mode/pascal/index.html +48 -0
  71. data/lib/public/milksteak/codemirror2/mode/pascal/pascal.js +94 -0
  72. data/lib/public/milksteak/codemirror2/mode/perl/LICENSE +19 -0
  73. data/lib/public/milksteak/codemirror2/mode/perl/index.html +62 -0
  74. data/lib/public/milksteak/codemirror2/mode/perl/perl.js +816 -0
  75. data/lib/public/milksteak/codemirror2/mode/php/index.html +48 -0
  76. data/lib/public/milksteak/codemirror2/mode/php/php.js +150 -0
  77. data/lib/public/milksteak/codemirror2/mode/plsql/index.html +62 -0
  78. data/lib/public/milksteak/codemirror2/mode/plsql/plsql.js +217 -0
  79. data/lib/public/milksteak/codemirror2/mode/properties/index.html +40 -0
  80. data/lib/public/milksteak/codemirror2/mode/properties/properties.css +3 -0
  81. data/lib/public/milksteak/codemirror2/mode/properties/properties.js +57 -0
  82. data/lib/public/milksteak/codemirror2/mode/python/LICENSE.txt +21 -0
  83. data/lib/public/milksteak/codemirror2/mode/python/index.html +122 -0
  84. data/lib/public/milksteak/codemirror2/mode/python/python.js +340 -0
  85. data/lib/public/milksteak/codemirror2/mode/r/LICENSE +24 -0
  86. data/lib/public/milksteak/codemirror2/mode/r/index.html +73 -0
  87. data/lib/public/milksteak/codemirror2/mode/r/r.js +141 -0
  88. data/lib/public/milksteak/codemirror2/mode/rpm/changes/changes.js +19 -0
  89. data/lib/public/milksteak/codemirror2/mode/rpm/changes/index.html +53 -0
  90. data/lib/public/milksteak/codemirror2/mode/rpm/spec/index.html +99 -0
  91. data/lib/public/milksteak/codemirror2/mode/rpm/spec/spec.css +5 -0
  92. data/lib/public/milksteak/codemirror2/mode/rpm/spec/spec.js +66 -0
  93. data/lib/public/milksteak/codemirror2/mode/rst/index.html +525 -0
  94. data/lib/public/milksteak/codemirror2/mode/rst/rst.js +326 -0
  95. data/lib/public/milksteak/codemirror2/mode/ruby/LICENSE +24 -0
  96. data/lib/public/milksteak/codemirror2/mode/ruby/index.html +171 -0
  97. data/lib/public/milksteak/codemirror2/mode/ruby/ruby.js +200 -0
  98. data/lib/public/milksteak/codemirror2/mode/rust/index.html +48 -0
  99. data/lib/public/milksteak/codemirror2/mode/rust/rust.js +432 -0
  100. data/lib/public/milksteak/codemirror2/mode/scheme/index.html +64 -0
  101. data/lib/public/milksteak/codemirror2/mode/scheme/scheme.js +202 -0
  102. data/lib/public/milksteak/codemirror2/mode/smalltalk/index.html +55 -0
  103. data/lib/public/milksteak/codemirror2/mode/smalltalk/smalltalk.js +139 -0
  104. data/lib/public/milksteak/codemirror2/mode/sparql/index.html +40 -0
  105. data/lib/public/milksteak/codemirror2/mode/sparql/sparql.js +143 -0
  106. data/lib/public/milksteak/codemirror2/mode/stex/index.html +95 -0
  107. data/lib/public/milksteak/codemirror2/mode/stex/stex.js +167 -0
  108. data/lib/public/milksteak/codemirror2/mode/tiddlywiki/index.html +183 -0
  109. data/lib/public/milksteak/codemirror2/mode/tiddlywiki/tiddlywiki.css +21 -0
  110. data/lib/public/milksteak/codemirror2/mode/tiddlywiki/tiddlywiki.js +374 -0
  111. data/lib/public/milksteak/codemirror2/mode/velocity/index.html +103 -0
  112. data/lib/public/milksteak/codemirror2/mode/velocity/velocity.js +146 -0
  113. data/lib/public/milksteak/codemirror2/mode/verilog/index.html +210 -0
  114. data/lib/public/milksteak/codemirror2/mode/verilog/verilog.js +194 -0
  115. data/lib/public/milksteak/codemirror2/mode/xml/index.html +45 -0
  116. data/lib/public/milksteak/codemirror2/mode/xml/xml.js +267 -0
  117. data/lib/public/milksteak/codemirror2/mode/xmlpure/index.html +59 -0
  118. data/lib/public/milksteak/codemirror2/mode/xmlpure/xmlpure.js +490 -0
  119. data/lib/public/milksteak/codemirror2/mode/yaml/index.html +67 -0
  120. data/lib/public/milksteak/codemirror2/mode/yaml/yaml.js +95 -0
  121. data/lib/public/milksteak/codemirror2/theme/cobalt.css +18 -0
  122. data/lib/public/milksteak/codemirror2/theme/eclipse.css +25 -0
  123. data/lib/public/milksteak/codemirror2/theme/elegant.css +10 -0
  124. data/lib/public/milksteak/codemirror2/theme/monokai.css +28 -0
  125. data/lib/public/milksteak/codemirror2/theme/neat.css +9 -0
  126. data/lib/public/milksteak/codemirror2/theme/night.css +21 -0
  127. data/lib/public/milksteak/codemirror2/theme/rubyblue.css +21 -0
  128. data/lib/public/milksteak/css/bootstrap-responsive.css +567 -0
  129. data/lib/public/milksteak/css/bootstrap-responsive.min.css +3 -0
  130. data/lib/public/milksteak/css/bootstrap.css +3365 -0
  131. data/lib/public/milksteak/css/bootstrap.min.css +610 -0
  132. data/lib/public/milksteak/css/calendrical.css +69 -0
  133. data/lib/public/milksteak/css/prettify.css +52 -0
  134. data/lib/public/milksteak/css/style.css +8 -0
  135. data/lib/public/milksteak/img/glyphicons-halflings-white.png +0 -0
  136. data/lib/public/milksteak/img/glyphicons-halflings.png +0 -0
  137. data/lib/public/milksteak/img/spinner.gif +0 -0
  138. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.asp +44 -0
  139. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.aspx +31 -0
  140. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.cf +19 -0
  141. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.jsp +49 -0
  142. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.php +43 -0
  143. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.pl +102 -0
  144. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.py +25 -0
  145. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.rb +61 -0
  146. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree_huck.lasso +36 -0
  147. data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree_sabourdin.lasso +48 -0
  148. data/lib/public/milksteak/jqueryFileTree/images/application.png +0 -0
  149. data/lib/public/milksteak/jqueryFileTree/images/code.png +0 -0
  150. data/lib/public/milksteak/jqueryFileTree/images/css.png +0 -0
  151. data/lib/public/milksteak/jqueryFileTree/images/db.png +0 -0
  152. data/lib/public/milksteak/jqueryFileTree/images/directory.png +0 -0
  153. data/lib/public/milksteak/jqueryFileTree/images/doc.png +0 -0
  154. data/lib/public/milksteak/jqueryFileTree/images/file.png +0 -0
  155. data/lib/public/milksteak/jqueryFileTree/images/film.png +0 -0
  156. data/lib/public/milksteak/jqueryFileTree/images/flash.png +0 -0
  157. data/lib/public/milksteak/jqueryFileTree/images/folder_open.png +0 -0
  158. data/lib/public/milksteak/jqueryFileTree/images/html.png +0 -0
  159. data/lib/public/milksteak/jqueryFileTree/images/java.png +0 -0
  160. data/lib/public/milksteak/jqueryFileTree/images/linux.png +0 -0
  161. data/lib/public/milksteak/jqueryFileTree/images/music.png +0 -0
  162. data/lib/public/milksteak/jqueryFileTree/images/pdf.png +0 -0
  163. data/lib/public/milksteak/jqueryFileTree/images/php.png +0 -0
  164. data/lib/public/milksteak/jqueryFileTree/images/picture.png +0 -0
  165. data/lib/public/milksteak/jqueryFileTree/images/ppt.png +0 -0
  166. data/lib/public/milksteak/jqueryFileTree/images/psd.png +0 -0
  167. data/lib/public/milksteak/jqueryFileTree/images/ruby.png +0 -0
  168. data/lib/public/milksteak/jqueryFileTree/images/script.png +0 -0
  169. data/lib/public/milksteak/jqueryFileTree/images/spinner.gif +0 -0
  170. data/lib/public/milksteak/jqueryFileTree/images/txt.png +0 -0
  171. data/lib/public/milksteak/jqueryFileTree/images/xls.png +0 -0
  172. data/lib/public/milksteak/jqueryFileTree/images/zip.png +0 -0
  173. data/lib/public/milksteak/jqueryFileTree/jqueryFileTree.css +91 -0
  174. data/lib/public/milksteak/jqueryFileTree/jqueryFileTree.js +95 -0
  175. data/lib/public/milksteak/js/app.js +0 -0
  176. data/lib/public/milksteak/js/backbone.js +1290 -0
  177. data/lib/public/milksteak/js/bootstrap-alert.js +91 -0
  178. data/lib/public/milksteak/js/bootstrap-button.js +98 -0
  179. data/lib/public/milksteak/js/bootstrap-carousel.js +154 -0
  180. data/lib/public/milksteak/js/bootstrap-collapse.js +136 -0
  181. data/lib/public/milksteak/js/bootstrap-dropdown.js +92 -0
  182. data/lib/public/milksteak/js/bootstrap-modal.js +209 -0
  183. data/lib/public/milksteak/js/bootstrap-popover.js +95 -0
  184. data/lib/public/milksteak/js/bootstrap-scrollspy.js +125 -0
  185. data/lib/public/milksteak/js/bootstrap-tab.js +130 -0
  186. data/lib/public/milksteak/js/bootstrap-tooltip.js +270 -0
  187. data/lib/public/milksteak/js/bootstrap-transition.js +51 -0
  188. data/lib/public/milksteak/js/bootstrap-typeahead.js +271 -0
  189. data/lib/public/milksteak/js/bootstrap.js +1722 -0
  190. data/lib/public/milksteak/js/bootstrap.min.js +1 -0
  191. data/lib/public/milksteak/js/jquery-ui.min.js +15 -0
  192. data/lib/public/milksteak/js/jquery.calendrical.js +490 -0
  193. data/lib/public/milksteak/js/jquery.easing.js +146 -0
  194. data/lib/public/milksteak/js/jquery.js +9252 -0
  195. data/lib/public/milksteak/js/mustache.js +536 -0
  196. data/lib/public/milksteak/js/prettify.js +28 -0
  197. data/lib/public/milksteak/js/underscore.js +999 -0
  198. data/lib/public/milksteak/markitup/.DS_Store +0 -0
  199. data/lib/public/milksteak/markitup/jquery.markitup.js +593 -0
  200. data/lib/public/milksteak/markitup/sets/default/images/bold.png +0 -0
  201. data/lib/public/milksteak/markitup/sets/default/images/clean.png +0 -0
  202. data/lib/public/milksteak/markitup/sets/default/images/image.png +0 -0
  203. data/lib/public/milksteak/markitup/sets/default/images/italic.png +0 -0
  204. data/lib/public/milksteak/markitup/sets/default/images/link.png +0 -0
  205. data/lib/public/milksteak/markitup/sets/default/images/list-bullet.png +0 -0
  206. data/lib/public/milksteak/markitup/sets/default/images/list-numeric.png +0 -0
  207. data/lib/public/milksteak/markitup/sets/default/images/picture.png +0 -0
  208. data/lib/public/milksteak/markitup/sets/default/images/preview.png +0 -0
  209. data/lib/public/milksteak/markitup/sets/default/images/stroke.png +0 -0
  210. data/lib/public/milksteak/markitup/sets/default/set.js +30 -0
  211. data/lib/public/milksteak/markitup/sets/default/style.css +34 -0
  212. data/lib/public/milksteak/markitup/sets/textile/images/bold.png +0 -0
  213. data/lib/public/milksteak/markitup/sets/textile/images/code.png +0 -0
  214. data/lib/public/milksteak/markitup/sets/textile/images/h1.png +0 -0
  215. data/lib/public/milksteak/markitup/sets/textile/images/h2.png +0 -0
  216. data/lib/public/milksteak/markitup/sets/textile/images/h3.png +0 -0
  217. data/lib/public/milksteak/markitup/sets/textile/images/h4.png +0 -0
  218. data/lib/public/milksteak/markitup/sets/textile/images/h5.png +0 -0
  219. data/lib/public/milksteak/markitup/sets/textile/images/h6.png +0 -0
  220. data/lib/public/milksteak/markitup/sets/textile/images/italic.png +0 -0
  221. data/lib/public/milksteak/markitup/sets/textile/images/link.png +0 -0
  222. data/lib/public/milksteak/markitup/sets/textile/images/list-bullet.png +0 -0
  223. data/lib/public/milksteak/markitup/sets/textile/images/list-numeric.png +0 -0
  224. data/lib/public/milksteak/markitup/sets/textile/images/paragraph.png +0 -0
  225. data/lib/public/milksteak/markitup/sets/textile/images/picture.png +0 -0
  226. data/lib/public/milksteak/markitup/sets/textile/images/preview.png +0 -0
  227. data/lib/public/milksteak/markitup/sets/textile/images/quotes.png +0 -0
  228. data/lib/public/milksteak/markitup/sets/textile/images/stroke.png +0 -0
  229. data/lib/public/milksteak/markitup/sets/textile/set.js +33 -0
  230. data/lib/public/milksteak/markitup/sets/textile/style.css +60 -0
  231. data/lib/public/milksteak/markitup/skins/markitup/images/bg-container.png +0 -0
  232. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
  233. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
  234. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-html.png +0 -0
  235. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-json.png +0 -0
  236. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
  237. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
  238. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
  239. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
  240. data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor.png +0 -0
  241. data/lib/public/milksteak/markitup/skins/markitup/images/handle.png +0 -0
  242. data/lib/public/milksteak/markitup/skins/markitup/images/menu.png +0 -0
  243. data/lib/public/milksteak/markitup/skins/markitup/images/submenu.png +0 -0
  244. data/lib/public/milksteak/markitup/skins/markitup/style.css +147 -0
  245. data/lib/public/milksteak/markitup/skins/simple/images/handle.png +0 -0
  246. data/lib/public/milksteak/markitup/skins/simple/images/menu.png +0 -0
  247. data/lib/public/milksteak/markitup/skins/simple/images/submenu.png +0 -0
  248. data/lib/public/milksteak/markitup/skins/simple/style.css +118 -0
  249. data/lib/public/milksteak/markitup/templates/preview.css +5 -0
  250. data/lib/public/milksteak/markitup/templates/preview.html +11 -0
  251. data/lib/public/milksteak/uploadify-v2.1.4/cancel.png +0 -0
  252. data/lib/public/milksteak/uploadify-v2.1.4/check.php +35 -0
  253. data/lib/public/milksteak/uploadify-v2.1.4/expressInstall.swf +0 -0
  254. data/lib/public/milksteak/uploadify-v2.1.4/jquery-1.4.2.min.js +154 -0
  255. data/lib/public/milksteak/uploadify-v2.1.4/jquery.uploadify.v2.1.4.js +296 -0
  256. data/lib/public/milksteak/uploadify-v2.1.4/jquery.uploadify.v2.1.4.min.js +26 -0
  257. data/lib/public/milksteak/uploadify-v2.1.4/swfobject.js +4 -0
  258. data/lib/public/milksteak/uploadify-v2.1.4/uploadify.allglyphs.swf +0 -0
  259. data/lib/public/milksteak/uploadify-v2.1.4/uploadify.css +53 -0
  260. data/lib/public/milksteak/uploadify-v2.1.4/uploadify.fla +0 -0
  261. data/lib/public/milksteak/uploadify-v2.1.4/uploadify.php +46 -0
  262. data/lib/public/milksteak/uploadify-v2.1.4/uploadify.swf +0 -0
  263. data/lib/public/milksteak/wmd/Markdown.Converter.js +1332 -0
  264. data/lib/public/milksteak/wmd/Markdown.Editor.js +2160 -0
  265. data/lib/public/milksteak/wmd/Markdown.Sanitizer.js +108 -0
  266. data/lib/public/milksteak/wmd/wmd-buttons.png +0 -0
  267. data/lib/public/milksteak/wmd/wmd.css +103 -0
  268. data/lib/public/milksteak/wymeditor/iframe/default/lbl-blockquote.png +0 -0
  269. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h1.png +0 -0
  270. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h2.png +0 -0
  271. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h3.png +0 -0
  272. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h4.png +0 -0
  273. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h5.png +0 -0
  274. data/lib/public/milksteak/wymeditor/iframe/default/lbl-h6.png +0 -0
  275. data/lib/public/milksteak/wymeditor/iframe/default/lbl-p.png +0 -0
  276. data/lib/public/milksteak/wymeditor/iframe/default/lbl-pre.png +0 -0
  277. data/lib/public/milksteak/wymeditor/iframe/default/wymiframe.css +90 -0
  278. data/lib/public/milksteak/wymeditor/iframe/default/wymiframe.html +26 -0
  279. data/lib/public/milksteak/wymeditor/jquery.wymeditor.js +4688 -0
  280. data/lib/public/milksteak/wymeditor/jquery.wymeditor.min.js +1 -0
  281. data/lib/public/milksteak/wymeditor/jquery.wymeditor.pack.js +1 -0
  282. data/lib/public/milksteak/wymeditor/lang/bg.js +45 -0
  283. data/lib/public/milksteak/wymeditor/lang/ca.js +45 -0
  284. data/lib/public/milksteak/wymeditor/lang/cs.js +45 -0
  285. data/lib/public/milksteak/wymeditor/lang/cy.js +45 -0
  286. data/lib/public/milksteak/wymeditor/lang/de.js +45 -0
  287. data/lib/public/milksteak/wymeditor/lang/en.js +45 -0
  288. data/lib/public/milksteak/wymeditor/lang/es.js +45 -0
  289. data/lib/public/milksteak/wymeditor/lang/fa.js +46 -0
  290. data/lib/public/milksteak/wymeditor/lang/fi.js +44 -0
  291. data/lib/public/milksteak/wymeditor/lang/fr.js +45 -0
  292. data/lib/public/milksteak/wymeditor/lang/gl.js +45 -0
  293. data/lib/public/milksteak/wymeditor/lang/he.js +45 -0
  294. data/lib/public/milksteak/wymeditor/lang/hr.js +45 -0
  295. data/lib/public/milksteak/wymeditor/lang/hu.js +45 -0
  296. data/lib/public/milksteak/wymeditor/lang/it.js +45 -0
  297. data/lib/public/milksteak/wymeditor/lang/nb.js +45 -0
  298. data/lib/public/milksteak/wymeditor/lang/nl.js +45 -0
  299. data/lib/public/milksteak/wymeditor/lang/nn.js +45 -0
  300. data/lib/public/milksteak/wymeditor/lang/pl.js +45 -0
  301. data/lib/public/milksteak/wymeditor/lang/pt-br.js +45 -0
  302. data/lib/public/milksteak/wymeditor/lang/pt.js +45 -0
  303. data/lib/public/milksteak/wymeditor/lang/ru.js +45 -0
  304. data/lib/public/milksteak/wymeditor/lang/sv.js +45 -0
  305. data/lib/public/milksteak/wymeditor/lang/tr.js +45 -0
  306. data/lib/public/milksteak/wymeditor/lang/zh_cn.js +47 -0
  307. data/lib/public/milksteak/wymeditor/plugins/embed/jquery.wymeditor.embed.js +52 -0
  308. data/lib/public/milksteak/wymeditor/plugins/fullscreen/icon_fullscreen.gif +0 -0
  309. data/lib/public/milksteak/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js +127 -0
  310. data/lib/public/milksteak/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js +57 -0
  311. data/lib/public/milksteak/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +91 -0
  312. data/lib/public/milksteak/wymeditor/plugins/resizable/readme.txt +124 -0
  313. data/lib/public/milksteak/wymeditor/plugins/tidy/README +19 -0
  314. data/lib/public/milksteak/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +82 -0
  315. data/lib/public/milksteak/wymeditor/plugins/tidy/tidy.php +36 -0
  316. data/lib/public/milksteak/wymeditor/plugins/tidy/wand.png +0 -0
  317. data/lib/public/milksteak/wymeditor/skins/compact/icons.png +0 -0
  318. data/lib/public/milksteak/wymeditor/skins/compact/skin.css +134 -0
  319. data/lib/public/milksteak/wymeditor/skins/compact/skin.js +35 -0
  320. data/lib/public/milksteak/wymeditor/skins/default/icons.png +0 -0
  321. data/lib/public/milksteak/wymeditor/skins/default/skin.css +133 -0
  322. data/lib/public/milksteak/wymeditor/skins/default/skin.js +40 -0
  323. data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.header.gif +0 -0
  324. data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.selector.silver.gif +0 -0
  325. data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.wymeditor.png +0 -0
  326. data/lib/public/milksteak/wymeditor/skins/minimal/images/icons.silver.gif +0 -0
  327. data/lib/public/milksteak/wymeditor/skins/minimal/skin.css +131 -0
  328. data/lib/public/milksteak/wymeditor/skins/minimal/skin.js +30 -0
  329. data/lib/public/milksteak/wymeditor/skins/silver/COPYING +674 -0
  330. data/lib/public/milksteak/wymeditor/skins/silver/README +27 -0
  331. data/lib/public/milksteak/wymeditor/skins/silver/images/bg.header.gif +0 -0
  332. data/lib/public/milksteak/wymeditor/skins/silver/images/bg.selector.silver.gif +0 -0
  333. data/lib/public/milksteak/wymeditor/skins/silver/images/bg.wymeditor.png +0 -0
  334. data/lib/public/milksteak/wymeditor/skins/silver/images/icons.silver.gif +0 -0
  335. data/lib/public/milksteak/wymeditor/skins/silver/skin.css +297 -0
  336. data/lib/public/milksteak/wymeditor/skins/silver/skin.js +61 -0
  337. data/lib/public/milksteak/wymeditor/skins/twopanels/icons.png +0 -0
  338. data/lib/public/milksteak/wymeditor/skins/twopanels/skin.css +134 -0
  339. data/lib/public/milksteak/wymeditor/skins/twopanels/skin.js +39 -0
  340. data/lib/public/milksteak/wymeditor/skins/wymeditor_icon.png +0 -0
  341. data/lib/views/layouts/admin.erb +8 -0
  342. data/lib/views/login.erb +1 -0
  343. data/milksteak.gemspec +30 -13
  344. data/spec/fixtures/pages/sample_page.yml +5 -0
  345. data/spec/lib/milksteak/cms_spec.rb +12 -0
  346. data/spec/models/page_spec.rb +58 -0
  347. data/spec/spec_helper.rb +19 -0
  348. metadata +429 -10
  349. data/LICENSE +0 -22
  350. data/README.md +0 -29
@@ -0,0 +1,1722 @@
1
+ /* ===================================================
2
+ * bootstrap-transition.js v2.0.0
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
+ !function( $ ) {
21
+
22
+ $(function () {
23
+
24
+ "use strict"
25
+
26
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
27
+ * ======================================================= */
28
+
29
+ $.support.transition = (function () {
30
+ var thisBody = document.body || document.documentElement
31
+ , thisStyle = thisBody.style
32
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
33
+
34
+ return support && {
35
+ end: (function () {
36
+ var transitionEnd = "TransitionEnd"
37
+ if ( $.browser.webkit ) {
38
+ transitionEnd = "webkitTransitionEnd"
39
+ } else if ( $.browser.mozilla ) {
40
+ transitionEnd = "transitionend"
41
+ } else if ( $.browser.opera ) {
42
+ transitionEnd = "oTransitionEnd"
43
+ }
44
+ return transitionEnd
45
+ }())
46
+ }
47
+ })()
48
+
49
+ })
50
+
51
+ }( window.jQuery )
52
+ /* ==========================================================
53
+ * bootstrap-alert.js v2.0.0
54
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
55
+ * ==========================================================
56
+ * Copyright 2012 Twitter, Inc.
57
+ *
58
+ * Licensed under the Apache License, Version 2.0 (the "License");
59
+ * you may not use this file except in compliance with the License.
60
+ * You may obtain a copy of the License at
61
+ *
62
+ * http://www.apache.org/licenses/LICENSE-2.0
63
+ *
64
+ * Unless required by applicable law or agreed to in writing, software
65
+ * distributed under the License is distributed on an "AS IS" BASIS,
66
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
67
+ * See the License for the specific language governing permissions and
68
+ * limitations under the License.
69
+ * ========================================================== */
70
+
71
+
72
+ !function( $ ){
73
+
74
+ "use strict"
75
+
76
+ /* ALERT CLASS DEFINITION
77
+ * ====================== */
78
+
79
+ var dismiss = '[data-dismiss="alert"]'
80
+ , Alert = function ( el ) {
81
+ $(el).on('click', dismiss, this.close)
82
+ }
83
+
84
+ Alert.prototype = {
85
+
86
+ constructor: Alert
87
+
88
+ , close: function ( e ) {
89
+ var $this = $(this)
90
+ , selector = $this.attr('data-target')
91
+ , $parent
92
+
93
+ if (!selector) {
94
+ selector = $this.attr('href')
95
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
96
+ }
97
+
98
+ $parent = $(selector)
99
+ $parent.trigger('close')
100
+
101
+ e && e.preventDefault()
102
+
103
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
104
+
105
+ $parent.removeClass('in')
106
+
107
+ function removeElement() {
108
+ $parent.remove()
109
+ $parent.trigger('closed')
110
+ }
111
+
112
+ $.support.transition && $parent.hasClass('fade') ?
113
+ $parent.on($.support.transition.end, removeElement) :
114
+ removeElement()
115
+ }
116
+
117
+ }
118
+
119
+
120
+ /* ALERT PLUGIN DEFINITION
121
+ * ======================= */
122
+
123
+ $.fn.alert = function ( option ) {
124
+ return this.each(function () {
125
+ var $this = $(this)
126
+ , data = $this.data('alert')
127
+ if (!data) $this.data('alert', (data = new Alert(this)))
128
+ if (typeof option == 'string') data[option].call($this)
129
+ })
130
+ }
131
+
132
+ $.fn.alert.Constructor = Alert
133
+
134
+
135
+ /* ALERT DATA-API
136
+ * ============== */
137
+
138
+ $(function () {
139
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
140
+ })
141
+
142
+ }( window.jQuery )
143
+ /* ============================================================
144
+ * bootstrap-button.js v2.0.0
145
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
146
+ * ============================================================
147
+ * Copyright 2012 Twitter, Inc.
148
+ *
149
+ * Licensed under the Apache License, Version 2.0 (the "License");
150
+ * you may not use this file except in compliance with the License.
151
+ * You may obtain a copy of the License at
152
+ *
153
+ * http://www.apache.org/licenses/LICENSE-2.0
154
+ *
155
+ * Unless required by applicable law or agreed to in writing, software
156
+ * distributed under the License is distributed on an "AS IS" BASIS,
157
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
158
+ * See the License for the specific language governing permissions and
159
+ * limitations under the License.
160
+ * ============================================================ */
161
+
162
+ !function( $ ){
163
+
164
+ "use strict"
165
+
166
+ /* BUTTON PUBLIC CLASS DEFINITION
167
+ * ============================== */
168
+
169
+ var Button = function ( element, options ) {
170
+ this.$element = $(element)
171
+ this.options = $.extend({}, $.fn.button.defaults, options)
172
+ }
173
+
174
+ Button.prototype = {
175
+
176
+ constructor: Button
177
+
178
+ , setState: function ( state ) {
179
+ var d = 'disabled'
180
+ , $el = this.$element
181
+ , data = $el.data()
182
+ , val = $el.is('input') ? 'val' : 'html'
183
+
184
+ state = state + 'Text'
185
+ data.resetText || $el.data('resetText', $el[val]())
186
+
187
+ $el[val](data[state] || this.options[state])
188
+
189
+ // push to event loop to allow forms to submit
190
+ setTimeout(function () {
191
+ state == 'loadingText' ?
192
+ $el.addClass(d).attr(d, d) :
193
+ $el.removeClass(d).removeAttr(d)
194
+ }, 0)
195
+ }
196
+
197
+ , toggle: function () {
198
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
199
+
200
+ $parent && $parent
201
+ .find('.active')
202
+ .removeClass('active')
203
+
204
+ this.$element.toggleClass('active')
205
+ }
206
+
207
+ }
208
+
209
+
210
+ /* BUTTON PLUGIN DEFINITION
211
+ * ======================== */
212
+
213
+ $.fn.button = function ( option ) {
214
+ return this.each(function () {
215
+ var $this = $(this)
216
+ , data = $this.data('button')
217
+ , options = typeof option == 'object' && option
218
+ if (!data) $this.data('button', (data = new Button(this, options)))
219
+ if (option == 'toggle') data.toggle()
220
+ else if (option) data.setState(option)
221
+ })
222
+ }
223
+
224
+ $.fn.button.defaults = {
225
+ loadingText: 'loading...'
226
+ }
227
+
228
+ $.fn.button.Constructor = Button
229
+
230
+
231
+ /* BUTTON DATA-API
232
+ * =============== */
233
+
234
+ $(function () {
235
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
236
+ $(e.target).button('toggle')
237
+ })
238
+ })
239
+
240
+ }( window.jQuery )
241
+ /* ==========================================================
242
+ * bootstrap-carousel.js v2.0.0
243
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
244
+ * ==========================================================
245
+ * Copyright 2012 Twitter, Inc.
246
+ *
247
+ * Licensed under the Apache License, Version 2.0 (the "License");
248
+ * you may not use this file except in compliance with the License.
249
+ * You may obtain a copy of the License at
250
+ *
251
+ * http://www.apache.org/licenses/LICENSE-2.0
252
+ *
253
+ * Unless required by applicable law or agreed to in writing, software
254
+ * distributed under the License is distributed on an "AS IS" BASIS,
255
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
256
+ * See the License for the specific language governing permissions and
257
+ * limitations under the License.
258
+ * ========================================================== */
259
+
260
+
261
+ !function( $ ){
262
+
263
+ "use strict"
264
+
265
+ /* CAROUSEL CLASS DEFINITION
266
+ * ========================= */
267
+
268
+ var Carousel = function (element, options) {
269
+ this.$element = $(element)
270
+ this.options = $.extend({}, $.fn.carousel.defaults, options)
271
+ this.options.slide && this.slide(this.options.slide)
272
+ }
273
+
274
+ Carousel.prototype = {
275
+
276
+ cycle: function () {
277
+ this.interval = setInterval($.proxy(this.next, this), this.options.interval)
278
+ return this
279
+ }
280
+
281
+ , to: function (pos) {
282
+ var $active = this.$element.find('.active')
283
+ , children = $active.parent().children()
284
+ , activePos = children.index($active)
285
+ , that = this
286
+
287
+ if (pos > (children.length - 1) || pos < 0) return
288
+
289
+ if (this.sliding) {
290
+ return this.$element.one('slid', function () {
291
+ that.to(pos)
292
+ })
293
+ }
294
+
295
+ if (activePos == pos) {
296
+ return this.pause().cycle()
297
+ }
298
+
299
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
300
+ }
301
+
302
+ , pause: function () {
303
+ clearInterval(this.interval)
304
+ return this
305
+ }
306
+
307
+ , next: function () {
308
+ if (this.sliding) return
309
+ return this.slide('next')
310
+ }
311
+
312
+ , prev: function () {
313
+ if (this.sliding) return
314
+ return this.slide('prev')
315
+ }
316
+
317
+ , slide: function (type, next) {
318
+ var $active = this.$element.find('.active')
319
+ , $next = next || $active[type]()
320
+ , isCycling = this.interval
321
+ , direction = type == 'next' ? 'left' : 'right'
322
+ , fallback = type == 'next' ? 'first' : 'last'
323
+ , that = this
324
+
325
+ this.sliding = true
326
+
327
+ isCycling && this.pause()
328
+
329
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
330
+
331
+ if (!$.support.transition && this.$element.hasClass('slide')) {
332
+ this.$element.trigger('slide')
333
+ $active.removeClass('active')
334
+ $next.addClass('active')
335
+ this.sliding = false
336
+ this.$element.trigger('slid')
337
+ } else {
338
+ $next.addClass(type)
339
+ $next[0].offsetWidth // force reflow
340
+ $active.addClass(direction)
341
+ $next.addClass(direction)
342
+ this.$element.trigger('slide')
343
+ this.$element.one($.support.transition.end, function () {
344
+ $next.removeClass([type, direction].join(' ')).addClass('active')
345
+ $active.removeClass(['active', direction].join(' '))
346
+ that.sliding = false
347
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
348
+ })
349
+ }
350
+
351
+ isCycling && this.cycle()
352
+
353
+ return this
354
+ }
355
+
356
+ }
357
+
358
+
359
+ /* CAROUSEL PLUGIN DEFINITION
360
+ * ========================== */
361
+
362
+ $.fn.carousel = function ( option ) {
363
+ return this.each(function () {
364
+ var $this = $(this)
365
+ , data = $this.data('carousel')
366
+ , options = typeof option == 'object' && option
367
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
368
+ if (typeof option == 'number') data.to(option)
369
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
370
+ else data.cycle()
371
+ })
372
+ }
373
+
374
+ $.fn.carousel.defaults = {
375
+ interval: 5000
376
+ }
377
+
378
+ $.fn.carousel.Constructor = Carousel
379
+
380
+
381
+ /* CAROUSEL DATA-API
382
+ * ================= */
383
+
384
+ $(function () {
385
+ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
386
+ var $this = $(this), href
387
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
388
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
389
+ $target.carousel(options)
390
+ e.preventDefault()
391
+ })
392
+ })
393
+
394
+ }( window.jQuery )
395
+ /* =============================================================
396
+ * bootstrap-collapse.js v2.0.0
397
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
398
+ * =============================================================
399
+ * Copyright 2012 Twitter, Inc.
400
+ *
401
+ * Licensed under the Apache License, Version 2.0 (the "License");
402
+ * you may not use this file except in compliance with the License.
403
+ * You may obtain a copy of the License at
404
+ *
405
+ * http://www.apache.org/licenses/LICENSE-2.0
406
+ *
407
+ * Unless required by applicable law or agreed to in writing, software
408
+ * distributed under the License is distributed on an "AS IS" BASIS,
409
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
410
+ * See the License for the specific language governing permissions and
411
+ * limitations under the License.
412
+ * ============================================================ */
413
+
414
+ !function( $ ){
415
+
416
+ "use strict"
417
+
418
+ var Collapse = function ( element, options ) {
419
+ this.$element = $(element)
420
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
421
+
422
+ if (this.options["parent"]) {
423
+ this.$parent = $(this.options["parent"])
424
+ }
425
+
426
+ this.options.toggle && this.toggle()
427
+ }
428
+
429
+ Collapse.prototype = {
430
+
431
+ constructor: Collapse
432
+
433
+ , dimension: function () {
434
+ var hasWidth = this.$element.hasClass('width')
435
+ return hasWidth ? 'width' : 'height'
436
+ }
437
+
438
+ , show: function () {
439
+ var dimension = this.dimension()
440
+ , scroll = $.camelCase(['scroll', dimension].join('-'))
441
+ , actives = this.$parent && this.$parent.find('.in')
442
+ , hasData
443
+
444
+ if (actives && actives.length) {
445
+ hasData = actives.data('collapse')
446
+ actives.collapse('hide')
447
+ hasData || actives.data('collapse', null)
448
+ }
449
+
450
+ this.$element[dimension](0)
451
+ this.transition('addClass', 'show', 'shown')
452
+ this.$element[dimension](this.$element[0][scroll])
453
+
454
+ }
455
+
456
+ , hide: function () {
457
+ var dimension = this.dimension()
458
+ this.reset(this.$element[dimension]())
459
+ this.transition('removeClass', 'hide', 'hidden')
460
+ this.$element[dimension](0)
461
+ }
462
+
463
+ , reset: function ( size ) {
464
+ var dimension = this.dimension()
465
+
466
+ this.$element
467
+ .removeClass('collapse')
468
+ [dimension](size || 'auto')
469
+ [0].offsetWidth
470
+
471
+ this.$element.addClass('collapse')
472
+ }
473
+
474
+ , transition: function ( method, startEvent, completeEvent ) {
475
+ var that = this
476
+ , complete = function () {
477
+ if (startEvent == 'show') that.reset()
478
+ that.$element.trigger(completeEvent)
479
+ }
480
+
481
+ this.$element
482
+ .trigger(startEvent)
483
+ [method]('in')
484
+
485
+ $.support.transition && this.$element.hasClass('collapse') ?
486
+ this.$element.one($.support.transition.end, complete) :
487
+ complete()
488
+ }
489
+
490
+ , toggle: function () {
491
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
492
+ }
493
+
494
+ }
495
+
496
+ /* COLLAPSIBLE PLUGIN DEFINITION
497
+ * ============================== */
498
+
499
+ $.fn.collapse = function ( option ) {
500
+ return this.each(function () {
501
+ var $this = $(this)
502
+ , data = $this.data('collapse')
503
+ , options = typeof option == 'object' && option
504
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
505
+ if (typeof option == 'string') data[option]()
506
+ })
507
+ }
508
+
509
+ $.fn.collapse.defaults = {
510
+ toggle: true
511
+ }
512
+
513
+ $.fn.collapse.Constructor = Collapse
514
+
515
+
516
+ /* COLLAPSIBLE DATA-API
517
+ * ==================== */
518
+
519
+ $(function () {
520
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
521
+ var $this = $(this), href
522
+ , target = $this.attr('data-target')
523
+ || e.preventDefault()
524
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
525
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
526
+ $(target).collapse(option)
527
+ })
528
+ })
529
+
530
+ }( window.jQuery )
531
+ /* ============================================================
532
+ * bootstrap-dropdown.js v2.0.0
533
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
534
+ * ============================================================
535
+ * Copyright 2012 Twitter, Inc.
536
+ *
537
+ * Licensed under the Apache License, Version 2.0 (the "License");
538
+ * you may not use this file except in compliance with the License.
539
+ * You may obtain a copy of the License at
540
+ *
541
+ * http://www.apache.org/licenses/LICENSE-2.0
542
+ *
543
+ * Unless required by applicable law or agreed to in writing, software
544
+ * distributed under the License is distributed on an "AS IS" BASIS,
545
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546
+ * See the License for the specific language governing permissions and
547
+ * limitations under the License.
548
+ * ============================================================ */
549
+
550
+
551
+ !function( $ ){
552
+
553
+ "use strict"
554
+
555
+ /* DROPDOWN CLASS DEFINITION
556
+ * ========================= */
557
+
558
+ var toggle = '[data-toggle="dropdown"]'
559
+ , Dropdown = function ( element ) {
560
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
561
+ $('html').on('click.dropdown.data-api', function () {
562
+ $el.parent().removeClass('open')
563
+ })
564
+ }
565
+
566
+ Dropdown.prototype = {
567
+
568
+ constructor: Dropdown
569
+
570
+ , toggle: function ( e ) {
571
+ var $this = $(this)
572
+ , selector = $this.attr('data-target')
573
+ , $parent
574
+ , isActive
575
+
576
+ if (!selector) {
577
+ selector = $this.attr('href')
578
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
579
+ }
580
+
581
+ $parent = $(selector)
582
+ $parent.length || ($parent = $this.parent())
583
+
584
+ isActive = $parent.hasClass('open')
585
+
586
+ clearMenus()
587
+ !isActive && $parent.toggleClass('open')
588
+
589
+ return false
590
+ }
591
+
592
+ }
593
+
594
+ function clearMenus() {
595
+ $(toggle).parent().removeClass('open')
596
+ }
597
+
598
+
599
+ /* DROPDOWN PLUGIN DEFINITION
600
+ * ========================== */
601
+
602
+ $.fn.dropdown = function ( option ) {
603
+ return this.each(function () {
604
+ var $this = $(this)
605
+ , data = $this.data('dropdown')
606
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
607
+ if (typeof option == 'string') data[option].call($this)
608
+ })
609
+ }
610
+
611
+ $.fn.dropdown.Constructor = Dropdown
612
+
613
+
614
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
615
+ * =================================== */
616
+
617
+ $(function () {
618
+ $('html').on('click.dropdown.data-api', clearMenus)
619
+ $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
620
+ })
621
+
622
+ }( window.jQuery )
623
+ /* =========================================================
624
+ * bootstrap-modal.js v2.0.0
625
+ * http://twitter.github.com/bootstrap/javascript.html#modals
626
+ * =========================================================
627
+ * Copyright 2012 Twitter, Inc.
628
+ *
629
+ * Licensed under the Apache License, Version 2.0 (the "License");
630
+ * you may not use this file except in compliance with the License.
631
+ * You may obtain a copy of the License at
632
+ *
633
+ * http://www.apache.org/licenses/LICENSE-2.0
634
+ *
635
+ * Unless required by applicable law or agreed to in writing, software
636
+ * distributed under the License is distributed on an "AS IS" BASIS,
637
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
638
+ * See the License for the specific language governing permissions and
639
+ * limitations under the License.
640
+ * ========================================================= */
641
+
642
+
643
+ !function( $ ){
644
+
645
+ "use strict"
646
+
647
+ /* MODAL CLASS DEFINITION
648
+ * ====================== */
649
+
650
+ var Modal = function ( content, options ) {
651
+ this.options = $.extend({}, $.fn.modal.defaults, options)
652
+ this.$element = $(content)
653
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
654
+ }
655
+
656
+ Modal.prototype = {
657
+
658
+ constructor: Modal
659
+
660
+ , toggle: function () {
661
+ return this[!this.isShown ? 'show' : 'hide']()
662
+ }
663
+
664
+ , show: function () {
665
+ var that = this
666
+
667
+ if (this.isShown) return
668
+
669
+ $('body').addClass('modal-open')
670
+
671
+ this.isShown = true
672
+ this.$element.trigger('show')
673
+
674
+ escape.call(this)
675
+ backdrop.call(this, function () {
676
+ var transition = $.support.transition && that.$element.hasClass('fade')
677
+
678
+ !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
679
+
680
+ that.$element
681
+ .show()
682
+
683
+ if (transition) {
684
+ that.$element[0].offsetWidth // force reflow
685
+ }
686
+
687
+ that.$element.addClass('in')
688
+
689
+ transition ?
690
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
691
+ that.$element.trigger('shown')
692
+
693
+ })
694
+ }
695
+
696
+ , hide: function ( e ) {
697
+ e && e.preventDefault()
698
+
699
+ if (!this.isShown) return
700
+
701
+ var that = this
702
+ this.isShown = false
703
+
704
+ $('body').removeClass('modal-open')
705
+
706
+ escape.call(this)
707
+
708
+ this.$element
709
+ .trigger('hide')
710
+ .removeClass('in')
711
+
712
+ $.support.transition && this.$element.hasClass('fade') ?
713
+ hideWithTransition.call(this) :
714
+ hideModal.call(this)
715
+ }
716
+
717
+ }
718
+
719
+
720
+ /* MODAL PRIVATE METHODS
721
+ * ===================== */
722
+
723
+ function hideWithTransition() {
724
+ var that = this
725
+ , timeout = setTimeout(function () {
726
+ that.$element.off($.support.transition.end)
727
+ hideModal.call(that)
728
+ }, 500)
729
+
730
+ this.$element.one($.support.transition.end, function () {
731
+ clearTimeout(timeout)
732
+ hideModal.call(that)
733
+ })
734
+ }
735
+
736
+ function hideModal( that ) {
737
+ this.$element
738
+ .hide()
739
+ .trigger('hidden')
740
+
741
+ backdrop.call(this)
742
+ }
743
+
744
+ function backdrop( callback ) {
745
+ var that = this
746
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
747
+
748
+ if (this.isShown && this.options.backdrop) {
749
+ var doAnimate = $.support.transition && animate
750
+
751
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
752
+ .appendTo(document.body)
753
+
754
+ if (this.options.backdrop != 'static') {
755
+ this.$backdrop.click($.proxy(this.hide, this))
756
+ }
757
+
758
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
759
+
760
+ this.$backdrop.addClass('in')
761
+
762
+ doAnimate ?
763
+ this.$backdrop.one($.support.transition.end, callback) :
764
+ callback()
765
+
766
+ } else if (!this.isShown && this.$backdrop) {
767
+ this.$backdrop.removeClass('in')
768
+
769
+ $.support.transition && this.$element.hasClass('fade')?
770
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
771
+ removeBackdrop.call(this)
772
+
773
+ } else if (callback) {
774
+ callback()
775
+ }
776
+ }
777
+
778
+ function removeBackdrop() {
779
+ this.$backdrop.remove()
780
+ this.$backdrop = null
781
+ }
782
+
783
+ function escape() {
784
+ var that = this
785
+ if (this.isShown && this.options.keyboard) {
786
+ $(document).on('keyup.dismiss.modal', function ( e ) {
787
+ e.which == 27 && that.hide()
788
+ })
789
+ } else if (!this.isShown) {
790
+ $(document).off('keyup.dismiss.modal')
791
+ }
792
+ }
793
+
794
+
795
+ /* MODAL PLUGIN DEFINITION
796
+ * ======================= */
797
+
798
+ $.fn.modal = function ( option ) {
799
+ return this.each(function () {
800
+ var $this = $(this)
801
+ , data = $this.data('modal')
802
+ , options = typeof option == 'object' && option
803
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
804
+ if (typeof option == 'string') data[option]()
805
+ else data.show()
806
+ })
807
+ }
808
+
809
+ $.fn.modal.defaults = {
810
+ backdrop: true
811
+ , keyboard: true
812
+ }
813
+
814
+ $.fn.modal.Constructor = Modal
815
+
816
+
817
+ /* MODAL DATA-API
818
+ * ============== */
819
+
820
+ $(function () {
821
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
822
+ var $this = $(this), href
823
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
824
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
825
+
826
+ e.preventDefault()
827
+ $target.modal(option)
828
+ })
829
+ })
830
+
831
+ }( window.jQuery )
832
+ /* ===========================================================
833
+ * bootstrap-tooltip.js v2.0.0
834
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
835
+ * Inspired by the original jQuery.tipsy by Jason Frame
836
+ * ===========================================================
837
+ * Copyright 2012 Twitter, Inc.
838
+ *
839
+ * Licensed under the Apache License, Version 2.0 (the "License");
840
+ * you may not use this file except in compliance with the License.
841
+ * You may obtain a copy of the License at
842
+ *
843
+ * http://www.apache.org/licenses/LICENSE-2.0
844
+ *
845
+ * Unless required by applicable law or agreed to in writing, software
846
+ * distributed under the License is distributed on an "AS IS" BASIS,
847
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
848
+ * See the License for the specific language governing permissions and
849
+ * limitations under the License.
850
+ * ========================================================== */
851
+
852
+ !function( $ ) {
853
+
854
+ "use strict"
855
+
856
+ /* TOOLTIP PUBLIC CLASS DEFINITION
857
+ * =============================== */
858
+
859
+ var Tooltip = function ( element, options ) {
860
+ this.init('tooltip', element, options)
861
+ }
862
+
863
+ Tooltip.prototype = {
864
+
865
+ constructor: Tooltip
866
+
867
+ , init: function ( type, element, options ) {
868
+ var eventIn
869
+ , eventOut
870
+
871
+ this.type = type
872
+ this.$element = $(element)
873
+ this.options = this.getOptions(options)
874
+ this.enabled = true
875
+
876
+ if (this.options.trigger != 'manual') {
877
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
878
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
879
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
880
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
881
+ }
882
+
883
+ this.options.selector ?
884
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
885
+ this.fixTitle()
886
+ }
887
+
888
+ , getOptions: function ( options ) {
889
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
890
+
891
+ if (options.delay && typeof options.delay == 'number') {
892
+ options.delay = {
893
+ show: options.delay
894
+ , hide: options.delay
895
+ }
896
+ }
897
+
898
+ return options
899
+ }
900
+
901
+ , enter: function ( e ) {
902
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
903
+
904
+ if (!self.options.delay || !self.options.delay.show) {
905
+ self.show()
906
+ } else {
907
+ self.hoverState = 'in'
908
+ setTimeout(function() {
909
+ if (self.hoverState == 'in') {
910
+ self.show()
911
+ }
912
+ }, self.options.delay.show)
913
+ }
914
+ }
915
+
916
+ , leave: function ( e ) {
917
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
918
+
919
+ if (!self.options.delay || !self.options.delay.hide) {
920
+ self.hide()
921
+ } else {
922
+ self.hoverState = 'out'
923
+ setTimeout(function() {
924
+ if (self.hoverState == 'out') {
925
+ self.hide()
926
+ }
927
+ }, self.options.delay.hide)
928
+ }
929
+ }
930
+
931
+ , show: function () {
932
+ var $tip
933
+ , inside
934
+ , pos
935
+ , actualWidth
936
+ , actualHeight
937
+ , placement
938
+ , tp
939
+
940
+ if (this.hasContent() && this.enabled) {
941
+ $tip = this.tip()
942
+ this.setContent()
943
+
944
+ if (this.options.animation) {
945
+ $tip.addClass('fade')
946
+ }
947
+
948
+ placement = typeof this.options.placement == 'function' ?
949
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
950
+ this.options.placement
951
+
952
+ inside = /in/.test(placement)
953
+
954
+ $tip
955
+ .remove()
956
+ .css({ top: 0, left: 0, display: 'block' })
957
+ .appendTo(inside ? this.$element : document.body)
958
+
959
+ pos = this.getPosition(inside)
960
+
961
+ actualWidth = $tip[0].offsetWidth
962
+ actualHeight = $tip[0].offsetHeight
963
+
964
+ switch (inside ? placement.split(' ')[1] : placement) {
965
+ case 'bottom':
966
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
967
+ break
968
+ case 'top':
969
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
970
+ break
971
+ case 'left':
972
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
973
+ break
974
+ case 'right':
975
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
976
+ break
977
+ }
978
+
979
+ $tip
980
+ .css(tp)
981
+ .addClass(placement)
982
+ .addClass('in')
983
+ }
984
+ }
985
+
986
+ , setContent: function () {
987
+ var $tip = this.tip()
988
+ $tip.find('.tooltip-inner').html(this.getTitle())
989
+ $tip.removeClass('fade in top bottom left right')
990
+ }
991
+
992
+ , hide: function () {
993
+ var that = this
994
+ , $tip = this.tip()
995
+
996
+ $tip.removeClass('in')
997
+
998
+ function removeWithAnimation() {
999
+ var timeout = setTimeout(function () {
1000
+ $tip.off($.support.transition.end).remove()
1001
+ }, 500)
1002
+
1003
+ $tip.one($.support.transition.end, function () {
1004
+ clearTimeout(timeout)
1005
+ $tip.remove()
1006
+ })
1007
+ }
1008
+
1009
+ $.support.transition && this.$tip.hasClass('fade') ?
1010
+ removeWithAnimation() :
1011
+ $tip.remove()
1012
+ }
1013
+
1014
+ , fixTitle: function () {
1015
+ var $e = this.$element
1016
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1017
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1018
+ }
1019
+ }
1020
+
1021
+ , hasContent: function () {
1022
+ return this.getTitle()
1023
+ }
1024
+
1025
+ , getPosition: function (inside) {
1026
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1027
+ width: this.$element[0].offsetWidth
1028
+ , height: this.$element[0].offsetHeight
1029
+ })
1030
+ }
1031
+
1032
+ , getTitle: function () {
1033
+ var title
1034
+ , $e = this.$element
1035
+ , o = this.options
1036
+
1037
+ title = $e.attr('data-original-title')
1038
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1039
+
1040
+ title = title.toString().replace(/(^\s*|\s*$)/, "")
1041
+
1042
+ return title
1043
+ }
1044
+
1045
+ , tip: function () {
1046
+ return this.$tip = this.$tip || $(this.options.template)
1047
+ }
1048
+
1049
+ , validate: function () {
1050
+ if (!this.$element[0].parentNode) {
1051
+ this.hide()
1052
+ this.$element = null
1053
+ this.options = null
1054
+ }
1055
+ }
1056
+
1057
+ , enable: function () {
1058
+ this.enabled = true
1059
+ }
1060
+
1061
+ , disable: function () {
1062
+ this.enabled = false
1063
+ }
1064
+
1065
+ , toggleEnabled: function () {
1066
+ this.enabled = !this.enabled
1067
+ }
1068
+
1069
+ , toggle: function () {
1070
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
1071
+ }
1072
+
1073
+ }
1074
+
1075
+
1076
+ /* TOOLTIP PLUGIN DEFINITION
1077
+ * ========================= */
1078
+
1079
+ $.fn.tooltip = function ( option ) {
1080
+ return this.each(function () {
1081
+ var $this = $(this)
1082
+ , data = $this.data('tooltip')
1083
+ , options = typeof option == 'object' && option
1084
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1085
+ if (typeof option == 'string') data[option]()
1086
+ })
1087
+ }
1088
+
1089
+ $.fn.tooltip.Constructor = Tooltip
1090
+
1091
+ $.fn.tooltip.defaults = {
1092
+ animation: true
1093
+ , delay: 0
1094
+ , selector: false
1095
+ , placement: 'top'
1096
+ , trigger: 'hover'
1097
+ , title: ''
1098
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1099
+ }
1100
+
1101
+ }( window.jQuery )
1102
+ /* ===========================================================
1103
+ * bootstrap-popover.js v2.0.0
1104
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
1105
+ * ===========================================================
1106
+ * Copyright 2012 Twitter, Inc.
1107
+ *
1108
+ * Licensed under the Apache License, Version 2.0 (the "License");
1109
+ * you may not use this file except in compliance with the License.
1110
+ * You may obtain a copy of the License at
1111
+ *
1112
+ * http://www.apache.org/licenses/LICENSE-2.0
1113
+ *
1114
+ * Unless required by applicable law or agreed to in writing, software
1115
+ * distributed under the License is distributed on an "AS IS" BASIS,
1116
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1117
+ * See the License for the specific language governing permissions and
1118
+ * limitations under the License.
1119
+ * =========================================================== */
1120
+
1121
+
1122
+ !function( $ ) {
1123
+
1124
+ "use strict"
1125
+
1126
+ var Popover = function ( element, options ) {
1127
+ this.init('popover', element, options)
1128
+ }
1129
+
1130
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1131
+ ========================================== */
1132
+
1133
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1134
+
1135
+ constructor: Popover
1136
+
1137
+ , setContent: function () {
1138
+ var $tip = this.tip()
1139
+ , title = this.getTitle()
1140
+ , content = this.getContent()
1141
+
1142
+ $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
1143
+ $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content)
1144
+
1145
+ $tip.removeClass('fade top bottom left right in')
1146
+ }
1147
+
1148
+ , hasContent: function () {
1149
+ return this.getTitle() || this.getContent()
1150
+ }
1151
+
1152
+ , getContent: function () {
1153
+ var content
1154
+ , $e = this.$element
1155
+ , o = this.options
1156
+
1157
+ content = $e.attr('data-content')
1158
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1159
+
1160
+ content = content.toString().replace(/(^\s*|\s*$)/, "")
1161
+
1162
+ return content
1163
+ }
1164
+
1165
+ , tip: function() {
1166
+ if (!this.$tip) {
1167
+ this.$tip = $(this.options.template)
1168
+ }
1169
+ return this.$tip
1170
+ }
1171
+
1172
+ })
1173
+
1174
+
1175
+ /* POPOVER PLUGIN DEFINITION
1176
+ * ======================= */
1177
+
1178
+ $.fn.popover = function ( option ) {
1179
+ return this.each(function () {
1180
+ var $this = $(this)
1181
+ , data = $this.data('popover')
1182
+ , options = typeof option == 'object' && option
1183
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
1184
+ if (typeof option == 'string') data[option]()
1185
+ })
1186
+ }
1187
+
1188
+ $.fn.popover.Constructor = Popover
1189
+
1190
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1191
+ placement: 'right'
1192
+ , content: ''
1193
+ , 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>'
1194
+ })
1195
+
1196
+ }( window.jQuery )
1197
+ /* =============================================================
1198
+ * bootstrap-scrollspy.js v2.0.0
1199
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1200
+ * =============================================================
1201
+ * Copyright 2012 Twitter, Inc.
1202
+ *
1203
+ * Licensed under the Apache License, Version 2.0 (the "License");
1204
+ * you may not use this file except in compliance with the License.
1205
+ * You may obtain a copy of the License at
1206
+ *
1207
+ * http://www.apache.org/licenses/LICENSE-2.0
1208
+ *
1209
+ * Unless required by applicable law or agreed to in writing, software
1210
+ * distributed under the License is distributed on an "AS IS" BASIS,
1211
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
+ * See the License for the specific language governing permissions and
1213
+ * limitations under the License.
1214
+ * ============================================================== */
1215
+
1216
+ !function ( $ ) {
1217
+
1218
+ "use strict"
1219
+
1220
+ /* SCROLLSPY CLASS DEFINITION
1221
+ * ========================== */
1222
+
1223
+ function ScrollSpy( element, options) {
1224
+ var process = $.proxy(this.process, this)
1225
+ , $element = $(element).is('body') ? $(window) : $(element)
1226
+ , href
1227
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1228
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
1229
+ this.selector = (this.options.target
1230
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1231
+ || '') + ' .nav li > a'
1232
+ this.$body = $('body').on('click.scroll.data-api', this.selector, process)
1233
+ this.refresh()
1234
+ this.process()
1235
+ }
1236
+
1237
+ ScrollSpy.prototype = {
1238
+
1239
+ constructor: ScrollSpy
1240
+
1241
+ , refresh: function () {
1242
+ this.targets = this.$body
1243
+ .find(this.selector)
1244
+ .map(function () {
1245
+ var href = $(this).attr('href')
1246
+ return /^#\w/.test(href) && $(href).length ? href : null
1247
+ })
1248
+
1249
+ this.offsets = $.map(this.targets, function (id) {
1250
+ return $(id).position().top
1251
+ })
1252
+ }
1253
+
1254
+ , process: function () {
1255
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1256
+ , offsets = this.offsets
1257
+ , targets = this.targets
1258
+ , activeTarget = this.activeTarget
1259
+ , i
1260
+
1261
+ for (i = offsets.length; i--;) {
1262
+ activeTarget != targets[i]
1263
+ && scrollTop >= offsets[i]
1264
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1265
+ && this.activate( targets[i] )
1266
+ }
1267
+ }
1268
+
1269
+ , activate: function (target) {
1270
+ var active
1271
+
1272
+ this.activeTarget = target
1273
+
1274
+ this.$body
1275
+ .find(this.selector).parent('.active')
1276
+ .removeClass('active')
1277
+
1278
+ active = this.$body
1279
+ .find(this.selector + '[href="' + target + '"]')
1280
+ .parent('li')
1281
+ .addClass('active')
1282
+
1283
+ if ( active.parent('.dropdown-menu') ) {
1284
+ active.closest('li.dropdown').addClass('active')
1285
+ }
1286
+ }
1287
+
1288
+ }
1289
+
1290
+
1291
+ /* SCROLLSPY PLUGIN DEFINITION
1292
+ * =========================== */
1293
+
1294
+ $.fn.scrollspy = function ( option ) {
1295
+ return this.each(function () {
1296
+ var $this = $(this)
1297
+ , data = $this.data('scrollspy')
1298
+ , options = typeof option == 'object' && option
1299
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1300
+ if (typeof option == 'string') data[option]()
1301
+ })
1302
+ }
1303
+
1304
+ $.fn.scrollspy.Constructor = ScrollSpy
1305
+
1306
+ $.fn.scrollspy.defaults = {
1307
+ offset: 10
1308
+ }
1309
+
1310
+
1311
+ /* SCROLLSPY DATA-API
1312
+ * ================== */
1313
+
1314
+ $(function () {
1315
+ $('[data-spy="scroll"]').each(function () {
1316
+ var $spy = $(this)
1317
+ $spy.scrollspy($spy.data())
1318
+ })
1319
+ })
1320
+
1321
+ }( window.jQuery )
1322
+ /* ========================================================
1323
+ * bootstrap-tab.js v2.0.0
1324
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
1325
+ * ========================================================
1326
+ * Copyright 2012 Twitter, Inc.
1327
+ *
1328
+ * Licensed under the Apache License, Version 2.0 (the "License");
1329
+ * you may not use this file except in compliance with the License.
1330
+ * You may obtain a copy of the License at
1331
+ *
1332
+ * http://www.apache.org/licenses/LICENSE-2.0
1333
+ *
1334
+ * Unless required by applicable law or agreed to in writing, software
1335
+ * distributed under the License is distributed on an "AS IS" BASIS,
1336
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1337
+ * See the License for the specific language governing permissions and
1338
+ * limitations under the License.
1339
+ * ======================================================== */
1340
+
1341
+
1342
+ !function( $ ){
1343
+
1344
+ "use strict"
1345
+
1346
+ /* TAB CLASS DEFINITION
1347
+ * ==================== */
1348
+
1349
+ var Tab = function ( element ) {
1350
+ this.element = $(element)
1351
+ }
1352
+
1353
+ Tab.prototype = {
1354
+
1355
+ constructor: Tab
1356
+
1357
+ , show: function () {
1358
+ var $this = this.element
1359
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
1360
+ , selector = $this.attr('data-target')
1361
+ , previous
1362
+ , $target
1363
+
1364
+ if (!selector) {
1365
+ selector = $this.attr('href')
1366
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1367
+ }
1368
+
1369
+ if ( $this.parent('li').hasClass('active') ) return
1370
+
1371
+ previous = $ul.find('.active a').last()[0]
1372
+
1373
+ $this.trigger({
1374
+ type: 'show'
1375
+ , relatedTarget: previous
1376
+ })
1377
+
1378
+ $target = $(selector)
1379
+
1380
+ this.activate($this.parent('li'), $ul)
1381
+ this.activate($target, $target.parent(), function () {
1382
+ $this.trigger({
1383
+ type: 'shown'
1384
+ , relatedTarget: previous
1385
+ })
1386
+ })
1387
+ }
1388
+
1389
+ , activate: function ( element, container, callback) {
1390
+ var $active = container.find('> .active')
1391
+ , transition = callback
1392
+ && $.support.transition
1393
+ && $active.hasClass('fade')
1394
+
1395
+ function next() {
1396
+ $active
1397
+ .removeClass('active')
1398
+ .find('> .dropdown-menu > .active')
1399
+ .removeClass('active')
1400
+
1401
+ element.addClass('active')
1402
+
1403
+ if (transition) {
1404
+ element[0].offsetWidth // reflow for transition
1405
+ element.addClass('in')
1406
+ } else {
1407
+ element.removeClass('fade')
1408
+ }
1409
+
1410
+ if ( element.parent('.dropdown-menu') ) {
1411
+ element.closest('li.dropdown').addClass('active')
1412
+ }
1413
+
1414
+ callback && callback()
1415
+ }
1416
+
1417
+ transition ?
1418
+ $active.one($.support.transition.end, next) :
1419
+ next()
1420
+
1421
+ $active.removeClass('in')
1422
+ }
1423
+ }
1424
+
1425
+
1426
+ /* TAB PLUGIN DEFINITION
1427
+ * ===================== */
1428
+
1429
+ $.fn.tab = function ( option ) {
1430
+ return this.each(function () {
1431
+ var $this = $(this)
1432
+ , data = $this.data('tab')
1433
+ if (!data) $this.data('tab', (data = new Tab(this)))
1434
+ if (typeof option == 'string') data[option]()
1435
+ })
1436
+ }
1437
+
1438
+ $.fn.tab.Constructor = Tab
1439
+
1440
+
1441
+ /* TAB DATA-API
1442
+ * ============ */
1443
+
1444
+ $(function () {
1445
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1446
+ e.preventDefault()
1447
+ $(this).tab('show')
1448
+ })
1449
+ })
1450
+
1451
+ }( window.jQuery )
1452
+ /* =============================================================
1453
+ * bootstrap-typeahead.js v2.0.0
1454
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
1455
+ * =============================================================
1456
+ * Copyright 2012 Twitter, Inc.
1457
+ *
1458
+ * Licensed under the Apache License, Version 2.0 (the "License");
1459
+ * you may not use this file except in compliance with the License.
1460
+ * You may obtain a copy of the License at
1461
+ *
1462
+ * http://www.apache.org/licenses/LICENSE-2.0
1463
+ *
1464
+ * Unless required by applicable law or agreed to in writing, software
1465
+ * distributed under the License is distributed on an "AS IS" BASIS,
1466
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1467
+ * See the License for the specific language governing permissions and
1468
+ * limitations under the License.
1469
+ * ============================================================ */
1470
+
1471
+ !function( $ ){
1472
+
1473
+ "use strict"
1474
+
1475
+ var Typeahead = function ( element, options ) {
1476
+ this.$element = $(element)
1477
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
1478
+ this.matcher = this.options.matcher || this.matcher
1479
+ this.sorter = this.options.sorter || this.sorter
1480
+ this.highlighter = this.options.highlighter || this.highlighter
1481
+ this.$menu = $(this.options.menu).appendTo('body')
1482
+ this.source = this.options.source
1483
+ this.shown = false
1484
+ this.listen()
1485
+ }
1486
+
1487
+ Typeahead.prototype = {
1488
+
1489
+ constructor: Typeahead
1490
+
1491
+ , select: function () {
1492
+ var val = this.$menu.find('.active').attr('data-value')
1493
+ this.$element.val(val)
1494
+ return this.hide()
1495
+ }
1496
+
1497
+ , show: function () {
1498
+ var pos = $.extend({}, this.$element.offset(), {
1499
+ height: this.$element[0].offsetHeight
1500
+ })
1501
+
1502
+ this.$menu.css({
1503
+ top: pos.top + pos.height
1504
+ , left: pos.left
1505
+ })
1506
+
1507
+ this.$menu.show()
1508
+ this.shown = true
1509
+ return this
1510
+ }
1511
+
1512
+ , hide: function () {
1513
+ this.$menu.hide()
1514
+ this.shown = false
1515
+ return this
1516
+ }
1517
+
1518
+ , lookup: function (event) {
1519
+ var that = this
1520
+ , items
1521
+ , q
1522
+
1523
+ this.query = this.$element.val()
1524
+
1525
+ if (!this.query) {
1526
+ return this.shown ? this.hide() : this
1527
+ }
1528
+
1529
+ items = $.grep(this.source, function (item) {
1530
+ if (that.matcher(item)) return item
1531
+ })
1532
+
1533
+ items = this.sorter(items)
1534
+
1535
+ if (!items.length) {
1536
+ return this.shown ? this.hide() : this
1537
+ }
1538
+
1539
+ return this.render(items.slice(0, this.options.items)).show()
1540
+ }
1541
+
1542
+ , matcher: function (item) {
1543
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1544
+ }
1545
+
1546
+ , sorter: function (items) {
1547
+ var beginswith = []
1548
+ , caseSensitive = []
1549
+ , caseInsensitive = []
1550
+ , item
1551
+
1552
+ while (item = items.shift()) {
1553
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1554
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
1555
+ else caseInsensitive.push(item)
1556
+ }
1557
+
1558
+ return beginswith.concat(caseSensitive, caseInsensitive)
1559
+ }
1560
+
1561
+ , highlighter: function (item) {
1562
+ return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
1563
+ return '<strong>' + match + '</strong>'
1564
+ })
1565
+ }
1566
+
1567
+ , render: function (items) {
1568
+ var that = this
1569
+
1570
+ items = $(items).map(function (i, item) {
1571
+ i = $(that.options.item).attr('data-value', item)
1572
+ i.find('a').html(that.highlighter(item))
1573
+ return i[0]
1574
+ })
1575
+
1576
+ items.first().addClass('active')
1577
+ this.$menu.html(items)
1578
+ return this
1579
+ }
1580
+
1581
+ , next: function (event) {
1582
+ var active = this.$menu.find('.active').removeClass('active')
1583
+ , next = active.next()
1584
+
1585
+ if (!next.length) {
1586
+ next = $(this.$menu.find('li')[0])
1587
+ }
1588
+
1589
+ next.addClass('active')
1590
+ }
1591
+
1592
+ , prev: function (event) {
1593
+ var active = this.$menu.find('.active').removeClass('active')
1594
+ , prev = active.prev()
1595
+
1596
+ if (!prev.length) {
1597
+ prev = this.$menu.find('li').last()
1598
+ }
1599
+
1600
+ prev.addClass('active')
1601
+ }
1602
+
1603
+ , listen: function () {
1604
+ this.$element
1605
+ .on('blur', $.proxy(this.blur, this))
1606
+ .on('keypress', $.proxy(this.keypress, this))
1607
+ .on('keyup', $.proxy(this.keyup, this))
1608
+
1609
+ if ($.browser.webkit || $.browser.msie) {
1610
+ this.$element.on('keydown', $.proxy(this.keypress, this))
1611
+ }
1612
+
1613
+ this.$menu
1614
+ .on('click', $.proxy(this.click, this))
1615
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1616
+ }
1617
+
1618
+ , keyup: function (e) {
1619
+ e.stopPropagation()
1620
+ e.preventDefault()
1621
+
1622
+ switch(e.keyCode) {
1623
+ case 40: // down arrow
1624
+ case 38: // up arrow
1625
+ break
1626
+
1627
+ case 9: // tab
1628
+ case 13: // enter
1629
+ if (!this.shown) return
1630
+ this.select()
1631
+ break
1632
+
1633
+ case 27: // escape
1634
+ this.hide()
1635
+ break
1636
+
1637
+ default:
1638
+ this.lookup()
1639
+ }
1640
+
1641
+ }
1642
+
1643
+ , keypress: function (e) {
1644
+ e.stopPropagation()
1645
+ if (!this.shown) return
1646
+
1647
+ switch(e.keyCode) {
1648
+ case 9: // tab
1649
+ case 13: // enter
1650
+ case 27: // escape
1651
+ e.preventDefault()
1652
+ break
1653
+
1654
+ case 38: // up arrow
1655
+ e.preventDefault()
1656
+ this.prev()
1657
+ break
1658
+
1659
+ case 40: // down arrow
1660
+ e.preventDefault()
1661
+ this.next()
1662
+ break
1663
+ }
1664
+ }
1665
+
1666
+ , blur: function (e) {
1667
+ var that = this
1668
+ e.stopPropagation()
1669
+ e.preventDefault()
1670
+ setTimeout(function () { that.hide() }, 150)
1671
+ }
1672
+
1673
+ , click: function (e) {
1674
+ e.stopPropagation()
1675
+ e.preventDefault()
1676
+ this.select()
1677
+ }
1678
+
1679
+ , mouseenter: function (e) {
1680
+ this.$menu.find('.active').removeClass('active')
1681
+ $(e.currentTarget).addClass('active')
1682
+ }
1683
+
1684
+ }
1685
+
1686
+
1687
+ /* TYPEAHEAD PLUGIN DEFINITION
1688
+ * =========================== */
1689
+
1690
+ $.fn.typeahead = function ( option ) {
1691
+ return this.each(function () {
1692
+ var $this = $(this)
1693
+ , data = $this.data('typeahead')
1694
+ , options = typeof option == 'object' && option
1695
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1696
+ if (typeof option == 'string') data[option]()
1697
+ })
1698
+ }
1699
+
1700
+ $.fn.typeahead.defaults = {
1701
+ source: []
1702
+ , items: 8
1703
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
1704
+ , item: '<li><a href="#"></a></li>'
1705
+ }
1706
+
1707
+ $.fn.typeahead.Constructor = Typeahead
1708
+
1709
+
1710
+ /* TYPEAHEAD DATA-API
1711
+ * ================== */
1712
+
1713
+ $(function () {
1714
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1715
+ var $this = $(this)
1716
+ if ($this.data('typeahead')) return
1717
+ e.preventDefault()
1718
+ $this.typeahead($this.data())
1719
+ })
1720
+ })
1721
+
1722
+ }( window.jQuery )