gollum 2.0.0 → 2.1.0

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 (454) hide show
  1. data/README.md +44 -7
  2. data/Rakefile +1 -1
  3. data/bin/gollum +20 -1
  4. data/gollum.gemspec +400 -5
  5. data/lib/gollum.rb +2 -1
  6. data/lib/gollum/blob_entry.rb +13 -1
  7. data/lib/gollum/committer.rb +10 -1
  8. data/lib/gollum/file.rb +15 -2
  9. data/lib/gollum/file_view.rb +145 -0
  10. data/lib/gollum/frontend/app.rb +217 -69
  11. data/lib/gollum/frontend/helpers.rb +21 -0
  12. data/lib/gollum/frontend/public/gollum/css/_styles.css +121 -0
  13. data/lib/gollum/frontend/public/gollum/css/editor.css +17 -8
  14. data/lib/gollum/frontend/public/gollum/css/gollum.css +440 -402
  15. data/lib/gollum/frontend/public/gollum/css/template.css +540 -289
  16. data/lib/gollum/frontend/public/gollum/images/dirty-shade.png +0 -0
  17. data/lib/gollum/frontend/public/gollum/images/fileview/document.png +0 -0
  18. data/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png +0 -0
  19. data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png +0 -0
  20. data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png +0 -0
  21. data/lib/gollum/frontend/public/gollum/images/para.png +0 -0
  22. data/lib/gollum/frontend/public/gollum/images/pin-16.png +0 -0
  23. data/lib/gollum/frontend/public/gollum/images/pin-20.png +0 -0
  24. data/lib/gollum/frontend/public/gollum/images/pin-24.png +0 -0
  25. data/lib/gollum/frontend/public/gollum/images/pin-32.png +0 -0
  26. data/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js +31 -7
  27. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js +2 -1
  28. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js +2 -1
  29. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js +18 -6
  30. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js +2 -1
  31. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js +2 -1
  32. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js +2 -1
  33. data/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js +3 -0
  34. data/lib/gollum/frontend/public/gollum/javascript/gollum.js +78 -16
  35. data/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
  36. data/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js +8 -0
  37. data/lib/gollum/frontend/public/gollum/livepreview/css/custom.css +107 -0
  38. data/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png +0 -0
  39. data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
  40. data/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png +0 -0
  41. data/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png +0 -0
  42. data/lib/gollum/frontend/public/gollum/livepreview/index.html +46 -0
  43. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +103 -0
  44. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +254 -0
  45. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +184 -0
  46. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +261 -0
  47. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +92 -0
  48. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +121 -0
  49. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +193 -0
  50. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +460 -0
  51. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +101 -0
  52. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +124 -0
  53. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
  54. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +327 -0
  55. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
  56. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +617 -0
  57. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +314 -0
  58. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2419 -0
  59. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +252 -0
  60. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +116 -0
  61. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +276 -0
  62. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +759 -0
  63. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +981 -0
  64. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +2163 -0
  65. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +195 -0
  66. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +231 -0
  67. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +171 -0
  68. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +562 -0
  69. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +22 -0
  70. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +98 -0
  71. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +81 -0
  72. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +536 -0
  73. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +367 -0
  74. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +170 -0
  75. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +143 -0
  76. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +257 -0
  77. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +315 -0
  78. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +122 -0
  79. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +556 -0
  80. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +101 -0
  81. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +611 -0
  82. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +193 -0
  83. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +134 -0
  84. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +49 -0
  85. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +202 -0
  86. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +187 -0
  87. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +214 -0
  88. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +595 -0
  89. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +106 -0
  90. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +105 -0
  91. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +292 -0
  92. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1059 -0
  93. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +317 -0
  94. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +121 -0
  95. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +72 -0
  96. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
  97. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +129 -0
  98. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +164 -0
  99. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +62 -0
  100. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +61 -0
  101. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
  102. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +105 -0
  103. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +98 -0
  104. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +225 -0
  105. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +98 -0
  106. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +113 -0
  107. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +68 -0
  108. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +74 -0
  109. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +66 -0
  110. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +132 -0
  111. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +180 -0
  112. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +121 -0
  113. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +235 -0
  114. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +121 -0
  115. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +63 -0
  116. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +100 -0
  117. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +739 -0
  118. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +2756 -0
  119. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +603 -0
  120. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +68 -0
  121. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +342 -0
  122. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +154 -0
  123. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +227 -0
  124. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +72 -0
  125. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +92 -0
  126. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +71 -0
  127. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +135 -0
  128. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +74 -0
  129. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +58 -0
  130. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +104 -0
  131. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +110 -0
  132. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9014 -0
  133. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +242 -0
  134. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +99 -0
  135. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +85 -0
  136. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +66 -0
  137. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +75 -0
  138. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +58 -0
  139. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
  140. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +93 -0
  141. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
  142. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +127 -0
  143. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +108 -0
  144. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +95 -0
  145. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +92 -0
  146. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +76 -0
  147. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +115 -0
  148. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +86 -0
  149. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +169 -0
  150. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +88 -0
  151. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +65 -0
  152. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +105 -0
  153. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +262 -0
  154. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +117 -0
  155. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +81 -0
  156. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +129 -0
  157. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
  158. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +183 -0
  159. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +58 -0
  160. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +104 -0
  161. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +83 -0
  162. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +159 -0
  163. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +93 -0
  164. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +74 -0
  165. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +25 -0
  166. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +144 -0
  167. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +164 -0
  168. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +471 -0
  169. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +225 -0
  170. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +165 -0
  171. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +88 -0
  172. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +99 -0
  173. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +100 -0
  174. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
  175. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +111 -0
  176. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +103 -0
  177. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +108 -0
  178. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +53 -0
  179. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +122 -0
  180. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +57 -0
  181. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +38 -0
  182. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +87 -0
  183. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +279 -0
  184. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +116 -0
  185. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +220 -0
  186. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +91 -0
  187. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +87 -0
  188. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +436 -0
  189. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +22 -0
  190. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +42 -0
  191. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +81 -0
  192. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +195 -0
  193. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +81 -0
  194. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +81 -0
  195. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +103 -0
  196. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +355 -0
  197. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +117 -0
  198. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +168 -0
  199. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +78 -0
  200. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +583 -0
  201. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +119 -0
  202. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1165 -0
  203. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +58 -0
  204. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +138 -0
  205. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +147 -0
  206. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +182 -0
  207. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +86 -0
  208. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +116 -0
  209. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +194 -0
  210. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +116 -0
  211. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +132 -0
  212. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +168 -0
  213. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
  214. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +179 -0
  215. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +86 -0
  216. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +304 -0
  217. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +144 -0
  218. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +145 -0
  219. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +70 -0
  220. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +89 -0
  221. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +78 -0
  222. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +71 -0
  223. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +159 -0
  224. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +109 -0
  225. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +71 -0
  226. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +73 -0
  227. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +100 -0
  228. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +65 -0
  229. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +109 -0
  230. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +103 -0
  231. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +82 -0
  232. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +120 -0
  233. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +202 -0
  234. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +59 -0
  235. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +6 -0
  236. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +1686 -0
  237. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +2993 -0
  238. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +69 -0
  239. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +63 -0
  240. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +10363 -0
  241. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +42525 -0
  242. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +165 -0
  243. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +6177 -0
  244. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +55 -0
  245. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +158 -0
  246. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +86 -0
  247. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +64 -0
  248. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +116 -0
  249. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +70 -0
  250. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +73 -0
  251. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +354 -0
  252. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +105 -0
  253. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +71 -0
  254. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +140 -0
  255. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +158 -0
  256. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +163 -0
  257. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +762 -0
  258. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +171 -0
  259. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +696 -0
  260. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +598 -0
  261. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +61 -0
  262. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +2072 -0
  263. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +278 -0
  264. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +164 -0
  265. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +581 -0
  266. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +230 -0
  267. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +170 -0
  268. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +198 -0
  269. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +93 -0
  270. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +58 -0
  271. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +142 -0
  272. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +398 -0
  273. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +87 -0
  274. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +451 -0
  275. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +886 -0
  276. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +472 -0
  277. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +411 -0
  278. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +42 -0
  279. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +136 -0
  280. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +63 -0
  281. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
  282. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
  283. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
  284. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
  285. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
  286. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +85 -0
  287. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
  288. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +204 -0
  289. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
  290. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +159 -0
  291. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +46 -0
  292. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +118 -0
  293. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +46 -0
  294. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +119 -0
  295. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +46 -0
  296. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +145 -0
  297. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +46 -0
  298. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +151 -0
  299. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +46 -0
  300. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +149 -0
  301. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +46 -0
  302. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +182 -0
  303. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +45 -0
  304. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +102 -0
  305. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +48 -0
  306. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +133 -0
  307. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +46 -0
  308. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +137 -0
  309. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +46 -0
  310. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +140 -0
  311. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +46 -0
  312. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +140 -0
  313. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +46 -0
  314. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +146 -0
  315. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +46 -0
  316. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +148 -0
  317. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +46 -0
  318. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +145 -0
  319. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +46 -0
  320. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +150 -0
  321. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +46 -0
  322. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +131 -0
  323. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +46 -0
  324. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +130 -0
  325. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +46 -0
  326. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +165 -0
  327. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +47 -0
  328. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +164 -0
  329. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +46 -0
  330. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +164 -0
  331. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +46 -0
  332. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +164 -0
  333. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +46 -0
  334. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +164 -0
  335. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +46 -0
  336. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +160 -0
  337. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +46 -0
  338. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +162 -0
  339. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +46 -0
  340. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +141 -0
  341. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +46 -0
  342. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +162 -0
  343. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +219 -0
  344. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +195 -0
  345. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +142 -0
  346. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
  347. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1402 -0
  348. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +93 -0
  349. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +4469 -0
  350. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +6396 -0
  351. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +43 -0
  352. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +138 -0
  353. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +176 -0
  354. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +73 -0
  355. data/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
  356. data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +456 -0
  357. data/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js +22 -0
  358. data/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js +35 -0
  359. data/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js +1 -0
  360. data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +476 -0
  361. data/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
  362. data/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
  363. data/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
  364. data/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
  365. data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +59 -0
  366. data/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
  367. data/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
  368. data/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
  369. data/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
  370. data/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
  371. data/lib/gollum/frontend/public/gollum/livepreview/readme.md +44 -0
  372. data/lib/gollum/frontend/templates/compare.mustache +9 -9
  373. data/lib/gollum/frontend/templates/create.mustache +4 -1
  374. data/lib/gollum/frontend/templates/edit.mustache +6 -3
  375. data/lib/gollum/frontend/templates/editor.mustache +30 -14
  376. data/lib/gollum/frontend/templates/file_view.mustache +32 -0
  377. data/lib/gollum/frontend/templates/history.mustache +8 -8
  378. data/lib/gollum/frontend/templates/layout.mustache +21 -14
  379. data/lib/gollum/frontend/templates/page.mustache +37 -14
  380. data/lib/gollum/frontend/templates/pages.mustache +14 -10
  381. data/lib/gollum/frontend/templates/search.mustache +2 -2
  382. data/lib/gollum/frontend/templates/searchbar.mustache +1 -1
  383. data/lib/gollum/frontend/uri_encode_component.rb +172 -0
  384. data/lib/gollum/frontend/views/compare.rb +2 -4
  385. data/lib/gollum/frontend/views/create.rb +5 -0
  386. data/lib/gollum/frontend/views/edit.rb +12 -0
  387. data/lib/gollum/frontend/views/file_view.rb +19 -0
  388. data/lib/gollum/frontend/views/has_page.rb +15 -0
  389. data/lib/gollum/frontend/views/history.rb +8 -4
  390. data/lib/gollum/frontend/views/layout.rb +9 -1
  391. data/lib/gollum/frontend/views/page.rb +37 -10
  392. data/lib/gollum/frontend/views/pages.rb +48 -0
  393. data/lib/gollum/git_access.rb +2 -2
  394. data/lib/gollum/markup.rb +115 -19
  395. data/lib/gollum/page.rb +79 -9
  396. data/lib/gollum/tex.rb +319 -42
  397. data/lib/gollum/wiki.rb +92 -12
  398. data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
  399. data/licenses/licenses.txt +23 -0
  400. data/licenses/unity_asset_pool/COPYRIGHT +286 -0
  401. data/test/examples/lotr.git/config +1 -1
  402. data/test/examples/lotr.git/logs/HEAD +4 -0
  403. data/test/examples/lotr.git/logs/refs/heads/master +4 -0
  404. data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
  405. data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
  406. data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
  407. data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
  408. data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
  409. data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
  410. data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +2 -0
  411. data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
  412. data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +1 -0
  413. data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
  414. data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
  415. data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
  416. data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
  417. data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
  418. data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
  419. data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
  420. data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
  421. data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
  422. data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +2 -0
  423. data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
  424. data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +1 -0
  425. data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
  426. data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
  427. data/test/examples/lotr.git/refs/heads/master +1 -1
  428. data/test/examples/revert.git/COMMIT_EDITMSG +1 -1
  429. data/test/examples/revert.git/index +0 -0
  430. data/test/examples/revert.git/logs/HEAD +1 -0
  431. data/test/examples/revert.git/logs/refs/heads/master +1 -0
  432. data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
  433. data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
  434. data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +3 -0
  435. data/test/examples/revert.git/refs/heads/master +1 -1
  436. data/test/file_view/1_file.txt +3 -0
  437. data/test/file_view/1_file_1_folder.txt +8 -0
  438. data/test/file_view/1_folder.txt +8 -0
  439. data/test/file_view/2_files_2_folders.txt +12 -0
  440. data/test/file_view/2_files_2_folders_1_root.txt +13 -0
  441. data/test/file_view/nested_folders.txt +28 -0
  442. data/test/test_app.rb +162 -12
  443. data/test/test_app_helpers.rb +13 -0
  444. data/test/test_committer.rb +1 -1
  445. data/test/test_file_view.rb +102 -0
  446. data/test/test_git_access.rb +3 -2
  447. data/test/test_markup.rb +45 -12
  448. data/test/test_page.rb +65 -1
  449. data/test/test_page_revert.rb +14 -2
  450. data/test/test_pages_view.rb +37 -0
  451. data/test/test_unicode.rb +110 -0
  452. data/test/test_wiki.rb +51 -4
  453. metadata +658 -239
  454. data/lib/gollum/frontend/public/gollum/javascript/jquery.js +0 -7179
@@ -0,0 +1,187 @@
1
+ /* vim:ts=4:sts=4:sw=4:
2
+ * ***** BEGIN LICENSE BLOCK *****
3
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
+ *
5
+ * The contents of this file are subject to the Mozilla Public License Version
6
+ * 1.1 (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ * http://www.mozilla.org/MPL/
9
+ *
10
+ * Software distributed under the License is distributed on an "AS IS" basis,
11
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
+ * for the specific language governing rights and limitations under the
13
+ * License.
14
+ *
15
+ * The Original Code is Ajax.org Code Editor (ACE).
16
+ *
17
+ * The Initial Developer of the Original Code is
18
+ * Ajax.org B.V.
19
+ * Portions created by the Initial Developer are Copyright (C) 2010
20
+ * the Initial Developer. All Rights Reserved.
21
+ *
22
+ * Contributor(s):
23
+ * Fabian Jakobs <fabian AT ajax DOT org>
24
+ * Julian Viereck <julian DOT viereck AT gmail DOT com>
25
+ *
26
+ * Alternatively, the contents of this file may be used under the terms of
27
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
28
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
+ * in which case the provisions of the GPL or the LGPL are applicable instead
30
+ * of those above. If you wish to allow use of your version of this file only
31
+ * under the terms of either the GPL or the LGPL, and not to allow others to
32
+ * use your version of this file under the terms of the MPL, indicate your
33
+ * decision by deleting the provisions above and replace them with the notice
34
+ * and other provisions required by the GPL or the LGPL. If you do not delete
35
+ * the provisions above, a recipient may use your version of this file under
36
+ * the terms of any one of the MPL, the GPL or the LGPL.
37
+ *
38
+ * ***** END LICENSE BLOCK ***** */
39
+
40
+ define(function(require, exports, module) {
41
+ "use strict";
42
+
43
+ var dom = require("../lib/dom");
44
+ var oop = require("../lib/oop");
45
+ var EventEmitter = require("../lib/event_emitter").EventEmitter;
46
+
47
+ var Gutter = function(parentEl) {
48
+ this.element = dom.createElement("div");
49
+ this.element.className = "ace_layer ace_gutter-layer";
50
+ parentEl.appendChild(this.element);
51
+ this.setShowFoldWidgets(this.$showFoldWidgets);
52
+
53
+ this.gutterWidth = 0;
54
+
55
+ this.$breakpoints = [];
56
+ this.$annotations = [];
57
+ this.$decorations = [];
58
+ };
59
+
60
+ (function() {
61
+
62
+ oop.implement(this, EventEmitter);
63
+
64
+ this.setSession = function(session) {
65
+ this.session = session;
66
+ };
67
+
68
+ this.addGutterDecoration = function(row, className){
69
+ if (!this.$decorations[row])
70
+ this.$decorations[row] = "";
71
+ this.$decorations[row] += " " + className;
72
+ };
73
+
74
+ this.removeGutterDecoration = function(row, className){
75
+ this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
76
+ };
77
+
78
+ this.setAnnotations = function(annotations) {
79
+ // iterate over sparse array
80
+ this.$annotations = [];
81
+ for (var row in annotations) if (annotations.hasOwnProperty(row)) {
82
+ var rowAnnotations = annotations[row];
83
+ if (!rowAnnotations)
84
+ continue;
85
+
86
+ var rowInfo = this.$annotations[row] = {
87
+ text: []
88
+ };
89
+ for (var i=0; i<rowAnnotations.length; i++) {
90
+ var annotation = rowAnnotations[i];
91
+ var annoText = annotation.text.replace(/"/g, "&quot;").replace(/'/g, "&#8217;").replace(/</, "&lt;");
92
+ if (rowInfo.text.indexOf(annoText) === -1)
93
+ rowInfo.text.push(annoText);
94
+ var type = annotation.type;
95
+ if (type == "error")
96
+ rowInfo.className = "ace_error";
97
+ else if (type == "warning" && rowInfo.className != "ace_error")
98
+ rowInfo.className = "ace_warning";
99
+ else if (type == "info" && (!rowInfo.className))
100
+ rowInfo.className = "ace_info";
101
+ }
102
+ }
103
+ };
104
+
105
+ this.update = function(config) {
106
+ this.$config = config;
107
+
108
+ var emptyAnno = {className: "", text: []};
109
+ var html = [];
110
+ var i = config.firstRow;
111
+ var lastRow = config.lastRow;
112
+ var fold = this.session.getNextFoldLine(i);
113
+ var foldStart = fold ? fold.start.row : Infinity;
114
+ var foldWidgets = this.$showFoldWidgets && this.session.foldWidgets;
115
+ var breakpoints = this.session.$breakpoints;
116
+
117
+ while (true) {
118
+ if(i > foldStart) {
119
+ i = fold.end.row + 1;
120
+ fold = this.session.getNextFoldLine(i, fold);
121
+ foldStart = fold ?fold.start.row :Infinity;
122
+ }
123
+ if(i > lastRow)
124
+ break;
125
+
126
+ var annotation = this.$annotations[i] || emptyAnno;
127
+ html.push("<div class='ace_gutter-cell",
128
+ this.$decorations[i] || "",
129
+ breakpoints[i] ? " ace_breakpoint " : " ",
130
+ annotation.className,
131
+ "' title='", annotation.text.join("\n"),
132
+ "' style='height:", this.session.getRowLength(i) * config.lineHeight, "px;'>", (i+1));
133
+
134
+ if (foldWidgets) {
135
+ var c = foldWidgets[i];
136
+ // check if cached value is invalidated and we need to recompute
137
+ if (c == null)
138
+ c = foldWidgets[i] = this.session.getFoldWidget(i);
139
+ if (c)
140
+ html.push(
141
+ "<span class='ace_fold-widget ", c,
142
+ c == "start" && i == foldStart && i < fold.end.row ? " closed" : " open",
143
+ "'></span>"
144
+ );
145
+ }
146
+
147
+ html.push("</div>");
148
+
149
+ i++;
150
+ }
151
+
152
+ if (this.session.$useWrapMode)
153
+ html.push(
154
+ "<div class='ace_gutter-cell' style='pointer-events:none;opacity:0'>",
155
+ this.session.getLength() - 1,
156
+ "</div>"
157
+ );
158
+
159
+ this.element = dom.setInnerHtml(this.element, html.join(""));
160
+ this.element.style.height = config.minHeight + "px";
161
+
162
+ var gutterWidth = this.element.offsetWidth;
163
+ if (gutterWidth !== this.gutterWidth) {
164
+ this.gutterWidth = gutterWidth;
165
+ this._emit("changeGutterWidth", gutterWidth);
166
+ }
167
+ };
168
+
169
+ this.$showFoldWidgets = true;
170
+ this.setShowFoldWidgets = function(show) {
171
+ if (show)
172
+ dom.addCssClass(this.element, "ace_folding-enabled");
173
+ else
174
+ dom.removeCssClass(this.element, "ace_folding-enabled");
175
+
176
+ this.$showFoldWidgets = show;
177
+ };
178
+
179
+ this.getShowFoldWidgets = function() {
180
+ return this.$showFoldWidgets;
181
+ };
182
+
183
+ }).call(Gutter.prototype);
184
+
185
+ exports.Gutter = Gutter;
186
+
187
+ });
@@ -0,0 +1,214 @@
1
+ /* vim:ts=4:sts=4:sw=4:
2
+ * ***** BEGIN LICENSE BLOCK *****
3
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
+ *
5
+ * The contents of this file are subject to the Mozilla Public License Version
6
+ * 1.1 (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ * http://www.mozilla.org/MPL/
9
+ *
10
+ * Software distributed under the License is distributed on an "AS IS" basis,
11
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
+ * for the specific language governing rights and limitations under the
13
+ * License.
14
+ *
15
+ * The Original Code is Ajax.org Code Editor (ACE).
16
+ *
17
+ * The Initial Developer of the Original Code is
18
+ * Ajax.org B.V.
19
+ * Portions created by the Initial Developer are Copyright (C) 2010
20
+ * the Initial Developer. All Rights Reserved.
21
+ *
22
+ * Contributor(s):
23
+ * Fabian Jakobs <fabian AT ajax DOT org>
24
+ * Julian Viereck <julian.viereck@gmail.com>
25
+ *
26
+ * Alternatively, the contents of this file may be used under the terms of
27
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
28
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
+ * in which case the provisions of the GPL or the LGPL are applicable instead
30
+ * of those above. If you wish to allow use of your version of this file only
31
+ * under the terms of either the GPL or the LGPL, and not to allow others to
32
+ * use your version of this file under the terms of the MPL, indicate your
33
+ * decision by deleting the provisions above and replace them with the notice
34
+ * and other provisions required by the GPL or the LGPL. If you do not delete
35
+ * the provisions above, a recipient may use your version of this file under
36
+ * the terms of any one of the MPL, the GPL or the LGPL.
37
+ *
38
+ * ***** END LICENSE BLOCK ***** */
39
+
40
+ define(function(require, exports, module) {
41
+ "use strict";
42
+
43
+ var Range = require("../range").Range;
44
+ var dom = require("../lib/dom");
45
+
46
+ var Marker = function(parentEl) {
47
+ this.element = dom.createElement("div");
48
+ this.element.className = "ace_layer ace_marker-layer";
49
+ parentEl.appendChild(this.element);
50
+ };
51
+
52
+ (function() {
53
+
54
+ this.$padding = 0;
55
+
56
+ this.setPadding = function(padding) {
57
+ this.$padding = padding;
58
+ };
59
+ this.setSession = function(session) {
60
+ this.session = session;
61
+ };
62
+
63
+ this.setMarkers = function(markers) {
64
+ this.markers = markers;
65
+ };
66
+
67
+ this.update = function(config) {
68
+ var config = config || this.config;
69
+ if (!config)
70
+ return;
71
+
72
+ this.config = config;
73
+
74
+
75
+ var html = [];
76
+ for (var key in this.markers) {
77
+ var marker = this.markers[key];
78
+
79
+ if (!marker.range) {
80
+ marker.update(html, this, this.session, config);
81
+ continue;
82
+ }
83
+
84
+ var range = marker.range.clipRows(config.firstRow, config.lastRow);
85
+ if (range.isEmpty()) continue;
86
+
87
+ range = range.toScreenRange(this.session);
88
+ if (marker.renderer) {
89
+ var top = this.$getTop(range.start.row, config);
90
+ var left = Math.round(
91
+ this.$padding + range.start.column * config.characterWidth
92
+ );
93
+ marker.renderer(html, range, left, top, config);
94
+ }
95
+ else if (range.isMultiLine()) {
96
+ if (marker.type == "text") {
97
+ this.drawTextMarker(html, range, marker.clazz, config);
98
+ } else {
99
+ this.drawMultiLineMarker(
100
+ html, range, marker.clazz, config,
101
+ marker.type
102
+ );
103
+ }
104
+ }
105
+ else {
106
+ this.drawSingleLineMarker(
107
+ html, range, marker.clazz + " start", config,
108
+ null, marker.type
109
+ );
110
+ }
111
+ }
112
+ this.element = dom.setInnerHtml(this.element, html.join(""));
113
+ };
114
+
115
+ this.$getTop = function(row, layerConfig) {
116
+ return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;
117
+ };
118
+
119
+ // Draws a marker, which spans a range of text on multiple lines
120
+ this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) {
121
+ // selection start
122
+ var row = range.start.row;
123
+
124
+ var lineRange = new Range(
125
+ row, range.start.column,
126
+ row, this.session.getScreenLastRowColumn(row)
127
+ );
128
+ this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " start", layerConfig, 1, "text");
129
+
130
+ // selection end
131
+ row = range.end.row;
132
+ lineRange = new Range(row, 0, row, range.end.column);
133
+ this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, "text");
134
+
135
+ for (row = range.start.row + 1; row < range.end.row; row++) {
136
+ lineRange.start.row = row;
137
+ lineRange.end.row = row;
138
+ lineRange.end.column = this.session.getScreenLastRowColumn(row);
139
+ this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text");
140
+ }
141
+ };
142
+
143
+ // Draws a multi line marker, where lines span the full width
144
+ this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) {
145
+ var padding = type === "background" ? 0 : this.$padding;
146
+ // from selection start to the end of the line
147
+ var height = config.lineHeight;
148
+ var top = this.$getTop(range.start.row, config);
149
+ var left = Math.round(padding + range.start.column * config.characterWidth);
150
+
151
+ stringBuilder.push(
152
+ "<div class='", clazz, " start' style='",
153
+ "height:", height, "px;",
154
+ "right:0;",
155
+ "top:", top, "px;",
156
+ "left:", left, "px;'></div>"
157
+ );
158
+
159
+ // from start of the last line to the selection end
160
+ top = this.$getTop(range.end.row, config);
161
+ var width = Math.round(range.end.column * config.characterWidth);
162
+
163
+ stringBuilder.push(
164
+ "<div class='", clazz, "' style='",
165
+ "height:", height, "px;",
166
+ "width:", width, "px;",
167
+ "top:", top, "px;",
168
+ "left:", padding, "px;'></div>"
169
+ );
170
+
171
+ // all the complete lines
172
+ height = (range.end.row - range.start.row - 1) * config.lineHeight;
173
+ if (height < 0)
174
+ return;
175
+ top = this.$getTop(range.start.row + 1, config);
176
+
177
+ stringBuilder.push(
178
+ "<div class='", clazz, "' style='",
179
+ "height:", height, "px;",
180
+ "right:0;",
181
+ "top:", top, "px;",
182
+ "left:", padding, "px;'></div>"
183
+ );
184
+ };
185
+
186
+ // Draws a marker which covers part or whole width of a single screen line
187
+ this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) {
188
+ var padding = type === "background" ? 0 : this.$padding;
189
+ var height = layerConfig.lineHeight;
190
+
191
+ if (type === "background")
192
+ var width = layerConfig.width;
193
+ else
194
+ width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth);
195
+
196
+ var top = this.$getTop(range.start.row, layerConfig);
197
+ var left = Math.round(
198
+ padding + range.start.column * layerConfig.characterWidth
199
+ );
200
+
201
+ stringBuilder.push(
202
+ "<div class='", clazz, "' style='",
203
+ "height:", height, "px;",
204
+ "width:", width, "px;",
205
+ "top:", top, "px;",
206
+ "left:", left,"px;'></div>"
207
+ );
208
+ };
209
+
210
+ }).call(Marker.prototype);
211
+
212
+ exports.Marker = Marker;
213
+
214
+ });
@@ -0,0 +1,595 @@
1
+ /* vim:ts=4:sts=4:sw=4:
2
+ * ***** BEGIN LICENSE BLOCK *****
3
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
+ *
5
+ * The contents of this file are subject to the Mozilla Public License Version
6
+ * 1.1 (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ * http://www.mozilla.org/MPL/
9
+ *
10
+ * Software distributed under the License is distributed on an "AS IS" basis,
11
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
+ * for the specific language governing rights and limitations under the
13
+ * License.
14
+ *
15
+ * The Original Code is Ajax.org Code Editor (ACE).
16
+ *
17
+ * The Initial Developer of the Original Code is
18
+ * Ajax.org B.V.
19
+ * Portions created by the Initial Developer are Copyright (C) 2010
20
+ * the Initial Developer. All Rights Reserved.
21
+ *
22
+ * Contributor(s):
23
+ * Fabian Jakobs <fabian AT ajax DOT org>
24
+ * Julian Viereck <julian DOT viereck AT gmail DOT com>
25
+ * Mihai Sucan <mihai.sucan@gmail.com>
26
+ * Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
27
+ *
28
+ * Alternatively, the contents of this file may be used under the terms of
29
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
30
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31
+ * in which case the provisions of the GPL or the LGPL are applicable instead
32
+ * of those above. If you wish to allow use of your version of this file only
33
+ * under the terms of either the GPL or the LGPL, and not to allow others to
34
+ * use your version of this file under the terms of the MPL, indicate your
35
+ * decision by deleting the provisions above and replace them with the notice
36
+ * and other provisions required by the GPL or the LGPL. If you do not delete
37
+ * the provisions above, a recipient may use your version of this file under
38
+ * the terms of any one of the MPL, the GPL or the LGPL.
39
+ *
40
+ * ***** END LICENSE BLOCK ***** */
41
+
42
+ define(function(require, exports, module) {
43
+ "use strict";
44
+
45
+ var oop = require("../lib/oop");
46
+ var dom = require("../lib/dom");
47
+ var lang = require("../lib/lang");
48
+ var useragent = require("../lib/useragent");
49
+ var EventEmitter = require("../lib/event_emitter").EventEmitter;
50
+
51
+ var Text = function(parentEl) {
52
+ this.element = dom.createElement("div");
53
+ this.element.className = "ace_layer ace_text-layer";
54
+ parentEl.appendChild(this.element);
55
+
56
+ this.$characterSize = this.$measureSizes() || {width: 0, height: 0};
57
+ this.$pollSizeChanges();
58
+ };
59
+
60
+ (function() {
61
+
62
+ oop.implement(this, EventEmitter);
63
+
64
+ this.EOF_CHAR = "\xB6"; //"&para;";
65
+ this.EOL_CHAR = "\xAC"; //"&not;";
66
+ this.TAB_CHAR = "\u2192"; //"&rarr;" "\u21E5";
67
+ this.SPACE_CHAR = "\xB7"; //"&middot;";
68
+ this.$padding = 0;
69
+
70
+ this.setPadding = function(padding) {
71
+ this.$padding = padding;
72
+ this.element.style.padding = "0 " + padding + "px";
73
+ };
74
+
75
+ this.getLineHeight = function() {
76
+ return this.$characterSize.height || 1;
77
+ };
78
+
79
+ this.getCharacterWidth = function() {
80
+ return this.$characterSize.width || 1;
81
+ };
82
+
83
+ this.checkForSizeChanges = function() {
84
+ var size = this.$measureSizes();
85
+ if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {
86
+ this.$characterSize = size;
87
+ this._emit("changeCharacterSize", {data: size});
88
+ }
89
+ };
90
+
91
+ this.$pollSizeChanges = function() {
92
+ var self = this;
93
+ this.$pollSizeChangesTimer = setInterval(function() {
94
+ self.checkForSizeChanges();
95
+ }, 500);
96
+ };
97
+
98
+ this.$fontStyles = {
99
+ fontFamily : 1,
100
+ fontSize : 1,
101
+ fontWeight : 1,
102
+ fontStyle : 1,
103
+ lineHeight : 1
104
+ };
105
+
106
+ this.$measureSizes = useragent.isIE || useragent.isOldGecko ? function() {
107
+ var n = 1000;
108
+ if (!this.$measureNode) {
109
+ var measureNode = this.$measureNode = dom.createElement("div");
110
+ var style = measureNode.style;
111
+
112
+ style.width = style.height = "auto";
113
+ style.left = style.top = (-n * 40) + "px";
114
+
115
+ style.visibility = "hidden";
116
+ style.position = "fixed";
117
+ style.overflow = "visible";
118
+ style.whiteSpace = "nowrap";
119
+
120
+ // in FF 3.6 monospace fonts can have a fixed sub pixel width.
121
+ // that's why we have to measure many characters
122
+ // Note: characterWidth can be a float!
123
+ measureNode.innerHTML = lang.stringRepeat("Xy", n);
124
+
125
+ if (this.element.ownerDocument.body) {
126
+ this.element.ownerDocument.body.appendChild(measureNode);
127
+ } else {
128
+ var container = this.element.parentNode;
129
+ while (!dom.hasCssClass(container, "ace_editor"))
130
+ container = container.parentNode;
131
+ container.appendChild(measureNode);
132
+ }
133
+ }
134
+
135
+ // Size and width can be null if the editor is not visible or
136
+ // detached from the document
137
+ if (!this.element.offsetWidth)
138
+ return null;
139
+
140
+ var style = this.$measureNode.style;
141
+ var computedStyle = dom.computedStyle(this.element);
142
+ for (var prop in this.$fontStyles)
143
+ style[prop] = computedStyle[prop];
144
+
145
+ var size = {
146
+ height: this.$measureNode.offsetHeight,
147
+ width: this.$measureNode.offsetWidth / (n * 2)
148
+ };
149
+
150
+ // Size and width can be null if the editor is not visible or
151
+ // detached from the document
152
+ if (size.width == 0 || size.height == 0)
153
+ return null;
154
+
155
+ return size;
156
+ }
157
+ : function() {
158
+ if (!this.$measureNode) {
159
+ var measureNode = this.$measureNode = dom.createElement("div");
160
+ var style = measureNode.style;
161
+
162
+ style.width = style.height = "auto";
163
+ style.left = style.top = -100 + "px";
164
+
165
+ style.visibility = "hidden";
166
+ style.position = "fixed";
167
+ style.overflow = "visible";
168
+ style.whiteSpace = "nowrap";
169
+
170
+ measureNode.innerHTML = "X";
171
+
172
+ var container = this.element.parentNode;
173
+ while (container && !dom.hasCssClass(container, "ace_editor"))
174
+ container = container.parentNode;
175
+
176
+ if (!container)
177
+ return this.$measureNode = null;
178
+
179
+ container.appendChild(measureNode);
180
+ }
181
+
182
+ var rect = this.$measureNode.getBoundingClientRect();
183
+
184
+ var size = {
185
+ height: rect.height,
186
+ width: rect.width
187
+ };
188
+
189
+ // Size and width can be null if the editor is not visible or
190
+ // detached from the document
191
+ if (size.width == 0 || size.height == 0)
192
+ return null;
193
+
194
+ return size;
195
+ };
196
+
197
+ this.setSession = function(session) {
198
+ this.session = session;
199
+ };
200
+
201
+ this.showInvisibles = false;
202
+ this.setShowInvisibles = function(showInvisibles) {
203
+ if (this.showInvisibles == showInvisibles)
204
+ return false;
205
+
206
+ this.showInvisibles = showInvisibles;
207
+ return true;
208
+ };
209
+
210
+ this.$tabStrings = [];
211
+ this.$computeTabString = function() {
212
+ var tabSize = this.session.getTabSize();
213
+ var tabStr = this.$tabStrings = [0];
214
+ for (var i = 1; i < tabSize + 1; i++) {
215
+ if (this.showInvisibles) {
216
+ tabStr.push("<span class='ace_invisible'>"
217
+ + this.TAB_CHAR
218
+ + new Array(i).join("&#160;")
219
+ + "</span>");
220
+ } else {
221
+ tabStr.push(new Array(i+1).join("&#160;"));
222
+ }
223
+ }
224
+
225
+ };
226
+
227
+ this.updateLines = function(config, firstRow, lastRow) {
228
+ this.$computeTabString();
229
+ // Due to wrap line changes there can be new lines if e.g.
230
+ // the line to updated wrapped in the meantime.
231
+ if (this.config.lastRow != config.lastRow ||
232
+ this.config.firstRow != config.firstRow) {
233
+ this.scrollLines(config);
234
+ }
235
+ this.config = config;
236
+
237
+ var first = Math.max(firstRow, config.firstRow);
238
+ var last = Math.min(lastRow, config.lastRow);
239
+
240
+ var lineElements = this.element.childNodes;
241
+ var lineElementsIdx = 0;
242
+
243
+ for (var row = config.firstRow; row < first; row++) {
244
+ var foldLine = this.session.getFoldLine(row);
245
+ if (foldLine) {
246
+ if (foldLine.containsRow(first)) {
247
+ first = foldLine.start.row;
248
+ break;
249
+ } else {
250
+ row = foldLine.end.row;
251
+ }
252
+ }
253
+ lineElementsIdx ++;
254
+ }
255
+
256
+ for (var i=first; i<=last; i++) {
257
+ var lineElement = lineElements[lineElementsIdx++];
258
+ if (!lineElement)
259
+ continue;
260
+
261
+ var html = [];
262
+ var tokens = this.session.getTokens(i);
263
+ this.$renderLine(html, i, tokens, !this.$useLineGroups());
264
+ lineElement = dom.setInnerHtml(lineElement, html.join(""));
265
+
266
+ i = this.session.getRowFoldEnd(i);
267
+ }
268
+ };
269
+
270
+ this.scrollLines = function(config) {
271
+ this.$computeTabString();
272
+ var oldConfig = this.config;
273
+ this.config = config;
274
+
275
+ if (!oldConfig || oldConfig.lastRow < config.firstRow)
276
+ return this.update(config);
277
+
278
+ if (config.lastRow < oldConfig.firstRow)
279
+ return this.update(config);
280
+
281
+ var el = this.element;
282
+ if (oldConfig.firstRow < config.firstRow)
283
+ for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--)
284
+ el.removeChild(el.firstChild);
285
+
286
+ if (oldConfig.lastRow > config.lastRow)
287
+ for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--)
288
+ el.removeChild(el.lastChild);
289
+
290
+ if (config.firstRow < oldConfig.firstRow) {
291
+ var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1);
292
+ if (el.firstChild)
293
+ el.insertBefore(fragment, el.firstChild);
294
+ else
295
+ el.appendChild(fragment);
296
+ }
297
+
298
+ if (config.lastRow > oldConfig.lastRow) {
299
+ var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow);
300
+ el.appendChild(fragment);
301
+ }
302
+ };
303
+
304
+ this.$renderLinesFragment = function(config, firstRow, lastRow) {
305
+ var fragment = this.element.ownerDocument.createDocumentFragment();
306
+ var row = firstRow;
307
+ var foldLine = this.session.getNextFoldLine(row);
308
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
309
+
310
+ while (true) {
311
+ if (row > foldStart) {
312
+ row = foldLine.end.row+1;
313
+ foldLine = this.session.getNextFoldLine(row, foldLine);
314
+ foldStart = foldLine ? foldLine.start.row : Infinity;
315
+ }
316
+ if (row > lastRow)
317
+ break;
318
+
319
+ var container = dom.createElement("div");
320
+
321
+ var html = [];
322
+ // Get the tokens per line as there might be some lines in between
323
+ // beeing folded.
324
+ var tokens = this.session.getTokens(row);
325
+ this.$renderLine(html, row, tokens, false);
326
+
327
+ // don't use setInnerHtml since we are working with an empty DIV
328
+ container.innerHTML = html.join("");
329
+ if (this.$useLineGroups()) {
330
+ container.className = 'ace_line_group';
331
+ fragment.appendChild(container);
332
+ } else {
333
+ var lines = container.childNodes
334
+ while(lines.length)
335
+ fragment.appendChild(lines[0]);
336
+ }
337
+
338
+ row++;
339
+ }
340
+ return fragment;
341
+ };
342
+
343
+ this.update = function(config) {
344
+ this.$computeTabString();
345
+ this.config = config;
346
+
347
+ var html = [];
348
+ var firstRow = config.firstRow, lastRow = config.lastRow;
349
+
350
+ var row = firstRow;
351
+ var foldLine = this.session.getNextFoldLine(row);
352
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
353
+
354
+ while (true) {
355
+ if (row > foldStart) {
356
+ row = foldLine.end.row+1;
357
+ foldLine = this.session.getNextFoldLine(row, foldLine);
358
+ foldStart = foldLine ? foldLine.start.row :Infinity;
359
+ }
360
+ if (row > lastRow)
361
+ break;
362
+
363
+ if (this.$useLineGroups())
364
+ html.push("<div class='ace_line_group'>")
365
+
366
+ // Get the tokens per line as there might be some lines in between
367
+ // beeing folded.
368
+ var tokens = this.session.getTokens(row);
369
+ this.$renderLine(html, row, tokens, false);
370
+
371
+ if (this.$useLineGroups())
372
+ html.push("</div>"); // end the line group
373
+
374
+ row++;
375
+ }
376
+ this.element = dom.setInnerHtml(this.element, html.join(""));
377
+ };
378
+
379
+ this.$textToken = {
380
+ "text": true,
381
+ "rparen": true,
382
+ "lparen": true
383
+ };
384
+
385
+ this.$renderToken = function(stringBuilder, screenColumn, token, value) {
386
+ var self = this;
387
+ var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u1680\u180E\u2000-\u200b\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g;
388
+ var replaceFunc = function(c, a, b, tabIdx, idx4) {
389
+ if (a) {
390
+ return new Array(c.length+1).join("&#160;");
391
+ } else if (c == "&") {
392
+ return "&#38;";
393
+ } else if (c == "<") {
394
+ return "&#60;";
395
+ } else if (c == "\t") {
396
+ var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx);
397
+ screenColumn += tabSize - 1;
398
+ return self.$tabStrings[tabSize];
399
+ } else if (c == "\u3000") {
400
+ // U+3000 is both invisible AND full-width, so must be handled uniquely
401
+ var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk";
402
+ var space = self.showInvisibles ? self.SPACE_CHAR : "";
403
+ screenColumn += 1;
404
+ return "<span class='" + classToUse + "' style='width:" +
405
+ (self.config.characterWidth * 2) +
406
+ "px'>" + space + "</span>";
407
+ } else if (b) {
408
+ return "<span class='ace_invisible ace_invalid'>" + self.SPACE_CHAR + "</span>";
409
+ } else {
410
+ screenColumn += 1;
411
+ return "<span class='ace_cjk' style='width:" +
412
+ (self.config.characterWidth * 2) +
413
+ "px'>" + c + "</span>";
414
+ }
415
+ };
416
+
417
+ var output = value.replace(replaceReg, replaceFunc);
418
+
419
+ if (!this.$textToken[token.type]) {
420
+ var classes = "ace_" + token.type.replace(/\./g, " ace_");
421
+ var style = "";
422
+ if (token.type == "fold")
423
+ style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' ";
424
+ stringBuilder.push("<span class='", classes, "'", style, ">", output, "</span>");
425
+ }
426
+ else {
427
+ stringBuilder.push(output);
428
+ }
429
+ return screenColumn + value.length;
430
+ };
431
+
432
+ this.$renderLineCore = function(stringBuilder, lastRow, tokens, splits, onlyContents) {
433
+ var chars = 0;
434
+ var split = 0;
435
+ var splitChars;
436
+ var screenColumn = 0;
437
+ var self = this;
438
+
439
+ if (!splits || splits.length == 0)
440
+ splitChars = Number.MAX_VALUE;
441
+ else
442
+ splitChars = splits[0];
443
+
444
+ if (!onlyContents) {
445
+ stringBuilder.push("<div class='ace_line' style='height:",
446
+ this.config.lineHeight, "px",
447
+ "'>"
448
+ );
449
+ }
450
+
451
+ for (var i = 0; i < tokens.length; i++) {
452
+ var token = tokens[i];
453
+ var value = token.value;
454
+
455
+ if (chars + value.length < splitChars) {
456
+ screenColumn = self.$renderToken(
457
+ stringBuilder, screenColumn, token, value
458
+ );
459
+ chars += value.length;
460
+ }
461
+ else {
462
+ while (chars + value.length >= splitChars) {
463
+ screenColumn = self.$renderToken(
464
+ stringBuilder, screenColumn,
465
+ token, value.substring(0, splitChars - chars)
466
+ );
467
+ value = value.substring(splitChars - chars);
468
+ chars = splitChars;
469
+
470
+ if (!onlyContents) {
471
+ stringBuilder.push("</div>",
472
+ "<div class='ace_line' style='height:",
473
+ this.config.lineHeight, "px",
474
+ "'>"
475
+ );
476
+ }
477
+
478
+ split ++;
479
+ screenColumn = 0;
480
+ splitChars = splits[split] || Number.MAX_VALUE;
481
+ }
482
+ if (value.length != 0) {
483
+ chars += value.length;
484
+ screenColumn = self.$renderToken(
485
+ stringBuilder, screenColumn, token, value
486
+ );
487
+ }
488
+ }
489
+ }
490
+
491
+ if (this.showInvisibles) {
492
+ if (lastRow !== this.session.getLength() - 1)
493
+ stringBuilder.push("<span class='ace_invisible'>" + this.EOL_CHAR + "</span>");
494
+ else
495
+ stringBuilder.push("<span class='ace_invisible'>" + this.EOF_CHAR + "</span>");
496
+ }
497
+ if (!onlyContents)
498
+ stringBuilder.push("</div>");
499
+ };
500
+
501
+ this.$renderLine = function(stringBuilder, row, tokens, onlyContents) {
502
+ // Check if the line to render is folded or not. If not, things are
503
+ // simple, otherwise, we need to fake some things...
504
+ if (!this.session.isRowFolded(row)) {
505
+ var splits = this.session.getRowSplitData(row);
506
+ this.$renderLineCore(stringBuilder, row, tokens, splits, onlyContents);
507
+ } else {
508
+ this.$renderFoldLine(stringBuilder, row, tokens, onlyContents);
509
+ }
510
+ };
511
+
512
+ this.$renderFoldLine = function(stringBuilder, row, tokens, onlyContents) {
513
+ var session = this.session;
514
+ var foldLine = session.getFoldLine(row);
515
+ var renderTokens = [];
516
+
517
+ function addTokens(tokens, from, to) {
518
+ var idx = 0, col = 0;
519
+ while ((col + tokens[idx].value.length) < from) {
520
+ col += tokens[idx].value.length;
521
+ idx++;
522
+
523
+ if (idx == tokens.length)
524
+ return;
525
+ }
526
+ if (col != from) {
527
+ var value = tokens[idx].value.substring(from - col);
528
+ // Check if the token value is longer then the from...to spacing.
529
+ if (value.length > (to - from))
530
+ value = value.substring(0, to - from);
531
+
532
+ renderTokens.push({
533
+ type: tokens[idx].type,
534
+ value: value
535
+ });
536
+
537
+ col = from + value.length;
538
+ idx += 1;
539
+ }
540
+
541
+ while (col < to && idx < tokens.length) {
542
+ var value = tokens[idx].value;
543
+ if (value.length + col > to) {
544
+ renderTokens.push({
545
+ type: tokens[idx].type,
546
+ value: value.substring(0, to - col)
547
+ });
548
+ } else
549
+ renderTokens.push(tokens[idx]);
550
+ col += value.length;
551
+ idx += 1;
552
+ }
553
+ }
554
+
555
+ foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) {
556
+ if (placeholder) {
557
+ renderTokens.push({
558
+ type: "fold",
559
+ value: placeholder
560
+ });
561
+ } else {
562
+ if (isNewRow)
563
+ tokens = session.getTokens(row);
564
+
565
+ if (tokens.length)
566
+ addTokens(tokens, lastColumn, column);
567
+ }
568
+ }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);
569
+
570
+ // splits for foldline are stored at its' first row
571
+ var splits = this.session.$useWrapMode ? this.session.$wrapData[row] : null;
572
+ this.$renderLineCore(stringBuilder, row, renderTokens, splits, onlyContents);
573
+ };
574
+
575
+ this.$useLineGroups = function() {
576
+ // For the updateLines function to work correctly, it's important that the
577
+ // child nodes of this.element correspond on a 1-to-1 basis to rows in the
578
+ // document (as distinct from lines on the screen). For sessions that are
579
+ // wrapped, this means we need to add a layer to the node hierarchy (tagged
580
+ // with the class name ace_line_group).
581
+ return this.session.getUseWrapMode();
582
+ };
583
+
584
+ this.destroy = function() {
585
+ clearInterval(this.$pollSizeChangesTimer);
586
+ if (this.$measureNode)
587
+ this.$measureNode.parentNode.removeChild(this.$measureNode);
588
+ delete this.$measureNode;
589
+ };
590
+
591
+ }).call(Text.prototype);
592
+
593
+ exports.Text = Text;
594
+
595
+ });