fluentd-ui 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/Gemfile.lock +1 -1
  4. data/app/assets/javascripts/application.js +2 -0
  5. data/app/assets/javascripts/codemirror.js +29 -0
  6. data/app/assets/javascripts/codemirror_fluentd.js +59 -0
  7. data/app/assets/stylesheets/application.css +6 -0
  8. data/app/views/fluentd/settings/edit.html.haml +1 -1
  9. data/app/views/shared/vue/_setting.html.erb +1 -1
  10. data/bower.json +2 -1
  11. data/lib/fluentd-ui/version.rb +1 -1
  12. data/spec/features/source_and_output_spec.rb +16 -6
  13. data/vendor/assets/javascripts/bower/codemirror/.bower.json +29 -0
  14. data/vendor/assets/javascripts/bower/codemirror/AUTHORS +423 -0
  15. data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +76 -0
  16. data/vendor/assets/javascripts/bower/codemirror/LICENSE +19 -0
  17. data/vendor/assets/javascripts/bower/codemirror/README.md +11 -0
  18. data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +183 -0
  19. data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +85 -0
  20. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +32 -0
  21. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +155 -0
  22. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +6 -0
  23. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +41 -0
  24. data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +94 -0
  25. data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +58 -0
  26. data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +64 -0
  27. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +159 -0
  28. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +159 -0
  29. data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +51 -0
  30. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +120 -0
  31. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +66 -0
  32. data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +27 -0
  33. data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +105 -0
  34. data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +57 -0
  35. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +145 -0
  36. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +20 -0
  37. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +134 -0
  38. data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +44 -0
  39. data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +49 -0
  40. data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +182 -0
  41. data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +41 -0
  42. data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +56 -0
  43. data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +348 -0
  44. data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +146 -0
  45. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +38 -0
  46. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +389 -0
  47. data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +197 -0
  48. data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +110 -0
  49. data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +41 -0
  50. data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +35 -0
  51. data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +136 -0
  52. data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +31 -0
  53. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +73 -0
  54. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +204 -0
  55. data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +28 -0
  56. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +112 -0
  57. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +643 -0
  58. data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +64 -0
  59. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +118 -0
  60. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +33 -0
  61. data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +85 -0
  62. data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +213 -0
  63. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +40 -0
  64. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +157 -0
  65. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +72 -0
  66. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +120 -0
  67. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +76 -0
  68. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +46 -0
  69. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +66 -0
  70. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +139 -0
  71. data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +128 -0
  72. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +8 -0
  73. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +90 -0
  74. data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +164 -0
  75. data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +189 -0
  76. data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +71 -0
  77. data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +118 -0
  78. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +86 -0
  79. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +670 -0
  80. data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +44 -0
  81. data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +139 -0
  82. data/vendor/assets/javascripts/bower/codemirror/bower.json +16 -0
  83. data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +411 -0
  84. data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +540 -0
  85. data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +4901 -0
  86. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +309 -0
  87. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +8029 -0
  88. data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +175 -0
  89. data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +198 -0
  90. data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +489 -0
  91. data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +767 -0
  92. data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +243 -0
  93. data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +255 -0
  94. data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +369 -0
  95. data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +122 -0
  96. data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +717 -0
  97. data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +152 -0
  98. data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +51 -0
  99. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +157 -0
  100. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +110 -0
  101. data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +135 -0
  102. data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +146 -0
  103. data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +218 -0
  104. data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +50 -0
  105. data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +47 -0
  106. data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +67 -0
  107. data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +76 -0
  108. data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +142 -0
  109. data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +299 -0
  110. data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +195 -0
  111. data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +207 -0
  112. data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +162 -0
  113. data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +622 -0
  114. data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +188 -0
  115. data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +345 -0
  116. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +123 -0
  117. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +213 -0
  118. data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +178 -0
  119. data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +184 -0
  120. data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +226 -0
  121. data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +159 -0
  122. data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +97 -0
  123. data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +267 -0
  124. data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +518 -0
  125. data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
  126. data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
  127. data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +113 -0
  128. data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +290 -0
  129. data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +590 -0
  130. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +686 -0
  131. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +72 -0
  132. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +200 -0
  133. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +61 -0
  134. data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +142 -0
  135. data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +301 -0
  136. data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +280 -0
  137. data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +280 -0
  138. data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +159 -0
  139. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +765 -0
  140. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +754 -0
  141. data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +165 -0
  142. data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +193 -0
  143. data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +205 -0
  144. data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +245 -0
  145. data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +178 -0
  146. data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +186 -0
  147. data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +135 -0
  148. data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +109 -0
  149. data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +114 -0
  150. data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +832 -0
  151. data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +226 -0
  152. data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +154 -0
  153. data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +188 -0
  154. data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +78 -0
  155. data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +220 -0
  156. data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +359 -0
  157. data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +139 -0
  158. data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +162 -0
  159. data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +101 -0
  160. data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +557 -0
  161. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +285 -0
  162. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +14 -0
  163. data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +451 -0
  164. data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +327 -0
  165. data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +248 -0
  166. data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +139 -0
  167. data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +58 -0
  168. data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +193 -0
  169. data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +575 -0
  170. data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +96 -0
  171. data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +168 -0
  172. data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +221 -0
  173. data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +197 -0
  174. data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +104 -0
  175. data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +198 -0
  176. data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +174 -0
  177. data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +109 -0
  178. data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +391 -0
  179. data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +251 -0
  180. data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +123 -0
  181. data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +147 -0
  182. data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +417 -0
  183. data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +469 -0
  184. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  185. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
  186. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +26 -0
  187. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +323 -0
  188. data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +88 -0
  189. data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +68 -0
  190. data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +162 -0
  191. data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +274 -0
  192. data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +350 -0
  193. data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +201 -0
  194. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +273 -0
  195. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +364 -0
  196. data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +51 -0
  197. data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +384 -0
  198. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +67 -0
  199. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +447 -0
  200. data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +117 -0
  201. data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +100 -0
  202. data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +38 -0
  203. data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +37 -0
  204. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +5 -0
  205. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +77 -0
  206. data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +36 -0
  207. data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +36 -0
  208. data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +30 -0
  209. data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +23 -0
  210. data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +23 -0
  211. data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +13 -0
  212. data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +32 -0
  213. data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +45 -0
  214. data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +35 -0
  215. data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +44 -0
  216. data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +45 -0
  217. data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +31 -0
  218. data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +12 -0
  219. data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +43 -0
  220. data/vendor/assets/javascripts/bower/codemirror/theme/night.css +26 -0
  221. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +36 -0
  222. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +36 -0
  223. data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +50 -0
  224. data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +23 -0
  225. data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +165 -0
  226. data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +28 -0
  227. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +35 -0
  228. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +36 -0
  229. data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +30 -0
  230. data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +32 -0
  231. data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +51 -0
  232. data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +43 -0
  233. data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +37 -0
  234. metadata +225 -2
@@ -0,0 +1,40 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("./runmode"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "./runmode"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
15
+
16
+ function textContent(node, out) {
17
+ if (node.nodeType == 3) return out.push(node.nodeValue);
18
+ for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
19
+ textContent(ch, out);
20
+ if (isBlock.test(node.nodeType)) out.push("\n");
21
+ }
22
+ }
23
+
24
+ CodeMirror.colorize = function(collection, defaultMode) {
25
+ if (!collection) collection = document.body.getElementsByTagName("pre");
26
+
27
+ for (var i = 0; i < collection.length; ++i) {
28
+ var node = collection[i];
29
+ var mode = node.getAttribute("data-lang") || defaultMode;
30
+ if (!mode) continue;
31
+
32
+ var text = [];
33
+ textContent(node, text);
34
+ node.innerHTML = "";
35
+ CodeMirror.runMode(text.join(""), mode, node);
36
+
37
+ node.className += " cm-s-default";
38
+ }
39
+ };
40
+ });
@@ -0,0 +1,157 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ window.CodeMirror = {};
5
+
6
+ (function() {
7
+ "use strict";
8
+
9
+ function splitLines(string){ return string.split(/\r?\n|\r/); };
10
+
11
+ function StringStream(string) {
12
+ this.pos = this.start = 0;
13
+ this.string = string;
14
+ this.lineStart = 0;
15
+ }
16
+ StringStream.prototype = {
17
+ eol: function() {return this.pos >= this.string.length;},
18
+ sol: function() {return this.pos == 0;},
19
+ peek: function() {return this.string.charAt(this.pos) || null;},
20
+ next: function() {
21
+ if (this.pos < this.string.length)
22
+ return this.string.charAt(this.pos++);
23
+ },
24
+ eat: function(match) {
25
+ var ch = this.string.charAt(this.pos);
26
+ if (typeof match == "string") var ok = ch == match;
27
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
28
+ if (ok) {++this.pos; return ch;}
29
+ },
30
+ eatWhile: function(match) {
31
+ var start = this.pos;
32
+ while (this.eat(match)){}
33
+ return this.pos > start;
34
+ },
35
+ eatSpace: function() {
36
+ var start = this.pos;
37
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
38
+ return this.pos > start;
39
+ },
40
+ skipToEnd: function() {this.pos = this.string.length;},
41
+ skipTo: function(ch) {
42
+ var found = this.string.indexOf(ch, this.pos);
43
+ if (found > -1) {this.pos = found; return true;}
44
+ },
45
+ backUp: function(n) {this.pos -= n;},
46
+ column: function() {return this.start - this.lineStart;},
47
+ indentation: function() {return 0;},
48
+ match: function(pattern, consume, caseInsensitive) {
49
+ if (typeof pattern == "string") {
50
+ var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
51
+ var substr = this.string.substr(this.pos, pattern.length);
52
+ if (cased(substr) == cased(pattern)) {
53
+ if (consume !== false) this.pos += pattern.length;
54
+ return true;
55
+ }
56
+ } else {
57
+ var match = this.string.slice(this.pos).match(pattern);
58
+ if (match && match.index > 0) return null;
59
+ if (match && consume !== false) this.pos += match[0].length;
60
+ return match;
61
+ }
62
+ },
63
+ current: function(){return this.string.slice(this.start, this.pos);},
64
+ hideFirstChars: function(n, inner) {
65
+ this.lineStart += n;
66
+ try { return inner(); }
67
+ finally { this.lineStart -= n; }
68
+ }
69
+ };
70
+ CodeMirror.StringStream = StringStream;
71
+
72
+ CodeMirror.startState = function (mode, a1, a2) {
73
+ return mode.startState ? mode.startState(a1, a2) : true;
74
+ };
75
+
76
+ var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
77
+ CodeMirror.defineMode = function (name, mode) {
78
+ if (arguments.length > 2)
79
+ mode.dependencies = Array.prototype.slice.call(arguments, 2);
80
+ modes[name] = mode;
81
+ };
82
+ CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; };
83
+ CodeMirror.resolveMode = function(spec) {
84
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
85
+ spec = mimeModes[spec];
86
+ } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
87
+ spec = mimeModes[spec.name];
88
+ }
89
+ if (typeof spec == "string") return {name: spec};
90
+ else return spec || {name: "null"};
91
+ };
92
+ CodeMirror.getMode = function (options, spec) {
93
+ spec = CodeMirror.resolveMode(spec);
94
+ var mfactory = modes[spec.name];
95
+ if (!mfactory) throw new Error("Unknown mode: " + spec);
96
+ return mfactory(options, spec);
97
+ };
98
+ CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min;
99
+ CodeMirror.defineMode("null", function() {
100
+ return {token: function(stream) {stream.skipToEnd();}};
101
+ });
102
+ CodeMirror.defineMIME("text/plain", "null");
103
+
104
+ CodeMirror.runMode = function (string, modespec, callback, options) {
105
+ var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);
106
+
107
+ if (callback.nodeType == 1) {
108
+ var tabSize = (options && options.tabSize) || 4;
109
+ var node = callback, col = 0;
110
+ node.innerHTML = "";
111
+ callback = function (text, style) {
112
+ if (text == "\n") {
113
+ node.appendChild(document.createElement("br"));
114
+ col = 0;
115
+ return;
116
+ }
117
+ var content = "";
118
+ // replace tabs
119
+ for (var pos = 0; ;) {
120
+ var idx = text.indexOf("\t", pos);
121
+ if (idx == -1) {
122
+ content += text.slice(pos);
123
+ col += text.length - pos;
124
+ break;
125
+ } else {
126
+ col += idx - pos;
127
+ content += text.slice(pos, idx);
128
+ var size = tabSize - col % tabSize;
129
+ col += size;
130
+ for (var i = 0; i < size; ++i) content += " ";
131
+ pos = idx + 1;
132
+ }
133
+ }
134
+
135
+ if (style) {
136
+ var sp = node.appendChild(document.createElement("span"));
137
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
138
+ sp.appendChild(document.createTextNode(content));
139
+ } else {
140
+ node.appendChild(document.createTextNode(content));
141
+ }
142
+ };
143
+ }
144
+
145
+ var lines = splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
146
+ for (var i = 0, e = lines.length; i < e; ++i) {
147
+ if (i) callback("\n");
148
+ var stream = new CodeMirror.StringStream(lines[i]);
149
+ if (!stream.string && mode.blankLine) mode.blankLine(state);
150
+ while (!stream.eol()) {
151
+ var style = mode.token(stream, state);
152
+ callback(stream.current(), style, i, stream.start, state);
153
+ stream.start = stream.pos;
154
+ }
155
+ }
156
+ };
157
+ })();
@@ -0,0 +1,72 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.runMode = function(string, modespec, callback, options) {
15
+ var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
16
+ var ie = /MSIE \d/.test(navigator.userAgent);
17
+ var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
18
+
19
+ if (callback.nodeType == 1) {
20
+ var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
21
+ var node = callback, col = 0;
22
+ node.innerHTML = "";
23
+ callback = function(text, style) {
24
+ if (text == "\n") {
25
+ // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
26
+ // Emitting a carriage return makes everything ok.
27
+ node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
28
+ col = 0;
29
+ return;
30
+ }
31
+ var content = "";
32
+ // replace tabs
33
+ for (var pos = 0;;) {
34
+ var idx = text.indexOf("\t", pos);
35
+ if (idx == -1) {
36
+ content += text.slice(pos);
37
+ col += text.length - pos;
38
+ break;
39
+ } else {
40
+ col += idx - pos;
41
+ content += text.slice(pos, idx);
42
+ var size = tabSize - col % tabSize;
43
+ col += size;
44
+ for (var i = 0; i < size; ++i) content += " ";
45
+ pos = idx + 1;
46
+ }
47
+ }
48
+
49
+ if (style) {
50
+ var sp = node.appendChild(document.createElement("span"));
51
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
52
+ sp.appendChild(document.createTextNode(content));
53
+ } else {
54
+ node.appendChild(document.createTextNode(content));
55
+ }
56
+ };
57
+ }
58
+
59
+ var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
60
+ for (var i = 0, e = lines.length; i < e; ++i) {
61
+ if (i) callback("\n");
62
+ var stream = new CodeMirror.StringStream(lines[i]);
63
+ if (!stream.string && mode.blankLine) mode.blankLine(state);
64
+ while (!stream.eol()) {
65
+ var style = mode.token(stream, state);
66
+ callback(stream.current(), style, i, stream.start, state);
67
+ stream.start = stream.pos;
68
+ }
69
+ }
70
+ };
71
+
72
+ });
@@ -0,0 +1,120 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /* Just enough of CodeMirror to run runMode under node.js */
5
+
6
+ // declare global: StringStream
7
+
8
+ function splitLines(string){ return string.split(/\r?\n|\r/); };
9
+
10
+ function StringStream(string) {
11
+ this.pos = this.start = 0;
12
+ this.string = string;
13
+ this.lineStart = 0;
14
+ }
15
+ StringStream.prototype = {
16
+ eol: function() {return this.pos >= this.string.length;},
17
+ sol: function() {return this.pos == 0;},
18
+ peek: function() {return this.string.charAt(this.pos) || null;},
19
+ next: function() {
20
+ if (this.pos < this.string.length)
21
+ return this.string.charAt(this.pos++);
22
+ },
23
+ eat: function(match) {
24
+ var ch = this.string.charAt(this.pos);
25
+ if (typeof match == "string") var ok = ch == match;
26
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
27
+ if (ok) {++this.pos; return ch;}
28
+ },
29
+ eatWhile: function(match) {
30
+ var start = this.pos;
31
+ while (this.eat(match)){}
32
+ return this.pos > start;
33
+ },
34
+ eatSpace: function() {
35
+ var start = this.pos;
36
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
37
+ return this.pos > start;
38
+ },
39
+ skipToEnd: function() {this.pos = this.string.length;},
40
+ skipTo: function(ch) {
41
+ var found = this.string.indexOf(ch, this.pos);
42
+ if (found > -1) {this.pos = found; return true;}
43
+ },
44
+ backUp: function(n) {this.pos -= n;},
45
+ column: function() {return this.start - this.lineStart;},
46
+ indentation: function() {return 0;},
47
+ match: function(pattern, consume, caseInsensitive) {
48
+ if (typeof pattern == "string") {
49
+ var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
50
+ var substr = this.string.substr(this.pos, pattern.length);
51
+ if (cased(substr) == cased(pattern)) {
52
+ if (consume !== false) this.pos += pattern.length;
53
+ return true;
54
+ }
55
+ } else {
56
+ var match = this.string.slice(this.pos).match(pattern);
57
+ if (match && match.index > 0) return null;
58
+ if (match && consume !== false) this.pos += match[0].length;
59
+ return match;
60
+ }
61
+ },
62
+ current: function(){return this.string.slice(this.start, this.pos);},
63
+ hideFirstChars: function(n, inner) {
64
+ this.lineStart += n;
65
+ try { return inner(); }
66
+ finally { this.lineStart -= n; }
67
+ }
68
+ };
69
+ exports.StringStream = StringStream;
70
+
71
+ exports.startState = function(mode, a1, a2) {
72
+ return mode.startState ? mode.startState(a1, a2) : true;
73
+ };
74
+
75
+ var modes = exports.modes = {}, mimeModes = exports.mimeModes = {};
76
+ exports.defineMode = function(name, mode) {
77
+ if (arguments.length > 2)
78
+ mode.dependencies = Array.prototype.slice.call(arguments, 2);
79
+ modes[name] = mode;
80
+ };
81
+ exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
82
+
83
+ exports.defineMode("null", function() {
84
+ return {token: function(stream) {stream.skipToEnd();}};
85
+ });
86
+ exports.defineMIME("text/plain", "null");
87
+
88
+ exports.resolveMode = function(spec) {
89
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
90
+ spec = mimeModes[spec];
91
+ } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
92
+ spec = mimeModes[spec.name];
93
+ }
94
+ if (typeof spec == "string") return {name: spec};
95
+ else return spec || {name: "null"};
96
+ };
97
+ exports.getMode = function(options, spec) {
98
+ spec = exports.resolveMode(spec);
99
+ var mfactory = modes[spec.name];
100
+ if (!mfactory) throw new Error("Unknown mode: " + spec);
101
+ return mfactory(options, spec);
102
+ };
103
+ exports.registerHelper = exports.registerGlobalHelper = Math.min;
104
+
105
+ exports.runMode = function(string, modespec, callback, options) {
106
+ var mode = exports.getMode({indentUnit: 2}, modespec);
107
+ var lines = splitLines(string), state = (options && options.state) || exports.startState(mode);
108
+ for (var i = 0, e = lines.length; i < e; ++i) {
109
+ if (i) callback("\n");
110
+ var stream = new exports.StringStream(lines[i]);
111
+ if (!stream.string && mode.blankLine) mode.blankLine(state);
112
+ while (!stream.eol()) {
113
+ var style = mode.token(stream, state);
114
+ callback(stream.current(), style, i, stream.start, state);
115
+ stream.start = stream.pos;
116
+ }
117
+ }
118
+ };
119
+
120
+ require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")];
@@ -0,0 +1,76 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineExtension("annotateScrollbar", function(className) {
15
+ return new Annotation(this, className);
16
+ });
17
+
18
+ function Annotation(cm, className) {
19
+ this.cm = cm;
20
+ this.className = className;
21
+ this.annotations = [];
22
+ this.div = cm.getWrapperElement().appendChild(document.createElement("div"));
23
+ this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";
24
+ this.computeScale();
25
+
26
+ var self = this;
27
+ cm.on("refresh", this.resizeHandler = function(){
28
+ if (self.computeScale()) self.redraw();
29
+ });
30
+ }
31
+
32
+ Annotation.prototype.computeScale = function() {
33
+ var cm = this.cm;
34
+ var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight) /
35
+ cm.heightAtLine(cm.lastLine() + 1, "local");
36
+ if (hScale != this.hScale) {
37
+ this.hScale = hScale;
38
+ return true;
39
+ }
40
+ };
41
+
42
+ Annotation.prototype.update = function(annotations) {
43
+ this.annotations = annotations;
44
+ this.redraw();
45
+ };
46
+
47
+ Annotation.prototype.redraw = function() {
48
+ var cm = this.cm, hScale = this.hScale;
49
+ if (!cm.display.barWidth) return;
50
+
51
+ var frag = document.createDocumentFragment(), anns = this.annotations;
52
+ for (var i = 0, nextTop; i < anns.length; i++) {
53
+ var ann = anns[i];
54
+ var top = nextTop || cm.charCoords(ann.from, "local").top * hScale;
55
+ var bottom = cm.charCoords(ann.to, "local").bottom * hScale;
56
+ while (i < anns.length - 1) {
57
+ nextTop = cm.charCoords(anns[i + 1].from, "local").top * hScale;
58
+ if (nextTop > bottom + .9) break;
59
+ ann = anns[++i];
60
+ bottom = cm.charCoords(ann.to, "local").bottom * hScale;
61
+ }
62
+ var height = Math.max(bottom - top, 3);
63
+
64
+ var elt = frag.appendChild(document.createElement("div"));
65
+ elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + top + "px; height: " + height + "px";
66
+ elt.className = this.className;
67
+ }
68
+ this.div.textContent = "";
69
+ this.div.appendChild(frag);
70
+ };
71
+
72
+ Annotation.prototype.clear = function() {
73
+ this.cm.off("refresh", this.resizeHandler);
74
+ this.div.parentNode.removeChild(this.div);
75
+ };
76
+ });