swagr 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (359) hide show
  1. data/bin/swagr +15 -0
  2. data/examples/examples01/app.rb +6 -2
  3. data/examples/examples01/coffee/data_port.coffee +2 -0
  4. data/examples/examples01/static/css/codemirror.css +1247 -0
  5. data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
  6. data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
  7. data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
  8. data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
  9. data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
  10. data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
  11. data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
  12. data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
  13. data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
  14. data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
  15. data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
  16. data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
  17. data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
  18. data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
  19. data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
  20. data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
  21. data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
  22. data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
  23. data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
  24. data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
  25. data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
  26. data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
  27. data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
  28. data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
  29. data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
  30. data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
  31. data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
  32. data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
  33. data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
  34. data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
  35. data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
  36. data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
  37. data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
  38. data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
  39. data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
  40. data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
  41. data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
  42. data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
  43. data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
  44. data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
  45. data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
  46. data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
  47. data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
  48. data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
  49. data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
  50. data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
  51. data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
  52. data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
  53. data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
  54. data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
  55. data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
  56. data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
  57. data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
  58. data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
  59. data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
  60. data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
  61. data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
  62. data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  63. data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
  64. data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
  65. data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
  66. data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
  67. data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
  68. data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
  69. data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
  70. data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
  71. data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
  72. data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
  73. data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
  74. data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
  75. data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
  76. data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
  77. data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
  78. data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
  79. data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
  80. data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
  81. data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
  82. data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
  83. data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
  84. data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
  85. data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
  86. data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
  87. data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
  88. data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
  89. data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
  90. data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
  91. data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
  92. data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
  93. data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
  94. data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
  95. data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
  96. data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
  97. data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
  98. data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
  99. data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
  100. data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
  101. data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
  102. data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
  103. data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
  104. data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
  105. data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
  106. data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
  107. data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
  108. data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
  109. data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
  110. data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
  111. data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
  112. data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
  113. data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
  114. data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
  115. data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
  116. data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
  117. data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
  118. data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
  119. data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
  120. data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
  121. data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
  122. data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
  123. data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
  124. data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
  125. data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
  126. data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
  127. data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
  128. data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
  129. data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
  130. data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
  131. data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
  132. data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
  133. data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
  134. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
  135. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  136. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  137. data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
  138. data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
  139. data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
  140. data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
  141. data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
  142. data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
  143. data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
  144. data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
  145. data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
  146. data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
  147. data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
  148. data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
  149. data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
  150. data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
  151. data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
  152. data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
  153. data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
  154. data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
  155. data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
  156. data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
  157. data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
  158. data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
  159. data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
  160. data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
  161. data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
  162. data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
  163. data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
  164. data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
  165. data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
  166. data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
  167. data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
  168. data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
  169. data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
  170. data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
  171. data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
  172. data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
  173. data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
  174. data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
  175. data/examples/examples01/static/js/d3.v3.min.js +2 -2
  176. data/examples/examples01/static/test/cm.html +33 -0
  177. data/examples/examples01/views/about.slim +15 -0
  178. data/examples/examples01/views/index.slim +1 -1
  179. data/examples/examples01/views/layout.slim +1 -0
  180. data/examples/examples01/views/layout_cm.slim +17 -0
  181. data/examples/examples01/views/navbar.slim +4 -4
  182. data/lib/swagr/version.rb +1 -1
  183. data/templates/app.rb +4 -0
  184. data/templates/static/js/codemirror/keymap/emacs.js +30 -0
  185. data/templates/static/js/codemirror/keymap/vim.js +2298 -0
  186. data/templates/static/js/codemirror/lib/codemirror.css +239 -0
  187. data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
  188. data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
  189. data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
  190. data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
  191. data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
  192. data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
  193. data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
  194. data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
  195. data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
  196. data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
  197. data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
  198. data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
  199. data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
  200. data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
  201. data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
  202. data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
  203. data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
  204. data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
  205. data/templates/static/js/codemirror/lib/util/search.js +119 -0
  206. data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
  207. data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
  208. data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
  209. data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
  210. data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
  211. data/templates/static/js/codemirror/mode/clike/index.html +103 -0
  212. data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
  213. data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
  214. data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
  215. data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
  216. data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
  217. data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
  218. data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
  219. data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
  220. data/templates/static/js/codemirror/mode/css/css.js +465 -0
  221. data/templates/static/js/codemirror/mode/css/index.html +58 -0
  222. data/templates/static/js/codemirror/mode/css/test.js +501 -0
  223. data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
  224. data/templates/static/js/codemirror/mode/diff/index.html +105 -0
  225. data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
  226. data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
  227. data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
  228. data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
  229. data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
  230. data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
  231. data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
  232. data/templates/static/js/codemirror/mode/go/go.js +165 -0
  233. data/templates/static/js/codemirror/mode/go/index.html +74 -0
  234. data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
  235. data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
  236. data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
  237. data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
  238. data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
  239. data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
  240. data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  241. data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
  242. data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
  243. data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
  244. data/templates/static/js/codemirror/mode/http/http.js +98 -0
  245. data/templates/static/js/codemirror/mode/http/index.html +32 -0
  246. data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
  247. data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
  248. data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
  249. data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
  250. data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
  251. data/templates/static/js/codemirror/mode/less/index.html +741 -0
  252. data/templates/static/js/codemirror/mode/less/less.js +266 -0
  253. data/templates/static/js/codemirror/mode/lua/index.html +74 -0
  254. data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
  255. data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
  256. data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
  257. data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
  258. data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
  259. data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
  260. data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
  261. data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
  262. data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
  263. data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
  264. data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
  265. data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
  266. data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
  267. data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
  268. data/templates/static/js/codemirror/mode/perl/index.html +62 -0
  269. data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
  270. data/templates/static/js/codemirror/mode/php/index.html +51 -0
  271. data/templates/static/js/codemirror/mode/php/php.js +129 -0
  272. data/templates/static/js/codemirror/mode/pig/index.html +42 -0
  273. data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
  274. data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
  275. data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
  276. data/templates/static/js/codemirror/mode/properties/index.html +41 -0
  277. data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
  278. data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
  279. data/templates/static/js/codemirror/mode/python/index.html +124 -0
  280. data/templates/static/js/codemirror/mode/python/python.js +340 -0
  281. data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
  282. data/templates/static/js/codemirror/mode/r/index.html +74 -0
  283. data/templates/static/js/codemirror/mode/r/r.js +141 -0
  284. data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
  285. data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
  286. data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
  287. data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
  288. data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
  289. data/templates/static/js/codemirror/mode/rst/index.html +526 -0
  290. data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
  291. data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
  292. data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
  293. data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
  294. data/templates/static/js/codemirror/mode/rust/index.html +48 -0
  295. data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
  296. data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
  297. data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
  298. data/templates/static/js/codemirror/mode/shell/index.html +51 -0
  299. data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
  300. data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
  301. data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
  302. data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
  303. data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
  304. data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
  305. data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
  306. data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
  307. data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
  308. data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
  309. data/templates/static/js/codemirror/mode/stex/index.html +98 -0
  310. data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
  311. data/templates/static/js/codemirror/mode/stex/test.js +343 -0
  312. data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
  313. data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  314. data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  315. data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
  316. data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
  317. data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
  318. data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
  319. data/templates/static/js/codemirror/mode/vb/index.html +88 -0
  320. data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
  321. data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
  322. data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
  323. data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
  324. data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
  325. data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
  326. data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
  327. data/templates/static/js/codemirror/mode/xml/index.html +45 -0
  328. data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
  329. data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
  330. data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
  331. data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
  332. data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
  333. data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
  334. data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
  335. data/templates/static/js/codemirror/mode/z80/index.html +39 -0
  336. data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
  337. data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
  338. data/templates/static/js/codemirror/theme/ambiance.css +76 -0
  339. data/templates/static/js/codemirror/theme/blackboard.css +25 -0
  340. data/templates/static/js/codemirror/theme/cobalt.css +18 -0
  341. data/templates/static/js/codemirror/theme/eclipse.css +25 -0
  342. data/templates/static/js/codemirror/theme/elegant.css +10 -0
  343. data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
  344. data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
  345. data/templates/static/js/codemirror/theme/monokai.css +28 -0
  346. data/templates/static/js/codemirror/theme/neat.css +9 -0
  347. data/templates/static/js/codemirror/theme/night.css +21 -0
  348. data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
  349. data/templates/static/js/codemirror/theme/solarized.css +207 -0
  350. data/templates/static/js/codemirror/theme/twilight.css +26 -0
  351. data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
  352. data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
  353. data/templates/static/js/d3.v3.min.js +2 -2
  354. data/templates/static/test/cm.html +33 -0
  355. data/templates/views/about.slim +15 -0
  356. data/templates/views/index.slim +1 -1
  357. data/templates/views/layout.slim +1 -0
  358. data/templates/views/navbar.slim +4 -4
  359. metadata +347 -2
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Tag-closer extension for CodeMirror.
3
+ *
4
+ * This extension adds an "autoCloseTags" option that can be set to
5
+ * either true to get the default behavior, or an object to further
6
+ * configure its behavior.
7
+ *
8
+ * These are supported options:
9
+ *
10
+ * `whenClosing` (default true)
11
+ * Whether to autoclose when the '/' of a closing tag is typed.
12
+ * `whenOpening` (default true)
13
+ * Whether to autoclose the tag when the final '>' of an opening
14
+ * tag is typed.
15
+ * `dontCloseTags` (default is empty tags for HTML, none for XML)
16
+ * An array of tag names that should not be autoclosed.
17
+ * `indentTags` (default is block tags for HTML, none for XML)
18
+ * An array of tag names that should, when opened, cause a
19
+ * blank line to be added inside the tag, and the blank line and
20
+ * closing line to be indented.
21
+ *
22
+ * See demos/closetag.html for a usage example.
23
+ */
24
+
25
+ (function() {
26
+ CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
27
+ if (val && (old == CodeMirror.Init || !old)) {
28
+ var map = {name: "autoCloseTags"};
29
+ if (typeof val != "object" || val.whenClosing)
30
+ map["'/'"] = function(cm) { autoCloseTag(cm, '/'); };
31
+ if (typeof val != "object" || val.whenOpening)
32
+ map["'>'"] = function(cm) { autoCloseTag(cm, '>'); };
33
+ cm.addKeyMap(map);
34
+ } else if (!val && (old != CodeMirror.Init && old)) {
35
+ cm.removeKeyMap("autoCloseTags");
36
+ }
37
+ });
38
+
39
+ var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
40
+ "source", "track", "wbr"];
41
+ var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
42
+ "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
43
+
44
+ function autoCloseTag(cm, ch) {
45
+ var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
46
+ var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
47
+ if (inner.mode.name != "xml") throw CodeMirror.Pass;
48
+
49
+ var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
50
+ var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
51
+ var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
52
+
53
+ if (ch == ">" && state.tagName) {
54
+ var tagName = state.tagName;
55
+ if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
56
+ var lowerTagName = tagName.toLowerCase();
57
+ // Don't process the '>' at the end of an end-tag or self-closing tag
58
+ if (tok.type == "tag" && state.type == "closeTag" ||
59
+ /\/\s*$/.test(tok.string) ||
60
+ dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
61
+ throw CodeMirror.Pass;
62
+
63
+ var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;
64
+ cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">",
65
+ doIndent ? {line: pos.line + 1, ch: 0} : {line: pos.line, ch: pos.ch + 1});
66
+ if (doIndent) {
67
+ cm.indentLine(pos.line + 1);
68
+ cm.indentLine(pos.line + 2);
69
+ }
70
+ return;
71
+ } else if (ch == "/" && tok.type == "tag" && tok.string == "<") {
72
+ var tagName = state.context && state.context.tagName;
73
+ if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
74
+ return;
75
+ }
76
+ throw CodeMirror.Pass;
77
+ }
78
+
79
+ function indexOf(collection, elt) {
80
+ if (collection.indexOf) return collection.indexOf(elt);
81
+ for (var i = 0, e = collection.length; i < e; ++i)
82
+ if (collection[i] == elt) return i;
83
+ return -1;
84
+ }
85
+ })();
@@ -0,0 +1,29 @@
1
+ CodeMirror.colorize = (function() {
2
+
3
+ var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
4
+
5
+ function textContent(node, out) {
6
+ if (node.nodeType == 3) return out.push(node.nodeValue);
7
+ for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
8
+ textContent(ch, out);
9
+ if (isBlock.test(node.nodeType)) out.push("\n");
10
+ }
11
+ }
12
+
13
+ return function(collection, defaultMode) {
14
+ if (!collection) collection = document.body.getElementsByTagName("pre");
15
+
16
+ for (var i = 0; i < collection.length; ++i) {
17
+ var node = collection[i];
18
+ var mode = node.getAttribute("data-lang") || defaultMode;
19
+ if (!mode) continue;
20
+
21
+ var text = [];
22
+ textContent(node, text);
23
+ node.innerHTML = "";
24
+ CodeMirror.runMode(text.join(""), mode, node);
25
+
26
+ node.className += " cm-s-default";
27
+ }
28
+ };
29
+ })();
@@ -0,0 +1,36 @@
1
+ (function() {
2
+ var modes = ["clike", "css", "javascript"];
3
+ for (var i = 0; i < modes.length; ++i)
4
+ CodeMirror.extendMode(modes[i], {blockCommentStart: "/*",
5
+ blockCommentEnd: "*/",
6
+ blockCommentContinue: " * "});
7
+
8
+ CodeMirror.commands.newlineAndIndentContinueComment = function(cm) {
9
+ var pos = cm.getCursor(), token = cm.getTokenAt(pos);
10
+ var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;
11
+ var space;
12
+
13
+ if (token.type == "comment" && mode.blockCommentStart) {
14
+ var end = token.string.indexOf(mode.blockCommentEnd);
15
+ var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}), found;
16
+ if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {
17
+ // Comment ended, don't continue it
18
+ } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
19
+ space = full.slice(0, token.start);
20
+ if (!/^\s*$/.test(space)) {
21
+ space = "";
22
+ for (var i = 0; i < token.start; ++i) space += " ";
23
+ }
24
+ } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
25
+ found + mode.blockCommentContinue.length > token.start &&
26
+ /^\s*$/.test(full.slice(0, found))) {
27
+ space = full.slice(0, found);
28
+ }
29
+ }
30
+
31
+ if (space != null)
32
+ cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end");
33
+ else
34
+ cm.execCommand("newlineAndIndent");
35
+ };
36
+ })();
@@ -0,0 +1,28 @@
1
+ (function() {
2
+ CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
3
+ var pos = cm.getCursor(), token = cm.getTokenAt(pos);
4
+ var space;
5
+ if (token.className == "string") {
6
+ var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end});
7
+ var listStart = /\*|\d+\./, listContinue;
8
+ if (token.string.search(listStart) == 0) {
9
+ var reg = /^[\W]*(\d+)\./g;
10
+ var matches = reg.exec(full);
11
+ if(matches)
12
+ listContinue = (parseInt(matches[1]) + 1) + ". ";
13
+ else
14
+ listContinue = "* ";
15
+ space = full.slice(0, token.start);
16
+ if (!/^\s*$/.test(space)) {
17
+ space = "";
18
+ for (var i = 0; i < token.start; ++i) space += " ";
19
+ }
20
+ }
21
+ }
22
+
23
+ if (space != null)
24
+ cm.replaceSelection("\n" + space + listContinue, "end");
25
+ else
26
+ cm.execCommand("newlineAndIndent");
27
+ };
28
+ })();
@@ -0,0 +1,32 @@
1
+ .CodeMirror-dialog {
2
+ position: absolute;
3
+ left: 0; right: 0;
4
+ background: white;
5
+ z-index: 15;
6
+ padding: .1em .8em;
7
+ overflow: hidden;
8
+ color: #333;
9
+ }
10
+
11
+ .CodeMirror-dialog-top {
12
+ border-bottom: 1px solid #eee;
13
+ top: 0;
14
+ }
15
+
16
+ .CodeMirror-dialog-bottom {
17
+ border-top: 1px solid #eee;
18
+ bottom: 0;
19
+ }
20
+
21
+ .CodeMirror-dialog input {
22
+ border: none;
23
+ outline: none;
24
+ background: transparent;
25
+ width: 20em;
26
+ color: inherit;
27
+ font-family: monospace;
28
+ }
29
+
30
+ .CodeMirror-dialog button {
31
+ font-size: 70%;
32
+ }
@@ -0,0 +1,75 @@
1
+ // Open simple dialogs on top of an editor. Relies on dialog.css.
2
+
3
+ (function() {
4
+ function dialogDiv(cm, template, bottom) {
5
+ var wrap = cm.getWrapperElement();
6
+ var dialog;
7
+ dialog = wrap.appendChild(document.createElement("div"));
8
+ if (bottom) {
9
+ dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
10
+ } else {
11
+ dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
12
+ }
13
+ dialog.innerHTML = template;
14
+ return dialog;
15
+ }
16
+
17
+ CodeMirror.defineExtension("openDialog", function(template, callback, options) {
18
+ var dialog = dialogDiv(this, template, options && options.bottom);
19
+ var closed = false, me = this;
20
+ function close() {
21
+ if (closed) return;
22
+ closed = true;
23
+ dialog.parentNode.removeChild(dialog);
24
+ }
25
+ var inp = dialog.getElementsByTagName("input")[0], button;
26
+ if (inp) {
27
+ CodeMirror.on(inp, "keydown", function(e) {
28
+ if (e.keyCode == 13 || e.keyCode == 27) {
29
+ CodeMirror.e_stop(e);
30
+ close();
31
+ me.focus();
32
+ if (e.keyCode == 13) callback(inp.value);
33
+ }
34
+ });
35
+ inp.focus();
36
+ CodeMirror.on(inp, "blur", close);
37
+ } else if (button = dialog.getElementsByTagName("button")[0]) {
38
+ CodeMirror.on(button, "click", function() {
39
+ close();
40
+ me.focus();
41
+ });
42
+ button.focus();
43
+ CodeMirror.on(button, "blur", close);
44
+ }
45
+ return close;
46
+ });
47
+
48
+ CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
49
+ var dialog = dialogDiv(this, template, options && options.bottom);
50
+ var buttons = dialog.getElementsByTagName("button");
51
+ var closed = false, me = this, blurring = 1;
52
+ function close() {
53
+ if (closed) return;
54
+ closed = true;
55
+ dialog.parentNode.removeChild(dialog);
56
+ me.focus();
57
+ }
58
+ buttons[0].focus();
59
+ for (var i = 0; i < buttons.length; ++i) {
60
+ var b = buttons[i];
61
+ (function(callback) {
62
+ CodeMirror.on(b, "click", function(e) {
63
+ CodeMirror.e_preventDefault(e);
64
+ close();
65
+ if (callback) callback(me);
66
+ });
67
+ })(callbacks[i]);
68
+ CodeMirror.on(b, "blur", function() {
69
+ --blurring;
70
+ setTimeout(function() { if (blurring <= 0) close(); }, 200);
71
+ });
72
+ CodeMirror.on(b, "focus", function() { ++blurring; });
73
+ }
74
+ });
75
+ })();
@@ -0,0 +1,182 @@
1
+ // the tagRangeFinder function is
2
+ // Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org>
3
+ // released under the MIT license (../../LICENSE) like the rest of CodeMirror
4
+ CodeMirror.tagRangeFinder = function(cm, start) {
5
+ var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
6
+ var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
7
+ var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*");
8
+
9
+ var lineText = cm.getLine(start.line);
10
+ var found = false;
11
+ var tag = null;
12
+ var pos = start.ch;
13
+ while (!found) {
14
+ pos = lineText.indexOf("<", pos);
15
+ if (-1 == pos) // no tag on line
16
+ return;
17
+ if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag
18
+ pos++;
19
+ continue;
20
+ }
21
+ // ok we seem to have a start tag
22
+ if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name...
23
+ pos++;
24
+ continue;
25
+ }
26
+ var gtPos = lineText.indexOf(">", pos + 1);
27
+ if (-1 == gtPos) { // end of start tag not in line
28
+ var l = start.line + 1;
29
+ var foundGt = false;
30
+ var lastLine = cm.lineCount();
31
+ while (l < lastLine && !foundGt) {
32
+ var lt = cm.getLine(l);
33
+ gtPos = lt.indexOf(">");
34
+ if (-1 != gtPos) { // found a >
35
+ foundGt = true;
36
+ var slash = lt.lastIndexOf("/", gtPos);
37
+ if (-1 != slash && slash < gtPos) {
38
+ var str = lineText.substr(slash, gtPos - slash + 1);
39
+ if (!str.match( /\/\s*\>/ )) // yep, that's the end of empty tag
40
+ return;
41
+ }
42
+ }
43
+ l++;
44
+ }
45
+ found = true;
46
+ }
47
+ else {
48
+ var slashPos = lineText.lastIndexOf("/", gtPos);
49
+ if (-1 == slashPos) { // cannot be empty tag
50
+ found = true;
51
+ // don't continue
52
+ }
53
+ else { // empty tag?
54
+ // check if really empty tag
55
+ var str = lineText.substr(slashPos, gtPos - slashPos + 1);
56
+ if (!str.match( /\/\s*\>/ )) { // finally not empty
57
+ found = true;
58
+ // don't continue
59
+ }
60
+ }
61
+ }
62
+ if (found) {
63
+ var subLine = lineText.substr(pos + 1);
64
+ tag = subLine.match(xmlNAMERegExp);
65
+ if (tag) {
66
+ // we have an element name, wooohooo !
67
+ tag = tag[0];
68
+ // do we have the close tag on same line ???
69
+ if (-1 != lineText.indexOf("</" + tag + ">", pos)) // yep
70
+ {
71
+ found = false;
72
+ }
73
+ // we don't, so we have a candidate...
74
+ }
75
+ else
76
+ found = false;
77
+ }
78
+ if (!found)
79
+ pos++;
80
+ }
81
+
82
+ if (found) {
83
+ var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)";
84
+ var startTagRegExp = new RegExp(startTag);
85
+ var endTag = "</" + tag + ">";
86
+ var depth = 1;
87
+ var l = start.line + 1;
88
+ var lastLine = cm.lineCount();
89
+ while (l < lastLine) {
90
+ lineText = cm.getLine(l);
91
+ var match = lineText.match(startTagRegExp);
92
+ if (match) {
93
+ for (var i = 0; i < match.length; i++) {
94
+ if (match[i] == endTag)
95
+ depth--;
96
+ else
97
+ depth++;
98
+ if (!depth) return {from: {line: start.line, ch: gtPos + 1},
99
+ to: {line: l, ch: match.index}};
100
+ }
101
+ }
102
+ l++;
103
+ }
104
+ return;
105
+ }
106
+ };
107
+
108
+ CodeMirror.braceRangeFinder = function(cm, start) {
109
+ var line = start.line, lineText = cm.getLine(line);
110
+ var at = lineText.length, startChar, tokenType;
111
+ for (;;) {
112
+ var found = lineText.lastIndexOf("{", at);
113
+ if (found < start.ch) break;
114
+ tokenType = cm.getTokenAt({line: line, ch: found}).type;
115
+ if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }
116
+ at = found - 1;
117
+ }
118
+ if (startChar == null || lineText.lastIndexOf("}") > startChar) return;
119
+ var count = 1, lastLine = cm.lineCount(), end, endCh;
120
+ outer: for (var i = line + 1; i < lastLine; ++i) {
121
+ var text = cm.getLine(i), pos = 0;
122
+ for (;;) {
123
+ var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos);
124
+ if (nextOpen < 0) nextOpen = text.length;
125
+ if (nextClose < 0) nextClose = text.length;
126
+ pos = Math.min(nextOpen, nextClose);
127
+ if (pos == text.length) break;
128
+ if (cm.getTokenAt({line: i, ch: pos + 1}).type == tokenType) {
129
+ if (pos == nextOpen) ++count;
130
+ else if (!--count) { end = i; endCh = pos; break outer; }
131
+ }
132
+ ++pos;
133
+ }
134
+ }
135
+ if (end == null || end == line + 1) return;
136
+ return {from: {line: line, ch: startChar + 1},
137
+ to: {line: end, ch: endCh}};
138
+ };
139
+
140
+ CodeMirror.indentRangeFinder = function(cm, start) {
141
+ var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
142
+ var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
143
+ for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
144
+ var curLine = cm.getLine(i);
145
+ if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent)
146
+ return {from: {line: start.line, ch: firstLine.length},
147
+ to: {line: i, ch: curLine.length}};
148
+ }
149
+ };
150
+
151
+ CodeMirror.newFoldFunction = function(rangeFinder, widget) {
152
+ if (widget == null) widget = "\u2194";
153
+ if (typeof widget == "string") {
154
+ var text = document.createTextNode(widget);
155
+ widget = document.createElement("span");
156
+ widget.appendChild(text);
157
+ widget.className = "CodeMirror-foldmarker";
158
+ }
159
+
160
+ return function(cm, pos) {
161
+ if (typeof pos == "number") pos = {line: pos, ch: 0};
162
+ var range = rangeFinder(cm, pos);
163
+ if (!range) return;
164
+
165
+ var present = cm.findMarksAt(range.from), cleared = 0;
166
+ for (var i = 0; i < present.length; ++i) {
167
+ if (present[i].__isFold) {
168
+ ++cleared;
169
+ present[i].clear();
170
+ }
171
+ }
172
+ if (cleared) return;
173
+
174
+ var myWidget = widget.cloneNode(true);
175
+ CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();});
176
+ var myRange = cm.markText(range.from, range.to, {
177
+ replacedWith: myWidget,
178
+ clearOnEnter: true,
179
+ __isFold: true
180
+ });
181
+ };
182
+ };