fluentd-ui 0.3.13 → 0.3.14

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 (287) hide show
  1. data/ChangeLog +9 -0
  2. data/Gemfile.lock +47 -44
  3. data/README.md +4 -4
  4. data/app/assets/javascripts/vue/in_tail_format.js +7 -2
  5. data/app/assets/stylesheets/common.css.scss +16 -0
  6. data/app/controllers/concerns/setting_history_concern.rb +6 -0
  7. data/app/controllers/fluentd/settings_controller.rb +37 -8
  8. data/app/models/fluent_gem.rb +6 -3
  9. data/app/models/fluentd/agent.rb +1 -0
  10. data/app/models/fluentd/agent/common.rb +4 -0
  11. data/app/models/fluentd/agent/fluentd_gem.rb +9 -13
  12. data/app/models/fluentd/agent/local_common.rb +23 -0
  13. data/app/models/fluentd/agent/td_agent.rb +4 -0
  14. data/app/models/fluentd/agent/td_agent/macosx.rb +0 -4
  15. data/app/models/fluentd/agent/td_agent/unix.rb +0 -4
  16. data/app/views/fluentd/settings/edit.html.haml +1 -3
  17. data/app/views/fluentd/settings/histories/show.html.haml +10 -0
  18. data/app/views/fluentd/settings/running_backup/show.html.haml +11 -0
  19. data/app/views/shared/settings/_diff.html.erb +21 -0
  20. data/circle.yml +5 -0
  21. data/config/application.rb +1 -0
  22. data/config/locales/translation_en.yml +7 -0
  23. data/config/locales/translation_ja.yml +7 -0
  24. data/fluentd-ui.gemspec +1 -0
  25. data/lib/fluentd-ui.rb +5 -1
  26. data/lib/fluentd-ui/version.rb +1 -1
  27. data/spec/features/fluentd/setting/histories_spec.rb +23 -1
  28. data/spec/features/fluentd/setting/running_backup_spec.rb +22 -1
  29. data/spec/models/fluentd/agent/local_common_spec.rb +4 -2
  30. data/spec/models/fluentd/agent_spec.rb +1 -48
  31. data/spec/models/plugin_spec.rb +2 -2
  32. data/spec/spec_helper.rb +10 -0
  33. data/spec/support/fluentd_agent_common_behavior.rb +53 -0
  34. data/vendor/assets/javascripts/bower/.gitignore +10 -0
  35. data/vendor/assets/javascripts/bower/vue/.bower.json +4 -4
  36. data/vendor/assets/javascripts/bower/vue/bower.json +17 -0
  37. data/vendor/assets/javascripts/bower/vue/dist/vue.js +329 -198
  38. data/vendor/assets/javascripts/bower/vue/dist/vue.min.js +3 -3
  39. metadata +107 -291
  40. checksums.yaml +0 -7
  41. data/vendor/assets/javascripts/bower/codemirror/AUTHORS +0 -423
  42. data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +0 -76
  43. data/vendor/assets/javascripts/bower/codemirror/LICENSE +0 -19
  44. data/vendor/assets/javascripts/bower/codemirror/README.md +0 -11
  45. data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +0 -183
  46. data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +0 -85
  47. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +0 -32
  48. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +0 -155
  49. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +0 -6
  50. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +0 -41
  51. data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +0 -94
  52. data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +0 -58
  53. data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +0 -64
  54. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +0 -159
  55. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +0 -159
  56. data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +0 -51
  57. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +0 -120
  58. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +0 -66
  59. data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +0 -27
  60. data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +0 -105
  61. data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +0 -57
  62. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +0 -145
  63. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +0 -20
  64. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +0 -134
  65. data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +0 -44
  66. data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +0 -49
  67. data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +0 -182
  68. data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +0 -41
  69. data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +0 -56
  70. data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +0 -348
  71. data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +0 -146
  72. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +0 -38
  73. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +0 -389
  74. data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +0 -197
  75. data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +0 -110
  76. data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +0 -41
  77. data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +0 -35
  78. data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +0 -136
  79. data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +0 -31
  80. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +0 -73
  81. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +0 -204
  82. data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +0 -28
  83. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +0 -112
  84. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +0 -643
  85. data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +0 -64
  86. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +0 -118
  87. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +0 -33
  88. data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +0 -85
  89. data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +0 -213
  90. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +0 -40
  91. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +0 -157
  92. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +0 -72
  93. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +0 -120
  94. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +0 -76
  95. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +0 -46
  96. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +0 -66
  97. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +0 -139
  98. data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +0 -128
  99. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +0 -8
  100. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +0 -90
  101. data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +0 -164
  102. data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +0 -189
  103. data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +0 -71
  104. data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +0 -118
  105. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +0 -86
  106. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +0 -670
  107. data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +0 -44
  108. data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +0 -139
  109. data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +0 -411
  110. data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +0 -540
  111. data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +0 -4901
  112. data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +0 -175
  113. data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +0 -198
  114. data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +0 -489
  115. data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +0 -767
  116. data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +0 -243
  117. data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +0 -255
  118. data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +0 -369
  119. data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +0 -122
  120. data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +0 -717
  121. data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +0 -152
  122. data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +0 -51
  123. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +0 -157
  124. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +0 -110
  125. data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +0 -135
  126. data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +0 -146
  127. data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +0 -218
  128. data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +0 -50
  129. data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +0 -47
  130. data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +0 -67
  131. data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +0 -76
  132. data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +0 -142
  133. data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +0 -299
  134. data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +0 -195
  135. data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +0 -207
  136. data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +0 -162
  137. data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +0 -622
  138. data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +0 -188
  139. data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +0 -345
  140. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +0 -123
  141. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +0 -213
  142. data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +0 -178
  143. data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +0 -184
  144. data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +0 -226
  145. data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +0 -159
  146. data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +0 -97
  147. data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +0 -267
  148. data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +0 -518
  149. data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +0 -86
  150. data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +0 -121
  151. data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +0 -113
  152. data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +0 -290
  153. data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +0 -590
  154. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +0 -686
  155. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +0 -72
  156. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +0 -200
  157. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +0 -61
  158. data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +0 -142
  159. data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +0 -301
  160. data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +0 -280
  161. data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +0 -280
  162. data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +0 -159
  163. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +0 -765
  164. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +0 -754
  165. data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +0 -165
  166. data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +0 -193
  167. data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +0 -205
  168. data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +0 -245
  169. data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +0 -178
  170. data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +0 -186
  171. data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +0 -135
  172. data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +0 -109
  173. data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +0 -114
  174. data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +0 -832
  175. data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +0 -226
  176. data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +0 -154
  177. data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +0 -188
  178. data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +0 -78
  179. data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +0 -220
  180. data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +0 -359
  181. data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +0 -139
  182. data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +0 -162
  183. data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +0 -101
  184. data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +0 -557
  185. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +0 -285
  186. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +0 -14
  187. data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +0 -451
  188. data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +0 -327
  189. data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +0 -248
  190. data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +0 -139
  191. data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +0 -58
  192. data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +0 -193
  193. data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +0 -575
  194. data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +0 -96
  195. data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +0 -168
  196. data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +0 -221
  197. data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +0 -197
  198. data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +0 -104
  199. data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +0 -198
  200. data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +0 -174
  201. data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +0 -109
  202. data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +0 -391
  203. data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +0 -251
  204. data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +0 -123
  205. data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +0 -147
  206. data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +0 -417
  207. data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +0 -469
  208. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
  209. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -369
  210. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +0 -26
  211. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +0 -323
  212. data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +0 -88
  213. data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +0 -68
  214. data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +0 -162
  215. data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +0 -274
  216. data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +0 -350
  217. data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +0 -201
  218. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +0 -273
  219. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +0 -364
  220. data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +0 -51
  221. data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +0 -384
  222. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +0 -67
  223. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +0 -447
  224. data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +0 -117
  225. data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +0 -100
  226. data/vendor/assets/javascripts/bower/vue/LICENSE +0 -21
  227. data/vendor/assets/javascripts/bower/vue/src/api/child.js +0 -53
  228. data/vendor/assets/javascripts/bower/vue/src/api/data.js +0 -161
  229. data/vendor/assets/javascripts/bower/vue/src/api/dom.js +0 -211
  230. data/vendor/assets/javascripts/bower/vue/src/api/events.js +0 -176
  231. data/vendor/assets/javascripts/bower/vue/src/api/global.js +0 -146
  232. data/vendor/assets/javascripts/bower/vue/src/api/lifecycle.js +0 -72
  233. data/vendor/assets/javascripts/bower/vue/src/batcher.js +0 -65
  234. data/vendor/assets/javascripts/bower/vue/src/cache.js +0 -112
  235. data/vendor/assets/javascripts/bower/vue/src/compiler/compile.js +0 -549
  236. data/vendor/assets/javascripts/bower/vue/src/compiler/transclude.js +0 -146
  237. data/vendor/assets/javascripts/bower/vue/src/config.js +0 -79
  238. data/vendor/assets/javascripts/bower/vue/src/directive.js +0 -219
  239. data/vendor/assets/javascripts/bower/vue/src/directives/attr.js +0 -32
  240. data/vendor/assets/javascripts/bower/vue/src/directives/class.js +0 -18
  241. data/vendor/assets/javascripts/bower/vue/src/directives/cloak.js +0 -12
  242. data/vendor/assets/javascripts/bower/vue/src/directives/component.js +0 -196
  243. data/vendor/assets/javascripts/bower/vue/src/directives/el.js +0 -13
  244. data/vendor/assets/javascripts/bower/vue/src/directives/html.js +0 -38
  245. data/vendor/assets/javascripts/bower/vue/src/directives/if.js +0 -87
  246. data/vendor/assets/javascripts/bower/vue/src/directives/index.js +0 -22
  247. data/vendor/assets/javascripts/bower/vue/src/directives/model/checkbox.js +0 -25
  248. data/vendor/assets/javascripts/bower/vue/src/directives/model/default.js +0 -123
  249. data/vendor/assets/javascripts/bower/vue/src/directives/model/index.js +0 -56
  250. data/vendor/assets/javascripts/bower/vue/src/directives/model/radio.js +0 -26
  251. data/vendor/assets/javascripts/bower/vue/src/directives/model/select.js +0 -166
  252. data/vendor/assets/javascripts/bower/vue/src/directives/on.js +0 -59
  253. data/vendor/assets/javascripts/bower/vue/src/directives/partial.js +0 -44
  254. data/vendor/assets/javascripts/bower/vue/src/directives/ref.js +0 -24
  255. data/vendor/assets/javascripts/bower/vue/src/directives/repeat.js +0 -503
  256. data/vendor/assets/javascripts/bower/vue/src/directives/show.js +0 -8
  257. data/vendor/assets/javascripts/bower/vue/src/directives/style.js +0 -58
  258. data/vendor/assets/javascripts/bower/vue/src/directives/text.js +0 -15
  259. data/vendor/assets/javascripts/bower/vue/src/directives/transition.js +0 -12
  260. data/vendor/assets/javascripts/bower/vue/src/directives/with.js +0 -47
  261. data/vendor/assets/javascripts/bower/vue/src/filters/array-filters.js +0 -87
  262. data/vendor/assets/javascripts/bower/vue/src/filters/index.js +0 -135
  263. data/vendor/assets/javascripts/bower/vue/src/instance/compile.js +0 -179
  264. data/vendor/assets/javascripts/bower/vue/src/instance/events.js +0 -122
  265. data/vendor/assets/javascripts/bower/vue/src/instance/init.js +0 -76
  266. data/vendor/assets/javascripts/bower/vue/src/instance/scope.js +0 -217
  267. data/vendor/assets/javascripts/bower/vue/src/observer/array.js +0 -90
  268. data/vendor/assets/javascripts/bower/vue/src/observer/dep.js +0 -50
  269. data/vendor/assets/javascripts/bower/vue/src/observer/index.js +0 -235
  270. data/vendor/assets/javascripts/bower/vue/src/observer/object.js +0 -66
  271. data/vendor/assets/javascripts/bower/vue/src/parsers/directive.js +0 -159
  272. data/vendor/assets/javascripts/bower/vue/src/parsers/expression.js +0 -226
  273. data/vendor/assets/javascripts/bower/vue/src/parsers/path.js +0 -300
  274. data/vendor/assets/javascripts/bower/vue/src/parsers/template.js +0 -248
  275. data/vendor/assets/javascripts/bower/vue/src/parsers/text.js +0 -178
  276. data/vendor/assets/javascripts/bower/vue/src/transition/css.js +0 -189
  277. data/vendor/assets/javascripts/bower/vue/src/transition/index.js +0 -151
  278. data/vendor/assets/javascripts/bower/vue/src/transition/js.js +0 -43
  279. data/vendor/assets/javascripts/bower/vue/src/util/debug.js +0 -50
  280. data/vendor/assets/javascripts/bower/vue/src/util/dom.js +0 -197
  281. data/vendor/assets/javascripts/bower/vue/src/util/env.js +0 -74
  282. data/vendor/assets/javascripts/bower/vue/src/util/filter.js +0 -72
  283. data/vendor/assets/javascripts/bower/vue/src/util/index.js +0 -8
  284. data/vendor/assets/javascripts/bower/vue/src/util/lang.js +0 -175
  285. data/vendor/assets/javascripts/bower/vue/src/util/merge-option.js +0 -255
  286. data/vendor/assets/javascripts/bower/vue/src/vue.js +0 -84
  287. data/vendor/assets/javascripts/bower/vue/src/watcher.js +0 -240
@@ -1,139 +0,0 @@
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.defineMode("q",function(config){
15
- var indentUnit=config.indentUnit,
16
- curPunc,
17
- keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),
18
- E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;
19
- function buildRE(w){return new RegExp("^("+w.join("|")+")$");}
20
- function tokenBase(stream,state){
21
- var sol=stream.sol(),c=stream.next();
22
- curPunc=null;
23
- if(sol)
24
- if(c=="/")
25
- return(state.tokenize=tokenLineComment)(stream,state);
26
- else if(c=="\\"){
27
- if(stream.eol()||/\s/.test(stream.peek()))
28
- return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment";
29
- else
30
- return state.tokenize=tokenBase,"builtin";
31
- }
32
- if(/\s/.test(c))
33
- return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace";
34
- if(c=='"')
35
- return(state.tokenize=tokenString)(stream,state);
36
- if(c=='`')
37
- return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";
38
- if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){
39
- var t=null;
40
- stream.backUp(1);
41
- if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)
42
- || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)
43
- || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)
44
- || stream.match(/^\d+[ptuv]{1}/))
45
- t="temporal";
46
- else if(stream.match(/^0[NwW]{1}/)
47
- || stream.match(/^0x[\d|a-f|A-F]*/)
48
- || stream.match(/^[0|1]+[b]{1}/)
49
- || stream.match(/^\d+[chijn]{1}/)
50
- || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))
51
- t="number";
52
- return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error");
53
- }
54
- if(/[A-Z|a-z]|\./.test(c))
55
- return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable";
56
- if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c))
57
- return null;
58
- if(/[{}\(\[\]\)]/.test(c))
59
- return null;
60
- return"error";
61
- }
62
- function tokenLineComment(stream,state){
63
- return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment";
64
- }
65
- function tokenBlockComment(stream,state){
66
- var f=stream.sol()&&stream.peek()=="\\";
67
- stream.skipToEnd();
68
- if(f&&/^\\\s*$/.test(stream.current()))
69
- state.tokenize=tokenBase;
70
- return"comment";
71
- }
72
- function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";}
73
- function tokenString(stream,state){
74
- var escaped=false,next,end=false;
75
- while((next=stream.next())){
76
- if(next=="\""&&!escaped){end=true;break;}
77
- escaped=!escaped&&next=="\\";
78
- }
79
- if(end)state.tokenize=tokenBase;
80
- return"string";
81
- }
82
- function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};}
83
- function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;}
84
- return{
85
- startState:function(){
86
- return{tokenize:tokenBase,
87
- context:null,
88
- indent:0,
89
- col:0};
90
- },
91
- token:function(stream,state){
92
- if(stream.sol()){
93
- if(state.context&&state.context.align==null)
94
- state.context.align=false;
95
- state.indent=stream.indentation();
96
- }
97
- //if (stream.eatSpace()) return null;
98
- var style=state.tokenize(stream,state);
99
- if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){
100
- state.context.align=true;
101
- }
102
- if(curPunc=="(")pushContext(state,")",stream.column());
103
- else if(curPunc=="[")pushContext(state,"]",stream.column());
104
- else if(curPunc=="{")pushContext(state,"}",stream.column());
105
- else if(/[\]\}\)]/.test(curPunc)){
106
- while(state.context&&state.context.type=="pattern")popContext(state);
107
- if(state.context&&curPunc==state.context.type)popContext(state);
108
- }
109
- else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state);
110
- else if(/atom|string|variable/.test(style)&&state.context){
111
- if(/[\}\]]/.test(state.context.type))
112
- pushContext(state,"pattern",stream.column());
113
- else if(state.context.type=="pattern"&&!state.context.align){
114
- state.context.align=true;
115
- state.context.col=stream.column();
116
- }
117
- }
118
- return style;
119
- },
120
- indent:function(state,textAfter){
121
- var firstChar=textAfter&&textAfter.charAt(0);
122
- var context=state.context;
123
- if(/[\]\}]/.test(firstChar))
124
- while (context&&context.type=="pattern")context=context.prev;
125
- var closing=context&&firstChar==context.type;
126
- if(!context)
127
- return 0;
128
- else if(context.type=="pattern")
129
- return context.col;
130
- else if(context.align)
131
- return context.col+(closing?0:1);
132
- else
133
- return context.indent+(closing?0:indentUnit);
134
- }
135
- };
136
- });
137
- CodeMirror.defineMIME("text/x-q","q");
138
-
139
- });
@@ -1,162 +0,0 @@
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.defineMode("r", function(config) {
15
- function wordObj(str) {
16
- var words = str.split(" "), res = {};
17
- for (var i = 0; i < words.length; ++i) res[words[i]] = true;
18
- return res;
19
- }
20
- var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_");
21
- var builtins = wordObj("list quote bquote eval return call parse deparse");
22
- var keywords = wordObj("if else repeat while function for in next break");
23
- var blockkeywords = wordObj("if else repeat while function for");
24
- var opChars = /[+\-*\/^<>=!&|~$:]/;
25
- var curPunc;
26
-
27
- function tokenBase(stream, state) {
28
- curPunc = null;
29
- var ch = stream.next();
30
- if (ch == "#") {
31
- stream.skipToEnd();
32
- return "comment";
33
- } else if (ch == "0" && stream.eat("x")) {
34
- stream.eatWhile(/[\da-f]/i);
35
- return "number";
36
- } else if (ch == "." && stream.eat(/\d/)) {
37
- stream.match(/\d*(?:e[+\-]?\d+)?/);
38
- return "number";
39
- } else if (/\d/.test(ch)) {
40
- stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);
41
- return "number";
42
- } else if (ch == "'" || ch == '"') {
43
- state.tokenize = tokenString(ch);
44
- return "string";
45
- } else if (ch == "." && stream.match(/.[.\d]+/)) {
46
- return "keyword";
47
- } else if (/[\w\.]/.test(ch) && ch != "_") {
48
- stream.eatWhile(/[\w\.]/);
49
- var word = stream.current();
50
- if (atoms.propertyIsEnumerable(word)) return "atom";
51
- if (keywords.propertyIsEnumerable(word)) {
52
- // Block keywords start new blocks, except 'else if', which only starts
53
- // one new block for the 'if', no block for the 'else'.
54
- if (blockkeywords.propertyIsEnumerable(word) &&
55
- !stream.match(/\s*if(\s+|$)/, false))
56
- curPunc = "block";
57
- return "keyword";
58
- }
59
- if (builtins.propertyIsEnumerable(word)) return "builtin";
60
- return "variable";
61
- } else if (ch == "%") {
62
- if (stream.skipTo("%")) stream.next();
63
- return "variable-2";
64
- } else if (ch == "<" && stream.eat("-")) {
65
- return "arrow";
66
- } else if (ch == "=" && state.ctx.argList) {
67
- return "arg-is";
68
- } else if (opChars.test(ch)) {
69
- if (ch == "$") return "dollar";
70
- stream.eatWhile(opChars);
71
- return "operator";
72
- } else if (/[\(\){}\[\];]/.test(ch)) {
73
- curPunc = ch;
74
- if (ch == ";") return "semi";
75
- return null;
76
- } else {
77
- return null;
78
- }
79
- }
80
-
81
- function tokenString(quote) {
82
- return function(stream, state) {
83
- if (stream.eat("\\")) {
84
- var ch = stream.next();
85
- if (ch == "x") stream.match(/^[a-f0-9]{2}/i);
86
- else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next();
87
- else if (ch == "u") stream.match(/^[a-f0-9]{4}/i);
88
- else if (ch == "U") stream.match(/^[a-f0-9]{8}/i);
89
- else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/);
90
- return "string-2";
91
- } else {
92
- var next;
93
- while ((next = stream.next()) != null) {
94
- if (next == quote) { state.tokenize = tokenBase; break; }
95
- if (next == "\\") { stream.backUp(1); break; }
96
- }
97
- return "string";
98
- }
99
- };
100
- }
101
-
102
- function push(state, type, stream) {
103
- state.ctx = {type: type,
104
- indent: state.indent,
105
- align: null,
106
- column: stream.column(),
107
- prev: state.ctx};
108
- }
109
- function pop(state) {
110
- state.indent = state.ctx.indent;
111
- state.ctx = state.ctx.prev;
112
- }
113
-
114
- return {
115
- startState: function() {
116
- return {tokenize: tokenBase,
117
- ctx: {type: "top",
118
- indent: -config.indentUnit,
119
- align: false},
120
- indent: 0,
121
- afterIdent: false};
122
- },
123
-
124
- token: function(stream, state) {
125
- if (stream.sol()) {
126
- if (state.ctx.align == null) state.ctx.align = false;
127
- state.indent = stream.indentation();
128
- }
129
- if (stream.eatSpace()) return null;
130
- var style = state.tokenize(stream, state);
131
- if (style != "comment" && state.ctx.align == null) state.ctx.align = true;
132
-
133
- var ctype = state.ctx.type;
134
- if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state);
135
- if (curPunc == "{") push(state, "}", stream);
136
- else if (curPunc == "(") {
137
- push(state, ")", stream);
138
- if (state.afterIdent) state.ctx.argList = true;
139
- }
140
- else if (curPunc == "[") push(state, "]", stream);
141
- else if (curPunc == "block") push(state, "block", stream);
142
- else if (curPunc == ctype) pop(state);
143
- state.afterIdent = style == "variable" || style == "keyword";
144
- return style;
145
- },
146
-
147
- indent: function(state, textAfter) {
148
- if (state.tokenize != tokenBase) return 0;
149
- var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx,
150
- closing = firstChar == ctx.type;
151
- if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
152
- else if (ctx.align) return ctx.column + (closing ? 0 : 1);
153
- else return ctx.indent + (closing ? 0 : config.indentUnit);
154
- },
155
-
156
- lineComment: "#"
157
- };
158
- });
159
-
160
- CodeMirror.defineMIME("text/x-rsrc", "r");
161
-
162
- });
@@ -1,101 +0,0 @@
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.defineMode("rpm-changes", function() {
15
- var headerSeperator = /^-+$/;
16
- var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
17
- var simpleEmail = /^[\w+.-]+@[\w.-]+/;
18
-
19
- return {
20
- token: function(stream) {
21
- if (stream.sol()) {
22
- if (stream.match(headerSeperator)) { return 'tag'; }
23
- if (stream.match(headerLine)) { return 'tag'; }
24
- }
25
- if (stream.match(simpleEmail)) { return 'string'; }
26
- stream.next();
27
- return null;
28
- }
29
- };
30
- });
31
-
32
- CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
33
-
34
- // Quick and dirty spec file highlighting
35
-
36
- CodeMirror.defineMode("rpm-spec", function() {
37
- var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
38
-
39
- var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
40
- var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;
41
- var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
42
- var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
43
- var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
44
-
45
- return {
46
- startState: function () {
47
- return {
48
- controlFlow: false,
49
- macroParameters: false,
50
- section: false
51
- };
52
- },
53
- token: function (stream, state) {
54
- var ch = stream.peek();
55
- if (ch == "#") { stream.skipToEnd(); return "comment"; }
56
-
57
- if (stream.sol()) {
58
- if (stream.match(preamble)) { return "preamble"; }
59
- if (stream.match(section)) { return "section"; }
60
- }
61
-
62
- if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
63
- if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}'
64
-
65
- if (stream.match(control_flow_simple)) { return "keyword"; }
66
- if (stream.match(control_flow_complex)) {
67
- state.controlFlow = true;
68
- return "keyword";
69
- }
70
- if (state.controlFlow) {
71
- if (stream.match(operators)) { return "operator"; }
72
- if (stream.match(/^(\d+)/)) { return "number"; }
73
- if (stream.eol()) { state.controlFlow = false; }
74
- }
75
-
76
- if (stream.match(arch)) { return "number"; }
77
-
78
- // Macros like '%make_install' or '%attr(0775,root,root)'
79
- if (stream.match(/^%[\w]+/)) {
80
- if (stream.match(/^\(/)) { state.macroParameters = true; }
81
- return "macro";
82
- }
83
- if (state.macroParameters) {
84
- if (stream.match(/^\d+/)) { return "number";}
85
- if (stream.match(/^\)/)) {
86
- state.macroParameters = false;
87
- return "macro";
88
- }
89
- }
90
- if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}'
91
-
92
- //TODO: Include bash script sub-parser (CodeMirror supports that)
93
- stream.next();
94
- return null;
95
- }
96
- };
97
- });
98
-
99
- CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
100
-
101
- });
@@ -1,557 +0,0 @@
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("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay"));
7
- else if (typeof define == "function" && define.amd) // AMD
8
- define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod);
9
- else // Plain browser env
10
- mod(CodeMirror);
11
- })(function(CodeMirror) {
12
- "use strict";
13
-
14
- CodeMirror.defineMode('rst', function (config, options) {
15
-
16
- var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/;
17
- var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/;
18
- var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/;
19
-
20
- var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;
21
- var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/;
22
- var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/;
23
-
24
- var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://";
25
- var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})";
26
- var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*";
27
- var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path);
28
-
29
- var overlay = {
30
- token: function (stream) {
31
-
32
- if (stream.match(rx_strong) && stream.match (/\W+|$/, false))
33
- return 'strong';
34
- if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false))
35
- return 'em';
36
- if (stream.match(rx_literal) && stream.match (/\W+|$/, false))
37
- return 'string-2';
38
- if (stream.match(rx_number))
39
- return 'number';
40
- if (stream.match(rx_positive))
41
- return 'positive';
42
- if (stream.match(rx_negative))
43
- return 'negative';
44
- if (stream.match(rx_uri))
45
- return 'link';
46
-
47
- while (stream.next() != null) {
48
- if (stream.match(rx_strong, false)) break;
49
- if (stream.match(rx_emphasis, false)) break;
50
- if (stream.match(rx_literal, false)) break;
51
- if (stream.match(rx_number, false)) break;
52
- if (stream.match(rx_positive, false)) break;
53
- if (stream.match(rx_negative, false)) break;
54
- if (stream.match(rx_uri, false)) break;
55
- }
56
-
57
- return null;
58
- }
59
- };
60
-
61
- var mode = CodeMirror.getMode(
62
- config, options.backdrop || 'rst-base'
63
- );
64
-
65
- return CodeMirror.overlayMode(mode, overlay, true); // combine
66
- }, 'python', 'stex');
67
-
68
- ///////////////////////////////////////////////////////////////////////////////
69
- ///////////////////////////////////////////////////////////////////////////////
70
-
71
- CodeMirror.defineMode('rst-base', function (config) {
72
-
73
- ///////////////////////////////////////////////////////////////////////////
74
- ///////////////////////////////////////////////////////////////////////////
75
-
76
- function format(string) {
77
- var args = Array.prototype.slice.call(arguments, 1);
78
- return string.replace(/{(\d+)}/g, function (match, n) {
79
- return typeof args[n] != 'undefined' ? args[n] : match;
80
- });
81
- }
82
-
83
- ///////////////////////////////////////////////////////////////////////////
84
- ///////////////////////////////////////////////////////////////////////////
85
-
86
- var mode_python = CodeMirror.getMode(config, 'python');
87
- var mode_stex = CodeMirror.getMode(config, 'stex');
88
-
89
- ///////////////////////////////////////////////////////////////////////////
90
- ///////////////////////////////////////////////////////////////////////////
91
-
92
- var SEPA = "\\s+";
93
- var TAIL = "(?:\\s*|\\W|$)",
94
- rx_TAIL = new RegExp(format('^{0}', TAIL));
95
-
96
- var NAME =
97
- "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)",
98
- rx_NAME = new RegExp(format('^{0}', NAME));
99
- var NAME_WWS =
100
- "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)";
101
- var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS);
102
-
103
- var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)";
104
- var TEXT2 = "(?:[^\\`]+)",
105
- rx_TEXT2 = new RegExp(format('^{0}', TEXT2));
106
-
107
- var rx_section = new RegExp(
108
- "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$");
109
- var rx_explicit = new RegExp(
110
- format('^\\.\\.{0}', SEPA));
111
- var rx_link = new RegExp(
112
- format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL));
113
- var rx_directive = new RegExp(
114
- format('^{0}::{1}', REF_NAME, TAIL));
115
- var rx_substitution = new RegExp(
116
- format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL));
117
- var rx_footnote = new RegExp(
118
- format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL));
119
- var rx_citation = new RegExp(
120
- format('^\\[{0}\\]{1}', REF_NAME, TAIL));
121
-
122
- var rx_substitution_ref = new RegExp(
123
- format('^\\|{0}\\|', TEXT1));
124
- var rx_footnote_ref = new RegExp(
125
- format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME));
126
- var rx_citation_ref = new RegExp(
127
- format('^\\[{0}\\]_', REF_NAME));
128
- var rx_link_ref1 = new RegExp(
129
- format('^{0}__?', REF_NAME));
130
- var rx_link_ref2 = new RegExp(
131
- format('^`{0}`_', TEXT2));
132
-
133
- var rx_role_pre = new RegExp(
134
- format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL));
135
- var rx_role_suf = new RegExp(
136
- format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL));
137
- var rx_role = new RegExp(
138
- format('^:{0}:{1}', NAME, TAIL));
139
-
140
- var rx_directive_name = new RegExp(format('^{0}', REF_NAME));
141
- var rx_directive_tail = new RegExp(format('^::{0}', TAIL));
142
- var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1));
143
- var rx_substitution_sepa = new RegExp(format('^{0}', SEPA));
144
- var rx_substitution_name = new RegExp(format('^{0}', REF_NAME));
145
- var rx_substitution_tail = new RegExp(format('^::{0}', TAIL));
146
- var rx_link_head = new RegExp("^_");
147
- var rx_link_name = new RegExp(format('^{0}|_', REF_NAME));
148
- var rx_link_tail = new RegExp(format('^:{0}', TAIL));
149
-
150
- var rx_verbatim = new RegExp('^::\\s*$');
151
- var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');
152
-
153
- ///////////////////////////////////////////////////////////////////////////
154
- ///////////////////////////////////////////////////////////////////////////
155
-
156
- function to_normal(stream, state) {
157
- var token = null;
158
-
159
- if (stream.sol() && stream.match(rx_examples, false)) {
160
- change(state, to_mode, {
161
- mode: mode_python, local: CodeMirror.startState(mode_python)
162
- });
163
- } else if (stream.sol() && stream.match(rx_explicit)) {
164
- change(state, to_explicit);
165
- token = 'meta';
166
- } else if (stream.sol() && stream.match(rx_section)) {
167
- change(state, to_normal);
168
- token = 'header';
169
- } else if (phase(state) == rx_role_pre ||
170
- stream.match(rx_role_pre, false)) {
171
-
172
- switch (stage(state)) {
173
- case 0:
174
- change(state, to_normal, context(rx_role_pre, 1));
175
- stream.match(/^:/);
176
- token = 'meta';
177
- break;
178
- case 1:
179
- change(state, to_normal, context(rx_role_pre, 2));
180
- stream.match(rx_NAME);
181
- token = 'keyword';
182
-
183
- if (stream.current().match(/^(?:math|latex)/)) {
184
- state.tmp_stex = true;
185
- }
186
- break;
187
- case 2:
188
- change(state, to_normal, context(rx_role_pre, 3));
189
- stream.match(/^:`/);
190
- token = 'meta';
191
- break;
192
- case 3:
193
- if (state.tmp_stex) {
194
- state.tmp_stex = undefined; state.tmp = {
195
- mode: mode_stex, local: CodeMirror.startState(mode_stex)
196
- };
197
- }
198
-
199
- if (state.tmp) {
200
- if (stream.peek() == '`') {
201
- change(state, to_normal, context(rx_role_pre, 4));
202
- state.tmp = undefined;
203
- break;
204
- }
205
-
206
- token = state.tmp.mode.token(stream, state.tmp.local);
207
- break;
208
- }
209
-
210
- change(state, to_normal, context(rx_role_pre, 4));
211
- stream.match(rx_TEXT2);
212
- token = 'string';
213
- break;
214
- case 4:
215
- change(state, to_normal, context(rx_role_pre, 5));
216
- stream.match(/^`/);
217
- token = 'meta';
218
- break;
219
- case 5:
220
- change(state, to_normal, context(rx_role_pre, 6));
221
- stream.match(rx_TAIL);
222
- break;
223
- default:
224
- change(state, to_normal);
225
- }
226
- } else if (phase(state) == rx_role_suf ||
227
- stream.match(rx_role_suf, false)) {
228
-
229
- switch (stage(state)) {
230
- case 0:
231
- change(state, to_normal, context(rx_role_suf, 1));
232
- stream.match(/^`/);
233
- token = 'meta';
234
- break;
235
- case 1:
236
- change(state, to_normal, context(rx_role_suf, 2));
237
- stream.match(rx_TEXT2);
238
- token = 'string';
239
- break;
240
- case 2:
241
- change(state, to_normal, context(rx_role_suf, 3));
242
- stream.match(/^`:/);
243
- token = 'meta';
244
- break;
245
- case 3:
246
- change(state, to_normal, context(rx_role_suf, 4));
247
- stream.match(rx_NAME);
248
- token = 'keyword';
249
- break;
250
- case 4:
251
- change(state, to_normal, context(rx_role_suf, 5));
252
- stream.match(/^:/);
253
- token = 'meta';
254
- break;
255
- case 5:
256
- change(state, to_normal, context(rx_role_suf, 6));
257
- stream.match(rx_TAIL);
258
- break;
259
- default:
260
- change(state, to_normal);
261
- }
262
- } else if (phase(state) == rx_role || stream.match(rx_role, false)) {
263
-
264
- switch (stage(state)) {
265
- case 0:
266
- change(state, to_normal, context(rx_role, 1));
267
- stream.match(/^:/);
268
- token = 'meta';
269
- break;
270
- case 1:
271
- change(state, to_normal, context(rx_role, 2));
272
- stream.match(rx_NAME);
273
- token = 'keyword';
274
- break;
275
- case 2:
276
- change(state, to_normal, context(rx_role, 3));
277
- stream.match(/^:/);
278
- token = 'meta';
279
- break;
280
- case 3:
281
- change(state, to_normal, context(rx_role, 4));
282
- stream.match(rx_TAIL);
283
- break;
284
- default:
285
- change(state, to_normal);
286
- }
287
- } else if (phase(state) == rx_substitution_ref ||
288
- stream.match(rx_substitution_ref, false)) {
289
-
290
- switch (stage(state)) {
291
- case 0:
292
- change(state, to_normal, context(rx_substitution_ref, 1));
293
- stream.match(rx_substitution_text);
294
- token = 'variable-2';
295
- break;
296
- case 1:
297
- change(state, to_normal, context(rx_substitution_ref, 2));
298
- if (stream.match(/^_?_?/)) token = 'link';
299
- break;
300
- default:
301
- change(state, to_normal);
302
- }
303
- } else if (stream.match(rx_footnote_ref)) {
304
- change(state, to_normal);
305
- token = 'quote';
306
- } else if (stream.match(rx_citation_ref)) {
307
- change(state, to_normal);
308
- token = 'quote';
309
- } else if (stream.match(rx_link_ref1)) {
310
- change(state, to_normal);
311
- if (!stream.peek() || stream.peek().match(/^\W$/)) {
312
- token = 'link';
313
- }
314
- } else if (phase(state) == rx_link_ref2 ||
315
- stream.match(rx_link_ref2, false)) {
316
-
317
- switch (stage(state)) {
318
- case 0:
319
- if (!stream.peek() || stream.peek().match(/^\W$/)) {
320
- change(state, to_normal, context(rx_link_ref2, 1));
321
- } else {
322
- stream.match(rx_link_ref2);
323
- }
324
- break;
325
- case 1:
326
- change(state, to_normal, context(rx_link_ref2, 2));
327
- stream.match(/^`/);
328
- token = 'link';
329
- break;
330
- case 2:
331
- change(state, to_normal, context(rx_link_ref2, 3));
332
- stream.match(rx_TEXT2);
333
- break;
334
- case 3:
335
- change(state, to_normal, context(rx_link_ref2, 4));
336
- stream.match(/^`_/);
337
- token = 'link';
338
- break;
339
- default:
340
- change(state, to_normal);
341
- }
342
- } else if (stream.match(rx_verbatim)) {
343
- change(state, to_verbatim);
344
- }
345
-
346
- else {
347
- if (stream.next()) change(state, to_normal);
348
- }
349
-
350
- return token;
351
- }
352
-
353
- ///////////////////////////////////////////////////////////////////////////
354
- ///////////////////////////////////////////////////////////////////////////
355
-
356
- function to_explicit(stream, state) {
357
- var token = null;
358
-
359
- if (phase(state) == rx_substitution ||
360
- stream.match(rx_substitution, false)) {
361
-
362
- switch (stage(state)) {
363
- case 0:
364
- change(state, to_explicit, context(rx_substitution, 1));
365
- stream.match(rx_substitution_text);
366
- token = 'variable-2';
367
- break;
368
- case 1:
369
- change(state, to_explicit, context(rx_substitution, 2));
370
- stream.match(rx_substitution_sepa);
371
- break;
372
- case 2:
373
- change(state, to_explicit, context(rx_substitution, 3));
374
- stream.match(rx_substitution_name);
375
- token = 'keyword';
376
- break;
377
- case 3:
378
- change(state, to_explicit, context(rx_substitution, 4));
379
- stream.match(rx_substitution_tail);
380
- token = 'meta';
381
- break;
382
- default:
383
- change(state, to_normal);
384
- }
385
- } else if (phase(state) == rx_directive ||
386
- stream.match(rx_directive, false)) {
387
-
388
- switch (stage(state)) {
389
- case 0:
390
- change(state, to_explicit, context(rx_directive, 1));
391
- stream.match(rx_directive_name);
392
- token = 'keyword';
393
-
394
- if (stream.current().match(/^(?:math|latex)/))
395
- state.tmp_stex = true;
396
- else if (stream.current().match(/^python/))
397
- state.tmp_py = true;
398
- break;
399
- case 1:
400
- change(state, to_explicit, context(rx_directive, 2));
401
- stream.match(rx_directive_tail);
402
- token = 'meta';
403
-
404
- if (stream.match(/^latex\s*$/) || state.tmp_stex) {
405
- state.tmp_stex = undefined; change(state, to_mode, {
406
- mode: mode_stex, local: CodeMirror.startState(mode_stex)
407
- });
408
- }
409
- break;
410
- case 2:
411
- change(state, to_explicit, context(rx_directive, 3));
412
- if (stream.match(/^python\s*$/) || state.tmp_py) {
413
- state.tmp_py = undefined; change(state, to_mode, {
414
- mode: mode_python, local: CodeMirror.startState(mode_python)
415
- });
416
- }
417
- break;
418
- default:
419
- change(state, to_normal);
420
- }
421
- } else if (phase(state) == rx_link || stream.match(rx_link, false)) {
422
-
423
- switch (stage(state)) {
424
- case 0:
425
- change(state, to_explicit, context(rx_link, 1));
426
- stream.match(rx_link_head);
427
- stream.match(rx_link_name);
428
- token = 'link';
429
- break;
430
- case 1:
431
- change(state, to_explicit, context(rx_link, 2));
432
- stream.match(rx_link_tail);
433
- token = 'meta';
434
- break;
435
- default:
436
- change(state, to_normal);
437
- }
438
- } else if (stream.match(rx_footnote)) {
439
- change(state, to_normal);
440
- token = 'quote';
441
- } else if (stream.match(rx_citation)) {
442
- change(state, to_normal);
443
- token = 'quote';
444
- }
445
-
446
- else {
447
- stream.eatSpace();
448
- if (stream.eol()) {
449
- change(state, to_normal);
450
- } else {
451
- stream.skipToEnd();
452
- change(state, to_comment);
453
- token = 'comment';
454
- }
455
- }
456
-
457
- return token;
458
- }
459
-
460
- ///////////////////////////////////////////////////////////////////////////
461
- ///////////////////////////////////////////////////////////////////////////
462
-
463
- function to_comment(stream, state) {
464
- return as_block(stream, state, 'comment');
465
- }
466
-
467
- function to_verbatim(stream, state) {
468
- return as_block(stream, state, 'meta');
469
- }
470
-
471
- function as_block(stream, state, token) {
472
- if (stream.eol() || stream.eatSpace()) {
473
- stream.skipToEnd();
474
- return token;
475
- } else {
476
- change(state, to_normal);
477
- return null;
478
- }
479
- }
480
-
481
- ///////////////////////////////////////////////////////////////////////////
482
- ///////////////////////////////////////////////////////////////////////////
483
-
484
- function to_mode(stream, state) {
485
-
486
- if (state.ctx.mode && state.ctx.local) {
487
-
488
- if (stream.sol()) {
489
- if (!stream.eatSpace()) change(state, to_normal);
490
- return null;
491
- }
492
-
493
- return state.ctx.mode.token(stream, state.ctx.local);
494
- }
495
-
496
- change(state, to_normal);
497
- return null;
498
- }
499
-
500
- ///////////////////////////////////////////////////////////////////////////
501
- ///////////////////////////////////////////////////////////////////////////
502
-
503
- function context(phase, stage, mode, local) {
504
- return {phase: phase, stage: stage, mode: mode, local: local};
505
- }
506
-
507
- function change(state, tok, ctx) {
508
- state.tok = tok;
509
- state.ctx = ctx || {};
510
- }
511
-
512
- function stage(state) {
513
- return state.ctx.stage || 0;
514
- }
515
-
516
- function phase(state) {
517
- return state.ctx.phase;
518
- }
519
-
520
- ///////////////////////////////////////////////////////////////////////////
521
- ///////////////////////////////////////////////////////////////////////////
522
-
523
- return {
524
- startState: function () {
525
- return {tok: to_normal, ctx: context(undefined, 0)};
526
- },
527
-
528
- copyState: function (state) {
529
- var ctx = state.ctx, tmp = state.tmp;
530
- if (ctx.local)
531
- ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)};
532
- if (tmp)
533
- tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)};
534
- return {tok: state.tok, ctx: ctx, tmp: tmp};
535
- },
536
-
537
- innerMode: function (state) {
538
- return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode}
539
- : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode}
540
- : null;
541
- },
542
-
543
- token: function (stream, state) {
544
- return state.tok(stream, state);
545
- }
546
- };
547
- }, 'python', 'stex');
548
-
549
- ///////////////////////////////////////////////////////////////////////////////
550
- ///////////////////////////////////////////////////////////////////////////////
551
-
552
- CodeMirror.defineMIME('text/x-rst', 'rst');
553
-
554
- ///////////////////////////////////////////////////////////////////////////////
555
- ///////////////////////////////////////////////////////////////////////////////
556
-
557
- });