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,43 @@
|
|
1
|
+
define(function(require, exports, module) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var Document = require("../document").Document;
|
5
|
+
var lang = require("../lib/lang");
|
6
|
+
|
7
|
+
var Mirror = exports.Mirror = function(sender) {
|
8
|
+
this.sender = sender;
|
9
|
+
var doc = this.doc = new Document("");
|
10
|
+
|
11
|
+
var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
|
12
|
+
|
13
|
+
var _self = this;
|
14
|
+
sender.on("change", function(e) {
|
15
|
+
doc.applyDeltas([e.data]);
|
16
|
+
deferredUpdate.schedule(_self.$timeout);
|
17
|
+
});
|
18
|
+
};
|
19
|
+
|
20
|
+
(function() {
|
21
|
+
|
22
|
+
this.$timeout = 500;
|
23
|
+
|
24
|
+
this.setTimeout = function(timeout) {
|
25
|
+
this.$timeout = timeout;
|
26
|
+
};
|
27
|
+
|
28
|
+
this.setValue = function(value) {
|
29
|
+
this.doc.setValue(value);
|
30
|
+
this.deferredUpdate.schedule(this.$timeout);
|
31
|
+
};
|
32
|
+
|
33
|
+
this.getValue = function(callbackId) {
|
34
|
+
this.sender.callback(this.doc.getValue(), callbackId);
|
35
|
+
};
|
36
|
+
|
37
|
+
this.onUpdate = function() {
|
38
|
+
// abstract method
|
39
|
+
};
|
40
|
+
|
41
|
+
}).call(Mirror.prototype);
|
42
|
+
|
43
|
+
});
|
@@ -0,0 +1,138 @@
|
|
1
|
+
"no use strict";
|
2
|
+
|
3
|
+
var console = {
|
4
|
+
log: function(msg) {
|
5
|
+
postMessage({type: "log", data: msg});
|
6
|
+
}
|
7
|
+
};
|
8
|
+
var window = {
|
9
|
+
console: console
|
10
|
+
};
|
11
|
+
|
12
|
+
var normalizeModule = function(parentId, moduleName) {
|
13
|
+
// normalize plugin requires
|
14
|
+
if (moduleName.indexOf("!") !== -1) {
|
15
|
+
var chunks = moduleName.split("!");
|
16
|
+
return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]);
|
17
|
+
}
|
18
|
+
// normalize relative requires
|
19
|
+
if (moduleName.charAt(0) == ".") {
|
20
|
+
var base = parentId.split("/").slice(0, -1).join("/");
|
21
|
+
var moduleName = base + "/" + moduleName;
|
22
|
+
|
23
|
+
while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
|
24
|
+
var previous = moduleName;
|
25
|
+
var moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
return moduleName;
|
30
|
+
};
|
31
|
+
|
32
|
+
var require = function(parentId, id) {
|
33
|
+
var id = normalizeModule(parentId, id);
|
34
|
+
|
35
|
+
var module = require.modules[id];
|
36
|
+
if (module) {
|
37
|
+
if (!module.initialized) {
|
38
|
+
module.exports = module.factory().exports;
|
39
|
+
module.initialized = true;
|
40
|
+
}
|
41
|
+
return module.exports;
|
42
|
+
}
|
43
|
+
|
44
|
+
var chunks = id.split("/");
|
45
|
+
chunks[0] = require.tlns[chunks[0]] || chunks[0];
|
46
|
+
var path = chunks.join("/") + ".js";
|
47
|
+
|
48
|
+
require.id = id;
|
49
|
+
importScripts(path);
|
50
|
+
return require(parentId, id);
|
51
|
+
};
|
52
|
+
|
53
|
+
require.modules = {};
|
54
|
+
require.tlns = {};
|
55
|
+
|
56
|
+
var define = function(id, deps, factory) {
|
57
|
+
if (arguments.length == 2) {
|
58
|
+
factory = deps;
|
59
|
+
} else if (arguments.length == 1) {
|
60
|
+
factory = id;
|
61
|
+
id = require.id;
|
62
|
+
}
|
63
|
+
|
64
|
+
if (id.indexOf("text!") === 0)
|
65
|
+
return;
|
66
|
+
|
67
|
+
var req = function(deps, factory) {
|
68
|
+
return require(id, deps, factory);
|
69
|
+
};
|
70
|
+
|
71
|
+
require.modules[id] = {
|
72
|
+
factory: function() {
|
73
|
+
var module = {
|
74
|
+
exports: {}
|
75
|
+
};
|
76
|
+
var returnExports = factory(req, module.exports, module);
|
77
|
+
if (returnExports)
|
78
|
+
module.exports = returnExports;
|
79
|
+
return module;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
};
|
83
|
+
|
84
|
+
function initBaseUrls(topLevelNamespaces) {
|
85
|
+
require.tlns = topLevelNamespaces;
|
86
|
+
}
|
87
|
+
|
88
|
+
function initSender() {
|
89
|
+
|
90
|
+
var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter;
|
91
|
+
var oop = require(null, "ace/lib/oop");
|
92
|
+
|
93
|
+
var Sender = function() {};
|
94
|
+
|
95
|
+
(function() {
|
96
|
+
|
97
|
+
oop.implement(this, EventEmitter);
|
98
|
+
|
99
|
+
this.callback = function(data, callbackId) {
|
100
|
+
postMessage({
|
101
|
+
type: "call",
|
102
|
+
id: callbackId,
|
103
|
+
data: data
|
104
|
+
});
|
105
|
+
};
|
106
|
+
|
107
|
+
this.emit = function(name, data) {
|
108
|
+
postMessage({
|
109
|
+
type: "event",
|
110
|
+
name: name,
|
111
|
+
data: data
|
112
|
+
});
|
113
|
+
};
|
114
|
+
|
115
|
+
}).call(Sender.prototype);
|
116
|
+
|
117
|
+
return new Sender();
|
118
|
+
}
|
119
|
+
|
120
|
+
var main;
|
121
|
+
var sender;
|
122
|
+
|
123
|
+
onmessage = function(e) {
|
124
|
+
var msg = e.data;
|
125
|
+
if (msg.command) {
|
126
|
+
main[msg.command].apply(main, msg.args);
|
127
|
+
}
|
128
|
+
else if (msg.init) {
|
129
|
+
initBaseUrls(msg.tlns);
|
130
|
+
require(null, "ace/lib/fixoldbrowsers");
|
131
|
+
sender = initSender();
|
132
|
+
var clazz = require(null, msg.module)[msg.classname];
|
133
|
+
main = new clazz(sender);
|
134
|
+
}
|
135
|
+
else if (msg.event && sender) {
|
136
|
+
sender._emit(msg.event, msg.data);
|
137
|
+
}
|
138
|
+
};
|
@@ -0,0 +1,176 @@
|
|
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 Ajax.org Code Editor (ACE).
|
15
|
+
*
|
16
|
+
* The Initial Developer of the Original Code is
|
17
|
+
* Ajax.org B.V.
|
18
|
+
* Portions created by the Initial Developer are Copyright (C) 2010
|
19
|
+
* the Initial Developer. All Rights Reserved.
|
20
|
+
*
|
21
|
+
* Contributor(s):
|
22
|
+
* Fabian Jakobs <fabian AT ajax DOT org>
|
23
|
+
*
|
24
|
+
* Alternatively, the contents of this file may be used under the terms of
|
25
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
26
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
27
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
28
|
+
* of those above. If you wish to allow use of your version of this file only
|
29
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
30
|
+
* use your version of this file under the terms of the MPL, indicate your
|
31
|
+
* decision by deleting the provisions above and replace them with the notice
|
32
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
33
|
+
* the provisions above, a recipient may use your version of this file under
|
34
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
35
|
+
*
|
36
|
+
* ***** END LICENSE BLOCK ***** */
|
37
|
+
|
38
|
+
define(function(require, exports, module) {
|
39
|
+
"use strict";
|
40
|
+
|
41
|
+
var oop = require("../lib/oop");
|
42
|
+
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
43
|
+
var config = require("../config");
|
44
|
+
|
45
|
+
var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
46
|
+
|
47
|
+
this.changeListener = this.changeListener.bind(this);
|
48
|
+
|
49
|
+
if (config.get("packaged")) {
|
50
|
+
this.$worker = new Worker(config.get("workerPath") + "/" + packagedJs);
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
var workerUrl;
|
54
|
+
if (typeof require.supports !== "undefined" && require.supports.indexOf("ucjs2-pinf-0") >= 0) {
|
55
|
+
// We are running in the sourcemint loader.
|
56
|
+
workerUrl = require.nameToUrl("ace/worker/worker_sourcemint");
|
57
|
+
} else {
|
58
|
+
// We are running in RequireJS.
|
59
|
+
// nameToUrl is renamed to toUrl in requirejs 2
|
60
|
+
if (require.nameToUrl && !require.toUrl)
|
61
|
+
require.toUrl = require.nameToUrl;
|
62
|
+
workerUrl = this.$normalizePath(require.toUrl("ace/worker/worker", null, "_"));
|
63
|
+
}
|
64
|
+
this.$worker = new Worker(workerUrl);
|
65
|
+
|
66
|
+
var tlns = {};
|
67
|
+
for (var i=0; i<topLevelNamespaces.length; i++) {
|
68
|
+
var ns = topLevelNamespaces[i];
|
69
|
+
var path = this.$normalizePath(require.toUrl(ns, null, "_").replace(/.js$/, ""));
|
70
|
+
|
71
|
+
tlns[ns] = path;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
this.$worker.postMessage({
|
76
|
+
init : true,
|
77
|
+
tlns: tlns,
|
78
|
+
module: mod,
|
79
|
+
classname: classname
|
80
|
+
});
|
81
|
+
|
82
|
+
this.callbackId = 1;
|
83
|
+
this.callbacks = {};
|
84
|
+
|
85
|
+
var _self = this;
|
86
|
+
this.$worker.onerror = function(e) {
|
87
|
+
window.console && console.log && console.log(e);
|
88
|
+
throw e;
|
89
|
+
};
|
90
|
+
this.$worker.onmessage = function(e) {
|
91
|
+
var msg = e.data;
|
92
|
+
switch(msg.type) {
|
93
|
+
case "log":
|
94
|
+
window.console && console.log && console.log(msg.data);
|
95
|
+
break;
|
96
|
+
|
97
|
+
case "event":
|
98
|
+
_self._emit(msg.name, {data: msg.data});
|
99
|
+
break;
|
100
|
+
|
101
|
+
case "call":
|
102
|
+
var callback = _self.callbacks[msg.id];
|
103
|
+
if (callback) {
|
104
|
+
callback(msg.data);
|
105
|
+
delete _self.callbacks[msg.id];
|
106
|
+
}
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
};
|
110
|
+
};
|
111
|
+
|
112
|
+
(function(){
|
113
|
+
|
114
|
+
oop.implement(this, EventEmitter);
|
115
|
+
|
116
|
+
this.$normalizePath = function(path) {
|
117
|
+
path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it
|
118
|
+
path = location.protocol + "//" + location.host
|
119
|
+
// paths starting with a slash are relative to the root (host)
|
120
|
+
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
121
|
+
+ "/" + path.replace(/^[\/]+/, "");
|
122
|
+
return path;
|
123
|
+
};
|
124
|
+
|
125
|
+
this.terminate = function() {
|
126
|
+
this._emit("terminate", {});
|
127
|
+
this.$worker.terminate();
|
128
|
+
this.$worker = null;
|
129
|
+
this.$doc.removeEventListener("change", this.changeListener);
|
130
|
+
this.$doc = null;
|
131
|
+
};
|
132
|
+
|
133
|
+
this.send = function(cmd, args) {
|
134
|
+
this.$worker.postMessage({command: cmd, args: args});
|
135
|
+
};
|
136
|
+
|
137
|
+
this.call = function(cmd, args, callback) {
|
138
|
+
if (callback) {
|
139
|
+
var id = this.callbackId++;
|
140
|
+
this.callbacks[id] = callback;
|
141
|
+
args.push(id);
|
142
|
+
}
|
143
|
+
this.send(cmd, args);
|
144
|
+
};
|
145
|
+
|
146
|
+
this.emit = function(event, data) {
|
147
|
+
try {
|
148
|
+
// firefox refuses to clone objects which have function properties
|
149
|
+
// TODO: cleanup event
|
150
|
+
this.$worker.postMessage({event: event, data: {data: data.data}});
|
151
|
+
}
|
152
|
+
catch(ex) {}
|
153
|
+
};
|
154
|
+
|
155
|
+
this.attachToDocument = function(doc) {
|
156
|
+
if(this.$doc)
|
157
|
+
this.terminate();
|
158
|
+
|
159
|
+
this.$doc = doc;
|
160
|
+
this.call("setValue", [doc.getValue()]);
|
161
|
+
doc.on("change", this.changeListener);
|
162
|
+
};
|
163
|
+
|
164
|
+
this.changeListener = function(e) {
|
165
|
+
e.range = {
|
166
|
+
start: e.data.range.start,
|
167
|
+
end: e.data.range.end
|
168
|
+
};
|
169
|
+
this.emit("change", e);
|
170
|
+
};
|
171
|
+
|
172
|
+
}).call(WorkerClient.prototype);
|
173
|
+
|
174
|
+
exports.WorkerClient = WorkerClient;
|
175
|
+
|
176
|
+
});
|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
define(function(require, exports, module) {
|
3
|
+
|
4
|
+
"no use strict";
|
5
|
+
|
6
|
+
exports.main = function()
|
7
|
+
{
|
8
|
+
var console = {
|
9
|
+
log: function(msg) {
|
10
|
+
postMessage({type: "log", data: msg});
|
11
|
+
}
|
12
|
+
};
|
13
|
+
|
14
|
+
// NOTE: This sets the global `window` object used by workers.
|
15
|
+
// TODO: Pass into worker what it needs and don't set global here.
|
16
|
+
window = {
|
17
|
+
console: console
|
18
|
+
};
|
19
|
+
|
20
|
+
function initSender() {
|
21
|
+
|
22
|
+
var EventEmitter = require("ace/lib/event_emitter").EventEmitter;
|
23
|
+
var oop = require("ace/lib/oop");
|
24
|
+
|
25
|
+
var Sender = function() {};
|
26
|
+
|
27
|
+
(function() {
|
28
|
+
|
29
|
+
oop.implement(this, EventEmitter);
|
30
|
+
|
31
|
+
this.callback = function(data, callbackId) {
|
32
|
+
postMessage({
|
33
|
+
type: "call",
|
34
|
+
id: callbackId,
|
35
|
+
data: data
|
36
|
+
});
|
37
|
+
};
|
38
|
+
|
39
|
+
this.emit = function(name, data) {
|
40
|
+
postMessage({
|
41
|
+
type: "event",
|
42
|
+
name: name,
|
43
|
+
data: data
|
44
|
+
});
|
45
|
+
};
|
46
|
+
|
47
|
+
}).call(Sender.prototype);
|
48
|
+
|
49
|
+
return new Sender();
|
50
|
+
}
|
51
|
+
|
52
|
+
var main;
|
53
|
+
var sender;
|
54
|
+
|
55
|
+
onmessage = function(e) {
|
56
|
+
var msg = e.data;
|
57
|
+
if (msg.command) {
|
58
|
+
main[msg.command].apply(main, msg.args);
|
59
|
+
}
|
60
|
+
else if (msg.init) {
|
61
|
+
require("ace/lib/fixoldbrowsers");
|
62
|
+
sender = initSender();
|
63
|
+
require.async(msg.module, function(WORKER) {
|
64
|
+
var clazz = WORKER[msg.classname];
|
65
|
+
main = new clazz(sender);
|
66
|
+
});
|
67
|
+
}
|
68
|
+
else if (msg.event && sender) {
|
69
|
+
sender._emit(msg.event, msg.data);
|
70
|
+
}
|
71
|
+
};
|
72
|
+
}
|
73
|
+
});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
(function(window,undefined){"$:nomunge";var $=window.jQuery||window.Cowboy||(window.Cowboy={}),jq_throttle;$.throttle=jq_throttle=function(delay,no_trailing,callback,debounce_mode){var timeout_id,last_exec=0;if(typeof no_trailing!=="boolean"){debounce_mode=callback;callback=no_trailing;no_trailing=undefined}function wrapper(){var that=this,elapsed=+new Date-last_exec,args=arguments;function exec(){last_exec=+new Date;callback.apply(that,args)}function clear(){timeout_id=undefined}if(debounce_mode&&
|
2
|
+
!timeout_id)exec();timeout_id&&clearTimeout(timeout_id);if(debounce_mode===undefined&&elapsed>delay)exec();else if(no_trailing!==true)timeout_id=setTimeout(debounce_mode?clear:exec,debounce_mode===undefined?delay-elapsed:delay)}if($.guid)wrapper.guid=callback.guid=callback.guid||$.guid++;return wrapper};$.debounce=function(delay,at_begin,callback){return callback===undefined?jq_throttle(delay,at_begin,false):jq_throttle(delay,callback,at_begin!==false)}})(this);
|
@@ -0,0 +1,456 @@
|
|
1
|
+
require([ 'ace/undomanager', 'ace/ext/static_highlight', 'ace/theme/github', 'ace/editor', 'ace/virtual_renderer', 'ace/mode/markdown', 'ace/theme/twilight',
|
2
|
+
'ace/mode/c_cpp', 'ace/mode/clojure', 'ace/mode/coffee', 'ace/mode/coldfusion', 'ace/mode/csharp', 'ace/mode/css', 'ace/mode/diff', 'ace/mode/golang', 'ace/mode/groovy', 'ace/mode/haxe', 'ace/mode/html', 'ace/mode/java', 'ace/mode/javascript', 'ace/mode/json', 'ace/mode/latex', 'ace/mode/less', 'ace/mode/liquid', 'ace/mode/lua', 'ace/mode/markdown', 'ace/mode/ocaml', 'ace/mode/perl', 'ace/mode/pgsql', 'ace/mode/php', 'ace/mode/powershell', 'ace/mode/python', 'ace/mode/ruby', 'ace/mode/scad', 'ace/mode/scala', 'ace/mode/scss', 'ace/mode/sh', 'ace/mode/sql', 'ace/mode/svg', 'ace/mode/textile', 'ace/mode/text', 'ace/mode/xml', 'ace/mode/xquery', 'ace/mode/yaml'
|
3
|
+
], function() {
|
4
|
+
var UndoManager = require("ace/undomanager").UndoManager;
|
5
|
+
var Renderer = require( 'ace/virtual_renderer' ).VirtualRenderer;
|
6
|
+
var Editor = require( 'ace/editor' ).Editor;
|
7
|
+
var dom = require( 'ace/lib/dom' );
|
8
|
+
|
9
|
+
var win = window;
|
10
|
+
var location = win.location;
|
11
|
+
var doc = document;
|
12
|
+
|
13
|
+
win.onbeforeunload = function() { return 'Leaving Live Preview will discard all edits!' };
|
14
|
+
|
15
|
+
var editor = new Editor( new Renderer( doc.getElementById( 'editor' ) ));//ace.edit( 'editor' );
|
16
|
+
var editorSession = editor.getSession();
|
17
|
+
$.editorSession = editorSession; // for testing
|
18
|
+
var editorContainer = editor.container;
|
19
|
+
var preview = doc.getElementById( 'previewframe' );
|
20
|
+
var content = doc.getElementById( 'contentframe' );
|
21
|
+
var toolPanel = doc.getElementById( 'toolpanel' );
|
22
|
+
var comment = doc.getElementById( 'comment' );
|
23
|
+
var commentToolPanel = doc.getElementById( 'commenttoolpanel' );
|
24
|
+
// dim the page
|
25
|
+
var darkness = doc.getElementById( 'darkness' );
|
26
|
+
|
27
|
+
var leftRight = true;
|
28
|
+
var jsm = {}; // JavaScript Markdown
|
29
|
+
win.jsm = jsm;
|
30
|
+
win.jsm.toggleLeftRight = function() {
|
31
|
+
leftRight = leftRight === false ? true : false;
|
32
|
+
jsm.resize();
|
33
|
+
}
|
34
|
+
|
35
|
+
var MarkdownMode = require( 'ace/mode/markdown' ).Mode;
|
36
|
+
|
37
|
+
function initAce( editor, editorSession ) {
|
38
|
+
editorSession.setUndoManager(new UndoManager());
|
39
|
+
editor.setTheme( 'ace/theme/twilight' );
|
40
|
+
editorSession.setMode( new MarkdownMode() );
|
41
|
+
// Gutter shows line numbers
|
42
|
+
editor.renderer.setShowGutter( true );
|
43
|
+
editor.renderer.setHScrollBarAlwaysVisible( false );
|
44
|
+
editorSession.setUseSoftTabs( true );
|
45
|
+
editorSession.setTabSize( 2 );
|
46
|
+
editorSession.setUseWrapMode( true );
|
47
|
+
editor.setShowPrintMargin( false );
|
48
|
+
editor.setBehavioursEnabled( true );
|
49
|
+
}
|
50
|
+
|
51
|
+
initAce( editor, editorSession );
|
52
|
+
|
53
|
+
// Setup comment ace.
|
54
|
+
var commentEditor = new Editor( new Renderer( doc.getElementById( 'comment' ) ));//ace.edit( 'comment' );
|
55
|
+
var commentEditorSession = commentEditor.getSession();
|
56
|
+
$.commentSession = commentEditorSession; // for testing
|
57
|
+
var commentEditorContainer = commentEditor.container;
|
58
|
+
|
59
|
+
initAce( commentEditor, commentEditorSession );
|
60
|
+
|
61
|
+
// Find the app's base url, knowing we are in /livepreview/index.html
|
62
|
+
var baseUrl = location.pathname.split('/').slice(0,-2).join('/');
|
63
|
+
|
64
|
+
// RegExp from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
|
65
|
+
$.key = function( key ) {
|
66
|
+
var value = new RegExp( '[\\?&]' + key + '=([^&#]*)' ).exec( location.href );
|
67
|
+
return ( !value ) ? 0 : value[ 1 ] || 0;
|
68
|
+
}
|
69
|
+
|
70
|
+
// True if &create=true
|
71
|
+
var create = $.key( 'create' );
|
72
|
+
// The path and name of the page being edited.
|
73
|
+
var pageName = $.key( 'page' );
|
74
|
+
var pathName = $.key( 'path' );
|
75
|
+
|
76
|
+
if ( pathName === 0 ) {
|
77
|
+
pathName = undefined;
|
78
|
+
}
|
79
|
+
|
80
|
+
defaultCommitMessage = function() {
|
81
|
+
var msg = pageName + ' (markdown)';
|
82
|
+
|
83
|
+
if (create) {
|
84
|
+
return 'Created ' + msg;
|
85
|
+
} else {
|
86
|
+
return 'Updated ' + msg;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
// Set comment using the default commit message.
|
91
|
+
commentEditorSession.setValue( defaultCommitMessage() );
|
92
|
+
|
93
|
+
$.save = function( commitMessage ) {
|
94
|
+
win.onbeforeunload = null;
|
95
|
+
|
96
|
+
var POST = 'POST';
|
97
|
+
var markdown = 'markdown';
|
98
|
+
var txt = editorSession.getValue();
|
99
|
+
var msg = defaultCommitMessage();
|
100
|
+
var newLocation = location.protocol + '//' + location.host + baseUrl;
|
101
|
+
|
102
|
+
if (pathName) {
|
103
|
+
newLocation += '/' + pathName;
|
104
|
+
}
|
105
|
+
|
106
|
+
newLocation += '/' + pageName;
|
107
|
+
|
108
|
+
// if &create=true then handle create instead of edit.
|
109
|
+
if ( create ) {
|
110
|
+
jQuery.ajax( {
|
111
|
+
type: POST,
|
112
|
+
url: baseUrl + '/create',
|
113
|
+
data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg },
|
114
|
+
success: function() {
|
115
|
+
win.location = newLocation;
|
116
|
+
}
|
117
|
+
});
|
118
|
+
} else {
|
119
|
+
jQuery.ajax( {
|
120
|
+
type: POST,
|
121
|
+
url: baseUrl + '/edit/' + pageName,
|
122
|
+
data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg },
|
123
|
+
success: function() {
|
124
|
+
win.location = newLocation;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
} // end else
|
128
|
+
}
|
129
|
+
|
130
|
+
var elapsedTime;
|
131
|
+
var oldInputText = '';
|
132
|
+
|
133
|
+
// ---- from Markdown.Editor
|
134
|
+
var timeout;
|
135
|
+
|
136
|
+
var nonSuckyBrowserPreviewSet = function( text ) {
|
137
|
+
content.innerHTML = text;
|
138
|
+
}
|
139
|
+
|
140
|
+
// IE doesn't let you use innerHTML if the element is contained somewhere in a table
|
141
|
+
// (which is the case for inline editing) -- in that case, detach the element, set the
|
142
|
+
// value, and reattach. Yes, that *is* ridiculous.
|
143
|
+
var ieSafePreviewSet = function( text ) {
|
144
|
+
var parent = content.parentNode;
|
145
|
+
var sibling = content.nextSibling;
|
146
|
+
parent.removeChild( content );
|
147
|
+
content.innerHTML = text;
|
148
|
+
if ( !sibling )
|
149
|
+
parent.appendChild( content );
|
150
|
+
else
|
151
|
+
parent.insertBefore( content, sibling );
|
152
|
+
}
|
153
|
+
|
154
|
+
var cssTextSet = function( element, css ){
|
155
|
+
element.style.cssText = css;
|
156
|
+
}
|
157
|
+
|
158
|
+
var cssAttrSet = function( element, css ){
|
159
|
+
element.setAttribute( 'style', css );
|
160
|
+
}
|
161
|
+
|
162
|
+
/*
|
163
|
+
Redefine the function based on browser support.
|
164
|
+
element - the element to set the css on
|
165
|
+
css - a fully formed css string. ex: 'top: 0; left: 0;'
|
166
|
+
|
167
|
+
Avoid reflow by batching CSS changes.
|
168
|
+
http://dev.opera.com/articles/view/efficient-javascript/?page=3#stylechanges
|
169
|
+
*/
|
170
|
+
var cssSet = function( element, css ) {
|
171
|
+
if( typeof( element.style.cssText ) != 'undefined' ) {
|
172
|
+
cssTextSet( element, css );
|
173
|
+
cssSet = cssTextSet;
|
174
|
+
} else {
|
175
|
+
cssAttrSet( element, css );
|
176
|
+
cssSet = cssAttrSet;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
var previewSet = function( text ) {
|
181
|
+
try {
|
182
|
+
nonSuckyBrowserPreviewSet( text );
|
183
|
+
previewSet = nonSuckyBrowserPreviewSet;
|
184
|
+
} catch ( e ) {
|
185
|
+
ieSafePreviewSet( text );
|
186
|
+
previewSet = ieSafePreviewSet;
|
187
|
+
}
|
188
|
+
};
|
189
|
+
|
190
|
+
// 'c', 'c++', 'cpp' are github specific and transformed to c_cpp for Ace.
|
191
|
+
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee', 'coldfusion',
|
192
|
+
'csharp', 'css', 'diff', 'golang', 'groovy', 'haxe', 'html',
|
193
|
+
'java', 'javascript', 'json', 'latex', 'less', 'liquid',
|
194
|
+
'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php', 'powershell',
|
195
|
+
'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql', 'svg',
|
196
|
+
'textile', 'text', 'xml', 'xquery', 'yaml' ];
|
197
|
+
|
198
|
+
var staticHighlight = require( 'ace/ext/static_highlight' );
|
199
|
+
var githubTheme = require( 'ace/theme/github' );
|
200
|
+
var langModes = {};
|
201
|
+
|
202
|
+
(function() {
|
203
|
+
var languagesLength = languages.length;
|
204
|
+
for ( var a = 0; a < languagesLength; a++ ) {
|
205
|
+
var name = languages[ a ];
|
206
|
+
langModes[ name ] = false;
|
207
|
+
}
|
208
|
+
})();
|
209
|
+
|
210
|
+
function getLang( language ) {
|
211
|
+
var mode = langModes[ language ];
|
212
|
+
|
213
|
+
if ( mode ) {
|
214
|
+
return mode;
|
215
|
+
}
|
216
|
+
|
217
|
+
// require.Mode must be wrapped in parens.
|
218
|
+
mode = new ( require( 'ace/mode/' + language ).Mode )();
|
219
|
+
|
220
|
+
return mode;
|
221
|
+
}
|
222
|
+
|
223
|
+
function highlight( element, language ) {
|
224
|
+
// Highlighting requires .innerText not
|
225
|
+
// .innerHTML. It's the difference between
|
226
|
+
// '>' and '>'.
|
227
|
+
// Firefox does not support innerText.
|
228
|
+
var data = element.innerText || element.textContent;
|
229
|
+
data = data.trim();
|
230
|
+
var mode = getLang( language );
|
231
|
+
// input, mode, theme, lineStart, disableGutter
|
232
|
+
var color = staticHighlight.render( data, mode, githubTheme, 1, true );
|
233
|
+
|
234
|
+
var newDiv = doc.createElement('div');
|
235
|
+
newDiv.innerHTML = color.html;
|
236
|
+
element.parentNode.parentNode.replaceChild( newDiv, element.parentNode );
|
237
|
+
}
|
238
|
+
|
239
|
+
var makePreviewHtml = function () {
|
240
|
+
var text = editorSession.getValue();
|
241
|
+
|
242
|
+
if ( text == undefined || text == '' ) {
|
243
|
+
previewSet( '' );
|
244
|
+
return;
|
245
|
+
}
|
246
|
+
|
247
|
+
if (text && text == oldInputText) {
|
248
|
+
return; // Input text hasn't changed.
|
249
|
+
}
|
250
|
+
else {
|
251
|
+
oldInputText = text;
|
252
|
+
}
|
253
|
+
|
254
|
+
var prevTime = new Date().getTime();
|
255
|
+
text = md_to_html( text );
|
256
|
+
|
257
|
+
// Calculate the processing time of the HTML creation.
|
258
|
+
// It's used as the delay time in the event listener.
|
259
|
+
var currTime = new Date().getTime();
|
260
|
+
elapsedTime = currTime - prevTime;
|
261
|
+
|
262
|
+
// Update the text using feature detection to support IE.
|
263
|
+
// preview.innerHTML = text; // this doesn't work on IE.
|
264
|
+
previewSet( text );
|
265
|
+
// MathJax is loaded asynchronously.
|
266
|
+
if (typeof MathJax != 'undefined') { MathJax.Hub.Typeset( content ); }
|
267
|
+
|
268
|
+
// highlight code blocks.
|
269
|
+
var codeElements = preview.getElementsByTagName( 'pre' );
|
270
|
+
var codeElementsLength = codeElements.length;
|
271
|
+
var skipped = 0;
|
272
|
+
|
273
|
+
if ( codeElementsLength > 0 ) {
|
274
|
+
for ( var idx = 0; idx < codeElementsLength; idx++ ) {
|
275
|
+
// highlight removes an element so 0 is always the correct index.
|
276
|
+
// Skipped tags are not removed so they must be added.
|
277
|
+
var element = codeElements[ 0 + skipped ].firstChild;
|
278
|
+
if ( element == undefined ) {
|
279
|
+
skipped++;
|
280
|
+
continue;
|
281
|
+
}
|
282
|
+
var codeHTML = element.innerHTML;
|
283
|
+
if ( codeHTML == undefined ) {
|
284
|
+
skipped++;
|
285
|
+
continue;
|
286
|
+
}
|
287
|
+
var txt = codeHTML.split( /\b/ );
|
288
|
+
// the syntax for code highlighting means all code, even one line, contains newlines.
|
289
|
+
if ( txt.length > 1 && codeHTML.match( /\n/ ) ) {
|
290
|
+
var declaredLanguage = element.className.toLowerCase();
|
291
|
+
var aceMode = declaredLanguage;
|
292
|
+
|
293
|
+
// GitHub supports 'c', 'c++', 'cpp'
|
294
|
+
// which must trigger the 'c_cpp' mode in Ace.
|
295
|
+
if ( declaredLanguage === 'c' ||
|
296
|
+
declaredLanguage === 'c++' ||
|
297
|
+
declaredLanguage === 'cpp' ) {
|
298
|
+
aceMode = 'c_cpp';
|
299
|
+
}
|
300
|
+
|
301
|
+
if ( $.inArray( declaredLanguage, languages ) === -1 ) {
|
302
|
+
// Unsupported language.
|
303
|
+
skipped++;
|
304
|
+
continue;
|
305
|
+
}
|
306
|
+
// highlight: element
|
307
|
+
highlight( element, aceMode );
|
308
|
+
} else {
|
309
|
+
// Highlighting is not for `code` inline syntax. For example `puts "string"`.
|
310
|
+
skipped++;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
}
|
314
|
+
};
|
315
|
+
|
316
|
+
// setTimeout is already used. Used as an event listener.
|
317
|
+
var applyTimeout = function () {
|
318
|
+
if ( timeout ) {
|
319
|
+
clearTimeout(timeout);
|
320
|
+
timeout = undefined;
|
321
|
+
}
|
322
|
+
|
323
|
+
// 3 second max delay
|
324
|
+
if ( elapsedTime > 3000 ) {
|
325
|
+
elapsedTime = 3000;
|
326
|
+
}
|
327
|
+
|
328
|
+
timeout = setTimeout( makePreviewHtml, elapsedTime );
|
329
|
+
};
|
330
|
+
|
331
|
+
/* Load markdown from /data/page into the ace editor.
|
332
|
+
~-1 == false; !~-1 == true;
|
333
|
+
*/
|
334
|
+
if ( !~location.host.indexOf('github.com') ) {
|
335
|
+
jQuery.ajax( {
|
336
|
+
type: 'GET',
|
337
|
+
url: baseUrl + '/data/' + $.key( 'page' ),
|
338
|
+
success: function( data ) {
|
339
|
+
editorSession.setValue( data );
|
340
|
+
}
|
341
|
+
});
|
342
|
+
}
|
343
|
+
|
344
|
+
$( '#save' ).click( function() {
|
345
|
+
$.save();
|
346
|
+
});
|
347
|
+
|
348
|
+
// Hide dimmer, comment tool panel, and comment.
|
349
|
+
$( '#commentcancel' ).click( function() {
|
350
|
+
// Restore focus on commentcancel but not on
|
351
|
+
// savecommentconfirm because the latter loads
|
352
|
+
// a new page.
|
353
|
+
hideCommentWindow();
|
354
|
+
editor.focus();
|
355
|
+
});
|
356
|
+
|
357
|
+
var isCommentHidden = true;
|
358
|
+
|
359
|
+
// var style = darkness.style.visibility will not update visibility.
|
360
|
+
var darknessStyle = darkness.style;
|
361
|
+
var commentToolPanelStyle = commentToolPanel.style;
|
362
|
+
var commentStyle = comment.style;
|
363
|
+
|
364
|
+
function hideCommentWindow() {
|
365
|
+
isCommentHidden = true;
|
366
|
+
darknessStyle.visibility =
|
367
|
+
commentToolPanelStyle.visibility =
|
368
|
+
commentStyle.visibility = 'hidden';
|
369
|
+
}
|
370
|
+
|
371
|
+
// Show dimmer, comment tool panel, and comment.
|
372
|
+
$( '#savecomment' ).click( function() {
|
373
|
+
isCommentHidden = false;
|
374
|
+
darknessStyle.visibility =
|
375
|
+
commentToolPanelStyle.visibility =
|
376
|
+
commentStyle.visibility = 'visible';
|
377
|
+
// Set focus so typing can begin immediately.
|
378
|
+
commentEditor.focus();
|
379
|
+
});
|
380
|
+
|
381
|
+
$( '#savecommentconfirm' ).click( function() {
|
382
|
+
$.save( commentEditorSession.getValue() );
|
383
|
+
hideCommentWindow();
|
384
|
+
});
|
385
|
+
|
386
|
+
// onChange calls applyTimeout which rate limits the calling of makePreviewHtml based on render time.
|
387
|
+
editor.on( 'change', applyTimeout );
|
388
|
+
makePreviewHtml(); // preview default text on load
|
389
|
+
|
390
|
+
function resize() {
|
391
|
+
var width = $( win ).width();
|
392
|
+
var widthHalf = width / 2;
|
393
|
+
var widthFourth = widthHalf / 2;
|
394
|
+
var height = $( win ).height();
|
395
|
+
var heightHalf = height / 2;
|
396
|
+
|
397
|
+
// height minus 50 so the end of document text doesn't flow off the page.
|
398
|
+
var editorContainerStyle = 'width:' + widthHalf + 'px;' +
|
399
|
+
'height:' + (height - 50) + 'px;' +
|
400
|
+
'left:' + (leftRight === false ? widthHalf + 'px;' : '0px;') +
|
401
|
+
'top:' + '40px;'; // use 40px for tool menu
|
402
|
+
cssSet( editorContainer, editorContainerStyle );
|
403
|
+
editor.resize();
|
404
|
+
|
405
|
+
// width -2 for scroll bar & -10 for left offset
|
406
|
+
var previewStyle = 'width:' + (widthHalf - 2 - 10) + 'px;' +
|
407
|
+
'height:' + height + 'px;' +
|
408
|
+
'left:' + (leftRight === false ? '10px;' : widthHalf + 'px;') +
|
409
|
+
'top:' + '0px;';
|
410
|
+
cssSet( preview, previewStyle );
|
411
|
+
|
412
|
+
// Resize tool panel
|
413
|
+
var toolPanelStyle = 'width:' + widthHalf + 'px;' +
|
414
|
+
'left:' + (leftRight === false ? widthHalf + 'px;' : '0px;');
|
415
|
+
cssSet( toolPanel, toolPanelStyle );
|
416
|
+
|
417
|
+
// Resize comment related elements.
|
418
|
+
var commentHidden = 'visibility:' + ( isCommentHidden === true ? 'hidden;' : 'visible;' );
|
419
|
+
|
420
|
+
// Adjust comment editor
|
421
|
+
var commentEditorContainerStyle = 'height:' + heightHalf + 'px;' +
|
422
|
+
'width:' + widthHalf + 'px;' +
|
423
|
+
'left:' + widthFourth + 'px;' +
|
424
|
+
'top:' + (heightHalf / 2) + 'px;' +
|
425
|
+
commentHidden;
|
426
|
+
cssSet( commentEditorContainer, commentEditorContainerStyle );
|
427
|
+
commentEditor.resize();
|
428
|
+
|
429
|
+
// In top subtract height (40px) of comment tool panel.
|
430
|
+
var commentToolPanelStyle = 'width:' + widthHalf + 'px;' +
|
431
|
+
'left:' + widthFourth + 'px;' +
|
432
|
+
'top:' + (height / 4 - 40) + 'px;' +
|
433
|
+
commentHidden;
|
434
|
+
cssSet( commentToolPanel, commentToolPanelStyle );
|
435
|
+
|
436
|
+
// Resize dimmer.
|
437
|
+
var darknessStyle = 'width:' + width + 'px;' +
|
438
|
+
'height:' + height + 'px;' +
|
439
|
+
commentHidden;
|
440
|
+
cssSet( darkness, darknessStyle );
|
441
|
+
}
|
442
|
+
|
443
|
+
win.jsm.resize = resize;
|
444
|
+
|
445
|
+
/*
|
446
|
+
Resize can be called an absurd amount of times
|
447
|
+
and will crash the page without debouncing.
|
448
|
+
http://benalman.com/projects/jquery-throttle-debounce-plugin/
|
449
|
+
https://github.com/cowboy/jquery-throttle-debounce
|
450
|
+
http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
451
|
+
*/
|
452
|
+
$( win ).resize( $.debounce( 100, resize ) );
|
453
|
+
|
454
|
+
// resize for the intial page load
|
455
|
+
resize();
|
456
|
+
});
|