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.
- data/README.md +44 -7
- data/Rakefile +1 -1
- data/bin/gollum +20 -1
- data/gollum.gemspec +400 -5
- data/lib/gollum.rb +2 -1
- data/lib/gollum/blob_entry.rb +13 -1
- data/lib/gollum/committer.rb +10 -1
- data/lib/gollum/file.rb +15 -2
- data/lib/gollum/file_view.rb +145 -0
- data/lib/gollum/frontend/app.rb +217 -69
- data/lib/gollum/frontend/helpers.rb +21 -0
- data/lib/gollum/frontend/public/gollum/css/_styles.css +121 -0
- data/lib/gollum/frontend/public/gollum/css/editor.css +17 -8
- data/lib/gollum/frontend/public/gollum/css/gollum.css +440 -402
- data/lib/gollum/frontend/public/gollum/css/template.css +540 -289
- data/lib/gollum/frontend/public/gollum/images/dirty-shade.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/document.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/para.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-16.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-20.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-24.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-32.png +0 -0
- data/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js +31 -7
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js +18 -6
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js +3 -0
- data/lib/gollum/frontend/public/gollum/javascript/gollum.js +78 -16
- data/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
- data/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js +8 -0
- data/lib/gollum/frontend/public/gollum/livepreview/css/custom.css +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/index.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +254 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +184 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +261 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +460 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +124 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +327 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +617 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +314 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2419 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +252 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +276 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +759 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +981 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +2163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +231 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +562 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +536 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +367 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +143 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +257 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +315 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +556 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +611 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +134 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +49 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +187 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +214 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +595 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +106 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +292 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1059 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +317 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +180 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +235 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +739 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +2756 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +603 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +342 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +154 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +227 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +135 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +110 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9014 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +242 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +75 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +127 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +95 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +76 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +115 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +169 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +262 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +183 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +471 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +111 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +53 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +57 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +38 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +279 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +220 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +91 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +436 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +355 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +583 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +147 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +194 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +179 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +304 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +89 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +82 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +120 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +6 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +1686 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +2993 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +69 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +10363 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +42525 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +6177 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +55 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +64 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +354 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +762 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +696 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +598 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +2072 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +278 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +581 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +230 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +198 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +398 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +451 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +886 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +472 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +411 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +136 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +204 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +118 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +151 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +149 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +45 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +102 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +48 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +133 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +137 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +146 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +150 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +131 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +130 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +47 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +160 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +141 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +219 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1402 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +4469 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +6396 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +43 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +176 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +456 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js +35 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js +1 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +476 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
- data/lib/gollum/frontend/public/gollum/livepreview/readme.md +44 -0
- data/lib/gollum/frontend/templates/compare.mustache +9 -9
- data/lib/gollum/frontend/templates/create.mustache +4 -1
- data/lib/gollum/frontend/templates/edit.mustache +6 -3
- data/lib/gollum/frontend/templates/editor.mustache +30 -14
- data/lib/gollum/frontend/templates/file_view.mustache +32 -0
- data/lib/gollum/frontend/templates/history.mustache +8 -8
- data/lib/gollum/frontend/templates/layout.mustache +21 -14
- data/lib/gollum/frontend/templates/page.mustache +37 -14
- data/lib/gollum/frontend/templates/pages.mustache +14 -10
- data/lib/gollum/frontend/templates/search.mustache +2 -2
- data/lib/gollum/frontend/templates/searchbar.mustache +1 -1
- data/lib/gollum/frontend/uri_encode_component.rb +172 -0
- data/lib/gollum/frontend/views/compare.rb +2 -4
- data/lib/gollum/frontend/views/create.rb +5 -0
- data/lib/gollum/frontend/views/edit.rb +12 -0
- data/lib/gollum/frontend/views/file_view.rb +19 -0
- data/lib/gollum/frontend/views/has_page.rb +15 -0
- data/lib/gollum/frontend/views/history.rb +8 -4
- data/lib/gollum/frontend/views/layout.rb +9 -1
- data/lib/gollum/frontend/views/page.rb +37 -10
- data/lib/gollum/frontend/views/pages.rb +48 -0
- data/lib/gollum/git_access.rb +2 -2
- data/lib/gollum/markup.rb +115 -19
- data/lib/gollum/page.rb +79 -9
- data/lib/gollum/tex.rb +319 -42
- data/lib/gollum/wiki.rb +92 -12
- data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
- data/licenses/licenses.txt +23 -0
- data/licenses/unity_asset_pool/COPYRIGHT +286 -0
- data/test/examples/lotr.git/config +1 -1
- data/test/examples/lotr.git/logs/HEAD +4 -0
- data/test/examples/lotr.git/logs/refs/heads/master +4 -0
- data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
- data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
- data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
- data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
- data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
- data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
- data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +2 -0
- data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
- data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +1 -0
- data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
- data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
- data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
- data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
- data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
- data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
- data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
- data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
- data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
- data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +2 -0
- data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
- data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +1 -0
- data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
- data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
- data/test/examples/lotr.git/refs/heads/master +1 -1
- data/test/examples/revert.git/COMMIT_EDITMSG +1 -1
- data/test/examples/revert.git/index +0 -0
- data/test/examples/revert.git/logs/HEAD +1 -0
- data/test/examples/revert.git/logs/refs/heads/master +1 -0
- data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
- data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
- data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +3 -0
- data/test/examples/revert.git/refs/heads/master +1 -1
- data/test/file_view/1_file.txt +3 -0
- data/test/file_view/1_file_1_folder.txt +8 -0
- data/test/file_view/1_folder.txt +8 -0
- data/test/file_view/2_files_2_folders.txt +12 -0
- data/test/file_view/2_files_2_folders_1_root.txt +13 -0
- data/test/file_view/nested_folders.txt +28 -0
- data/test/test_app.rb +162 -12
- data/test/test_app_helpers.rb +13 -0
- data/test/test_committer.rb +1 -1
- data/test/test_file_view.rb +102 -0
- data/test/test_git_access.rb +3 -2
- data/test/test_markup.rb +45 -12
- data/test/test_page.rb +65 -1
- data/test/test_page_revert.rb +14 -2
- data/test/test_pages_view.rb +37 -0
- data/test/test_unicode.rb +110 -0
- data/test/test_wiki.rb +51 -4
- metadata +658 -239
- data/lib/gollum/frontend/public/gollum/javascript/jquery.js +0 -7179
@@ -0,0 +1,22 @@
|
|
1
|
+
.ace_editor {
|
2
|
+
font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;
|
3
|
+
font-size: 12px;
|
4
|
+
}
|
5
|
+
|
6
|
+
.ace_editor .ace_gutter {
|
7
|
+
width: 25px !important;
|
8
|
+
display: block;
|
9
|
+
float: left;
|
10
|
+
text-align: right;
|
11
|
+
padding: 0 3px 0 0;
|
12
|
+
margin-right: 3px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.ace_line { clear: both; }
|
16
|
+
|
17
|
+
*.ace_gutter-cell {
|
18
|
+
-moz-user-select: -moz-none;
|
19
|
+
-khtml-user-select: none;
|
20
|
+
-webkit-user-select: none;
|
21
|
+
user-select: none;
|
22
|
+
}
|
@@ -0,0 +1,98 @@
|
|
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
|
+
* Jan Jongboom <fabian AT ajax DOT org>
|
24
|
+
* Fabian Jakobs <fabian AT ajax DOT org>
|
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 EditSession = require("../edit_session").EditSession;
|
44
|
+
var TextLayer = require("../layer/text").Text;
|
45
|
+
var baseStyles = require("../requirejs/text!./static.css");
|
46
|
+
|
47
|
+
/* Transforms a given input code snippet into HTML using the given mode
|
48
|
+
*
|
49
|
+
* @param {string} input Code snippet
|
50
|
+
* @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode')
|
51
|
+
* @param {string} r Code snippet
|
52
|
+
* @returns {object} An object containing: html, css
|
53
|
+
*/
|
54
|
+
|
55
|
+
exports.render = function(input, mode, theme, lineStart, disableGutter) {
|
56
|
+
lineStart = parseInt(lineStart || 1, 10);
|
57
|
+
|
58
|
+
var session = new EditSession("");
|
59
|
+
session.setMode(mode);
|
60
|
+
session.setUseWorker(false);
|
61
|
+
|
62
|
+
var textLayer = new TextLayer(document.createElement("div"));
|
63
|
+
textLayer.setSession(session);
|
64
|
+
textLayer.config = {
|
65
|
+
characterWidth: 10,
|
66
|
+
lineHeight: 20
|
67
|
+
};
|
68
|
+
|
69
|
+
session.setValue(input);
|
70
|
+
|
71
|
+
var stringBuilder = [];
|
72
|
+
var length = session.getLength();
|
73
|
+
|
74
|
+
for(var ix = 0; ix < length; ix++) {
|
75
|
+
var lineTokens = session.getTokens(ix);
|
76
|
+
stringBuilder.push("<div class='ace_line'>");
|
77
|
+
if (!disableGutter)
|
78
|
+
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix + lineStart) + "</span>");
|
79
|
+
textLayer.$renderLine(stringBuilder, 0, lineTokens, true);
|
80
|
+
stringBuilder.push("</div>");
|
81
|
+
}
|
82
|
+
|
83
|
+
// let's prepare the whole html
|
84
|
+
var html = "<div class=':cssClass'>\
|
85
|
+
<div class='ace_editor ace_scroller ace_text-layer'>\
|
86
|
+
:code\
|
87
|
+
</div>\
|
88
|
+
</div>".replace(/:cssClass/, theme.cssClass).replace(/:code/, stringBuilder.join(""));
|
89
|
+
|
90
|
+
textLayer.destroy();
|
91
|
+
|
92
|
+
return {
|
93
|
+
css: baseStyles + theme.cssText,
|
94
|
+
html: html
|
95
|
+
};
|
96
|
+
};
|
97
|
+
|
98
|
+
});
|
data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
if (typeof process !== "undefined") {
|
2
|
+
require("amd-loader");
|
3
|
+
require("../test/mockdom");
|
4
|
+
}
|
5
|
+
|
6
|
+
define(function(require, exports, module) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
var assert = require("assert");
|
10
|
+
var highlighter = require("./static_highlight");
|
11
|
+
var JavaScriptMode = require("../mode/javascript").Mode;
|
12
|
+
|
13
|
+
// Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite
|
14
|
+
module.exports = {
|
15
|
+
timeout: 10000,
|
16
|
+
|
17
|
+
"test simple snippet": function(next) {
|
18
|
+
var theme = require("../theme/tomorrow");
|
19
|
+
var snippet = "/** this is a function\n\
|
20
|
+
*\n\
|
21
|
+
*/\n\
|
22
|
+
function hello (a, b, c) {\n\
|
23
|
+
console.log(a * b + c + 'sup?');\n\
|
24
|
+
}";
|
25
|
+
var mode = new JavaScriptMode();
|
26
|
+
|
27
|
+
var isError = false, result;
|
28
|
+
try {
|
29
|
+
result = highlighter.render(snippet, mode, theme);
|
30
|
+
}
|
31
|
+
catch (e) {
|
32
|
+
console.log(e);
|
33
|
+
isError = true;
|
34
|
+
}
|
35
|
+
// todo: write something more meaningful
|
36
|
+
assert.equal(isError, false);
|
37
|
+
|
38
|
+
next();
|
39
|
+
},
|
40
|
+
|
41
|
+
"test css from theme is used": function(next) {
|
42
|
+
var theme = require("../theme/tomorrow");
|
43
|
+
var snippet = "/** this is a function\n\
|
44
|
+
*\n\
|
45
|
+
*/\n\
|
46
|
+
function hello (a, b, c) {\n\
|
47
|
+
console.log(a * b + c + 'sup?');\n\
|
48
|
+
}";
|
49
|
+
var mode = new JavaScriptMode();
|
50
|
+
|
51
|
+
var isError = false, result;
|
52
|
+
result = highlighter.render(snippet, mode, theme);
|
53
|
+
|
54
|
+
assert.ok(result.css.indexOf(theme.cssText) !== -1);
|
55
|
+
|
56
|
+
next();
|
57
|
+
},
|
58
|
+
|
59
|
+
"test theme classname should be in output html": function (next) {
|
60
|
+
var theme = require("../theme/tomorrow");
|
61
|
+
var snippet = "/** this is a function\n\
|
62
|
+
*\n\
|
63
|
+
*/\n\
|
64
|
+
function hello (a, b, c) {\n\
|
65
|
+
console.log(a * b + c + 'sup?');\n\
|
66
|
+
}";
|
67
|
+
var mode = new JavaScriptMode();
|
68
|
+
|
69
|
+
var isError = false, result;
|
70
|
+
result = highlighter.render(snippet, mode, theme);
|
71
|
+
assert.equal(!!result.html.match(/<div class='ace-tomorrow'>/), true);
|
72
|
+
|
73
|
+
next();
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
});
|
78
|
+
|
79
|
+
if (typeof module !== "undefined" && module === require.main) {
|
80
|
+
require("asyncjs").test.testcase(module.exports).exec();
|
81
|
+
}
|
@@ -0,0 +1,536 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
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 Mozilla Skywriter.
|
15
|
+
*
|
16
|
+
* The Initial Developer of the Original Code is
|
17
|
+
* Mozilla.
|
18
|
+
* Portions created by the Initial Developer are Copyright (C) 2009
|
19
|
+
* the Initial Developer. All Rights Reserved.
|
20
|
+
*
|
21
|
+
* Contributor(s):
|
22
|
+
* Kevin Dangoor (kdangoor@mozilla.com)
|
23
|
+
* Julian Viereck <julian.viereck@gmail.com>
|
24
|
+
* Harutyun Amirjanyan [harutyun@c9.io]
|
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 event = require("../lib/event");
|
44
|
+
var UA = require("../lib/useragent");
|
45
|
+
var net = require("../lib/net");
|
46
|
+
var ace = require("../ace");
|
47
|
+
|
48
|
+
require("ace/theme/textmate");
|
49
|
+
|
50
|
+
module.exports = exports = ace;
|
51
|
+
|
52
|
+
/*
|
53
|
+
* Returns the CSS property of element.
|
54
|
+
* 1) If the CSS property is on the style object of the element, use it, OR
|
55
|
+
* 2) Compute the CSS property
|
56
|
+
*
|
57
|
+
* If the property can't get computed, is 'auto' or 'intrinsic', the former
|
58
|
+
* calculated property is used (this can happen in cases where the textarea
|
59
|
+
* is hidden and has no dimension styles).
|
60
|
+
*/
|
61
|
+
var getCSSProperty = function(element, container, property) {
|
62
|
+
var ret = element.style[property];
|
63
|
+
|
64
|
+
if (!ret) {
|
65
|
+
if (window.getComputedStyle) {
|
66
|
+
ret = window.getComputedStyle(element, '').getPropertyValue(property);
|
67
|
+
} else {
|
68
|
+
ret = element.currentStyle[property];
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
if (!ret || ret == 'auto' || ret == 'intrinsic') {
|
73
|
+
ret = container.style[property];
|
74
|
+
}
|
75
|
+
return ret;
|
76
|
+
};
|
77
|
+
|
78
|
+
function applyStyles(elm, styles) {
|
79
|
+
for (var style in styles) {
|
80
|
+
elm.style[style] = styles[style];
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
function setupContainer(element, getValue) {
|
85
|
+
if (element.type != 'textarea') {
|
86
|
+
throw "Textarea required!";
|
87
|
+
}
|
88
|
+
|
89
|
+
var parentNode = element.parentNode;
|
90
|
+
|
91
|
+
// This will hold the editor.
|
92
|
+
var container = document.createElement('div');
|
93
|
+
|
94
|
+
// To put Ace in the place of the textarea, we have to copy a few of the
|
95
|
+
// textarea's style attributes to the div container.
|
96
|
+
//
|
97
|
+
// The problem is that the properties have to get computed (they might be
|
98
|
+
// defined by a CSS file on the page - you can't access such rules that
|
99
|
+
// apply to an element via elm.style). Computed properties are converted to
|
100
|
+
// pixels although the dimension might be given as percentage. When the
|
101
|
+
// window resizes, the dimensions defined by percentages changes, so the
|
102
|
+
// properties have to get recomputed to get the new/true pixels.
|
103
|
+
var resizeEvent = function() {
|
104
|
+
var style = 'position:relative;';
|
105
|
+
[
|
106
|
+
'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
|
107
|
+
].forEach(function(item) {
|
108
|
+
style += item + ':' +
|
109
|
+
getCSSProperty(element, container, item) + ';';
|
110
|
+
});
|
111
|
+
|
112
|
+
// Calculating the width/height of the textarea is somewhat tricky. To
|
113
|
+
// do it right, you have to include the paddings to the sides as well
|
114
|
+
// (eg. width = width + padding-left, -right). This works well, as
|
115
|
+
// long as the width of the element is not set or given in pixels. In
|
116
|
+
// this case and after the textarea is hidden, getCSSProperty(element,
|
117
|
+
// container, 'width') will still return pixel value. If the element
|
118
|
+
// has realtiv dimensions (e.g. width='95<percent>')
|
119
|
+
// getCSSProperty(...) will return pixel values only as long as the
|
120
|
+
// textarea is visible. After it is hidden getCSSProperty will return
|
121
|
+
// the relative dimensions as they are set on the element (in the case
|
122
|
+
// of width, 95<percent>).
|
123
|
+
// Making the sum of pixel vaules (e.g. padding) and realtive values
|
124
|
+
// (e.g. <percent>) is not possible. As such the padding styles are
|
125
|
+
// ignored.
|
126
|
+
|
127
|
+
// The complete width is the width of the textarea + the padding
|
128
|
+
// to the left and right.
|
129
|
+
var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
|
130
|
+
var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
|
131
|
+
style += 'height:' + height + ';width:' + width + ';';
|
132
|
+
|
133
|
+
// Set the display property to 'inline-block'.
|
134
|
+
style += 'display:inline-block;';
|
135
|
+
container.setAttribute('style', style);
|
136
|
+
};
|
137
|
+
event.addListener(window, 'resize', resizeEvent);
|
138
|
+
|
139
|
+
// Call the resizeEvent once, so that the size of the container is
|
140
|
+
// calculated.
|
141
|
+
resizeEvent();
|
142
|
+
|
143
|
+
// Insert the div container after the element.
|
144
|
+
if (element.nextSibling) {
|
145
|
+
parentNode.insertBefore(container, element.nextSibling);
|
146
|
+
} else {
|
147
|
+
parentNode.appendChild(container);
|
148
|
+
}
|
149
|
+
|
150
|
+
// Override the forms onsubmit function. Set the innerHTML and value
|
151
|
+
// of the textarea before submitting.
|
152
|
+
while (parentNode !== document) {
|
153
|
+
if (parentNode.tagName.toUpperCase() === 'FORM') {
|
154
|
+
var oldSumit = parentNode.onsubmit;
|
155
|
+
// Override the onsubmit function of the form.
|
156
|
+
parentNode.onsubmit = function(evt) {
|
157
|
+
element.innerHTML = getValue();
|
158
|
+
element.value = getValue();
|
159
|
+
// If there is a onsubmit function already, then call
|
160
|
+
// it with the current context and pass the event.
|
161
|
+
if (oldSumit) {
|
162
|
+
oldSumit.call(this, evt);
|
163
|
+
}
|
164
|
+
};
|
165
|
+
break;
|
166
|
+
}
|
167
|
+
parentNode = parentNode.parentNode;
|
168
|
+
}
|
169
|
+
return container;
|
170
|
+
}
|
171
|
+
|
172
|
+
exports.transformTextarea = function(element, loader) {
|
173
|
+
var session;
|
174
|
+
var container = setupContainer(element, function() {
|
175
|
+
return session.getValue();
|
176
|
+
});
|
177
|
+
|
178
|
+
// Hide the element.
|
179
|
+
element.style.display = 'none';
|
180
|
+
container.style.background = 'white';
|
181
|
+
|
182
|
+
//
|
183
|
+
var editorDiv = document.createElement("div");
|
184
|
+
applyStyles(editorDiv, {
|
185
|
+
top: "0px",
|
186
|
+
left: "0px",
|
187
|
+
right: "0px",
|
188
|
+
bottom: "0px",
|
189
|
+
border: "1px solid gray"
|
190
|
+
});
|
191
|
+
container.appendChild(editorDiv);
|
192
|
+
|
193
|
+
var settingOpener = document.createElement("div");
|
194
|
+
applyStyles(settingOpener, {
|
195
|
+
position: "absolute",
|
196
|
+
width: "15px",
|
197
|
+
right: "0px",
|
198
|
+
bottom: "0px",
|
199
|
+
background: "red",
|
200
|
+
cursor: "nw-resize",
|
201
|
+
borderStyle: "solid",
|
202
|
+
borderWidth: "9px 8px 10px 9px",
|
203
|
+
width: "2px",
|
204
|
+
borderColor: "lightblue gray gray lightblue",
|
205
|
+
zIndex: 101
|
206
|
+
});
|
207
|
+
|
208
|
+
var settingDiv = document.createElement("div");
|
209
|
+
var settingDivStyles = {
|
210
|
+
top: "0px",
|
211
|
+
left: "0px",
|
212
|
+
right: "0px",
|
213
|
+
bottom: "0px",
|
214
|
+
position: "absolute",
|
215
|
+
padding: "5px",
|
216
|
+
zIndex: 100,
|
217
|
+
color: "white",
|
218
|
+
display: "none",
|
219
|
+
overflow: "auto",
|
220
|
+
fontSize: "14px"
|
221
|
+
};
|
222
|
+
if (!UA.isOldIE) {
|
223
|
+
settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
224
|
+
} else {
|
225
|
+
settingDivStyles.backgroundColor = "#333";
|
226
|
+
}
|
227
|
+
|
228
|
+
applyStyles(settingDiv, settingDivStyles);
|
229
|
+
container.appendChild(settingDiv);
|
230
|
+
|
231
|
+
// Power up ace on the textarea:
|
232
|
+
var options = {};
|
233
|
+
|
234
|
+
var editor = ace.edit(editorDiv);
|
235
|
+
session = editor.getSession();
|
236
|
+
|
237
|
+
session.setValue(element.value || element.innerHTML);
|
238
|
+
editor.focus();
|
239
|
+
|
240
|
+
// Add the settingPanel opener to the editor's div.
|
241
|
+
editorDiv.appendChild(settingOpener);
|
242
|
+
|
243
|
+
// Create the API.
|
244
|
+
setupApi(editor, editorDiv, settingDiv, ace, options, loader);
|
245
|
+
|
246
|
+
// Create the setting's panel.
|
247
|
+
setupSettingPanel(settingDiv, settingOpener, editor, options);
|
248
|
+
|
249
|
+
var state = "";
|
250
|
+
event.addListener(settingOpener, "mousemove", function(e) {
|
251
|
+
var rect = this.getBoundingClientRect();
|
252
|
+
var x = e.clientX - rect.left, y = e.clientY - rect.top;
|
253
|
+
if (x + y < (rect.width + rect.height)/2) {
|
254
|
+
this.style.cursor = "pointer";
|
255
|
+
state = "toggle";
|
256
|
+
} else {
|
257
|
+
state = "resize";
|
258
|
+
this.style.cursor = "nw-resize";
|
259
|
+
}
|
260
|
+
});
|
261
|
+
|
262
|
+
event.addListener(settingOpener, "mousedown", function(e) {
|
263
|
+
if (state == "toggle") {
|
264
|
+
editor.setDisplaySettings();
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
container.style.zIndex = 100000;
|
268
|
+
var rect = container.getBoundingClientRect();
|
269
|
+
var startX = rect.width + rect.left - e.clientX;
|
270
|
+
var startY = rect.height + rect.top - e.clientY;
|
271
|
+
event.capture(settingOpener, function(e) {
|
272
|
+
container.style.width = e.clientX - rect.left + startX + "px";
|
273
|
+
container.style.height = e.clientY - rect.top + startY + "px";
|
274
|
+
editor.resize();
|
275
|
+
}, function() {});
|
276
|
+
});
|
277
|
+
|
278
|
+
return editor;
|
279
|
+
};
|
280
|
+
|
281
|
+
function load(url, module, callback) {
|
282
|
+
net.loadScript(url, function() {
|
283
|
+
require([module], callback);
|
284
|
+
});
|
285
|
+
}
|
286
|
+
|
287
|
+
function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
|
288
|
+
var session = editor.getSession();
|
289
|
+
var renderer = editor.renderer;
|
290
|
+
loader = loader || load;
|
291
|
+
|
292
|
+
function toBool(value) {
|
293
|
+
return value == "true";
|
294
|
+
}
|
295
|
+
|
296
|
+
editor.setDisplaySettings = function(display) {
|
297
|
+
if (display == null)
|
298
|
+
display = settingDiv.style.display == "none";
|
299
|
+
settingDiv.style.display = display ? "block" : "none";
|
300
|
+
};
|
301
|
+
|
302
|
+
editor.setOption = function(key, value) {
|
303
|
+
if (options[key] == value) return;
|
304
|
+
|
305
|
+
switch (key) {
|
306
|
+
case "gutter":
|
307
|
+
renderer.setShowGutter(toBool(value));
|
308
|
+
break;
|
309
|
+
|
310
|
+
case "mode":
|
311
|
+
if (value != "text") {
|
312
|
+
// Load the required mode file. Files get loaded only once.
|
313
|
+
loader("mode-" + value + ".js", "ace/mode/" + value, function() {
|
314
|
+
var aceMode = require("../mode/" + value).Mode;
|
315
|
+
session.setMode(new aceMode());
|
316
|
+
});
|
317
|
+
} else {
|
318
|
+
session.setMode(new (require("../mode/text").Mode));
|
319
|
+
}
|
320
|
+
break;
|
321
|
+
|
322
|
+
case "theme":
|
323
|
+
if (value != "textmate") {
|
324
|
+
// Load the required theme file. Files get loaded only once.
|
325
|
+
loader("theme-" + value + ".js", "ace/theme/" + value, function() {
|
326
|
+
editor.setTheme("ace/theme/" + value);
|
327
|
+
});
|
328
|
+
} else {
|
329
|
+
editor.setTheme("ace/theme/textmate");
|
330
|
+
}
|
331
|
+
break;
|
332
|
+
|
333
|
+
case "fontSize":
|
334
|
+
editorDiv.style.fontSize = value;
|
335
|
+
break;
|
336
|
+
|
337
|
+
case "softWrap":
|
338
|
+
switch (value) {
|
339
|
+
case "off":
|
340
|
+
session.setUseWrapMode(false);
|
341
|
+
renderer.setPrintMarginColumn(80);
|
342
|
+
break;
|
343
|
+
case "40":
|
344
|
+
session.setUseWrapMode(true);
|
345
|
+
session.setWrapLimitRange(40, 40);
|
346
|
+
renderer.setPrintMarginColumn(40);
|
347
|
+
break;
|
348
|
+
case "80":
|
349
|
+
session.setUseWrapMode(true);
|
350
|
+
session.setWrapLimitRange(80, 80);
|
351
|
+
renderer.setPrintMarginColumn(80);
|
352
|
+
break;
|
353
|
+
case "free":
|
354
|
+
session.setUseWrapMode(true);
|
355
|
+
session.setWrapLimitRange(null, null);
|
356
|
+
renderer.setPrintMarginColumn(80);
|
357
|
+
break;
|
358
|
+
}
|
359
|
+
break;
|
360
|
+
|
361
|
+
case "useSoftTabs":
|
362
|
+
session.setUseSoftTabs(toBool(value));
|
363
|
+
break;
|
364
|
+
|
365
|
+
case "showPrintMargin":
|
366
|
+
renderer.setShowPrintMargin(toBool(value));
|
367
|
+
break;
|
368
|
+
|
369
|
+
case "showInvisibles":
|
370
|
+
editor.setShowInvisibles(toBool(value));
|
371
|
+
break;
|
372
|
+
}
|
373
|
+
|
374
|
+
options[key] = value;
|
375
|
+
};
|
376
|
+
|
377
|
+
editor.getOption = function(key) {
|
378
|
+
return options[key];
|
379
|
+
};
|
380
|
+
|
381
|
+
editor.getOptions = function() {
|
382
|
+
return options;
|
383
|
+
};
|
384
|
+
|
385
|
+
for (var option in exports.options) {
|
386
|
+
editor.setOption(option, exports.options[option]);
|
387
|
+
}
|
388
|
+
|
389
|
+
return editor;
|
390
|
+
}
|
391
|
+
|
392
|
+
function setupSettingPanel(settingDiv, settingOpener, editor, options) {
|
393
|
+
var BOOL = {
|
394
|
+
"true": true,
|
395
|
+
"false": false
|
396
|
+
};
|
397
|
+
|
398
|
+
var desc = {
|
399
|
+
mode: "Mode:",
|
400
|
+
gutter: "Display Gutter:",
|
401
|
+
theme: "Theme:",
|
402
|
+
fontSize: "Font Size:",
|
403
|
+
softWrap: "Soft Wrap:",
|
404
|
+
showPrintMargin: "Show Print Margin:",
|
405
|
+
useSoftTabs: "Use Soft Tabs:",
|
406
|
+
showInvisibles: "Show Invisibles"
|
407
|
+
};
|
408
|
+
|
409
|
+
var optionValues = {
|
410
|
+
mode: {
|
411
|
+
text: "Plain",
|
412
|
+
javascript: "JavaScript",
|
413
|
+
xml: "XML",
|
414
|
+
html: "HTML",
|
415
|
+
css: "CSS",
|
416
|
+
scss: "SCSS",
|
417
|
+
python: "Python",
|
418
|
+
php: "PHP",
|
419
|
+
java: "Java",
|
420
|
+
ruby: "Ruby",
|
421
|
+
c_cpp: "C/C++",
|
422
|
+
coffee: "CoffeeScript",
|
423
|
+
json: "json",
|
424
|
+
perl: "Perl",
|
425
|
+
clojure: "Clojure",
|
426
|
+
ocaml: "OCaml",
|
427
|
+
csharp: "C#",
|
428
|
+
haxe: "haXe",
|
429
|
+
svg: "SVG",
|
430
|
+
textile: "Textile",
|
431
|
+
groovy: "Groovy",
|
432
|
+
liquid: "Liquid",
|
433
|
+
Scala: "Scala"
|
434
|
+
},
|
435
|
+
theme: {
|
436
|
+
clouds: "Clouds",
|
437
|
+
clouds_midnight: "Clouds Midnight",
|
438
|
+
cobalt: "Cobalt",
|
439
|
+
crimson_editor: "Crimson Editor",
|
440
|
+
dawn: "Dawn",
|
441
|
+
eclipse: "Eclipse",
|
442
|
+
idle_fingers: "Idle Fingers",
|
443
|
+
kr_theme: "Kr Theme",
|
444
|
+
merbivore: "Merbivore",
|
445
|
+
merbivore_soft: "Merbivore Soft",
|
446
|
+
mono_industrial: "Mono Industrial",
|
447
|
+
monokai: "Monokai",
|
448
|
+
pastel_on_dark: "Pastel On Dark",
|
449
|
+
solarized_dark: "Solarized Dark",
|
450
|
+
solarized_light: "Solarized Light",
|
451
|
+
textmate: "Textmate",
|
452
|
+
twilight: "Twilight",
|
453
|
+
vibrant_ink: "Vibrant Ink"
|
454
|
+
},
|
455
|
+
gutter: BOOL,
|
456
|
+
fontSize: {
|
457
|
+
"10px": "10px",
|
458
|
+
"11px": "11px",
|
459
|
+
"12px": "12px",
|
460
|
+
"14px": "14px",
|
461
|
+
"16px": "16px"
|
462
|
+
},
|
463
|
+
softWrap: {
|
464
|
+
off: "Off",
|
465
|
+
40: "40",
|
466
|
+
80: "80",
|
467
|
+
free: "Free"
|
468
|
+
},
|
469
|
+
showPrintMargin: BOOL,
|
470
|
+
useSoftTabs: BOOL,
|
471
|
+
showInvisibles: BOOL
|
472
|
+
};
|
473
|
+
|
474
|
+
var table = [];
|
475
|
+
table.push("<table><tr><th>Setting</th><th>Value</th></tr>");
|
476
|
+
|
477
|
+
function renderOption(builder, option, obj, cValue) {
|
478
|
+
builder.push("<select title='" + option + "'>");
|
479
|
+
for (var value in obj) {
|
480
|
+
builder.push("<option value='" + value + "' ");
|
481
|
+
|
482
|
+
if (cValue == value) {
|
483
|
+
builder.push(" selected ");
|
484
|
+
}
|
485
|
+
|
486
|
+
builder.push(">",
|
487
|
+
obj[value],
|
488
|
+
"</option>");
|
489
|
+
}
|
490
|
+
builder.push("</select>");
|
491
|
+
}
|
492
|
+
|
493
|
+
for (var option in options) {
|
494
|
+
table.push("<tr><td>", desc[option], "</td>");
|
495
|
+
table.push("<td>");
|
496
|
+
renderOption(table, option, optionValues[option], options[option]);
|
497
|
+
table.push("</td></tr>");
|
498
|
+
}
|
499
|
+
table.push("</table>");
|
500
|
+
settingDiv.innerHTML = table.join("");
|
501
|
+
|
502
|
+
var selects = settingDiv.getElementsByTagName("select");
|
503
|
+
for (var i = 0; i < selects.length; i++) {
|
504
|
+
var onChange = (function() {
|
505
|
+
var select = selects[i];
|
506
|
+
return function() {
|
507
|
+
var option = select.title;
|
508
|
+
var value = select.value;
|
509
|
+
editor.setOption(option, value);
|
510
|
+
};
|
511
|
+
})();
|
512
|
+
selects[i].onchange = onChange;
|
513
|
+
}
|
514
|
+
|
515
|
+
var button = document.createElement("input");
|
516
|
+
button.type = "button";
|
517
|
+
button.value = "Hide";
|
518
|
+
event.addListener(button, "click", function() {
|
519
|
+
editor.setDisplaySettings(false);
|
520
|
+
});
|
521
|
+
settingDiv.appendChild(button);
|
522
|
+
}
|
523
|
+
|
524
|
+
// Default startup options.
|
525
|
+
exports.options = {
|
526
|
+
mode: "text",
|
527
|
+
theme: "textmate",
|
528
|
+
gutter: "false",
|
529
|
+
fontSize: "12px",
|
530
|
+
softWrap: "off",
|
531
|
+
showPrintMargin: "false",
|
532
|
+
useSoftTabs: "true",
|
533
|
+
showInvisibles: "true"
|
534
|
+
};
|
535
|
+
|
536
|
+
});
|