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,540 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- // A rough approximation of Sublime Text's keybindings
5
- // Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js
6
-
7
- (function(mod) {
8
- if (typeof exports == "object" && typeof module == "object") // CommonJS
9
- mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets"));
10
- else if (typeof define == "function" && define.amd) // AMD
11
- define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod);
12
- else // Plain browser env
13
- mod(CodeMirror);
14
- })(function(CodeMirror) {
15
- "use strict";
16
-
17
- var map = CodeMirror.keyMap.sublime = {fallthrough: "default"};
18
- var cmds = CodeMirror.commands;
19
- var Pos = CodeMirror.Pos;
20
- var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault;
21
- var ctrl = mac ? "Cmd-" : "Ctrl-";
22
-
23
- // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.
24
- function findPosSubword(doc, start, dir) {
25
- if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));
26
- var line = doc.getLine(start.line);
27
- if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));
28
- var state = "start", type;
29
- for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {
30
- var next = line.charAt(dir < 0 ? pos - 1 : pos);
31
- var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o";
32
- if (cat == "w" && next.toUpperCase() == next) cat = "W";
33
- if (state == "start") {
34
- if (cat != "o") { state = "in"; type = cat; }
35
- } else if (state == "in") {
36
- if (type != cat) {
37
- if (type == "w" && cat == "W" && dir < 0) pos--;
38
- if (type == "W" && cat == "w" && dir > 0) { type = "w"; continue; }
39
- break;
40
- }
41
- }
42
- }
43
- return Pos(start.line, pos);
44
- }
45
-
46
- function moveSubword(cm, dir) {
47
- cm.extendSelectionsBy(function(range) {
48
- if (cm.display.shift || cm.doc.extend || range.empty())
49
- return findPosSubword(cm.doc, range.head, dir);
50
- else
51
- return dir < 0 ? range.from() : range.to();
52
- });
53
- }
54
-
55
- cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
56
- cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
57
-
58
- cmds[map[ctrl + "Up"] = "scrollLineUp"] = function(cm) {
59
- var info = cm.getScrollInfo();
60
- if (!cm.somethingSelected()) {
61
- var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
62
- if (cm.getCursor().line >= visibleBottomLine)
63
- cm.execCommand("goLineUp");
64
- }
65
- cm.scrollTo(null, info.top - cm.defaultTextHeight());
66
- };
67
- cmds[map[ctrl + "Down"] = "scrollLineDown"] = function(cm) {
68
- var info = cm.getScrollInfo();
69
- if (!cm.somethingSelected()) {
70
- var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;
71
- if (cm.getCursor().line <= visibleTopLine)
72
- cm.execCommand("goLineDown");
73
- }
74
- cm.scrollTo(null, info.top + cm.defaultTextHeight());
75
- };
76
-
77
- cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) {
78
- var ranges = cm.listSelections(), lineRanges = [];
79
- for (var i = 0; i < ranges.length; i++) {
80
- var from = ranges[i].from(), to = ranges[i].to();
81
- for (var line = from.line; line <= to.line; ++line)
82
- if (!(to.line > from.line && line == to.line && to.ch == 0))
83
- lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),
84
- head: line == to.line ? to : Pos(line)});
85
- }
86
- cm.setSelections(lineRanges, 0);
87
- };
88
-
89
- map["Shift-Tab"] = "indentLess";
90
-
91
- cmds[map["Esc"] = "singleSelectionTop"] = function(cm) {
92
- var range = cm.listSelections()[0];
93
- cm.setSelection(range.anchor, range.head, {scroll: false});
94
- };
95
-
96
- cmds[map[ctrl + "L"] = "selectLine"] = function(cm) {
97
- var ranges = cm.listSelections(), extended = [];
98
- for (var i = 0; i < ranges.length; i++) {
99
- var range = ranges[i];
100
- extended.push({anchor: Pos(range.from().line, 0),
101
- head: Pos(range.to().line + 1, 0)});
102
- }
103
- cm.setSelections(extended);
104
- };
105
-
106
- map["Shift-" + ctrl + "K"] = "deleteLine";
107
-
108
- function insertLine(cm, above) {
109
- cm.operation(function() {
110
- var len = cm.listSelections().length, newSelection = [], last = -1;
111
- for (var i = 0; i < len; i++) {
112
- var head = cm.listSelections()[i].head;
113
- if (head.line <= last) continue;
114
- var at = Pos(head.line + (above ? 0 : 1), 0);
115
- cm.replaceRange("\n", at, null, "+insertLine");
116
- cm.indentLine(at.line, null, true);
117
- newSelection.push({head: at, anchor: at});
118
- last = head.line + 1;
119
- }
120
- cm.setSelections(newSelection);
121
- });
122
- }
123
-
124
- cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); };
125
-
126
- cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); };
127
-
128
- function wordAt(cm, pos) {
129
- var start = pos.ch, end = start, line = cm.getLine(pos.line);
130
- while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;
131
- while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;
132
- return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};
133
- }
134
-
135
- cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) {
136
- var from = cm.getCursor("from"), to = cm.getCursor("to");
137
- var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;
138
- if (CodeMirror.cmpPos(from, to) == 0) {
139
- var word = wordAt(cm, from);
140
- if (!word.word) return;
141
- cm.setSelection(word.from, word.to);
142
- fullWord = true;
143
- } else {
144
- var text = cm.getRange(from, to);
145
- var query = fullWord ? new RegExp("\\b" + text + "\\b") : text;
146
- var cur = cm.getSearchCursor(query, to);
147
- if (cur.findNext()) {
148
- cm.addSelection(cur.from(), cur.to());
149
- } else {
150
- cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));
151
- if (cur.findNext())
152
- cm.addSelection(cur.from(), cur.to());
153
- }
154
- }
155
- if (fullWord)
156
- cm.state.sublimeFindFullWord = cm.doc.sel;
157
- };
158
-
159
- var mirror = "(){}[]";
160
- function selectBetweenBrackets(cm) {
161
- var pos = cm.getCursor(), opening = cm.scanForBracket(pos, -1);
162
- if (!opening) return;
163
- for (;;) {
164
- var closing = cm.scanForBracket(pos, 1);
165
- if (!closing) return;
166
- if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
167
- cm.setSelection(Pos(opening.pos.line, opening.pos.ch + 1), closing.pos, false);
168
- return true;
169
- }
170
- pos = Pos(closing.pos.line, closing.pos.ch + 1);
171
- }
172
- }
173
-
174
- cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) {
175
- selectBetweenBrackets(cm) || cm.execCommand("selectAll");
176
- };
177
- cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) {
178
- if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;
179
- };
180
-
181
- cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) {
182
- cm.extendSelectionsBy(function(range) {
183
- var next = cm.scanForBracket(range.head, 1);
184
- if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;
185
- var prev = cm.scanForBracket(range.head, -1);
186
- return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;
187
- });
188
- };
189
-
190
- var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-";
191
-
192
- cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) {
193
- var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];
194
- for (var i = 0; i < ranges.length; i++) {
195
- var range = ranges[i], from = range.from().line - 1, to = range.to().line;
196
- newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch),
197
- head: Pos(range.head.line - 1, range.head.ch)});
198
- if (range.to().ch == 0 && !range.empty()) --to;
199
- if (from > at) linesToMove.push(from, to);
200
- else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
201
- at = to;
202
- }
203
- cm.operation(function() {
204
- for (var i = 0; i < linesToMove.length; i += 2) {
205
- var from = linesToMove[i], to = linesToMove[i + 1];
206
- var line = cm.getLine(from);
207
- cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
208
- if (to > cm.lastLine())
209
- cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");
210
- else
211
- cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
212
- }
213
- cm.setSelections(newSels);
214
- cm.scrollIntoView();
215
- });
216
- };
217
-
218
- cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) {
219
- var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;
220
- for (var i = ranges.length - 1; i >= 0; i--) {
221
- var range = ranges[i], from = range.to().line + 1, to = range.from().line;
222
- if (range.to().ch == 0 && !range.empty()) from--;
223
- if (from < at) linesToMove.push(from, to);
224
- else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
225
- at = to;
226
- }
227
- cm.operation(function() {
228
- for (var i = linesToMove.length - 2; i >= 0; i -= 2) {
229
- var from = linesToMove[i], to = linesToMove[i + 1];
230
- var line = cm.getLine(from);
231
- if (from == cm.lastLine())
232
- cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine");
233
- else
234
- cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
235
- cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
236
- }
237
- cm.scrollIntoView();
238
- });
239
- };
240
-
241
- map[ctrl + "/"] = "toggleComment";
242
-
243
- cmds[map[ctrl + "J"] = "joinLines"] = function(cm) {
244
- var ranges = cm.listSelections(), joined = [];
245
- for (var i = 0; i < ranges.length; i++) {
246
- var range = ranges[i], from = range.from();
247
- var start = from.line, end = range.to().line;
248
- while (i < ranges.length - 1 && ranges[i + 1].from().line == end)
249
- end = ranges[++i].to().line;
250
- joined.push({start: start, end: end, anchor: !range.empty() && from});
251
- }
252
- cm.operation(function() {
253
- var offset = 0, ranges = [];
254
- for (var i = 0; i < joined.length; i++) {
255
- var obj = joined[i];
256
- var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;
257
- for (var line = obj.start; line <= obj.end; line++) {
258
- var actual = line - offset;
259
- if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);
260
- if (actual < cm.lastLine()) {
261
- cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
262
- ++offset;
263
- }
264
- }
265
- ranges.push({anchor: anchor || head, head: head});
266
- }
267
- cm.setSelections(ranges, 0);
268
- });
269
- };
270
-
271
- cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) {
272
- cm.operation(function() {
273
- var rangeCount = cm.listSelections().length;
274
- for (var i = 0; i < rangeCount; i++) {
275
- var range = cm.listSelections()[i];
276
- if (range.empty())
277
- cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));
278
- else
279
- cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());
280
- }
281
- cm.scrollIntoView();
282
- });
283
- };
284
-
285
- map[ctrl + "T"] = "transposeChars";
286
-
287
- function sortLines(cm, caseSensitive) {
288
- var ranges = cm.listSelections(), toSort = [], selected;
289
- for (var i = 0; i < ranges.length; i++) {
290
- var range = ranges[i];
291
- if (range.empty()) continue;
292
- var from = range.from().line, to = range.to().line;
293
- while (i < ranges.length - 1 && ranges[i + 1].from().line == to)
294
- to = range[++i].to().line;
295
- toSort.push(from, to);
296
- }
297
- if (toSort.length) selected = true;
298
- else toSort.push(cm.firstLine(), cm.lastLine());
299
-
300
- cm.operation(function() {
301
- var ranges = [];
302
- for (var i = 0; i < toSort.length; i += 2) {
303
- var from = toSort[i], to = toSort[i + 1];
304
- var start = Pos(from, 0), end = Pos(to);
305
- var lines = cm.getRange(start, end, false);
306
- if (caseSensitive)
307
- lines.sort();
308
- else
309
- lines.sort(function(a, b) {
310
- var au = a.toUpperCase(), bu = b.toUpperCase();
311
- if (au != bu) { a = au; b = bu; }
312
- return a < b ? -1 : a == b ? 0 : 1;
313
- });
314
- cm.replaceRange(lines, start, end);
315
- if (selected) ranges.push({anchor: start, head: end});
316
- }
317
- if (selected) cm.setSelections(ranges, 0);
318
- });
319
- }
320
-
321
- cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); };
322
- cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); };
323
-
324
- cmds[map["F2"] = "nextBookmark"] = function(cm) {
325
- var marks = cm.state.sublimeBookmarks;
326
- if (marks) while (marks.length) {
327
- var current = marks.shift();
328
- var found = current.find();
329
- if (found) {
330
- marks.push(current);
331
- return cm.setSelection(found.from, found.to);
332
- }
333
- }
334
- };
335
-
336
- cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) {
337
- var marks = cm.state.sublimeBookmarks;
338
- if (marks) while (marks.length) {
339
- marks.unshift(marks.pop());
340
- var found = marks[marks.length - 1].find();
341
- if (!found)
342
- marks.pop();
343
- else
344
- return cm.setSelection(found.from, found.to);
345
- }
346
- };
347
-
348
- cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) {
349
- var ranges = cm.listSelections();
350
- var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
351
- for (var i = 0; i < ranges.length; i++) {
352
- var from = ranges[i].from(), to = ranges[i].to();
353
- var found = cm.findMarks(from, to);
354
- for (var j = 0; j < found.length; j++) {
355
- if (found[j].sublimeBookmark) {
356
- found[j].clear();
357
- for (var k = 0; k < marks.length; k++)
358
- if (marks[k] == found[j])
359
- marks.splice(k--, 1);
360
- break;
361
- }
362
- }
363
- if (j == found.length)
364
- marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));
365
- }
366
- };
367
-
368
- cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) {
369
- var marks = cm.state.sublimeBookmarks;
370
- if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
371
- marks.length = 0;
372
- };
373
-
374
- cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) {
375
- var marks = cm.state.sublimeBookmarks, ranges = [];
376
- if (marks) for (var i = 0; i < marks.length; i++) {
377
- var found = marks[i].find();
378
- if (!found)
379
- marks.splice(i--, 0);
380
- else
381
- ranges.push({anchor: found.from, head: found.to});
382
- }
383
- if (ranges.length)
384
- cm.setSelections(ranges, 0);
385
- };
386
-
387
- map["Alt-Q"] = "wrapLines";
388
-
389
- var cK = ctrl + "K ";
390
-
391
- function modifyWordOrSelection(cm, mod) {
392
- cm.operation(function() {
393
- var ranges = cm.listSelections(), indices = [], replacements = [];
394
- for (var i = 0; i < ranges.length; i++) {
395
- var range = ranges[i];
396
- if (range.empty()) { indices.push(i); replacements.push(""); }
397
- else replacements.push(mod(cm.getRange(range.from(), range.to())));
398
- }
399
- cm.replaceSelections(replacements, "around", "case");
400
- for (var i = indices.length - 1, at; i >= 0; i--) {
401
- var range = ranges[indices[i]];
402
- if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;
403
- var word = wordAt(cm, range.head);
404
- at = word.from;
405
- cm.replaceRange(mod(word.word), word.from, word.to);
406
- }
407
- });
408
- }
409
-
410
- map[cK + ctrl + "Backspace"] = "delLineLeft";
411
-
412
- cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
413
- cm.operation(function() {
414
- var ranges = cm.listSelections();
415
- for (var i = ranges.length - 1; i >= 0; i--)
416
- cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete");
417
- cm.scrollIntoView();
418
- });
419
- };
420
-
421
- cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) {
422
- modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });
423
- };
424
- cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) {
425
- modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });
426
- };
427
-
428
- cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) {
429
- if (cm.state.sublimeMark) cm.state.sublimeMark.clear();
430
- cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
431
- };
432
- cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) {
433
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
434
- if (found) cm.setSelection(cm.getCursor(), found);
435
- };
436
- cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) {
437
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
438
- if (found) {
439
- var from = cm.getCursor(), to = found;
440
- if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }
441
- cm.state.sublimeKilled = cm.getRange(from, to);
442
- cm.replaceRange("", from, to);
443
- }
444
- };
445
- cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
446
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
447
- if (found) {
448
- cm.state.sublimeMark.clear();
449
- cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
450
- cm.setCursor(found);
451
- }
452
- };
453
- cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) {
454
- if (cm.state.sublimeKilled != null)
455
- cm.replaceSelection(cm.state.sublimeKilled, null, "paste");
456
- };
457
-
458
- map[cK + ctrl + "G"] = "clearBookmarks";
459
- cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) {
460
- var pos = cm.cursorCoords(null, "local");
461
- cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
462
- };
463
-
464
- cmds[map["Shift-Alt-Up"] = "selectLinesUpward"] = function(cm) {
465
- cm.operation(function() {
466
- var ranges = cm.listSelections();
467
- for (var i = 0; i < ranges.length; i++) {
468
- var range = ranges[i];
469
- if (range.head.line > cm.firstLine())
470
- cm.addSelection(Pos(range.head.line - 1, range.head.ch));
471
- }
472
- });
473
- };
474
- cmds[map["Shift-Alt-Down"] = "selectLinesDownward"] = function(cm) {
475
- cm.operation(function() {
476
- var ranges = cm.listSelections();
477
- for (var i = 0; i < ranges.length; i++) {
478
- var range = ranges[i];
479
- if (range.head.line < cm.lastLine())
480
- cm.addSelection(Pos(range.head.line + 1, range.head.ch));
481
- }
482
- });
483
- };
484
-
485
- function getTarget(cm) {
486
- var from = cm.getCursor("from"), to = cm.getCursor("to");
487
- if (CodeMirror.cmpPos(from, to) == 0) {
488
- var word = wordAt(cm, from);
489
- if (!word.word) return;
490
- from = word.from;
491
- to = word.to;
492
- }
493
- return {from: from, to: to, query: cm.getRange(from, to), word: word};
494
- }
495
-
496
- function findAndGoTo(cm, forward) {
497
- var target = getTarget(cm);
498
- if (!target) return;
499
- var query = target.query;
500
- var cur = cm.getSearchCursor(query, forward ? target.to : target.from);
501
-
502
- if (forward ? cur.findNext() : cur.findPrevious()) {
503
- cm.setSelection(cur.from(), cur.to());
504
- } else {
505
- cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)
506
- : cm.clipPos(Pos(cm.lastLine())));
507
- if (forward ? cur.findNext() : cur.findPrevious())
508
- cm.setSelection(cur.from(), cur.to());
509
- else if (target.word)
510
- cm.setSelection(target.from, target.to);
511
- }
512
- };
513
- cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); };
514
- cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); };
515
- cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) {
516
- var target = getTarget(cm);
517
- if (!target) return;
518
- var cur = cm.getSearchCursor(target.query);
519
- var matches = [];
520
- var primaryIndex = -1;
521
- while (cur.findNext()) {
522
- matches.push({anchor: cur.from(), head: cur.to()});
523
- if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch)
524
- primaryIndex++;
525
- }
526
- cm.setSelections(matches, primaryIndex);
527
- };
528
-
529
- map["Shift-" + ctrl + "["] = "fold";
530
- map["Shift-" + ctrl + "]"] = "unfold";
531
- map[cK + ctrl + "0"] = map[cK + ctrl + "j"] = "unfoldAll";
532
-
533
- map[ctrl + "I"] = "findIncremental";
534
- map["Shift-" + ctrl + "I"] = "findIncrementalReverse";
535
- map[ctrl + "H"] = "replace";
536
- map["F3"] = "findNext";
537
- map["Shift-F3"] = "findPrev";
538
-
539
- CodeMirror.normalizeKeyMap(map);
540
- });