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,171 @@
|
|
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
|
+
* Harutyun Amirjanyan <amirjanyan AT gmail DOT com>
|
24
|
+
*
|
25
|
+
* Alternatively, the contents of this file may be used under the terms of
|
26
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
27
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
28
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
29
|
+
* of those above. If you wish to allow use of your version of this file only
|
30
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
31
|
+
* use your version of this file under the terms of the MPL, indicate your
|
32
|
+
* decision by deleting the provisions above and replace them with the notice
|
33
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
34
|
+
* the provisions above, a recipient may use your version of this file under
|
35
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
36
|
+
*
|
37
|
+
* ***** END LICENSE BLOCK ***** */
|
38
|
+
|
39
|
+
if (typeof process !== "undefined") {
|
40
|
+
require("amd-loader");
|
41
|
+
}
|
42
|
+
|
43
|
+
define(function(require, exports, module) {
|
44
|
+
"use strict";
|
45
|
+
|
46
|
+
var EditSession = require("./edit_session").EditSession;
|
47
|
+
var Editor = require("./editor").Editor;
|
48
|
+
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
49
|
+
var Range = require("./range").Range;
|
50
|
+
var assert = require("./test/assertions");
|
51
|
+
var MultiSelect = require("./multi_select").MultiSelect;
|
52
|
+
|
53
|
+
var editor
|
54
|
+
var exec = function(name, times, args) {
|
55
|
+
do {
|
56
|
+
editor.commands.exec(name, editor, args);
|
57
|
+
} while(times --> 1)
|
58
|
+
};
|
59
|
+
var testRanges = function(str) {
|
60
|
+
assert.equal(editor.selection.getAllRanges() + "", str + "");
|
61
|
+
}
|
62
|
+
|
63
|
+
module.exports = {
|
64
|
+
|
65
|
+
name: "ACE multi_select.js",
|
66
|
+
|
67
|
+
"test: multiselect editing": function() {
|
68
|
+
var doc = new EditSession([
|
69
|
+
"w1.w2",
|
70
|
+
" wtt.w",
|
71
|
+
" wtt.w"
|
72
|
+
]);
|
73
|
+
editor = new Editor(new MockRenderer(), doc);
|
74
|
+
MultiSelect(editor);
|
75
|
+
|
76
|
+
editor.navigateFileEnd();
|
77
|
+
exec("selectMoreBefore", 3);
|
78
|
+
assert.ok(editor.inMultiSelectMode);
|
79
|
+
assert.equal(editor.selection.getAllRanges().length, 4);
|
80
|
+
|
81
|
+
var newLine = editor.session.getDocument().getNewLineCharacter();
|
82
|
+
var copyText = "wwww".split("").join(newLine);
|
83
|
+
assert.equal(editor.getCopyText(), copyText);
|
84
|
+
exec("insertstring", 1, "a");
|
85
|
+
exec("backspace", 2);
|
86
|
+
assert.equal(editor.session.getValue(), "w1.w2\ntt\ntt");
|
87
|
+
assert.equal(editor.selection.getAllRanges().length, 4);
|
88
|
+
|
89
|
+
exec("selectall");
|
90
|
+
assert.ok(!editor.inMultiSelectMode);
|
91
|
+
//assert.equal(editor.selection.getAllRanges().length, 1);
|
92
|
+
},
|
93
|
+
|
94
|
+
"test: multiselect navigation": function() {
|
95
|
+
var doc = new EditSession([
|
96
|
+
"w1.w2",
|
97
|
+
" wtt.w",
|
98
|
+
" wtt.we"
|
99
|
+
]);
|
100
|
+
editor = new Editor(new MockRenderer(), doc);
|
101
|
+
MultiSelect(editor);
|
102
|
+
|
103
|
+
editor.selectMoreLines(1);
|
104
|
+
testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]");
|
105
|
+
assert.ok(editor.inMultiSelectMode);
|
106
|
+
|
107
|
+
exec("golinedown");
|
108
|
+
exec("gotolineend");
|
109
|
+
testRanges("Range: [1/9] -> [1/9],Range: [2/10] -> [2/10]");
|
110
|
+
exec("selectwordleft");
|
111
|
+
|
112
|
+
testRanges("Range: [1/8] -> [1/9],Range: [2/8] -> [2/10]");
|
113
|
+
exec("golinedown", 2);
|
114
|
+
assert.ok(!editor.inMultiSelectMode);
|
115
|
+
},
|
116
|
+
|
117
|
+
"test: multiselect session change": function() {
|
118
|
+
var doc = new EditSession([
|
119
|
+
"w1.w2",
|
120
|
+
" wtt.w",
|
121
|
+
" wtt.w"
|
122
|
+
]);
|
123
|
+
editor = new Editor(new MockRenderer(), doc);
|
124
|
+
MultiSelect(editor);
|
125
|
+
|
126
|
+
editor.selectMoreLines(1)
|
127
|
+
testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]");
|
128
|
+
assert.ok(editor.inMultiSelectMode);
|
129
|
+
|
130
|
+
var doc2 = new EditSession(["w1"]);
|
131
|
+
editor.setSession(doc2);
|
132
|
+
assert.ok(!editor.inMultiSelectMode);
|
133
|
+
|
134
|
+
editor.setSession(doc);
|
135
|
+
assert.ok(editor.inMultiSelectMode);
|
136
|
+
},
|
137
|
+
|
138
|
+
"test: multiselect addRange": function() {
|
139
|
+
var doc = new EditSession([
|
140
|
+
"w1.w2",
|
141
|
+
" wtt.w",
|
142
|
+
" wtt.w"
|
143
|
+
]);
|
144
|
+
editor = new Editor(new MockRenderer(), doc);
|
145
|
+
MultiSelect(editor);
|
146
|
+
var selection = editor.selection;
|
147
|
+
|
148
|
+
var range1 = new Range(0, 2, 0, 4);
|
149
|
+
editor.selection.fromOrientedRange(range1);
|
150
|
+
|
151
|
+
var range2 = new Range(0, 3, 0, 4);
|
152
|
+
selection.addRange(range2);
|
153
|
+
assert.ok(!editor.inMultiSelectMode);
|
154
|
+
assert.ok(range2.isEqual(editor.selection.getRange()));
|
155
|
+
|
156
|
+
var range3 = new Range(0, 1, 0, 1);
|
157
|
+
selection.addRange(range3);
|
158
|
+
assert.ok(editor.inMultiSelectMode);
|
159
|
+
testRanges([range3, range2]);
|
160
|
+
|
161
|
+
var range4 = new Range(0, 0, 4, 0);
|
162
|
+
selection.addRange(range4);
|
163
|
+
assert.ok(!editor.inMultiSelectMode);
|
164
|
+
}
|
165
|
+
};
|
166
|
+
|
167
|
+
});
|
168
|
+
|
169
|
+
if (typeof module !== "undefined" && module === require.main) {
|
170
|
+
require("asyncjs").test.testcase(module.exports).exec()
|
171
|
+
}
|
@@ -0,0 +1,696 @@
|
|
1
|
+
/* vim: set sw=4 ts=4 et tw=78: */
|
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 the Narcissus JavaScript engine.
|
16
|
+
*
|
17
|
+
* The Initial Developer of the Original Code is
|
18
|
+
* Brendan Eich <brendan@mozilla.org>.
|
19
|
+
* Portions created by the Initial Developer are Copyright (C) 2004
|
20
|
+
* the Initial Developer. All Rights Reserved.
|
21
|
+
*
|
22
|
+
* Contributor(s):
|
23
|
+
* Tom Austin <taustin@ucsc.edu>
|
24
|
+
* Brendan Eich <brendan@mozilla.org>
|
25
|
+
* Shu-Yu Guo <shu@rfrn.org>
|
26
|
+
* Dave Herman <dherman@mozilla.com>
|
27
|
+
* Dimitris Vardoulakis <dimvar@ccs.neu.edu>
|
28
|
+
* Patrick Walton <pcwalton@mozilla.com>
|
29
|
+
*
|
30
|
+
* Alternatively, the contents of this file may be used under the terms of
|
31
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
32
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
33
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
34
|
+
* of those above. If you wish to allow use of your version of this file only
|
35
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
36
|
+
* use your version of this file under the terms of the MPL, indicate your
|
37
|
+
* decision by deleting the provisions above and replace them with the notice
|
38
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
39
|
+
* the provisions above, a recipient may use your version of this file under
|
40
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
41
|
+
*
|
42
|
+
* ***** END LICENSE BLOCK ***** */
|
43
|
+
|
44
|
+
/*
|
45
|
+
* Narcissus - JS implemented in JS.
|
46
|
+
*
|
47
|
+
* Well-known constants and lookup tables. Many consts are generated from the
|
48
|
+
* tokens table via eval to minimize redundancy, so consumers must be compiled
|
49
|
+
* separately to take advantage of the simple switch-case constant propagation
|
50
|
+
* done by SpiderMonkey.
|
51
|
+
*/
|
52
|
+
|
53
|
+
define(function(require, exports, module) {
|
54
|
+
|
55
|
+
var tokens = [
|
56
|
+
// End of source.
|
57
|
+
"END",
|
58
|
+
|
59
|
+
// Operators and punctuators. Some pair-wise order matters, e.g. (+, -)
|
60
|
+
// and (UNARY_PLUS, UNARY_MINUS).
|
61
|
+
"\n", ";",
|
62
|
+
",",
|
63
|
+
"=",
|
64
|
+
"?", ":", "CONDITIONAL",
|
65
|
+
"||",
|
66
|
+
"&&",
|
67
|
+
"|",
|
68
|
+
"^",
|
69
|
+
"&",
|
70
|
+
"==", "!=", "===", "!==",
|
71
|
+
"<", "<=", ">=", ">",
|
72
|
+
"<<", ">>", ">>>",
|
73
|
+
"+", "-",
|
74
|
+
"*", "/", "%",
|
75
|
+
"!", "~", "UNARY_PLUS", "UNARY_MINUS",
|
76
|
+
"++", "--",
|
77
|
+
".",
|
78
|
+
"[", "]",
|
79
|
+
"{", "}",
|
80
|
+
"(", ")",
|
81
|
+
|
82
|
+
// Nonterminal tree node type codes.
|
83
|
+
"SCRIPT", "BLOCK", "LABEL", "FOR_IN", "CALL", "NEW_WITH_ARGS", "INDEX",
|
84
|
+
"ARRAY_INIT", "OBJECT_INIT", "PROPERTY_INIT", "GETTER", "SETTER",
|
85
|
+
"GROUP", "LIST", "LET_BLOCK", "ARRAY_COMP", "GENERATOR", "COMP_TAIL",
|
86
|
+
|
87
|
+
// Contextual keywords.
|
88
|
+
"IMPLEMENTS", "INTERFACE", "LET", "MODULE", "PACKAGE", "PRIVATE",
|
89
|
+
"PROTECTED", "PUBLIC", "STATIC", "USE", "YIELD",
|
90
|
+
|
91
|
+
// Terminals.
|
92
|
+
"IDENTIFIER", "NUMBER", "STRING", "REGEXP",
|
93
|
+
|
94
|
+
// Keywords.
|
95
|
+
"break",
|
96
|
+
"case", "catch", "const", "continue",
|
97
|
+
"debugger", "default", "delete", "do",
|
98
|
+
"else", "export",
|
99
|
+
"false", "finally", "for", "function",
|
100
|
+
"if", "import", "in", "instanceof",
|
101
|
+
"new", "null",
|
102
|
+
"return",
|
103
|
+
"switch",
|
104
|
+
"this", "throw", "true", "try", "typeof",
|
105
|
+
"var", "void",
|
106
|
+
"while", "with",
|
107
|
+
];
|
108
|
+
|
109
|
+
var strictKeywords = {
|
110
|
+
__proto__: null,
|
111
|
+
"implements": true,
|
112
|
+
"interface": true,
|
113
|
+
"let": true,
|
114
|
+
//"module": true,
|
115
|
+
"package": true,
|
116
|
+
"private": true,
|
117
|
+
"protected": true,
|
118
|
+
"public": true,
|
119
|
+
"static": true,
|
120
|
+
"use": true,
|
121
|
+
"yield": true
|
122
|
+
};
|
123
|
+
|
124
|
+
var statementStartTokens = [
|
125
|
+
"break",
|
126
|
+
"const", "continue",
|
127
|
+
"debugger", "do",
|
128
|
+
"for",
|
129
|
+
"if",
|
130
|
+
"let",
|
131
|
+
"return",
|
132
|
+
"switch",
|
133
|
+
"throw", "try",
|
134
|
+
"var",
|
135
|
+
"yield",
|
136
|
+
"while", "with",
|
137
|
+
];
|
138
|
+
|
139
|
+
// Whitespace characters (see ECMA-262 7.2)
|
140
|
+
var whitespaceChars = [
|
141
|
+
// normal whitespace:
|
142
|
+
"\u0009", "\u000B", "\u000C", "\u0020", "\u00A0", "\uFEFF",
|
143
|
+
|
144
|
+
// high-Unicode whitespace:
|
145
|
+
"\u1680", "\u180E",
|
146
|
+
"\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006",
|
147
|
+
"\u2007", "\u2008", "\u2009", "\u200A",
|
148
|
+
"\u202F", "\u205F", "\u3000"
|
149
|
+
];
|
150
|
+
|
151
|
+
var whitespace = {};
|
152
|
+
for (var i = 0; i < whitespaceChars.length; i++) {
|
153
|
+
whitespace[whitespaceChars[i]] = true;
|
154
|
+
}
|
155
|
+
|
156
|
+
// Operator and punctuator mapping from token to tree node type name.
|
157
|
+
// NB: because the lexer doesn't backtrack, all token prefixes must themselves
|
158
|
+
// be valid tokens (e.g. !== is acceptable because its prefixes are the valid
|
159
|
+
// tokens != and !).
|
160
|
+
var opTypeNames = {
|
161
|
+
'\n': "NEWLINE",
|
162
|
+
';': "SEMICOLON",
|
163
|
+
',': "COMMA",
|
164
|
+
'?': "HOOK",
|
165
|
+
':': "COLON",
|
166
|
+
'||': "OR",
|
167
|
+
'&&': "AND",
|
168
|
+
'|': "BITWISE_OR",
|
169
|
+
'^': "BITWISE_XOR",
|
170
|
+
'&': "BITWISE_AND",
|
171
|
+
'===': "STRICT_EQ",
|
172
|
+
'==': "EQ",
|
173
|
+
'=': "ASSIGN",
|
174
|
+
'!==': "STRICT_NE",
|
175
|
+
'!=': "NE",
|
176
|
+
'<<': "LSH",
|
177
|
+
'<=': "LE",
|
178
|
+
'<': "LT",
|
179
|
+
'>>>': "URSH",
|
180
|
+
'>>': "RSH",
|
181
|
+
'>=': "GE",
|
182
|
+
'>': "GT",
|
183
|
+
'++': "INCREMENT",
|
184
|
+
'--': "DECREMENT",
|
185
|
+
'+': "PLUS",
|
186
|
+
'-': "MINUS",
|
187
|
+
'*': "MUL",
|
188
|
+
'/': "DIV",
|
189
|
+
'%': "MOD",
|
190
|
+
'!': "NOT",
|
191
|
+
'~': "BITWISE_NOT",
|
192
|
+
'.': "DOT",
|
193
|
+
'[': "LEFT_BRACKET",
|
194
|
+
']': "RIGHT_BRACKET",
|
195
|
+
'{': "LEFT_CURLY",
|
196
|
+
'}': "RIGHT_CURLY",
|
197
|
+
'(': "LEFT_PAREN",
|
198
|
+
')': "RIGHT_PAREN"
|
199
|
+
};
|
200
|
+
|
201
|
+
// Hash of keyword identifier to tokens index. NB: we must null __proto__ to
|
202
|
+
// avoid toString, etc. namespace pollution.
|
203
|
+
var keywords = {__proto__: null};
|
204
|
+
var mozillaKeywords = {__proto__: null};
|
205
|
+
|
206
|
+
// Define const END, etc., based on the token names. Also map name to index.
|
207
|
+
var tokenIds = {};
|
208
|
+
|
209
|
+
var hostSupportsEvalConst = (function() {
|
210
|
+
try {
|
211
|
+
return eval("(function(s) { eval(s); return x })('const x = true;')");
|
212
|
+
} catch (e) {
|
213
|
+
return false;
|
214
|
+
}
|
215
|
+
})();
|
216
|
+
|
217
|
+
// Building up a string to be eval'd in different contexts.
|
218
|
+
var consts = hostSupportsEvalConst ? "const " : "var ";
|
219
|
+
for (var i = 0, j = tokens.length; i < j; i++) {
|
220
|
+
if (i > 0)
|
221
|
+
consts += ", ";
|
222
|
+
var t = tokens[i];
|
223
|
+
var name;
|
224
|
+
if (/^[a-z]/.test(t)) {
|
225
|
+
name = t.toUpperCase();
|
226
|
+
if (name === "LET" || name === "YIELD")
|
227
|
+
mozillaKeywords[name] = i;
|
228
|
+
if (strictKeywords[name])
|
229
|
+
strictKeywords[name] = i;
|
230
|
+
keywords[t] = i;
|
231
|
+
} else {
|
232
|
+
name = (/^\W/.test(t) ? opTypeNames[t] : t);
|
233
|
+
}
|
234
|
+
consts += name + " = " + i;
|
235
|
+
tokenIds[name] = i;
|
236
|
+
tokens[t] = i;
|
237
|
+
}
|
238
|
+
consts += ";";
|
239
|
+
|
240
|
+
var isStatementStartCode = {__proto__: null};
|
241
|
+
for (i = 0, j = statementStartTokens.length; i < j; i++)
|
242
|
+
isStatementStartCode[keywords[statementStartTokens[i]]] = true;
|
243
|
+
|
244
|
+
// Map assignment operators to their indexes in the tokens array.
|
245
|
+
var assignOps = ['|', '^', '&', '<<', '>>', '>>>', '+', '-', '*', '/', '%'];
|
246
|
+
|
247
|
+
for (i = 0, j = assignOps.length; i < j; i++) {
|
248
|
+
t = assignOps[i];
|
249
|
+
assignOps[t] = tokens[t];
|
250
|
+
}
|
251
|
+
|
252
|
+
function defineGetter(obj, prop, fn, dontDelete, dontEnum) {
|
253
|
+
Object.defineProperty(obj, prop,
|
254
|
+
{ get: fn, configurable: !dontDelete, enumerable: !dontEnum });
|
255
|
+
}
|
256
|
+
|
257
|
+
function defineGetterSetter(obj, prop, getter, setter, dontDelete, dontEnum) {
|
258
|
+
Object.defineProperty(obj, prop, {
|
259
|
+
get: getter,
|
260
|
+
set: setter,
|
261
|
+
configurable: !dontDelete,
|
262
|
+
enumerable: !dontEnum
|
263
|
+
});
|
264
|
+
}
|
265
|
+
|
266
|
+
function defineMemoGetter(obj, prop, fn, dontDelete, dontEnum) {
|
267
|
+
Object.defineProperty(obj, prop, {
|
268
|
+
get: function() {
|
269
|
+
var val = fn();
|
270
|
+
defineProperty(obj, prop, val, dontDelete, true, dontEnum);
|
271
|
+
return val;
|
272
|
+
},
|
273
|
+
configurable: true,
|
274
|
+
enumerable: !dontEnum
|
275
|
+
});
|
276
|
+
}
|
277
|
+
|
278
|
+
function defineProperty(obj, prop, val, dontDelete, readOnly, dontEnum) {
|
279
|
+
Object.defineProperty(obj, prop,
|
280
|
+
{ value: val, writable: !readOnly, configurable: !dontDelete,
|
281
|
+
enumerable: !dontEnum });
|
282
|
+
}
|
283
|
+
|
284
|
+
// Returns true if fn is a native function. (Note: SpiderMonkey specific.)
|
285
|
+
function isNativeCode(fn) {
|
286
|
+
// Relies on the toString method to identify native code.
|
287
|
+
return ((typeof fn) === "function") && fn.toString().match(/\[native code\]/);
|
288
|
+
}
|
289
|
+
|
290
|
+
var Fpapply = Function.prototype.apply;
|
291
|
+
|
292
|
+
function apply(f, o, a) {
|
293
|
+
return Fpapply.call(f, [o].concat(a));
|
294
|
+
}
|
295
|
+
|
296
|
+
var applyNew;
|
297
|
+
|
298
|
+
// ES5's bind is a simpler way to implement applyNew
|
299
|
+
if (Function.prototype.bind) {
|
300
|
+
applyNew = function applyNew(f, a) {
|
301
|
+
return new (f.bind.apply(f, [,].concat(Array.prototype.slice.call(a))))();
|
302
|
+
};
|
303
|
+
} else {
|
304
|
+
applyNew = function applyNew(f, a) {
|
305
|
+
switch (a.length) {
|
306
|
+
case 0:
|
307
|
+
return new f();
|
308
|
+
case 1:
|
309
|
+
return new f(a[0]);
|
310
|
+
case 2:
|
311
|
+
return new f(a[0], a[1]);
|
312
|
+
case 3:
|
313
|
+
return new f(a[0], a[1], a[2]);
|
314
|
+
default:
|
315
|
+
var argStr = "a[0]";
|
316
|
+
for (var i = 1, n = a.length; i < n; i++)
|
317
|
+
argStr += ",a[" + i + "]";
|
318
|
+
return eval("new f(" + argStr + ")");
|
319
|
+
}
|
320
|
+
};
|
321
|
+
}
|
322
|
+
|
323
|
+
function getPropertyDescriptor(obj, name) {
|
324
|
+
while (obj) {
|
325
|
+
if (({}).hasOwnProperty.call(obj, name))
|
326
|
+
return Object.getOwnPropertyDescriptor(obj, name);
|
327
|
+
obj = Object.getPrototypeOf(obj);
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
331
|
+
function getPropertyNames(obj) {
|
332
|
+
var table = Object.create(null, {});
|
333
|
+
while (obj) {
|
334
|
+
var names = Object.getOwnPropertyNames(obj);
|
335
|
+
for (var i = 0, n = names.length; i < n; i++)
|
336
|
+
table[names[i]] = true;
|
337
|
+
obj = Object.getPrototypeOf(obj);
|
338
|
+
}
|
339
|
+
return Object.keys(table);
|
340
|
+
}
|
341
|
+
|
342
|
+
function getOwnProperties(obj) {
|
343
|
+
var map = {};
|
344
|
+
for (var name in Object.getOwnPropertyNames(obj))
|
345
|
+
map[name] = Object.getOwnPropertyDescriptor(obj, name);
|
346
|
+
return map;
|
347
|
+
}
|
348
|
+
|
349
|
+
function blacklistHandler(target, blacklist) {
|
350
|
+
var mask = Object.create(null, {});
|
351
|
+
var redirect = Dict.create(blacklist).mapObject(function(name) { return mask; });
|
352
|
+
return mixinHandler(redirect, target);
|
353
|
+
}
|
354
|
+
|
355
|
+
function whitelistHandler(target, whitelist) {
|
356
|
+
var catchall = Object.create(null, {});
|
357
|
+
var redirect = Dict.create(whitelist).mapObject(function(name) { return target; });
|
358
|
+
return mixinHandler(redirect, catchall);
|
359
|
+
}
|
360
|
+
|
361
|
+
/*
|
362
|
+
* Mixin proxies break the single-inheritance model of prototypes, so
|
363
|
+
* the handler treats all properties as own-properties:
|
364
|
+
*
|
365
|
+
* X
|
366
|
+
* |
|
367
|
+
* +------------+------------+
|
368
|
+
* | O |
|
369
|
+
* | | |
|
370
|
+
* | O O O |
|
371
|
+
* | | | | |
|
372
|
+
* | O O O O |
|
373
|
+
* | | | | | |
|
374
|
+
* | O O O O O |
|
375
|
+
* | | | | | | |
|
376
|
+
* +-(*)--(w)--(x)--(y)--(z)-+
|
377
|
+
*/
|
378
|
+
|
379
|
+
function mixinHandler(redirect, catchall) {
|
380
|
+
function targetFor(name) {
|
381
|
+
return hasOwn(redirect, name) ? redirect[name] : catchall;
|
382
|
+
}
|
383
|
+
|
384
|
+
function getMuxPropertyDescriptor(name) {
|
385
|
+
var desc = getPropertyDescriptor(targetFor(name), name);
|
386
|
+
if (desc)
|
387
|
+
desc.configurable = true;
|
388
|
+
return desc;
|
389
|
+
}
|
390
|
+
|
391
|
+
function getMuxPropertyNames() {
|
392
|
+
var names1 = Object.getOwnPropertyNames(redirect).filter(function(name) {
|
393
|
+
return name in redirect[name];
|
394
|
+
});
|
395
|
+
var names2 = getPropertyNames(catchall).filter(function(name) {
|
396
|
+
return !hasOwn(redirect, name);
|
397
|
+
});
|
398
|
+
return names1.concat(names2);
|
399
|
+
}
|
400
|
+
|
401
|
+
function enumerateMux() {
|
402
|
+
var result = Object.getOwnPropertyNames(redirect).filter(function(name) {
|
403
|
+
return name in redirect[name];
|
404
|
+
});
|
405
|
+
for (name in catchall) {
|
406
|
+
if (!hasOwn(redirect, name))
|
407
|
+
result.push(name);
|
408
|
+
};
|
409
|
+
return result;
|
410
|
+
}
|
411
|
+
|
412
|
+
function hasMux(name) {
|
413
|
+
return name in targetFor(name);
|
414
|
+
}
|
415
|
+
|
416
|
+
return {
|
417
|
+
getOwnPropertyDescriptor: getMuxPropertyDescriptor,
|
418
|
+
getPropertyDescriptor: getMuxPropertyDescriptor,
|
419
|
+
getOwnPropertyNames: getMuxPropertyNames,
|
420
|
+
defineProperty: function(name, desc) {
|
421
|
+
Object.defineProperty(targetFor(name), name, desc);
|
422
|
+
},
|
423
|
+
"delete": function(name) {
|
424
|
+
var target = targetFor(name);
|
425
|
+
return delete target[name];
|
426
|
+
},
|
427
|
+
// FIXME: ha ha ha
|
428
|
+
fix: function() { },
|
429
|
+
has: hasMux,
|
430
|
+
hasOwn: hasMux,
|
431
|
+
get: function(receiver, name) {
|
432
|
+
var target = targetFor(name);
|
433
|
+
return target[name];
|
434
|
+
},
|
435
|
+
set: function(receiver, name, val) {
|
436
|
+
var target = targetFor(name);
|
437
|
+
target[name] = val;
|
438
|
+
return true;
|
439
|
+
},
|
440
|
+
enumerate: enumerateMux,
|
441
|
+
keys: enumerateMux
|
442
|
+
};
|
443
|
+
}
|
444
|
+
|
445
|
+
function makePassthruHandler(obj) {
|
446
|
+
// Handler copied from
|
447
|
+
// http://wiki.ecmascript.org/doku.php?id=harmony:proxies&s=proxy%20object#examplea_no-op_forwarding_proxy
|
448
|
+
return {
|
449
|
+
getOwnPropertyDescriptor: function(name) {
|
450
|
+
var desc = Object.getOwnPropertyDescriptor(obj, name);
|
451
|
+
|
452
|
+
// a trapping proxy's properties must always be configurable
|
453
|
+
desc.configurable = true;
|
454
|
+
return desc;
|
455
|
+
},
|
456
|
+
getPropertyDescriptor: function(name) {
|
457
|
+
var desc = getPropertyDescriptor(obj, name);
|
458
|
+
|
459
|
+
// a trapping proxy's properties must always be configurable
|
460
|
+
desc.configurable = true;
|
461
|
+
return desc;
|
462
|
+
},
|
463
|
+
getOwnPropertyNames: function() {
|
464
|
+
return Object.getOwnPropertyNames(obj);
|
465
|
+
},
|
466
|
+
defineProperty: function(name, desc) {
|
467
|
+
Object.defineProperty(obj, name, desc);
|
468
|
+
},
|
469
|
+
"delete": function(name) { return delete obj[name]; },
|
470
|
+
fix: function() {
|
471
|
+
if (Object.isFrozen(obj)) {
|
472
|
+
return getOwnProperties(obj);
|
473
|
+
}
|
474
|
+
|
475
|
+
// As long as obj is not frozen, the proxy won't allow itself to be fixed.
|
476
|
+
return undefined; // will cause a TypeError to be thrown
|
477
|
+
},
|
478
|
+
|
479
|
+
has: function(name) { return name in obj; },
|
480
|
+
hasOwn: function(name) { return ({}).hasOwnProperty.call(obj, name); },
|
481
|
+
get: function(receiver, name) { return obj[name]; },
|
482
|
+
|
483
|
+
// bad behavior when set fails in non-strict mode
|
484
|
+
set: function(receiver, name, val) { obj[name] = val; return true; },
|
485
|
+
enumerate: function() {
|
486
|
+
var result = [];
|
487
|
+
for (name in obj) { result.push(name); };
|
488
|
+
return result;
|
489
|
+
},
|
490
|
+
keys: function() { return Object.keys(obj); }
|
491
|
+
};
|
492
|
+
}
|
493
|
+
|
494
|
+
var hasOwnProperty = ({}).hasOwnProperty;
|
495
|
+
|
496
|
+
function hasOwn(obj, name) {
|
497
|
+
return hasOwnProperty.call(obj, name);
|
498
|
+
}
|
499
|
+
|
500
|
+
function Dict(table, size) {
|
501
|
+
this.table = table || Object.create(null, {});
|
502
|
+
this.size = size || 0;
|
503
|
+
}
|
504
|
+
|
505
|
+
Dict.create = function(table) {
|
506
|
+
var init = Object.create(null, {});
|
507
|
+
var size = 0;
|
508
|
+
var names = Object.getOwnPropertyNames(table);
|
509
|
+
for (var i = 0, n = names.length; i < n; i++) {
|
510
|
+
var name = names[i];
|
511
|
+
init[name] = table[name];
|
512
|
+
size++;
|
513
|
+
}
|
514
|
+
return new Dict(init, size);
|
515
|
+
};
|
516
|
+
|
517
|
+
Dict.prototype = {
|
518
|
+
has: function(x) { return hasOwnProperty.call(this.table, x); },
|
519
|
+
set: function(x, v) {
|
520
|
+
if (!hasOwnProperty.call(this.table, x))
|
521
|
+
this.size++;
|
522
|
+
this.table[x] = v;
|
523
|
+
},
|
524
|
+
get: function(x) { return this.table[x]; },
|
525
|
+
getDef: function(x, thunk) {
|
526
|
+
if (!hasOwnProperty.call(this.table, x)) {
|
527
|
+
this.size++;
|
528
|
+
this.table[x] = thunk();
|
529
|
+
}
|
530
|
+
return this.table[x];
|
531
|
+
},
|
532
|
+
forEach: function(f) {
|
533
|
+
var table = this.table;
|
534
|
+
for (var key in table)
|
535
|
+
f.call(this, key, table[key]);
|
536
|
+
},
|
537
|
+
map: function(f) {
|
538
|
+
var table1 = this.table;
|
539
|
+
var table2 = Object.create(null, {});
|
540
|
+
this.forEach(function(key, val) {
|
541
|
+
table2[key] = f.call(this, val, key);
|
542
|
+
});
|
543
|
+
return new Dict(table2, this.size);
|
544
|
+
},
|
545
|
+
mapObject: function(f) {
|
546
|
+
var table1 = this.table;
|
547
|
+
var table2 = Object.create(null, {});
|
548
|
+
this.forEach(function(key, val) {
|
549
|
+
table2[key] = f.call(this, val, key);
|
550
|
+
});
|
551
|
+
return table2;
|
552
|
+
},
|
553
|
+
toObject: function() {
|
554
|
+
return this.mapObject(function(val) { return val; });
|
555
|
+
},
|
556
|
+
choose: function() {
|
557
|
+
return Object.getOwnPropertyNames(this.table)[0];
|
558
|
+
},
|
559
|
+
remove: function(x) {
|
560
|
+
if (hasOwnProperty.call(this.table, x)) {
|
561
|
+
this.size--;
|
562
|
+
delete this.table[x];
|
563
|
+
}
|
564
|
+
},
|
565
|
+
copy: function() {
|
566
|
+
var table = Object.create(null, {});
|
567
|
+
for (var key in this.table)
|
568
|
+
table[key] = this.table[key];
|
569
|
+
return new Dict(table, this.size);
|
570
|
+
},
|
571
|
+
keys: function() {
|
572
|
+
return Object.keys(this.table);
|
573
|
+
},
|
574
|
+
toString: function() { return "[object Dict]" }
|
575
|
+
};
|
576
|
+
|
577
|
+
var _WeakMap = typeof WeakMap === "function" ? WeakMap : (function() {
|
578
|
+
// shim for ES6 WeakMap with poor asymptotics
|
579
|
+
function WeakMap(array) {
|
580
|
+
this.array = array || [];
|
581
|
+
}
|
582
|
+
|
583
|
+
function searchMap(map, key, found, notFound) {
|
584
|
+
var a = map.array;
|
585
|
+
for (var i = 0, n = a.length; i < n; i++) {
|
586
|
+
var pair = a[i];
|
587
|
+
if (pair.key === key)
|
588
|
+
return found(pair, i);
|
589
|
+
}
|
590
|
+
return notFound();
|
591
|
+
}
|
592
|
+
|
593
|
+
WeakMap.prototype = {
|
594
|
+
has: function(x) {
|
595
|
+
return searchMap(this, x, function() { return true }, function() { return false });
|
596
|
+
},
|
597
|
+
set: function(x, v) {
|
598
|
+
var a = this.array;
|
599
|
+
searchMap(this, x,
|
600
|
+
function(pair) { pair.value = v },
|
601
|
+
function() { a.push({ key: x, value: v }) });
|
602
|
+
},
|
603
|
+
get: function(x) {
|
604
|
+
return searchMap(this, x,
|
605
|
+
function(pair) { return pair.value },
|
606
|
+
function() { return null });
|
607
|
+
},
|
608
|
+
"delete": function(x) {
|
609
|
+
var a = this.array;
|
610
|
+
searchMap(this, x,
|
611
|
+
function(pair, i) { a.splice(i, 1) },
|
612
|
+
function() { });
|
613
|
+
},
|
614
|
+
toString: function() { return "[object WeakMap]" }
|
615
|
+
};
|
616
|
+
|
617
|
+
return WeakMap;
|
618
|
+
})();
|
619
|
+
|
620
|
+
// non-destructive stack
|
621
|
+
function Stack(elts) {
|
622
|
+
this.elts = elts || null;
|
623
|
+
}
|
624
|
+
|
625
|
+
Stack.prototype = {
|
626
|
+
push: function(x) {
|
627
|
+
return new Stack({ top: x, rest: this.elts });
|
628
|
+
},
|
629
|
+
top: function() {
|
630
|
+
if (!this.elts)
|
631
|
+
throw new Error("empty stack");
|
632
|
+
return this.elts.top;
|
633
|
+
},
|
634
|
+
isEmpty: function() {
|
635
|
+
return this.top === null;
|
636
|
+
},
|
637
|
+
find: function(test) {
|
638
|
+
for (var elts = this.elts; elts; elts = elts.rest) {
|
639
|
+
if (test(elts.top))
|
640
|
+
return elts.top;
|
641
|
+
}
|
642
|
+
return null;
|
643
|
+
},
|
644
|
+
has: function(x) {
|
645
|
+
return Boolean(this.find(function(elt) { return elt === x }));
|
646
|
+
},
|
647
|
+
forEach: function(f) {
|
648
|
+
for (var elts = this.elts; elts; elts = elts.rest) {
|
649
|
+
f(elts.top);
|
650
|
+
}
|
651
|
+
}
|
652
|
+
};
|
653
|
+
|
654
|
+
if (!Array.prototype.copy) {
|
655
|
+
defineProperty(Array.prototype, "copy",
|
656
|
+
function() {
|
657
|
+
var result = [];
|
658
|
+
for (var i = 0, n = this.length; i < n; i++)
|
659
|
+
result[i] = this[i];
|
660
|
+
return result;
|
661
|
+
}, false, false, true);
|
662
|
+
}
|
663
|
+
|
664
|
+
if (!Array.prototype.top) {
|
665
|
+
defineProperty(Array.prototype, "top",
|
666
|
+
function() {
|
667
|
+
return this.length && this[this.length-1];
|
668
|
+
}, false, false, true);
|
669
|
+
}
|
670
|
+
|
671
|
+
exports.tokens = tokens;
|
672
|
+
exports.whitespace = whitespace;
|
673
|
+
exports.opTypeNames = opTypeNames;
|
674
|
+
exports.keywords = keywords;
|
675
|
+
exports.mozillaKeywords = mozillaKeywords;
|
676
|
+
exports.strictKeywords = strictKeywords;
|
677
|
+
exports.isStatementStartCode = isStatementStartCode;
|
678
|
+
exports.tokenIds = tokenIds;
|
679
|
+
exports.consts = consts;
|
680
|
+
exports.assignOps = assignOps;
|
681
|
+
exports.defineGetter = defineGetter;
|
682
|
+
exports.defineGetterSetter = defineGetterSetter;
|
683
|
+
exports.defineMemoGetter = defineMemoGetter;
|
684
|
+
exports.defineProperty = defineProperty;
|
685
|
+
exports.isNativeCode = isNativeCode;
|
686
|
+
exports.apply = apply;
|
687
|
+
exports.applyNew = applyNew;
|
688
|
+
exports.mixinHandler = mixinHandler;
|
689
|
+
exports.whitelistHandler = whitelistHandler;
|
690
|
+
exports.blacklistHandler = blacklistHandler;
|
691
|
+
exports.makePassthruHandler = makePassthruHandler;
|
692
|
+
exports.Dict = Dict;
|
693
|
+
exports.WeakMap = _WeakMap;
|
694
|
+
exports.Stack = Stack;
|
695
|
+
|
696
|
+
});
|