gollum 2.4.4 → 2.4.5

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

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (391) hide show
  1. data/gollum.gemspec +100 -19
  2. data/lib/gollum.rb +2 -3
  3. data/lib/gollum/frontend/public/gollum/css/gollum.css +3 -1
  4. data/lib/gollum/frontend/public/gollum/css/template.css +8 -12
  5. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +64 -60
  6. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +56 -62
  7. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +25 -32
  8. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +56 -63
  9. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +25 -32
  10. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +11 -11
  11. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +59 -53
  12. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +46 -39
  13. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +32 -36
  14. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +62 -47
  15. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config_test.js +71 -0
  16. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +82 -41
  17. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +126 -145
  18. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +25 -33
  19. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +484 -467
  20. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +30 -63
  21. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +29 -37
  22. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +27 -35
  23. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +47 -55
  24. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +61 -41
  25. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +506 -517
  26. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +25 -32
  27. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +26 -34
  28. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +25 -32
  29. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +25 -32
  30. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +28 -38
  31. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +9 -14
  32. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +26 -36
  33. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +44 -36
  34. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +45 -52
  35. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +25 -34
  36. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +26 -33
  37. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +230 -165
  38. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +76 -49
  39. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +66 -61
  40. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +36 -43
  41. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +138 -156
  42. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +35 -32
  43. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +18 -18
  44. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +25 -32
  45. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +116 -101
  46. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +117 -83
  47. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +60 -71
  48. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +163 -102
  49. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +60 -41
  50. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +26 -36
  51. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +26 -36
  52. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +24 -1
  53. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +52 -54
  54. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +32 -39
  55. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +25 -32
  56. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +9 -1
  57. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +73 -33
  58. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +10 -3
  59. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +25 -32
  60. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +2 -2
  61. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +55 -58
  62. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +8 -0
  63. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +144 -0
  64. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +52 -0
  65. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +175 -0
  66. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +124 -0
  67. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +248 -0
  68. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +188 -0
  69. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +41 -0
  70. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +42 -0
  71. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +231 -0
  72. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +732 -0
  73. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +185 -0
  74. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +362 -0
  75. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +529 -0
  76. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +195 -0
  77. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +150 -0
  78. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +139 -0
  79. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +555 -0
  80. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +611 -0
  81. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +79 -0
  82. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +196 -0
  83. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +292 -0
  84. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +698 -0
  85. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +451 -0
  86. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +824 -0
  87. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +1202 -0
  88. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +260 -0
  89. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +311 -0
  90. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +1020 -0
  91. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +238 -0
  92. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +255 -0
  93. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +205 -0
  94. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +104 -0
  95. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +267 -0
  96. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +748 -0
  97. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +181 -0
  98. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +434 -0
  99. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +73 -0
  100. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +931 -0
  101. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +536 -0
  102. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +58 -0
  103. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +195 -0
  104. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +705 -0
  105. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +64 -0
  106. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +260 -0
  107. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +77 -0
  108. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +133 -0
  109. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +64 -0
  110. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +234 -0
  111. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +26 -34
  112. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +195 -55
  113. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +26 -34
  114. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +26 -34
  115. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +31 -31
  116. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +25 -32
  117. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +25 -32
  118. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +25 -33
  119. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +67 -60
  120. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +25 -34
  121. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +112 -130
  122. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +29 -36
  123. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +25 -32
  124. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +22 -7
  125. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +140 -64
  126. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +479 -237
  127. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +321 -230
  128. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +25 -32
  129. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +62 -28
  130. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +39 -20
  131. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +183 -82
  132. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +226 -32
  133. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +25 -32
  134. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +25 -32
  135. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +28 -35
  136. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +25 -32
  137. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +7 -21
  138. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +36 -47
  139. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +202 -697
  140. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +51 -84
  141. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +25 -32
  142. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +25 -32
  143. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +68 -40
  144. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +25 -32
  145. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +62 -0
  146. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +192 -0
  147. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +25 -31
  148. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +27 -33
  149. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +25 -32
  150. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js +142 -0
  151. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +31 -37
  152. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +26 -33
  153. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +25 -32
  154. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +30 -51
  155. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +25 -32
  156. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +28 -35
  157. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +35 -30
  158. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +25 -32
  159. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +25 -32
  160. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +162 -0
  161. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +163 -0
  162. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js +125 -0
  163. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +25 -32
  164. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +25 -32
  165. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +26 -33
  166. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +25 -32
  167. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +25 -32
  168. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +52 -0
  169. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js +81 -0
  170. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +0 -1
  171. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +15 -22
  172. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +28 -36
  173. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +62 -0
  174. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +132 -0
  175. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +20 -25
  176. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +11 -15
  177. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +25 -32
  178. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +32 -38
  179. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +162 -69
  180. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +25 -32
  181. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +58 -0
  182. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +347 -0
  183. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +18 -29
  184. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +28 -51
  185. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +4838 -0
  186. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +98 -180
  187. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +26 -33
  188. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +25 -32
  189. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +163 -64
  190. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +38 -40
  191. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +26 -33
  192. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +26 -34
  193. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +25 -32
  194. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +25 -32
  195. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +56 -0
  196. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +85 -0
  197. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +3 -2
  198. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +1 -1
  199. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +25 -33
  200. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +25 -33
  201. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +25 -32
  202. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +146 -161
  203. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +25 -32
  204. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +60 -0
  205. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +127 -0
  206. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +116 -56
  207. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +75 -101
  208. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +16 -0
  209. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js +49 -0
  210. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +99 -0
  211. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +62 -0
  212. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +75 -0
  213. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +35 -41
  214. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +29 -37
  215. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +100 -0
  216. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +25 -32
  217. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +25 -32
  218. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +62 -0
  219. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +343 -0
  220. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +25 -32
  221. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +39 -53
  222. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +25 -32
  223. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +39 -52
  224. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +33 -24
  225. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +55 -51
  226. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +57 -36
  227. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +53 -153
  228. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +31 -21
  229. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +28 -36
  230. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +44 -61
  231. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +25 -32
  232. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +135 -0
  233. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +190 -0
  234. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +36 -0
  235. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +99 -0
  236. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +67 -0
  237. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +49 -0
  238. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +27 -33
  239. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +102 -90
  240. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +29 -37
  241. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +25 -33
  242. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +32 -54
  243. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +18 -32
  244. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +25 -32
  245. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +25 -32
  246. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +28 -35
  247. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +48 -64
  248. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +28 -18
  249. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +41 -36
  250. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +62 -0
  251. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +175 -0
  252. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +25 -32
  253. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +26 -33
  254. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +110 -0
  255. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +180 -0
  256. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +48 -0
  257. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +107 -0
  258. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +26 -36
  259. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +57 -46
  260. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +25 -32
  261. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +25 -32
  262. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +26 -33
  263. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +68 -0
  264. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +98 -0
  265. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +25 -32
  266. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +27 -34
  267. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +183 -78
  268. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +25 -32
  269. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +30 -38
  270. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +32 -37
  271. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js +92 -0
  272. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +32954 -42497
  273. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +316 -0
  274. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +31 -44
  275. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +48 -57
  276. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +30 -18
  277. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +48 -40
  278. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +26 -34
  279. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +126 -40
  280. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +35 -43
  281. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +28 -35
  282. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +78 -39
  283. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +26 -34
  284. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +39 -36
  285. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +26 -34
  286. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +234 -103
  287. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +26 -34
  288. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +30 -39
  289. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +27 -35
  290. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +190 -201
  291. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +25 -32
  292. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +25 -32
  293. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +25 -32
  294. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +31 -49
  295. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +27 -34
  296. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +52 -55
  297. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +91 -105
  298. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +31 -34
  299. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +47 -37
  300. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +138 -153
  301. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +25 -32
  302. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +67 -105
  303. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +25 -32
  304. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +3 -2
  305. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +25 -32
  306. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +25 -32
  307. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +30 -34
  308. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +217 -0
  309. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +33 -0
  310. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +37 -38
  311. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +27 -34
  312. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +53 -47
  313. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +28 -35
  314. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +54 -48
  315. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +28 -35
  316. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +58 -59
  317. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +28 -35
  318. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +33 -33
  319. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +26 -33
  320. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +52 -64
  321. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +28 -35
  322. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +33 -36
  323. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +26 -33
  324. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +29 -25
  325. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +26 -33
  326. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +14 -21
  327. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +26 -33
  328. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +48 -60
  329. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +28 -35
  330. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +52 -57
  331. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +28 -35
  332. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +53 -71
  333. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +28 -35
  334. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +54 -77
  335. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +28 -35
  336. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +60 -70
  337. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +28 -35
  338. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +55 -72
  339. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +28 -35
  340. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +55 -64
  341. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +28 -35
  342. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +48 -66
  343. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +28 -35
  344. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +49 -61
  345. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +28 -35
  346. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +38 -44
  347. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +26 -33
  348. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +59 -87
  349. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +28 -35
  350. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +59 -87
  351. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +28 -35
  352. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +59 -90
  353. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +28 -35
  354. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +59 -87
  355. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +28 -35
  356. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +57 -85
  357. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +28 -35
  358. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +54 -78
  359. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +28 -35
  360. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +45 -68
  361. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +28 -35
  362. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +111 -0
  363. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +39 -0
  364. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +37 -50
  365. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +26 -33
  366. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +40 -41
  367. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +205 -0
  368. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +48 -55
  369. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +254 -277
  370. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +25 -32
  371. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +22 -4
  372. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +97 -56
  373. data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +24 -476
  374. data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +2 -2
  375. data/lib/gollum/frontend/views/page.rb +3 -2
  376. metadata +102 -21
  377. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +0 -59
  378. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +0 -1686
  379. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +0 -2993
  380. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +0 -69
  381. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +0 -63
  382. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +0 -10363
  383. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +0 -165
  384. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +0 -6177
  385. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +0 -55
  386. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +0 -696
  387. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +0 -598
  388. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +0 -61
  389. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +0 -2072
  390. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +0 -4469
  391. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +0 -6396
@@ -1,37 +1,30 @@
1
1
  /* ***** BEGIN LICENSE BLOCK *****
2
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2
+ * Distributed under the BSD license:
3
3
  *
4
- * The contents of this file are subject to the Mozilla Public License Version
5
- * 1.1 (the "License"); you may not use this file except in compliance with
6
- * the License. You may obtain a copy of the License at
7
- * http://www.mozilla.org/MPL/
8
- *
9
- * Software distributed under the License is distributed on an "AS IS" basis,
10
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
- * for the specific language governing rights and limitations under the
12
- * License.
13
- *
14
- * The Original Code is Ajax.org Code Editor (ACE).
15
- *
16
- * The Initial Developer of the Original Code is
17
- * Ajax.org B.V.
18
- * Portions created by the Initial Developer are Copyright (C) 2010
19
- * the Initial Developer. All Rights Reserved.
20
- *
21
- * Contributor(s):
22
- * Fabian Jakobs <fabian AT ajax DOT org>
23
- *
24
- * Alternatively, the contents of this file may be used under the terms of
25
- * either the GNU General Public License Version 2 or later (the "GPL"), or
26
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
- * in which case the provisions of the GPL or the LGPL are applicable instead
28
- * of those above. If you wish to allow use of your version of this file only
29
- * under the terms of either the GPL or the LGPL, and not to allow others to
30
- * use your version of this file under the terms of the MPL, indicate your
31
- * decision by deleting the provisions above and replace them with the notice
32
- * and other provisions required by the GPL or the LGPL. If you do not delete
33
- * the provisions above, a recipient may use your version of this file under
34
- * the terms of any one of the MPL, the GPL or the LGPL.
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
28
  *
36
29
  * ***** END LICENSE BLOCK ***** */
37
30
 
@@ -2,20 +2,15 @@ define(function(require, exports, module) {
2
2
  "use strict";
3
3
 
4
4
  var oop = require("../lib/oop");
5
- var lang = require("../lib/lang");
6
5
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
7
6
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
8
7
 
9
8
  var CSharpHighlightRules = function() {
10
-
11
- var keywords = lang.arrayToMap(
12
- ("abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic").split("|")
13
- );
14
-
15
- var buildinConstants = lang.arrayToMap(
16
- ("null|true|false").split("|")
17
- );
18
-
9
+ var keywordMapper = this.createKeywordMapper({
10
+ "variable.language": "this",
11
+ "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
12
+ "constant.language": "null|true|false"
13
+ }, "identifier");
19
14
 
20
15
  // regexp must not have capturing parentheses. Use (?:) instead.
21
16
  // regexps are ordered -> the first match is used
@@ -51,16 +46,7 @@ var CSharpHighlightRules = function() {
51
46
  token : "constant.language.boolean",
52
47
  regex : "(?:true|false)\\b"
53
48
  }, {
54
- token : function(value) {
55
- if (value == "this")
56
- return "variable.language";
57
- else if (keywords.hasOwnProperty(value))
58
- return "keyword";
59
- else if (buildinConstants.hasOwnProperty(value))
60
- return "constant.language";
61
- else
62
- return "identifier";
63
- },
49
+ token : keywordMapper,
64
50
  // TODO: Unicode escape sequences
65
51
  // TODO: Unicode identifiers
66
52
  regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
@@ -93,7 +79,7 @@ var CSharpHighlightRules = function() {
93
79
  }
94
80
  ]
95
81
  };
96
-
82
+
97
83
  this.embedRules(DocCommentHighlightRules, "doc-",
98
84
  [ DocCommentHighlightRules.getEndRule("start") ]);
99
85
  };
@@ -1,37 +1,30 @@
1
1
  /* ***** BEGIN LICENSE BLOCK *****
2
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2
+ * Distributed under the BSD license:
3
3
  *
4
- * The contents of this file are subject to the Mozilla Public License Version
5
- * 1.1 (the "License"); you may not use this file except in compliance with
6
- * the License. You may obtain a copy of the License at
7
- * http://www.mozilla.org/MPL/
8
- *
9
- * Software distributed under the License is distributed on an "AS IS" basis,
10
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
- * for the specific language governing rights and limitations under the
12
- * License.
13
- *
14
- * The Original Code is Ajax.org Code Editor (ACE).
15
- *
16
- * The Initial Developer of the Original Code is
17
- * Ajax.org B.V.
18
- * Portions created by the Initial Developer are Copyright (C) 2010
19
- * the Initial Developer. All Rights Reserved.
20
- *
21
- * Contributor(s):
22
- * Fabian Jakobs <fabian AT ajax DOT org>
23
- *
24
- * Alternatively, the contents of this file may be used under the terms of
25
- * either the GNU General Public License Version 2 or later (the "GPL"), or
26
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
- * in which case the provisions of the GPL or the LGPL are applicable instead
28
- * of those above. If you wish to allow use of your version of this file only
29
- * under the terms of either the GPL or the LGPL, and not to allow others to
30
- * use your version of this file under the terms of the MPL, indicate your
31
- * decision by deleting the provisions above and replace them with the notice
32
- * and other provisions required by the GPL or the LGPL. If you do not delete
33
- * the provisions above, a recipient may use your version of this file under
34
- * the terms of any one of the MPL, the GPL or the LGPL.
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
28
  *
36
29
  * ***** END LICENSE BLOCK ***** */
37
30
 
@@ -44,11 +37,13 @@ var Tokenizer = require("../tokenizer").Tokenizer;
44
37
  var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
45
38
  var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
46
39
  var WorkerClient = require("../worker/worker_client").WorkerClient;
40
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
47
41
  var CStyleFoldMode = require("./folding/cstyle").FoldMode;
48
42
 
49
43
  var Mode = function() {
50
44
  this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
51
45
  this.$outdent = new MatchingBraceOutdent();
46
+ this.$behaviour = new CstyleBehaviour();
52
47
  this.foldingRules = new CStyleFoldMode();
53
48
  };
54
49
  oop.inherits(Mode, TextMode);
@@ -81,25 +76,19 @@ oop.inherits(Mode, TextMode);
81
76
  this.autoOutdent = function(state, doc, row) {
82
77
  this.$outdent.autoOutdent(doc, row);
83
78
  };
84
-
79
+
85
80
  this.createWorker = function(session) {
86
- var worker = new WorkerClient(["ace"], "worker-css.js", "ace/mode/css_worker", "Worker");
81
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
87
82
  worker.attachToDocument(session.getDocument());
88
-
83
+
89
84
  worker.on("csslint", function(e) {
90
- var errors = [];
91
- e.data.forEach(function(message) {
92
- errors.push({
93
- row: message.line - 1,
94
- column: message.col - 1,
95
- text: message.message,
96
- type: message.type,
97
- lint: message
98
- });
99
- });
100
-
101
- session.setAnnotations(errors);
85
+ session.setAnnotations(e.data);
102
86
  });
87
+
88
+ worker.on("terminate", function() {
89
+ session.clearAnnotations();
90
+ });
91
+
103
92
  return worker;
104
93
  };
105
94
 
@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
22
  THE SOFTWARE.
23
23
 
24
24
  */
25
- /* Build time: 2-March-2012 02:47:11 */
25
+ /* Build time: 12-September-2012 01:46:26 */
26
26
 
27
27
  /*!
28
28
  Parser-Lib
@@ -47,7 +47,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47
47
  THE SOFTWARE.
48
48
 
49
49
  */
50
- /* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
50
+ /* Version v0.1.9, Build time: 23-July-2012 10:52:31 */
51
51
  var parserlib = {};
52
52
  (function(){
53
53
 
@@ -957,7 +957,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
957
957
  THE SOFTWARE.
958
958
 
959
959
  */
960
- /* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
960
+ /* Version v0.1.9, Build time: 23-July-2012 10:52:31 */
961
961
  (function(){
962
962
  var EventTarget = parserlib.util.EventTarget,
963
963
  TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -2171,7 +2171,7 @@ Parser.prototype = function(){
2171
2171
 
2172
2172
  //there must be a next selector
2173
2173
  if (nextSelector === null){
2174
- this._unexpectedToken(this.LT(1));
2174
+ this._unexpectedToken(tokenStream.LT(1));
2175
2175
  } else {
2176
2176
 
2177
2177
  //nextSelector is an instance of SelectorPart
@@ -2666,7 +2666,8 @@ Parser.prototype = function(){
2666
2666
  expr = null,
2667
2667
  prio = null,
2668
2668
  error = null,
2669
- invalid = null;
2669
+ invalid = null,
2670
+ propertyName= "";
2670
2671
 
2671
2672
  property = this._property();
2672
2673
  if (property !== null){
@@ -2683,8 +2684,20 @@ Parser.prototype = function(){
2683
2684
 
2684
2685
  prio = this._prio();
2685
2686
 
2687
+ /*
2688
+ * If hacks should be allowed, then only check the root
2689
+ * property. If hacks should not be allowed, treat
2690
+ * _property or *property as invalid properties.
2691
+ */
2692
+ propertyName = property.toString();
2693
+ if (this.options.starHack && property.hack == "*" ||
2694
+ this.options.underscoreHack && property.hack == "_") {
2695
+
2696
+ propertyName = property.text;
2697
+ }
2698
+
2686
2699
  try {
2687
- this._validateProperty(property, expr);
2700
+ this._validateProperty(propertyName, expr);
2688
2701
  } catch (ex) {
2689
2702
  invalid = ex;
2690
2703
  }
@@ -2728,7 +2741,7 @@ Parser.prototype = function(){
2728
2741
 
2729
2742
  var tokenStream = this._tokenStream,
2730
2743
  values = [],
2731
- //valueParts = [],
2744
+ //valueParts = [],
2732
2745
  value = null,
2733
2746
  operator = null;
2734
2747
 
@@ -3012,9 +3025,15 @@ Parser.prototype = function(){
3012
3025
  var tokenStream = this._tokenStream,
3013
3026
  token,
3014
3027
  tt,
3015
- name;
3028
+ name,
3029
+ prefix = "";
3016
3030
 
3017
3031
  tokenStream.mustMatch(Tokens.KEYFRAMES_SYM);
3032
+ token = tokenStream.token();
3033
+ if (/^@\-([^\-]+)\-/.test(token.value)) {
3034
+ prefix = RegExp.$1;
3035
+ }
3036
+
3018
3037
  this._readWhitespace();
3019
3038
  name = this._keyframe_name();
3020
3039
 
@@ -3024,8 +3043,9 @@ Parser.prototype = function(){
3024
3043
  this.fire({
3025
3044
  type: "startkeyframes",
3026
3045
  name: name,
3027
- line: name.line,
3028
- col: name.col
3046
+ prefix: prefix,
3047
+ line: token.startLine,
3048
+ col: token.startCol
3029
3049
  });
3030
3050
 
3031
3051
  this._readWhitespace();
@@ -3041,8 +3061,9 @@ Parser.prototype = function(){
3041
3061
  this.fire({
3042
3062
  type: "endkeyframes",
3043
3063
  name: name,
3044
- line: name.line,
3045
- col: name.col
3064
+ prefix: prefix,
3065
+ line: token.startLine,
3066
+ col: token.startCol
3046
3067
  });
3047
3068
 
3048
3069
  this._readWhitespace();
@@ -3525,6 +3546,7 @@ var Properties = {
3525
3546
  "background-repeat" : { multi: "<repeat-style>" },
3526
3547
  "background-size" : { multi: "<bg-size>", comma: true },
3527
3548
  "baseline-shift" : "baseline | sub | super | <percentage> | <length>",
3549
+ "behavior" : 1,
3528
3550
  "binding" : 1,
3529
3551
  "bleed" : "<length>",
3530
3552
  "bookmark-label" : "<content> | <attr> | <string>",
@@ -3823,6 +3845,7 @@ var Properties = {
3823
3845
  "pitch" : 1,
3824
3846
  "pitch-range" : 1,
3825
3847
  "play-during" : 1,
3848
+ "pointer-events" : "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit",
3826
3849
  "position" : "static | relative | absolute | fixed | inherit",
3827
3850
  "presentation-level" : 1,
3828
3851
  "punctuation-trim" : 1,
@@ -3871,6 +3894,7 @@ var Properties = {
3871
3894
  "text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
3872
3895
  "text-outline" : 1,
3873
3896
  "text-overflow" : 1,
3897
+ "text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
3874
3898
  "text-shadow" : 1,
3875
3899
  "text-transform" : "capitalize | uppercase | lowercase | none | inherit",
3876
3900
  "text-wrap" : "normal | none | avoid",
@@ -5566,7 +5590,7 @@ var Tokens = [
5566
5590
  //{ name: "ATKEYWORD"},
5567
5591
 
5568
5592
  //CSS3 animations
5569
- { name: "KEYFRAMES_SYM", text: [ "@keyframes", "@-webkit-keyframes", "@-moz-keyframes", "@-ms-keyframes" ] },
5593
+ { name: "KEYFRAMES_SYM", text: [ "@keyframes", "@-webkit-keyframes", "@-moz-keyframes", "@-o-keyframes" ] },
5570
5594
 
5571
5595
  //important symbol
5572
5596
  { name: "IMPORTANT_SYM"},
@@ -5950,7 +5974,7 @@ var ValidationTypes = {
5950
5974
  i, len, found = false;
5951
5975
 
5952
5976
  for (i=0,len=args.length; i < len && !found; i++){
5953
- if (text == args[i]){
5977
+ if (text == args[i].toLowerCase()){
5954
5978
  found = true;
5955
5979
  }
5956
5980
  }
@@ -6042,7 +6066,7 @@ var ValidationTypes = {
6042
6066
  },
6043
6067
 
6044
6068
  "<gradient>": function(part) {
6045
- return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
6069
+ return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
6046
6070
  },
6047
6071
 
6048
6072
  "<box>": function(part){
@@ -6134,6 +6158,18 @@ var ValidationTypes = {
6134
6158
  part,
6135
6159
  i, len;
6136
6160
 
6161
+ /*
6162
+ <position> = [
6163
+ [ left | center | right | top | bottom | <percentage> | <length> ]
6164
+ |
6165
+ [ left | center | right | <percentage> | <length> ]
6166
+ [ top | center | bottom | <percentage> | <length> ]
6167
+ |
6168
+ [ center | [ left | right ] [ <percentage> | <length> ]? ] &&
6169
+ [ center | [ top | bottom ] [ <percentage> | <length> ]? ]
6170
+ ]
6171
+
6172
+ */
6137
6173
 
6138
6174
  if (ValidationTypes.isAny(expression, "top | bottom")) {
6139
6175
  result = true;
@@ -6306,7 +6342,7 @@ var CSSLint = (function(){
6306
6342
  formatters = [],
6307
6343
  api = new parserlib.util.EventTarget();
6308
6344
 
6309
- api.version = "0.9.7";
6345
+ api.version = "0.9.9";
6310
6346
 
6311
6347
  //-------------------------------------------------------------------------
6312
6348
  // Rule Management
@@ -6340,6 +6376,23 @@ var CSSLint = (function(){
6340
6376
  return a.id > b.id ? 1 : 0;
6341
6377
  });
6342
6378
  };
6379
+
6380
+ /**
6381
+ * Returns a ruleset configuration object with all current rules.
6382
+ * @return A ruleset object.
6383
+ * @method getRuleset
6384
+ */
6385
+ api.getRuleset = function() {
6386
+ var ruleset = {},
6387
+ i = 0,
6388
+ len = rules.length;
6389
+
6390
+ while (i < len){
6391
+ ruleset[rules[i++].id] = 1; //by default, everything is a warning
6392
+ }
6393
+
6394
+ return ruleset;
6395
+ };
6343
6396
 
6344
6397
  //-------------------------------------------------------------------------
6345
6398
  // Formatters
@@ -6420,13 +6473,11 @@ var CSSLint = (function(){
6420
6473
  parser = new parserlib.css.Parser({ starHack: true, ieFilters: true,
6421
6474
  underscoreHack: true, strict: false });
6422
6475
 
6476
+ // normalize line endings
6423
6477
  lines = text.replace(/\n\r?/g, "$split$").split('$split$');
6424
6478
 
6425
6479
  if (!ruleset){
6426
- ruleset = {};
6427
- while (i < len){
6428
- ruleset[rules[i++].id] = 1; //by default, everything is a warning
6429
- }
6480
+ ruleset = this.getRuleset();
6430
6481
  }
6431
6482
 
6432
6483
  reporter = new Reporter(lines, ruleset);
@@ -6775,36 +6826,42 @@ CSSLint.addRule({
6775
6826
  "padding-bottom": 1,
6776
6827
  "padding-top": 1
6777
6828
  },
6778
- properties;
6829
+ properties,
6830
+ boxSizing = false;
6779
6831
 
6780
6832
  function startRule(){
6781
6833
  properties = {};
6834
+ boxSizing = false;
6782
6835
  }
6783
6836
 
6784
6837
  function endRule(){
6785
- var prop;
6786
- if (properties.height){
6787
- for (prop in heightProperties){
6788
- if (heightProperties.hasOwnProperty(prop) && properties[prop]){
6789
-
6790
- //special case for padding
6791
- if (!(prop == "padding" && properties[prop].value.parts.length === 2 && properties[prop].value.parts[0].value === 0)){
6792
- reporter.report("Using height with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
6838
+ var prop, value;
6839
+
6840
+ if (!boxSizing) {
6841
+ if (properties.height){
6842
+ for (prop in heightProperties){
6843
+ if (heightProperties.hasOwnProperty(prop) && properties[prop]){
6844
+ value = properties[prop].value;
6845
+ //special case for padding
6846
+ if (!(prop == "padding" && value.parts.length === 2 && value.parts[0].value === 0)){
6847
+ reporter.report("Using height with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
6848
+ }
6793
6849
  }
6794
6850
  }
6795
6851
  }
6796
- }
6797
-
6798
- if (properties.width){
6799
- for (prop in widthProperties){
6800
- if (widthProperties.hasOwnProperty(prop) && properties[prop]){
6801
6852
 
6802
- if (!(prop == "padding" && properties[prop].value.parts.length === 2 && properties[prop].value.parts[1].value === 0)){
6803
- reporter.report("Using width with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
6853
+ if (properties.width){
6854
+ for (prop in widthProperties){
6855
+ if (widthProperties.hasOwnProperty(prop) && properties[prop]){
6856
+ value = properties[prop].value;
6857
+
6858
+ if (!(prop == "padding" && value.parts.length === 2 && value.parts[1].value === 0)){
6859
+ reporter.report("Using width with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
6860
+ }
6804
6861
  }
6805
6862
  }
6806
- }
6807
- }
6863
+ }
6864
+ }
6808
6865
  }
6809
6866
 
6810
6867
  parser.addListener("startrule", startRule);
@@ -6821,8 +6878,10 @@ CSSLint.addRule({
6821
6878
  properties[name] = { line: event.property.line, col: event.property.col, value: event.value };
6822
6879
  }
6823
6880
  } else {
6824
- if (name == "width" || name == "height"){
6881
+ if (/^(width|height)/i.test(name) && /^(length|percentage)/.test(event.value.parts[0].type)){
6825
6882
  properties[name] = 1;
6883
+ } else if (name == "box-sizing") {
6884
+ boxSizing = true;
6826
6885
  }
6827
6886
  }
6828
6887
 
@@ -6887,20 +6946,21 @@ CSSLint.addRule({
6887
6946
  prefixed,
6888
6947
  i,
6889
6948
  len,
6949
+ inKeyFrame = false,
6890
6950
  arrayPush = Array.prototype.push,
6891
6951
  applyTo = [];
6892
6952
 
6893
6953
  // See http://peter.sh/experiments/vendor-prefixed-css-property-overview/ for details
6894
6954
  compatiblePrefixes = {
6895
- "animation" : "webkit moz ms",
6896
- "animation-delay" : "webkit moz ms",
6897
- "animation-direction" : "webkit moz ms",
6898
- "animation-duration" : "webkit moz ms",
6899
- "animation-fill-mode" : "webkit moz ms",
6900
- "animation-iteration-count" : "webkit moz ms",
6901
- "animation-name" : "webkit moz ms",
6902
- "animation-play-state" : "webkit moz ms",
6903
- "animation-timing-function" : "webkit moz ms",
6955
+ "animation" : "webkit moz",
6956
+ "animation-delay" : "webkit moz",
6957
+ "animation-direction" : "webkit moz",
6958
+ "animation-duration" : "webkit moz",
6959
+ "animation-fill-mode" : "webkit moz",
6960
+ "animation-iteration-count" : "webkit moz",
6961
+ "animation-name" : "webkit moz",
6962
+ "animation-play-state" : "webkit moz",
6963
+ "animation-timing-function" : "webkit moz",
6904
6964
  "appearance" : "webkit moz",
6905
6965
  "border-end" : "webkit moz",
6906
6966
  "border-end-color" : "webkit moz",
@@ -6940,11 +7000,11 @@ CSSLint.addRule({
6940
7000
  "text-size-adjust" : "webkit ms",
6941
7001
  "transform" : "webkit moz ms o",
6942
7002
  "transform-origin" : "webkit moz ms o",
6943
- "transition" : "webkit moz o ms",
6944
- "transition-delay" : "webkit moz o ms",
6945
- "transition-duration" : "webkit moz o ms",
6946
- "transition-property" : "webkit moz o ms",
6947
- "transition-timing-function" : "webkit moz o ms",
7003
+ "transition" : "webkit moz o",
7004
+ "transition-delay" : "webkit moz o",
7005
+ "transition-duration" : "webkit moz o",
7006
+ "transition-property" : "webkit moz o",
7007
+ "transition-timing-function" : "webkit moz o",
6948
7008
  "user-modify" : "webkit moz",
6949
7009
  "user-select" : "webkit moz ms",
6950
7010
  "word-break" : "epub ms",
@@ -6963,14 +7023,28 @@ CSSLint.addRule({
6963
7023
  arrayPush.apply(applyTo, variations);
6964
7024
  }
6965
7025
  }
7026
+
6966
7027
  parser.addListener("startrule", function () {
6967
7028
  properties = [];
6968
7029
  });
6969
7030
 
7031
+ parser.addListener("startkeyframes", function (event) {
7032
+ inKeyFrame = event.prefix || true;
7033
+ });
7034
+
7035
+ parser.addListener("endkeyframes", function (event) {
7036
+ inKeyFrame = false;
7037
+ });
7038
+
6970
7039
  parser.addListener("property", function (event) {
6971
7040
  var name = event.property;
6972
7041
  if (CSSLint.Util.indexOf(applyTo, name.text) > -1) {
6973
- properties.push(name);
7042
+
7043
+ // e.g., -moz-transform is okay to be alone in @-moz-keyframes
7044
+ if (!inKeyFrame || typeof inKeyFrame != "string" ||
7045
+ name.text.indexOf("-" + inKeyFrame + "-") !== 0) {
7046
+ properties.push(name);
7047
+ }
6974
7048
  }
6975
7049
  });
6976
7050
 
@@ -7633,7 +7707,7 @@ CSSLint.addRule({
7633
7707
  parser.addListener("endstylesheet", function(){
7634
7708
  reporter.stat("important", count);
7635
7709
  if (count >= 10){
7636
- reporter.rollupWarn("Too many !important declarations (" + count + "), try to use less than 10 to avoid specifity issues.", rule);
7710
+ reporter.rollupWarn("Too many !important declarations (" + count + "), try to use less than 10 to avoid specificity issues.", rule);
7637
7711
  }
7638
7712
  });
7639
7713
  }
@@ -7649,308 +7723,20 @@ CSSLint.addRule({
7649
7723
  //rule information
7650
7724
  id: "known-properties",
7651
7725
  name: "Require use of known properties",
7652
- desc: "Properties should be known (listed in CSS specification) or be a vendor-prefixed property.",
7726
+ desc: "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",
7653
7727
  browsers: "All",
7654
7728
 
7655
7729
  //initialization
7656
7730
  init: function(parser, reporter){
7657
- var rule = this,
7658
- properties = {
7659
-
7660
- "alignment-adjust": 1,
7661
- "alignment-baseline": 1,
7662
- "animation": 1,
7663
- "animation-delay": 1,
7664
- "animation-direction": 1,
7665
- "animation-duration": 1,
7666
- "animation-fill-mode": 1,
7667
- "animation-iteration-count": 1,
7668
- "animation-name": 1,
7669
- "animation-play-state": 1,
7670
- "animation-timing-function": 1,
7671
- "appearance": 1,
7672
- "azimuth": 1,
7673
- "backface-visibility": 1,
7674
- "background": 1,
7675
- "background-attachment": 1,
7676
- "background-break": 1,
7677
- "background-clip": 1,
7678
- "background-color": 1,
7679
- "background-image": 1,
7680
- "background-origin": 1,
7681
- "background-position": 1,
7682
- "background-repeat": 1,
7683
- "background-size": 1,
7684
- "baseline-shift": 1,
7685
- "binding": 1,
7686
- "bleed": 1,
7687
- "bookmark-label": 1,
7688
- "bookmark-level": 1,
7689
- "bookmark-state": 1,
7690
- "bookmark-target": 1,
7691
- "border": 1,
7692
- "border-bottom": 1,
7693
- "border-bottom-color": 1,
7694
- "border-bottom-left-radius": 1,
7695
- "border-bottom-right-radius": 1,
7696
- "border-bottom-style": 1,
7697
- "border-bottom-width": 1,
7698
- "border-collapse": 1,
7699
- "border-color": 1,
7700
- "border-image": 1,
7701
- "border-image-outset": 1,
7702
- "border-image-repeat": 1,
7703
- "border-image-slice": 1,
7704
- "border-image-source": 1,
7705
- "border-image-width": 1,
7706
- "border-left": 1,
7707
- "border-left-color": 1,
7708
- "border-left-style": 1,
7709
- "border-left-width": 1,
7710
- "border-radius": 1,
7711
- "border-right": 1,
7712
- "border-right-color": 1,
7713
- "border-right-style": 1,
7714
- "border-right-width": 1,
7715
- "border-spacing": 1,
7716
- "border-style": 1,
7717
- "border-top": 1,
7718
- "border-top-color": 1,
7719
- "border-top-left-radius": 1,
7720
- "border-top-right-radius": 1,
7721
- "border-top-style": 1,
7722
- "border-top-width": 1,
7723
- "border-width": 1,
7724
- "bottom": 1,
7725
- "box-align": 1,
7726
- "box-decoration-break": 1,
7727
- "box-direction": 1,
7728
- "box-flex": 1,
7729
- "box-flex-group": 1,
7730
- "box-lines": 1,
7731
- "box-ordinal-group": 1,
7732
- "box-orient": 1,
7733
- "box-pack": 1,
7734
- "box-shadow": 1,
7735
- "box-sizing": 1,
7736
- "break-after": 1,
7737
- "break-before": 1,
7738
- "break-inside": 1,
7739
- "caption-side": 1,
7740
- "clear": 1,
7741
- "clip": 1,
7742
- "color": 1,
7743
- "color-profile": 1,
7744
- "column-count": 1,
7745
- "column-fill": 1,
7746
- "column-gap": 1,
7747
- "column-rule": 1,
7748
- "column-rule-color": 1,
7749
- "column-rule-style": 1,
7750
- "column-rule-width": 1,
7751
- "column-span": 1,
7752
- "column-width": 1,
7753
- "columns": 1,
7754
- "content": 1,
7755
- "counter-increment": 1,
7756
- "counter-reset": 1,
7757
- "crop": 1,
7758
- "cue": 1,
7759
- "cue-after": 1,
7760
- "cue-before": 1,
7761
- "cursor": 1,
7762
- "direction": 1,
7763
- "display": 1,
7764
- "dominant-baseline": 1,
7765
- "drop-initial-after-adjust": 1,
7766
- "drop-initial-after-align": 1,
7767
- "drop-initial-before-adjust": 1,
7768
- "drop-initial-before-align": 1,
7769
- "drop-initial-size": 1,
7770
- "drop-initial-value": 1,
7771
- "elevation": 1,
7772
- "empty-cells": 1,
7773
- "fit": 1,
7774
- "fit-position": 1,
7775
- "float": 1,
7776
- "float-offset": 1,
7777
- "font": 1,
7778
- "font-family": 1,
7779
- "font-size": 1,
7780
- "font-size-adjust": 1,
7781
- "font-stretch": 1,
7782
- "font-style": 1,
7783
- "font-variant": 1,
7784
- "font-weight": 1,
7785
- "grid-columns": 1,
7786
- "grid-rows": 1,
7787
- "hanging-punctuation": 1,
7788
- "height": 1,
7789
- "hyphenate-after": 1,
7790
- "hyphenate-before": 1,
7791
- "hyphenate-character": 1,
7792
- "hyphenate-lines": 1,
7793
- "hyphenate-resource": 1,
7794
- "hyphens": 1,
7795
- "icon": 1,
7796
- "image-orientation": 1,
7797
- "image-rendering": 1,
7798
- "image-resolution": 1,
7799
- "inline-box-align": 1,
7800
- "left": 1,
7801
- "letter-spacing": 1,
7802
- "line-height": 1,
7803
- "line-stacking": 1,
7804
- "line-stacking-ruby": 1,
7805
- "line-stacking-shift": 1,
7806
- "line-stacking-strategy": 1,
7807
- "list-style": 1,
7808
- "list-style-image": 1,
7809
- "list-style-position": 1,
7810
- "list-style-type": 1,
7811
- "margin": 1,
7812
- "margin-bottom": 1,
7813
- "margin-left": 1,
7814
- "margin-right": 1,
7815
- "margin-top": 1,
7816
- "mark": 1,
7817
- "mark-after": 1,
7818
- "mark-before": 1,
7819
- "marks": 1,
7820
- "marquee-direction": 1,
7821
- "marquee-play-count": 1,
7822
- "marquee-speed": 1,
7823
- "marquee-style": 1,
7824
- "max-height": 1,
7825
- "max-width": 1,
7826
- "min-height": 1,
7827
- "min-width": 1,
7828
- "move-to": 1,
7829
- "nav-down": 1,
7830
- "nav-index": 1,
7831
- "nav-left": 1,
7832
- "nav-right": 1,
7833
- "nav-up": 1,
7834
- "opacity": 1,
7835
- "orphans": 1,
7836
- "outline": 1,
7837
- "outline-color": 1,
7838
- "outline-offset": 1,
7839
- "outline-style": 1,
7840
- "outline-width": 1,
7841
- "overflow": 1,
7842
- "overflow-style": 1,
7843
- "overflow-x": 1,
7844
- "overflow-y": 1,
7845
- "padding": 1,
7846
- "padding-bottom": 1,
7847
- "padding-left": 1,
7848
- "padding-right": 1,
7849
- "padding-top": 1,
7850
- "page": 1,
7851
- "page-break-after": 1,
7852
- "page-break-before": 1,
7853
- "page-break-inside": 1,
7854
- "page-policy": 1,
7855
- "pause": 1,
7856
- "pause-after": 1,
7857
- "pause-before": 1,
7858
- "perspective": 1,
7859
- "perspective-origin": 1,
7860
- "phonemes": 1,
7861
- "pitch": 1,
7862
- "pitch-range": 1,
7863
- "play-during": 1,
7864
- "position": 1,
7865
- "presentation-level": 1,
7866
- "punctuation-trim": 1,
7867
- "quotes": 1,
7868
- "rendering-intent": 1,
7869
- "resize": 1,
7870
- "rest": 1,
7871
- "rest-after": 1,
7872
- "rest-before": 1,
7873
- "richness": 1,
7874
- "right": 1,
7875
- "rotation": 1,
7876
- "rotation-point": 1,
7877
- "ruby-align": 1,
7878
- "ruby-overhang": 1,
7879
- "ruby-position": 1,
7880
- "ruby-span": 1,
7881
- "size": 1,
7882
- "speak": 1,
7883
- "speak-header": 1,
7884
- "speak-numeral": 1,
7885
- "speak-punctuation": 1,
7886
- "speech-rate": 1,
7887
- "stress": 1,
7888
- "string-set": 1,
7889
- "table-layout": 1,
7890
- "target": 1,
7891
- "target-name": 1,
7892
- "target-new": 1,
7893
- "target-position": 1,
7894
- "text-align": 1,
7895
- "text-align-last": 1,
7896
- "text-decoration": 1,
7897
- "text-emphasis": 1,
7898
- "text-height": 1,
7899
- "text-indent": 1,
7900
- "text-justify": 1,
7901
- "text-outline": 1,
7902
- "text-shadow": 1,
7903
- "text-transform": 1,
7904
- "text-wrap": 1,
7905
- "top": 1,
7906
- "transform": 1,
7907
- "transform-origin": 1,
7908
- "transform-style": 1,
7909
- "transition": 1,
7910
- "transition-delay": 1,
7911
- "transition-duration": 1,
7912
- "transition-property": 1,
7913
- "transition-timing-function": 1,
7914
- "unicode-bidi": 1,
7915
- "user-modify": 1,
7916
- "user-select": 1,
7917
- "vertical-align": 1,
7918
- "visibility": 1,
7919
- "voice-balance": 1,
7920
- "voice-duration": 1,
7921
- "voice-family": 1,
7922
- "voice-pitch": 1,
7923
- "voice-pitch-range": 1,
7924
- "voice-rate": 1,
7925
- "voice-stress": 1,
7926
- "voice-volume": 1,
7927
- "volume": 1,
7928
- "white-space": 1,
7929
- "white-space-collapse": 1,
7930
- "widows": 1,
7931
- "width": 1,
7932
- "word-break": 1,
7933
- "word-spacing": 1,
7934
- "word-wrap": 1,
7935
- "z-index": 1,
7936
-
7937
- //IE
7938
- "filter": 1,
7939
- "zoom": 1,
7940
-
7941
- //@font-face
7942
- "src": 1
7943
- };
7731
+ var rule = this;
7944
7732
 
7945
7733
  parser.addListener("property", function(event){
7946
7734
  var name = event.property.text.toLowerCase();
7947
7735
 
7736
+ // the check is handled entirely by the parser-lib (https://github.com/nzakas/parser-lib)
7948
7737
  if (event.invalid) {
7949
7738
  reporter.report(event.invalid.message, event.line, event.col, rule);
7950
7739
  }
7951
- //if (!properties[name] && name.charAt(0) != "-"){
7952
- // reporter.error("Unknown property '" + event.property + "'.", event.line, event.col, rule);
7953
- //}
7954
7740
 
7955
7741
  });
7956
7742
  }
@@ -8290,8 +8076,35 @@ CSSLint.addRule({
8290
8076
 
8291
8077
  });
8292
8078
  /*
8293
- * Rule: Don't use text-indent for image replacement if you need to support rtl.
8294
- *
8079
+ * Rule: Don't use properties with a star prefix.
8080
+ *
8081
+ */
8082
+ /*global CSSLint*/
8083
+ CSSLint.addRule({
8084
+
8085
+ //rule information
8086
+ id: "star-property-hack",
8087
+ name: "Disallow properties with a star prefix",
8088
+ desc: "Checks for the star property hack (targets IE6/7)",
8089
+ browsers: "All",
8090
+
8091
+ //initialization
8092
+ init: function(parser, reporter){
8093
+ var rule = this;
8094
+
8095
+ //check if property name starts with "*"
8096
+ parser.addListener("property", function(event){
8097
+ var property = event.property;
8098
+
8099
+ if (property.hack == "*") {
8100
+ reporter.report("Property with star prefix found.", event.property.line, event.property.col, rule);
8101
+ }
8102
+ });
8103
+ }
8104
+ });
8105
+ /*
8106
+ * Rule: Don't use text-indent for image replacement if you need to support rtl.
8107
+ *
8295
8108
  */
8296
8109
  /*global CSSLint*/
8297
8110
  CSSLint.addRule({
@@ -8301,27 +8114,29 @@ CSSLint.addRule({
8301
8114
  name: "Disallow negative text-indent",
8302
8115
  desc: "Checks for text indent less than -99px",
8303
8116
  browsers: "All",
8304
-
8117
+
8305
8118
  //initialization
8306
8119
  init: function(parser, reporter){
8307
8120
  var rule = this,
8308
- textIndent = false;
8309
-
8310
-
8121
+ textIndent,
8122
+ direction;
8123
+
8124
+
8311
8125
  function startRule(event){
8312
8126
  textIndent = false;
8127
+ direction = "inherit";
8313
8128
  }
8314
-
8129
+
8315
8130
  //event handler for end of rules
8316
8131
  function endRule(event){
8317
- if (textIndent){
8132
+ if (textIndent && direction != "ltr"){
8318
8133
  reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule);
8319
8134
  }
8320
- }
8321
-
8135
+ }
8136
+
8322
8137
  parser.addListener("startrule", startRule);
8323
8138
  parser.addListener("startfontface", startRule);
8324
-
8139
+
8325
8140
  //check for use of "font-size"
8326
8141
  parser.addListener("property", function(event){
8327
8142
  var name = event.property.toString().toLowerCase(),
@@ -8330,16 +8145,43 @@ CSSLint.addRule({
8330
8145
  if (name == "text-indent" && value.parts[0].value < -99){
8331
8146
  textIndent = event.property;
8332
8147
  } else if (name == "direction" && value == "ltr"){
8333
- textIndent = false;
8148
+ direction = "ltr";
8334
8149
  }
8335
8150
  });
8336
8151
 
8337
8152
  parser.addListener("endrule", endRule);
8338
- parser.addListener("endfontface", endRule);
8153
+ parser.addListener("endfontface", endRule);
8339
8154
 
8340
8155
  }
8341
8156
 
8342
8157
  });
8158
+ /*
8159
+ * Rule: Don't use properties with a underscore prefix.
8160
+ *
8161
+ */
8162
+ /*global CSSLint*/
8163
+ CSSLint.addRule({
8164
+
8165
+ //rule information
8166
+ id: "underscore-property-hack",
8167
+ name: "Disallow properties with an underscore prefix",
8168
+ desc: "Checks for the underscore property hack (targets IE6)",
8169
+ browsers: "All",
8170
+
8171
+ //initialization
8172
+ init: function(parser, reporter){
8173
+ var rule = this;
8174
+
8175
+ //check if property name starts with "_"
8176
+ parser.addListener("property", function(event){
8177
+ var property = event.property;
8178
+
8179
+ if (property.hack == "_") {
8180
+ reporter.report("Property with underscore prefix found.", event.property.line, event.property.col, rule);
8181
+ }
8182
+ });
8183
+ }
8184
+ });
8343
8185
  /*
8344
8186
  * Rule: Headings (h1-h6) should be defined only once.
8345
8187
  */
@@ -8669,346 +8511,9 @@ CSSLint.addRule({
8669
8511
 
8670
8512
  });
8671
8513
  /*global CSSLint*/
8672
- CSSLint.addFormatter({
8673
- //format information
8674
- id: "checkstyle-xml",
8675
- name: "Checkstyle XML format",
8676
-
8677
- /**
8678
- * Return opening root XML tag.
8679
- * @return {String} to prepend before all results
8680
- */
8681
- startFormat: function(){
8682
- return "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle>";
8683
- },
8684
-
8685
- /**
8686
- * Return closing root XML tag.
8687
- * @return {String} to append after all results
8688
- */
8689
- endFormat: function(){
8690
- return "</checkstyle>";
8691
- },
8692
-
8693
- /**
8694
- * Given CSS Lint results for a file, return output for this format.
8695
- * @param results {Object} with error and warning messages
8696
- * @param filename {String} relative file path
8697
- * @param options {Object} (UNUSED for now) specifies special handling of output
8698
- * @return {String} output for results
8699
- */
8700
- formatResults: function(results, filename, options) {
8701
- var messages = results.messages,
8702
- output = [];
8703
-
8704
- /**
8705
- * Generate a source string for a rule.
8706
- * Checkstyle source strings usually resemble Java class names e.g
8707
- * net.csslint.SomeRuleName
8708
- * @param {Object} rule
8709
- * @return rule source as {String}
8710
- */
8711
- var generateSource = function(rule) {
8712
- if (!rule || !('name' in rule)) {
8713
- return "";
8714
- }
8715
- return 'net.csslint.' + rule.name.replace(/\s/g,'');
8716
- };
8717
-
8718
- /**
8719
- * Replace special characters before write to output.
8720
- *
8721
- * Rules:
8722
- * - single quotes is the escape sequence for double-quotes
8723
- * - &lt; is the escape sequence for <
8724
- * - &gt; is the escape sequence for >
8725
- *
8726
- * @param {String} message to escape
8727
- * @return escaped message as {String}
8728
- */
8729
- var escapeSpecialCharacters = function(str) {
8730
- if (!str || str.constructor !== String) {
8731
- return "";
8732
- }
8733
- return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
8734
- };
8735
-
8736
- if (messages.length > 0) {
8737
- output.push("<file name=\""+filename+"\">");
8738
- CSSLint.Util.forEach(messages, function (message, i) {
8739
- //ignore rollups for now
8740
- if (!message.rollup) {
8741
- output.push("<error line=\"" + message.line + "\" column=\"" + message.col + "\" severity=\"" + message.type + "\"" +
8742
- " message=\"" + escapeSpecialCharacters(message.message) + "\" source=\"" + generateSource(message.rule) +"\"/>");
8743
- }
8744
- });
8745
- output.push("</file>");
8746
- }
8747
-
8748
- return output.join("");
8749
- }
8750
- });
8751
- /*global CSSLint*/
8752
- CSSLint.addFormatter({
8753
- //format information
8754
- id: "compact",
8755
- name: "Compact, 'porcelain' format",
8756
-
8757
- /**
8758
- * Return content to be printed before all file results.
8759
- * @return {String} to prepend before all results
8760
- */
8761
- startFormat: function() {
8762
- return "";
8763
- },
8764
-
8765
- /**
8766
- * Return content to be printed after all file results.
8767
- * @return {String} to append after all results
8768
- */
8769
- endFormat: function() {
8770
- return "";
8771
- },
8772
-
8773
- /**
8774
- * Given CSS Lint results for a file, return output for this format.
8775
- * @param results {Object} with error and warning messages
8776
- * @param filename {String} relative file path
8777
- * @param options {Object} (Optional) specifies special handling of output
8778
- * @return {String} output for results
8779
- */
8780
- formatResults: function(results, filename, options) {
8781
- var messages = results.messages,
8782
- output = "";
8783
- options = options || {};
8784
-
8785
- /**
8786
- * Capitalize and return given string.
8787
- * @param str {String} to capitalize
8788
- * @return {String} capitalized
8789
- */
8790
- var capitalize = function(str) {
8791
- return str.charAt(0).toUpperCase() + str.slice(1);
8792
- };
8793
-
8794
- if (messages.length === 0) {
8795
- return options.quiet ? "" : filename + ": Lint Free!";
8796
- }
8797
-
8798
- CSSLint.Util.forEach(messages, function(message, i) {
8799
- if (message.rollup) {
8800
- output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n";
8801
- } else {
8802
- output += filename + ": " + "line " + message.line +
8803
- ", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + "\n";
8804
- }
8805
- });
8806
-
8807
- return output;
8808
- }
8809
- });
8810
- /*global CSSLint*/
8811
- CSSLint.addFormatter({
8812
- //format information
8813
- id: "csslint-xml",
8814
- name: "CSSLint XML format",
8815
-
8816
- /**
8817
- * Return opening root XML tag.
8818
- * @return {String} to prepend before all results
8819
- */
8820
- startFormat: function(){
8821
- return "<?xml version=\"1.0\" encoding=\"utf-8\"?><csslint>";
8822
- },
8823
-
8824
- /**
8825
- * Return closing root XML tag.
8826
- * @return {String} to append after all results
8827
- */
8828
- endFormat: function(){
8829
- return "</csslint>";
8830
- },
8831
-
8832
- /**
8833
- * Given CSS Lint results for a file, return output for this format.
8834
- * @param results {Object} with error and warning messages
8835
- * @param filename {String} relative file path
8836
- * @param options {Object} (UNUSED for now) specifies special handling of output
8837
- * @return {String} output for results
8838
- */
8839
- formatResults: function(results, filename, options) {
8840
- var messages = results.messages,
8841
- output = [];
8842
-
8843
- /**
8844
- * Replace special characters before write to output.
8845
- *
8846
- * Rules:
8847
- * - single quotes is the escape sequence for double-quotes
8848
- * - &lt; is the escape sequence for <
8849
- * - &gt; is the escape sequence for >
8850
- *
8851
- * @param {String} message to escape
8852
- * @return escaped message as {String}
8853
- */
8854
- var escapeSpecialCharacters = function(str) {
8855
- if (!str || str.constructor !== String) {
8856
- return "";
8857
- }
8858
- return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
8859
- };
8860
-
8861
- if (messages.length > 0) {
8862
- output.push("<file name=\""+filename+"\">");
8863
- CSSLint.Util.forEach(messages, function (message, i) {
8864
- if (message.rollup) {
8865
- output.push("<issue severity=\"" + message.type + "\" reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
8866
- } else {
8867
- output.push("<issue line=\"" + message.line + "\" char=\"" + message.col + "\" severity=\"" + message.type + "\"" +
8868
- " reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
8869
- }
8870
- });
8871
- output.push("</file>");
8872
- }
8873
-
8874
- return output.join("");
8875
- }
8876
- });
8877
- /*global CSSLint*/
8878
- CSSLint.addFormatter({
8879
- //format information
8880
- id: "lint-xml",
8881
- name: "Lint XML format",
8882
-
8883
- /**
8884
- * Return opening root XML tag.
8885
- * @return {String} to prepend before all results
8886
- */
8887
- startFormat: function(){
8888
- return "<?xml version=\"1.0\" encoding=\"utf-8\"?><lint>";
8889
- },
8890
-
8891
- /**
8892
- * Return closing root XML tag.
8893
- * @return {String} to append after all results
8894
- */
8895
- endFormat: function(){
8896
- return "</lint>";
8897
- },
8898
-
8899
- /**
8900
- * Given CSS Lint results for a file, return output for this format.
8901
- * @param results {Object} with error and warning messages
8902
- * @param filename {String} relative file path
8903
- * @param options {Object} (UNUSED for now) specifies special handling of output
8904
- * @return {String} output for results
8905
- */
8906
- formatResults: function(results, filename, options) {
8907
- var messages = results.messages,
8908
- output = [];
8909
-
8910
- /**
8911
- * Replace special characters before write to output.
8912
- *
8913
- * Rules:
8914
- * - single quotes is the escape sequence for double-quotes
8915
- * - &lt; is the escape sequence for <
8916
- * - &gt; is the escape sequence for >
8917
- *
8918
- * @param {String} message to escape
8919
- * @return escaped message as {String}
8920
- */
8921
- var escapeSpecialCharacters = function(str) {
8922
- if (!str || str.constructor !== String) {
8923
- return "";
8924
- }
8925
- return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
8926
- };
8927
-
8928
- if (messages.length > 0) {
8929
-
8930
- output.push("<file name=\""+filename+"\">");
8931
- CSSLint.Util.forEach(messages, function (message, i) {
8932
- if (message.rollup) {
8933
- output.push("<issue severity=\"" + message.type + "\" reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
8934
- } else {
8935
- output.push("<issue line=\"" + message.line + "\" char=\"" + message.col + "\" severity=\"" + message.type + "\"" +
8936
- " reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
8937
- }
8938
- });
8939
- output.push("</file>");
8940
- }
8941
-
8942
- return output.join("");
8943
- }
8944
- });
8945
- /*global CSSLint*/
8946
- CSSLint.addFormatter({
8947
- //format information
8948
- id: "text",
8949
- name: "Plain Text",
8950
-
8951
- /**
8952
- * Return content to be printed before all file results.
8953
- * @return {String} to prepend before all results
8954
- */
8955
- startFormat: function() {
8956
- return "";
8957
- },
8958
-
8959
- /**
8960
- * Return content to be printed after all file results.
8961
- * @return {String} to append after all results
8962
- */
8963
- endFormat: function() {
8964
- return "";
8965
- },
8966
-
8967
- /**
8968
- * Given CSS Lint results for a file, return output for this format.
8969
- * @param results {Object} with error and warning messages
8970
- * @param filename {String} relative file path
8971
- * @param options {Object} (Optional) specifies special handling of output
8972
- * @return {String} output for results
8973
- */
8974
- formatResults: function(results, filename, options) {
8975
- var messages = results.messages,
8976
- output = "";
8977
- options = options || {};
8978
-
8979
- if (messages.length === 0) {
8980
- return options.quiet ? "" : "\n\ncsslint: No errors in " + filename + ".";
8981
- }
8982
-
8983
- output = "\n\ncsslint: There are " + messages.length + " problems in " + filename + ".";
8984
- var pos = filename.lastIndexOf("/"),
8985
- shortFilename = filename;
8986
-
8987
- if (pos === -1){
8988
- pos = filename.lastIndexOf("\\");
8989
- }
8990
- if (pos > -1){
8991
- shortFilename = filename.substring(pos+1);
8992
- }
8993
-
8994
- CSSLint.Util.forEach(messages, function (message, i) {
8995
- output = output + "\n\n" + shortFilename;
8996
- if (message.rollup) {
8997
- output += "\n" + (i+1) + ": " + message.type;
8998
- output += "\n" + message.message;
8999
- } else {
9000
- output += "\n" + (i+1) + ": " + message.type + " at line " + message.line + ", col " + message.col;
9001
- output += "\n" + message.message;
9002
- output += "\n" + message.evidence;
9003
- }
9004
- });
9005
-
9006
- return output;
9007
- }
9008
- });
9009
8514
 
9010
8515
 
9011
8516
  exports.CSSLint = CSSLint;
9012
8517
 
9013
8518
 
9014
- });
8519
+ });