mdbe 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/app.rb +182 -0
- data/bin/mdbe +5 -0
- data/config.ru +2 -0
- data/environment.rb +8 -0
- data/lib/mdbe.rb +39 -0
- data/lib/mdbe/action_controller_debug_patch.rb +12 -0
- data/lib/mdbe/code_evaluation.rb +46 -0
- data/lib/mdbe/database_views.rb +24 -0
- data/lib/mdbe/database_views/abstract_dictionary.rb +69 -0
- data/lib/mdbe/database_views/abstract_exception.rb +25 -0
- data/lib/mdbe/database_views/array.rb +28 -0
- data/lib/mdbe/database_views/boolean.rb +12 -0
- data/lib/mdbe/database_views/class.rb +46 -0
- data/lib/mdbe/database_views/exception.rb +3 -0
- data/lib/mdbe/database_views/execblock.rb +5 -0
- data/lib/mdbe/database_views/fixnum.rb +5 -0
- data/lib/mdbe/database_views/float.rb +5 -0
- data/lib/mdbe/database_views/globals.rb +2 -0
- data/lib/mdbe/database_views/gsnmethod.rb +29 -0
- data/lib/mdbe/database_views/hash.rb +5 -0
- data/lib/mdbe/database_views/maglev_record.rb +42 -0
- data/lib/mdbe/database_views/module.rb +103 -0
- data/lib/mdbe/database_views/nilclass.rb +5 -0
- data/lib/mdbe/database_views/object.rb +80 -0
- data/lib/mdbe/database_views/proc.rb +3 -0
- data/lib/mdbe/database_views/repository.rb +3 -0
- data/lib/mdbe/database_views/ruby_workspace.rb +5 -0
- data/lib/mdbe/database_views/smalltalk_classes.rb +34 -0
- data/lib/mdbe/database_views/smalltalk_classes.st +60 -0
- data/lib/mdbe/database_views/string.rb +31 -0
- data/lib/mdbe/database_views/symbol.rb +32 -0
- data/lib/mdbe/database_views/system.rb +61 -0
- data/lib/mdbe/database_views/thread.rb +101 -0
- data/lib/mdbe/debug_server.rb +22 -0
- data/lib/mdbe/halt.rb +42 -0
- data/lib/mdbe/ruby_workspace.rb +29 -0
- data/lib/mdbe/version.rb +3 -0
- data/lib/tasks/maglev-database-explorer_tasks.rake +4 -0
- data/public/LICENSE +35 -0
- data/public/amber/CHANGELOG +65 -0
- data/public/amber/LICENSE +22 -0
- data/public/amber/Makefile +53 -0
- data/public/amber/README.md +30 -0
- data/public/amber/bin/amber +3 -0
- data/public/amber/bin/amberc +352 -0
- data/public/amber/bin/nodecompile.js +33 -0
- data/public/amber/bin/server +3 -0
- data/public/amber/bin/server.bat +3 -0
- data/public/amber/css/amber-normalize.css +468 -0
- data/public/amber/css/amber-normalize.less +501 -0
- data/public/amber/css/amber.css +539 -0
- data/public/amber/css/documentation.css +84 -0
- data/public/amber/css/profstef.css +75 -0
- data/public/amber/css/style.css +313 -0
- data/public/amber/documentation.html +37 -0
- data/public/amber/examples/Makefile +23 -0
- data/public/amber/examples/README +4 -0
- data/public/amber/examples/android/helloamber/AndroidManifest.xml +19 -0
- data/public/amber/examples/android/helloamber/HelloAmber.st +13 -0
- data/public/amber/examples/android/helloamber/Makefile +56 -0
- data/public/amber/examples/android/helloamber/README.md +80 -0
- data/public/amber/examples/android/helloamber/ant.properties +17 -0
- data/public/amber/examples/android/helloamber/assets/index.html +15 -0
- data/public/amber/examples/android/helloamber/assets/jquery-1.7.2.min.js +4 -0
- data/public/amber/examples/android/helloamber/build.xml +83 -0
- data/public/amber/examples/android/helloamber/local.properties +10 -0
- data/public/amber/examples/android/helloamber/proguard-project.txt +20 -0
- data/public/amber/examples/android/helloamber/project.properties +14 -0
- data/public/amber/examples/android/helloamber/res/layout/main.xml +6 -0
- data/public/amber/examples/android/helloamber/res/values/strings.xml +4 -0
- data/public/amber/examples/android/helloamber/src/org/amberlang/android/helloamber/HelloAmber.java +59 -0
- data/public/amber/examples/myproject/index.html +16 -0
- data/public/amber/examples/nodejs/README +9 -0
- data/public/amber/examples/nodejs/benchfib/Benchfib.st +124 -0
- data/public/amber/examples/nodejs/benchfib/Makefile +8 -0
- data/public/amber/examples/nodejs/benchfib/benchfib +1 -0
- data/public/amber/examples/nodejs/hello/Hello.st +9 -0
- data/public/amber/examples/nodejs/hello/Makefile +8 -0
- data/public/amber/examples/nodejs/hello/README +13 -0
- data/public/amber/examples/nodejs/hello/hello +1 -0
- data/public/amber/examples/nodejs/meta/Makefile +8 -0
- data/public/amber/examples/nodejs/meta/MyScript.st +27 -0
- data/public/amber/examples/nodejs/meta/meta +1 -0
- data/public/amber/examples/nodejs/pystone/Makefile +8 -0
- data/public/amber/examples/nodejs/pystone/Pystone.st +306 -0
- data/public/amber/examples/nodejs/pystone/pystone +1 -0
- data/public/amber/examples/nodejs/trivialserver/Makefile +8 -0
- data/public/amber/examples/nodejs/trivialserver/TrivialServer.st +51 -0
- data/public/amber/examples/nodejs/trivialserver/trivial +1 -0
- data/public/amber/examples/presentation/esug2011/images/asterix.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_box.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/devices.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/enyo.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/ide_star_wars.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/terminal.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/webos.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/amber.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/ambrhino.jpg +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/pharo.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/php.gif +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/rails.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-next.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-prev.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/closedhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/openhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-back.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-forward.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.css +100 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.js +1232 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js +13 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.easing.1.3.js +38 -0
- data/public/amber/examples/presentation/index.html +17 -0
- data/public/amber/examples/presentation/js/Presentation.deploy.js +1922 -0
- data/public/amber/examples/presentation/js/Presentation.js +2712 -0
- data/public/amber/examples/presentation/st/Presentation.st +1996 -0
- data/public/amber/examples/trysmalltalk/index.html +18 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.deploy.js +837 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.js +1206 -0
- data/public/amber/examples/trysmalltalk/st/TrySmalltalk.st +964 -0
- data/public/amber/examples/twitterwall/css/twitterwall.css +19 -0
- data/public/amber/examples/twitterwall/index.html +35 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.deploy.js +116 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.js +146 -0
- data/public/amber/examples/twitterwall/st/TwitterWall.st +91 -0
- data/public/amber/examples/webos/README +11 -0
- data/public/amber/examples/webos/eris/DuckQwaq.wav +0 -0
- data/public/amber/examples/webos/eris/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/eris/Eris.css +0 -0
- data/public/amber/examples/webos/eris/Eris.st +86 -0
- data/public/amber/examples/webos/eris/Makefile +37 -0
- data/public/amber/examples/webos/eris/README +3 -0
- data/public/amber/examples/webos/eris/appinfo.json +10 -0
- data/public/amber/examples/webos/eris/index.html +12 -0
- data/public/amber/examples/webos/helloamber/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/helloamber/HelloAmber.st +86 -0
- data/public/amber/examples/webos/helloamber/Makefile +38 -0
- data/public/amber/examples/webos/helloamber/README +5 -0
- data/public/amber/examples/webos/helloamber/appinfo.json +10 -0
- data/public/amber/examples/webos/helloamber/index.html +12 -0
- data/public/amber/favicon.ico +0 -0
- data/public/amber/images/amber.png +0 -0
- data/public/amber/images/amber.svg +706 -0
- data/public/amber/images/amber_small.png +0 -0
- data/public/amber/images/off.amber.png +0 -0
- data/public/amber/images/off.png +0 -0
- data/public/amber/images/offHover.amber.png +0 -0
- data/public/amber/images/offHover.png +0 -0
- data/public/amber/images/presentation.png +0 -0
- data/public/amber/images/profstef.png +0 -0
- data/public/amber/images/sprite.amber.png +0 -0
- data/public/amber/images/sprite.png +0 -0
- data/public/amber/images/tinylogo.amber.png +0 -0
- data/public/amber/images/tinylogo.png +0 -0
- data/public/amber/images/twitterwall.png +0 -0
- data/public/amber/index.html +55 -0
- data/public/amber/js/Additional-Examples.deploy.js +15 -0
- data/public/amber/js/Additional-Examples.js +21 -0
- data/public/amber/js/Benchfib.deploy.js +132 -0
- data/public/amber/js/Benchfib.js +167 -0
- data/public/amber/js/Canvas.deploy.js +2446 -0
- data/public/amber/js/Canvas.js +3547 -0
- data/public/amber/js/Compiler-Tests.deploy.js +97 -0
- data/public/amber/js/Compiler-Tests.js +137 -0
- data/public/amber/js/Compiler.deploy.js +1877 -0
- data/public/amber/js/Compiler.js +2622 -0
- data/public/amber/js/Documentation.deploy.js +961 -0
- data/public/amber/js/Documentation.js +1376 -0
- data/public/amber/js/Examples.deploy.js +53 -0
- data/public/amber/js/Examples.js +73 -0
- data/public/amber/js/IDE.deploy.js +3557 -0
- data/public/amber/js/IDE.js +5002 -0
- data/public/amber/js/Kernel-Announcements.deploy.js +107 -0
- data/public/amber/js/Kernel-Announcements.js +152 -0
- data/public/amber/js/Kernel-Classes.deploy.js +774 -0
- data/public/amber/js/Kernel-Classes.js +1095 -0
- data/public/amber/js/Kernel-Collections.deploy.js +3121 -0
- data/public/amber/js/Kernel-Collections.js +4427 -0
- data/public/amber/js/Kernel-Exceptions.deploy.js +244 -0
- data/public/amber/js/Kernel-Exceptions.js +349 -0
- data/public/amber/js/Kernel-Methods.deploy.js +573 -0
- data/public/amber/js/Kernel-Methods.js +807 -0
- data/public/amber/js/Kernel-Objects.deploy.js +2877 -0
- data/public/amber/js/Kernel-Objects.js +4107 -0
- data/public/amber/js/Kernel-Tests.deploy.js +1513 -0
- data/public/amber/js/Kernel-Tests.js +2053 -0
- data/public/amber/js/Kernel-Transcript.deploy.js +142 -0
- data/public/amber/js/Kernel-Transcript.js +202 -0
- data/public/amber/js/Maglev-Core.deploy.js +2996 -0
- data/public/amber/js/Maglev-Core.js +4246 -0
- data/public/amber/js/Maglev-Database-Explorer.deploy.js +4476 -0
- data/public/amber/js/Maglev-Database-Explorer.js +6232 -0
- data/public/amber/js/Maglev-Vendor.deploy.js +350 -0
- data/public/amber/js/Maglev-Vendor.js +465 -0
- data/public/amber/js/README.md +5 -0
- data/public/amber/js/SUnit.deploy.js +351 -0
- data/public/amber/js/SUnit.js +501 -0
- data/public/amber/js/amber.js +273 -0
- data/public/amber/js/boot.js +602 -0
- data/public/amber/js/compat.js +22 -0
- data/public/amber/js/init.js +9 -0
- data/public/amber/js/lib/CodeMirror/LICENSE +19 -0
- data/public/amber/js/lib/CodeMirror/active-line.js +39 -0
- data/public/amber/js/lib/CodeMirror/amber.css +21 -0
- data/public/amber/js/lib/CodeMirror/codemirror.css +67 -0
- data/public/amber/js/lib/CodeMirror/codemirror.js +2144 -0
- data/public/amber/js/lib/CodeMirror/smalltalk.js +134 -0
- data/public/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
- data/public/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
- data/public/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
- data/public/amber/js/lib/jQuery/jquery.textarea.js +267 -0
- data/public/amber/js/lib/peg-0.6.2.min.js +2 -0
- data/public/amber/js/lib/showdown.js +419 -0
- data/public/amber/js/parser.js +4222 -0
- data/public/amber/js/parser.pegjs +223 -0
- data/public/amber/learn.html +40 -0
- data/public/amber/repl/Makefile +8 -0
- data/public/amber/repl/REPL.js +124 -0
- data/public/amber/repl/REPL.st +56 -0
- data/public/amber/repl/amber.js +18085 -0
- data/public/amber/server/FileServer.st +576 -0
- data/public/amber/server/Makefile +8 -0
- data/public/amber/server/server.js +13049 -0
- data/public/amber/st/Benchfib.js +297 -0
- data/public/amber/st/Benchfib.st +124 -0
- data/public/amber/st/Canvas.st +968 -0
- data/public/amber/st/Compiler-Tests.st +471 -0
- data/public/amber/st/Compiler.st +1445 -0
- data/public/amber/st/Documentation.st +758 -0
- data/public/amber/st/Examples.js +100 -0
- data/public/amber/st/Examples.st +38 -0
- data/public/amber/st/IDE.st +2404 -0
- data/public/amber/st/Kernel-Announcements.st +61 -0
- data/public/amber/st/Kernel-Classes.st +462 -0
- data/public/amber/st/Kernel-Collections.st +1611 -0
- data/public/amber/st/Kernel-Exceptions.st +124 -0
- data/public/amber/st/Kernel-Methods.st +291 -0
- data/public/amber/st/Kernel-Objects.st +1587 -0
- data/public/amber/st/Kernel-Tests.st +953 -0
- data/public/amber/st/Kernel-Transcript.st +70 -0
- data/public/amber/st/Maglev-Core.st +1694 -0
- data/public/amber/st/Maglev-Database-Explorer.st +3148 -0
- data/public/amber/st/Maglev-Vendor.st +151 -0
- data/public/amber/st/Makefile +104 -0
- data/public/amber/st/README.md +4 -0
- data/public/amber/st/SUnit.st +172 -0
- data/public/css/bootstrap-combined.no-icons.min.css +731 -0
- data/public/css/bootstrap.css +6811 -0
- data/public/css/images/animated-overlay.gif +0 -0
- data/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/css/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/css/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/css/jquery-ui.min.css +5 -0
- data/public/css/smalltalk_code.css +42 -0
- data/public/css/style.css +210 -0
- data/public/images/bg_tile.png +0 -0
- data/public/images/maglev-logo.gif +0 -0
- data/public/images/mchammer.gif +0 -0
- data/public/images/rails_tiny.png +0 -0
- data/public/images/ruby.png +0 -0
- data/public/images/ruby_smalltalk_bridge.png +0 -0
- data/public/images/smalltalk.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/index.html +118 -0
- data/public/libs/bootstrap.min.js +7 -0
- data/public/libs/codemirror/CONTRIBUTING.md +72 -0
- data/public/libs/codemirror/LICENSE +23 -0
- data/public/libs/codemirror/README.md +11 -0
- data/public/libs/codemirror/addon/dialog/dialog.css +32 -0
- data/public/libs/codemirror/addon/dialog/dialog.js +80 -0
- data/public/libs/codemirror/addon/display/placeholder.js +54 -0
- data/public/libs/codemirror/addon/edit/closebrackets.js +54 -0
- data/public/libs/codemirror/addon/edit/closetag.js +86 -0
- data/public/libs/codemirror/addon/edit/continuecomment.js +44 -0
- data/public/libs/codemirror/addon/edit/continuelist.js +25 -0
- data/public/libs/codemirror/addon/edit/matchbrackets.js +82 -0
- data/public/libs/codemirror/addon/fold/brace-fold.js +31 -0
- data/public/libs/codemirror/addon/fold/foldcode.js +32 -0
- data/public/libs/codemirror/addon/fold/indent-fold.js +11 -0
- data/public/libs/codemirror/addon/fold/xml-fold.js +64 -0
- data/public/libs/codemirror/addon/hint/html-hint.js +582 -0
- data/public/libs/codemirror/addon/hint/javascript-hint.js +142 -0
- data/public/libs/codemirror/addon/hint/pig-hint.js +117 -0
- data/public/libs/codemirror/addon/hint/python-hint.js +93 -0
- data/public/libs/codemirror/addon/hint/show-hint.css +38 -0
- data/public/libs/codemirror/addon/hint/show-hint.js +180 -0
- data/public/libs/codemirror/addon/hint/xml-hint.js +118 -0
- data/public/libs/codemirror/addon/lint/javascript-lint.js +127 -0
- data/public/libs/codemirror/addon/lint/json-lint.js +14 -0
- data/public/libs/codemirror/addon/lint/lint.css +96 -0
- data/public/libs/codemirror/addon/lint/lint.js +197 -0
- data/public/libs/codemirror/addon/mode/loadmode.js +51 -0
- data/public/libs/codemirror/addon/mode/multiplex.js +95 -0
- data/public/libs/codemirror/addon/mode/overlay.js +59 -0
- data/public/libs/codemirror/addon/runmode/colorize.js +29 -0
- data/public/libs/codemirror/addon/runmode/runmode-standalone.js +130 -0
- data/public/libs/codemirror/addon/runmode/runmode.js +52 -0
- data/public/libs/codemirror/addon/runmode/runmode.node.js +89 -0
- data/public/libs/codemirror/addon/search/match-highlighter.js +60 -0
- data/public/libs/codemirror/addon/search/search.js +131 -0
- data/public/libs/codemirror/addon/search/searchcursor.js +133 -0
- data/public/libs/codemirror/addon/selection/active-line.js +39 -0
- data/public/libs/codemirror/addon/selection/mark-selection.js +34 -0
- data/public/libs/codemirror/bin/compress +91 -0
- data/public/libs/codemirror/bin/lint +11 -0
- data/public/libs/codemirror/demo/activeline.html +70 -0
- data/public/libs/codemirror/demo/bidi.html +61 -0
- data/public/libs/codemirror/demo/btree.html +87 -0
- data/public/libs/codemirror/demo/buffers.html +98 -0
- data/public/libs/codemirror/demo/changemode.html +50 -0
- data/public/libs/codemirror/demo/closebrackets.html +63 -0
- data/public/libs/codemirror/demo/closetag.html +37 -0
- data/public/libs/codemirror/demo/complete.html +70 -0
- data/public/libs/codemirror/demo/emacs.html +60 -0
- data/public/libs/codemirror/demo/folding.html +69 -0
- data/public/libs/codemirror/demo/fullscreen.html +147 -0
- data/public/libs/codemirror/demo/html5complete.html +92 -0
- data/public/libs/codemirror/demo/indentwrap.html +49 -0
- data/public/libs/codemirror/demo/lint.html +90 -0
- data/public/libs/codemirror/demo/loadmode.html +40 -0
- data/public/libs/codemirror/demo/marker.html +59 -0
- data/public/libs/codemirror/demo/markselection.html +36 -0
- data/public/libs/codemirror/demo/matchhighlighter.html +38 -0
- data/public/libs/codemirror/demo/multiplex.html +60 -0
- data/public/libs/codemirror/demo/mustache.html +59 -0
- data/public/libs/codemirror/demo/placeholder.html +36 -0
- data/public/libs/codemirror/demo/preview.html +76 -0
- data/public/libs/codemirror/demo/resize.html +49 -0
- data/public/libs/codemirror/demo/runmode.html +50 -0
- data/public/libs/codemirror/demo/search.html +85 -0
- data/public/libs/codemirror/demo/spanaffectswrapping_shim.html +73 -0
- data/public/libs/codemirror/demo/theme.html +89 -0
- data/public/libs/codemirror/demo/variableheight.html +52 -0
- data/public/libs/codemirror/demo/vim.html +65 -0
- data/public/libs/codemirror/demo/visibletabs.html +53 -0
- data/public/libs/codemirror/demo/widget.html +74 -0
- data/public/libs/codemirror/demo/xmlcomplete.html +81 -0
- data/public/libs/codemirror/index.html +487 -0
- data/public/libs/codemirror/keymap/emacs.js +30 -0
- data/public/libs/codemirror/keymap/vim.js +3044 -0
- data/public/libs/codemirror/lib/codemirror.css +253 -0
- data/public/libs/codemirror/lib/codemirror.js +5585 -0
- data/public/libs/codemirror/mode/apl/apl.js +160 -0
- data/public/libs/codemirror/mode/apl/index.html +61 -0
- data/public/libs/codemirror/mode/asterisk/asterisk.js +183 -0
- data/public/libs/codemirror/mode/asterisk/index.html +142 -0
- data/public/libs/codemirror/mode/clike/clike.js +302 -0
- data/public/libs/codemirror/mode/clike/index.html +103 -0
- data/public/libs/codemirror/mode/clike/scala.html +767 -0
- data/public/libs/codemirror/mode/clojure/clojure.js +222 -0
- data/public/libs/codemirror/mode/clojure/index.html +76 -0
- data/public/libs/codemirror/mode/coffeescript/LICENSE +22 -0
- data/public/libs/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/public/libs/codemirror/mode/coffeescript/index.html +728 -0
- data/public/libs/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/public/libs/codemirror/mode/commonlisp/index.html +165 -0
- data/public/libs/codemirror/mode/css/css.js +567 -0
- data/public/libs/codemirror/mode/css/index.html +58 -0
- data/public/libs/codemirror/mode/css/scss.html +145 -0
- data/public/libs/codemirror/mode/css/scss_test.js +80 -0
- data/public/libs/codemirror/mode/css/test.js +113 -0
- data/public/libs/codemirror/mode/d/d.js +205 -0
- data/public/libs/codemirror/mode/d/index.html +262 -0
- data/public/libs/codemirror/mode/diff/diff.js +32 -0
- data/public/libs/codemirror/mode/diff/index.html +105 -0
- data/public/libs/codemirror/mode/ecl/ecl.js +192 -0
- data/public/libs/codemirror/mode/ecl/index.html +39 -0
- data/public/libs/codemirror/mode/erlang/erlang.js +463 -0
- data/public/libs/codemirror/mode/erlang/index.html +64 -0
- data/public/libs/codemirror/mode/gas/gas.js +326 -0
- data/public/libs/codemirror/mode/gas/index.html +57 -0
- data/public/libs/codemirror/mode/gfm/gfm.js +96 -0
- data/public/libs/codemirror/mode/gfm/index.html +74 -0
- data/public/libs/codemirror/mode/gfm/test.js +112 -0
- data/public/libs/codemirror/mode/go/go.js +165 -0
- data/public/libs/codemirror/mode/go/index.html +74 -0
- data/public/libs/codemirror/mode/groovy/groovy.js +210 -0
- data/public/libs/codemirror/mode/groovy/index.html +73 -0
- data/public/libs/codemirror/mode/haskell/haskell.js +242 -0
- data/public/libs/codemirror/mode/haskell/index.html +62 -0
- data/public/libs/codemirror/mode/haxe/haxe.js +429 -0
- data/public/libs/codemirror/mode/haxe/index.html +90 -0
- data/public/libs/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/public/libs/codemirror/mode/htmlembedded/index.html +49 -0
- data/public/libs/codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/public/libs/codemirror/mode/htmlmixed/index.html +73 -0
- data/public/libs/codemirror/mode/http/http.js +98 -0
- data/public/libs/codemirror/mode/http/index.html +32 -0
- data/public/libs/codemirror/mode/javascript/index.html +92 -0
- data/public/libs/codemirror/mode/javascript/javascript.js +467 -0
- data/public/libs/codemirror/mode/javascript/typescript.html +48 -0
- data/public/libs/codemirror/mode/jinja2/index.html +38 -0
- data/public/libs/codemirror/mode/jinja2/jinja2.js +42 -0
- data/public/libs/codemirror/mode/less/index.html +741 -0
- data/public/libs/codemirror/mode/less/less.js +266 -0
- data/public/libs/codemirror/mode/livescript/LICENSE +23 -0
- data/public/libs/codemirror/mode/livescript/index.html +446 -0
- data/public/libs/codemirror/mode/livescript/livescript.js +267 -0
- data/public/libs/codemirror/mode/livescript/livescript.ls +266 -0
- data/public/libs/codemirror/mode/lua/index.html +74 -0
- data/public/libs/codemirror/mode/lua/lua.js +140 -0
- data/public/libs/codemirror/mode/markdown/index.html +344 -0
- data/public/libs/codemirror/mode/markdown/markdown.js +526 -0
- data/public/libs/codemirror/mode/markdown/test.js +636 -0
- data/public/libs/codemirror/mode/meta.js +75 -0
- data/public/libs/codemirror/mode/mirc/index.html +149 -0
- data/public/libs/codemirror/mode/mirc/mirc.js +177 -0
- data/public/libs/codemirror/mode/ntriples/index.html +33 -0
- data/public/libs/codemirror/mode/ntriples/ntriples.js +170 -0
- data/public/libs/codemirror/mode/ocaml/index.html +131 -0
- data/public/libs/codemirror/mode/ocaml/ocaml.js +113 -0
- data/public/libs/codemirror/mode/pascal/LICENSE +7 -0
- data/public/libs/codemirror/mode/pascal/index.html +48 -0
- data/public/libs/codemirror/mode/pascal/pascal.js +94 -0
- data/public/libs/codemirror/mode/perl/LICENSE +19 -0
- data/public/libs/codemirror/mode/perl/index.html +62 -0
- data/public/libs/codemirror/mode/perl/perl.js +816 -0
- data/public/libs/codemirror/mode/php/index.html +51 -0
- data/public/libs/codemirror/mode/php/php.js +129 -0
- data/public/libs/codemirror/mode/pig/index.html +42 -0
- data/public/libs/codemirror/mode/pig/pig.js +171 -0
- data/public/libs/codemirror/mode/properties/index.html +41 -0
- data/public/libs/codemirror/mode/properties/properties.js +63 -0
- data/public/libs/codemirror/mode/python/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/python/index.html +135 -0
- data/public/libs/codemirror/mode/python/python.js +340 -0
- data/public/libs/codemirror/mode/q/index.html +131 -0
- data/public/libs/codemirror/mode/q/q.js +124 -0
- data/public/libs/codemirror/mode/r/LICENSE +24 -0
- data/public/libs/codemirror/mode/r/index.html +74 -0
- data/public/libs/codemirror/mode/r/r.js +141 -0
- data/public/libs/codemirror/mode/rpm/changes/changes.js +19 -0
- data/public/libs/codemirror/mode/rpm/changes/index.html +53 -0
- data/public/libs/codemirror/mode/rpm/spec/index.html +99 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.css +5 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.js +66 -0
- data/public/libs/codemirror/mode/rst/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/rst/index.html +524 -0
- data/public/libs/codemirror/mode/rst/rst.js +550 -0
- data/public/libs/codemirror/mode/ruby/LICENSE +24 -0
- data/public/libs/codemirror/mode/ruby/index.html +173 -0
- data/public/libs/codemirror/mode/ruby/ruby.js +197 -0
- data/public/libs/codemirror/mode/rust/index.html +48 -0
- data/public/libs/codemirror/mode/rust/rust.js +432 -0
- data/public/libs/codemirror/mode/sass/index.html +54 -0
- data/public/libs/codemirror/mode/sass/sass.js +349 -0
- data/public/libs/codemirror/mode/scheme/index.html +65 -0
- data/public/libs/codemirror/mode/scheme/scheme.js +230 -0
- data/public/libs/codemirror/mode/shell/index.html +51 -0
- data/public/libs/codemirror/mode/shell/shell.js +118 -0
- data/public/libs/codemirror/mode/sieve/LICENSE +19 -0
- data/public/libs/codemirror/mode/sieve/index.html +81 -0
- data/public/libs/codemirror/mode/sieve/sieve.js +183 -0
- data/public/libs/codemirror/mode/smalltalk/index.html +57 -0
- data/public/libs/codemirror/mode/smalltalk/smalltalk.js +141 -0
- data/public/libs/codemirror/mode/smarty/index.html +83 -0
- data/public/libs/codemirror/mode/smarty/smarty.js +148 -0
- data/public/libs/codemirror/mode/sparql/index.html +42 -0
- data/public/libs/codemirror/mode/sparql/sparql.js +143 -0
- data/public/libs/codemirror/mode/sql/index.html +68 -0
- data/public/libs/codemirror/mode/sql/sql.js +268 -0
- data/public/libs/codemirror/mode/stex/index.html +98 -0
- data/public/libs/codemirror/mode/stex/stex.js +246 -0
- data/public/libs/codemirror/mode/stex/test.js +117 -0
- data/public/libs/codemirror/mode/tcl/index.html +129 -0
- data/public/libs/codemirror/mode/tcl/tcl.js +131 -0
- data/public/libs/codemirror/mode/tiddlywiki/index.html +142 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/public/libs/codemirror/mode/tiki/index.html +81 -0
- data/public/libs/codemirror/mode/tiki/tiki.css +26 -0
- data/public/libs/codemirror/mode/tiki/tiki.js +308 -0
- data/public/libs/codemirror/mode/turtle/index.html +39 -0
- data/public/libs/codemirror/mode/turtle/turtle.js +145 -0
- data/public/libs/codemirror/mode/vb/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/vb/index.html +88 -0
- data/public/libs/codemirror/mode/vb/vb.js +259 -0
- data/public/libs/codemirror/mode/vbscript/index.html +42 -0
- data/public/libs/codemirror/mode/vbscript/vbscript.js +26 -0
- data/public/libs/codemirror/mode/velocity/index.html +103 -0
- data/public/libs/codemirror/mode/velocity/velocity.js +144 -0
- data/public/libs/codemirror/mode/verilog/index.html +121 -0
- data/public/libs/codemirror/mode/verilog/verilog.js +182 -0
- data/public/libs/codemirror/mode/xml/index.html +45 -0
- data/public/libs/codemirror/mode/xml/xml.js +328 -0
- data/public/libs/codemirror/mode/xquery/LICENSE +20 -0
- data/public/libs/codemirror/mode/xquery/index.html +221 -0
- data/public/libs/codemirror/mode/xquery/test.js +64 -0
- data/public/libs/codemirror/mode/xquery/xquery.js +450 -0
- data/public/libs/codemirror/mode/yaml/index.html +68 -0
- data/public/libs/codemirror/mode/yaml/yaml.js +95 -0
- data/public/libs/codemirror/mode/z80/index.html +39 -0
- data/public/libs/codemirror/mode/z80/z80.js +85 -0
- data/public/libs/codemirror/package.json +21 -0
- data/public/libs/codemirror/test/doc_test.js +329 -0
- data/public/libs/codemirror/test/driver.js +138 -0
- data/public/libs/codemirror/test/index.html +182 -0
- data/public/libs/codemirror/test/lint/acorn.js +1593 -0
- data/public/libs/codemirror/test/lint/lint.js +112 -0
- data/public/libs/codemirror/test/lint/parse-js.js +1372 -0
- data/public/libs/codemirror/test/lint/walk.js +216 -0
- data/public/libs/codemirror/test/mode_test.css +10 -0
- data/public/libs/codemirror/test/mode_test.js +192 -0
- data/public/libs/codemirror/test/phantom_driver.js +31 -0
- data/public/libs/codemirror/test/run.js +33 -0
- data/public/libs/codemirror/test/test.js +1400 -0
- data/public/libs/codemirror/test/vim_test.js +1688 -0
- data/public/libs/codemirror/theme/ambiance-mobile.css +5 -0
- data/public/libs/codemirror/theme/ambiance.css +75 -0
- data/public/libs/codemirror/theme/blackboard.css +25 -0
- data/public/libs/codemirror/theme/cobalt.css +18 -0
- data/public/libs/codemirror/theme/eclipse.css +25 -0
- data/public/libs/codemirror/theme/elegant.css +10 -0
- data/public/libs/codemirror/theme/erlang-dark.css +21 -0
- data/public/libs/codemirror/theme/lesser-dark.css +44 -0
- data/public/libs/codemirror/theme/midnight.css +52 -0
- data/public/libs/codemirror/theme/monokai.css +28 -0
- data/public/libs/codemirror/theme/neat.css +9 -0
- data/public/libs/codemirror/theme/night.css +21 -0
- data/public/libs/codemirror/theme/rubyblue.css +21 -0
- data/public/libs/codemirror/theme/solarized.css +207 -0
- data/public/libs/codemirror/theme/twilight.css +26 -0
- data/public/libs/codemirror/theme/vibrant-ink.css +27 -0
- data/public/libs/codemirror/theme/xq-dark.css +46 -0
- data/public/libs/codemirror/theme/xq-light.css +43 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.css +983 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.min.css +24 -0
- data/public/libs/font-awesome/css/font-awesome.css +1268 -0
- data/public/libs/font-awesome/css/font-awesome.min.css +24 -0
- data/public/libs/font-awesome/font/FontAwesome.otf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.eot +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.svg +339 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.ttf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.woff +0 -0
- data/public/libs/font-awesome/less/bootstrap.less +78 -0
- data/public/libs/font-awesome/less/core.less +132 -0
- data/public/libs/font-awesome/less/extras.less +79 -0
- data/public/libs/font-awesome/less/font-awesome-ie7.less +413 -0
- data/public/libs/font-awesome/less/font-awesome.less +32 -0
- data/public/libs/font-awesome/less/icons.less +330 -0
- data/public/libs/font-awesome/less/mixins.less +34 -0
- data/public/libs/font-awesome/less/path.less +15 -0
- data/public/libs/font-awesome/less/variables.less +9 -0
- data/public/libs/jquery-1.10.0.min.js +6 -0
- data/public/libs/jquery-ui.min.js +12 -0
- data/public/libs/jquery.jsPlumb-1.4.0-all.js +9571 -0
- data/public/libs/jquery.livequery.js +226 -0
- data/public/libs/jsPlumbInitializer.js +72 -0
- data/public/libs/jstree/README.txt +10 -0
- data/public/libs/jstree/_demo/_dump.sql +20 -0
- data/public/libs/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/libs/jstree/_demo/_inc/class._database.php +146 -0
- data/public/libs/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/libs/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/libs/jstree/_demo/_install.txt +6 -0
- data/public/libs/jstree/_demo/config.php +14 -0
- data/public/libs/jstree/_demo/file.png +0 -0
- data/public/libs/jstree/_demo/folder.png +0 -0
- data/public/libs/jstree/_demo/index.html +461 -0
- data/public/libs/jstree/_demo/root.png +0 -0
- data/public/libs/jstree/_demo/server.php +69 -0
- data/public/libs/jstree/_docs/!style.css +48 -0
- data/public/libs/jstree/_docs/_drive.png +0 -0
- data/public/libs/jstree/_docs/_html_data.html +2 -0
- data/public/libs/jstree/_docs/_json_data.json +4 -0
- data/public/libs/jstree/_docs/_search_data.json +6 -0
- data/public/libs/jstree/_docs/_search_result.json +1 -0
- data/public/libs/jstree/_docs/_xml_flat.xml +12 -0
- data/public/libs/jstree/_docs/_xml_nest.xml +18 -0
- data/public/libs/jstree/_docs/checkbox.html +171 -0
- data/public/libs/jstree/_docs/contextmenu.html +121 -0
- data/public/libs/jstree/_docs/cookies.html +97 -0
- data/public/libs/jstree/_docs/core.html +689 -0
- data/public/libs/jstree/_docs/crrm.html +316 -0
- data/public/libs/jstree/_docs/dnd.html +199 -0
- data/public/libs/jstree/_docs/hotkeys.html +82 -0
- data/public/libs/jstree/_docs/html_data.html +175 -0
- data/public/libs/jstree/_docs/index.html +86 -0
- data/public/libs/jstree/_docs/json_data.html +249 -0
- data/public/libs/jstree/_docs/languages.html +152 -0
- data/public/libs/jstree/_docs/logo.png +0 -0
- data/public/libs/jstree/_docs/search.html +153 -0
- data/public/libs/jstree/_docs/sort.html +85 -0
- data/public/libs/jstree/_docs/syntax/!script.js +2232 -0
- data/public/libs/jstree/_docs/syntax/!style.css +511 -0
- data/public/libs/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/libs/jstree/_docs/syntax/help.png +0 -0
- data/public/libs/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/libs/jstree/_docs/syntax/printer.png +0 -0
- data/public/libs/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/libs/jstree/_docs/themeroller.html +107 -0
- data/public/libs/jstree/_docs/themes.html +127 -0
- data/public/libs/jstree/_docs/types.html +178 -0
- data/public/libs/jstree/_docs/ui.html +197 -0
- data/public/libs/jstree/_docs/unique.html +85 -0
- data/public/libs/jstree/_docs/xml_data.html +218 -0
- data/public/libs/jstree/_lib/jquery.cookie.js +96 -0
- data/public/libs/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/libs/jstree/_lib/jquery.js +5 -0
- data/public/libs/jstree/jquery.jstree.js +4564 -0
- data/public/libs/jstree/themes/apple/bg.jpg +0 -0
- data/public/libs/jstree/themes/apple/d.png +0 -0
- data/public/libs/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/apple/style.css +61 -0
- data/public/libs/jstree/themes/apple/throbber.gif +0 -0
- data/public/libs/jstree/themes/classic/d.gif +0 -0
- data/public/libs/jstree/themes/classic/d.png +0 -0
- data/public/libs/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/classic/style.css +77 -0
- data/public/libs/jstree/themes/classic/throbber.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.png +0 -0
- data/public/libs/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/style.css +84 -0
- data/public/libs/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/libs/jstree/themes/default/d.gif +0 -0
- data/public/libs/jstree/themes/default/d.png +0 -0
- data/public/libs/jstree/themes/default/style.css +74 -0
- data/public/libs/jstree/themes/default/throbber.gif +0 -0
- data/public/themes/geo-bootstrap/README.md +25 -0
- data/public/themes/geo-bootstrap/img/flames.gif +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings.png +0 -0
- data/public/themes/geo-bootstrap/img/microfab.gif +0 -0
- data/public/themes/geo-bootstrap/img/progress.gif +0 -0
- data/public/themes/geo-bootstrap/img/rainbow.gif +0 -0
- data/public/themes/geo-bootstrap/img/stars.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/7upspot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/americanflag.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/community.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer-01.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/construction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider1.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider3.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider4.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/drudgesiren.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/emailme.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/funky.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/geocities.jpg +0 -0
- data/public/themes/geo-bootstrap/img/test/hacker.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/heart.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/hot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ie_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mailkitten.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mchammer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/noframes.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/notepad.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ns_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/sign-in.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/spinningearth.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/underconstruction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/wabwalk.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/webtrips.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/yahooweek.gif +0 -0
- data/public/themes/geo-bootstrap/package.json +21 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.css +1109 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.min.css +9 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.css +6462 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.min.css +9 -0
- metadata +791 -0
@@ -0,0 +1,267 @@
|
|
1
|
+
/*
|
2
|
+
* Tabby jQuery plugin version 0.12
|
3
|
+
*
|
4
|
+
* Ted Devito - http://teddevito.com/demos/textarea.html
|
5
|
+
*
|
6
|
+
* Copyright (c) 2009 Ted Devito
|
7
|
+
*
|
8
|
+
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
9
|
+
* conditions are met:
|
10
|
+
*
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
|
13
|
+
* in the documentation and/or other materials provided with the distribution.
|
14
|
+
* 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written
|
15
|
+
* permission.
|
16
|
+
*
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
19
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
20
|
+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
21
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
22
|
+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
|
26
|
+
// create closure
|
27
|
+
|
28
|
+
(function($) {
|
29
|
+
|
30
|
+
// plugin definition
|
31
|
+
|
32
|
+
$.fn.tabby = function(options) {
|
33
|
+
//debug(this);
|
34
|
+
// build main options before element iteration
|
35
|
+
var opts = $.extend({}, $.fn.tabby.defaults, options);
|
36
|
+
var pressed = $.fn.tabby.pressed;
|
37
|
+
|
38
|
+
// iterate and reformat each matched element
|
39
|
+
return this.each(function() {
|
40
|
+
$this = $(this);
|
41
|
+
|
42
|
+
// build element specific options
|
43
|
+
var options = $.meta ? $.extend({}, opts, $this.data()) : opts;
|
44
|
+
|
45
|
+
$this.bind('keydown',function (e) {
|
46
|
+
var kc = $.fn.tabby.catch_kc(e);
|
47
|
+
if (16 == kc) pressed.shft = true;
|
48
|
+
/*
|
49
|
+
because both CTRL+TAB and ALT+TAB default to an event (changing tab/window) that
|
50
|
+
will prevent js from capturing the keyup event, we'll set a timer on releasing them.
|
51
|
+
*/
|
52
|
+
if (17 == kc) {pressed.ctrl = true; setTimeout("$.fn.tabby.pressed.ctrl = false;",1000);}
|
53
|
+
if (18 == kc) {pressed.alt = true; setTimeout("$.fn.tabby.pressed.alt = false;",1000);}
|
54
|
+
|
55
|
+
if (9 == kc && !pressed.ctrl && !pressed.alt) {
|
56
|
+
e.preventDefault; // does not work in O9.63 ??
|
57
|
+
pressed.last = kc; setTimeout("$.fn.tabby.pressed.last = null;",0);
|
58
|
+
process_keypress ($(e.target).get(0), pressed.shft, options);
|
59
|
+
return false;
|
60
|
+
}
|
61
|
+
|
62
|
+
}).bind('keyup',function (e) {
|
63
|
+
if (16 == $.fn.tabby.catch_kc(e)) pressed.shft = false;
|
64
|
+
}).bind('blur',function (e) { // workaround for Opera -- http://www.webdeveloper.com/forum/showthread.php?p=806588
|
65
|
+
if (9 == pressed.last) $(e.target).one('focus',function (e) {pressed.last = null;}).get(0).focus();
|
66
|
+
});
|
67
|
+
|
68
|
+
});
|
69
|
+
};
|
70
|
+
|
71
|
+
// define and expose any extra methods
|
72
|
+
$.fn.tabby.catch_kc = function(e) { return e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which; };
|
73
|
+
$.fn.tabby.pressed = {shft : false, ctrl : false, alt : false, last: null};
|
74
|
+
|
75
|
+
// private function for debugging
|
76
|
+
function debug($obj) {
|
77
|
+
if (window.console && window.console.log)
|
78
|
+
window.console.log('textarea count: ' + $obj.size());
|
79
|
+
};
|
80
|
+
|
81
|
+
function process_keypress (o,shft,options) {
|
82
|
+
var scrollTo = o.scrollTop;
|
83
|
+
//var tabString = String.fromCharCode(9);
|
84
|
+
|
85
|
+
// gecko; o.setSelectionRange is only available when the text box has focus
|
86
|
+
if (o.setSelectionRange) gecko_tab (o, shft, options);
|
87
|
+
|
88
|
+
// ie; document.selection is always available
|
89
|
+
else if (document.selection) ie_tab (o, shft, options);
|
90
|
+
|
91
|
+
o.scrollTop = scrollTo;
|
92
|
+
}
|
93
|
+
|
94
|
+
// plugin defaults
|
95
|
+
$.fn.tabby.defaults = {tabString : String.fromCharCode(9)};
|
96
|
+
|
97
|
+
function gecko_tab (o, shft, options) {
|
98
|
+
var ss = o.selectionStart;
|
99
|
+
var es = o.selectionEnd;
|
100
|
+
|
101
|
+
// when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control
|
102
|
+
if(ss == es) {
|
103
|
+
// SHIFT+TAB
|
104
|
+
if (shft) {
|
105
|
+
// check to the left of the caret first
|
106
|
+
if ("\t" == o.value.substring(ss-options.tabString.length, ss)) {
|
107
|
+
o.value = o.value.substring(0, ss-options.tabString.length) + o.value.substring(ss); // put it back together omitting one character to the left
|
108
|
+
o.focus();
|
109
|
+
o.setSelectionRange(ss - options.tabString.length, ss - options.tabString.length);
|
110
|
+
}
|
111
|
+
// then check to the right of the caret
|
112
|
+
else if ("\t" == o.value.substring(ss, ss + options.tabString.length)) {
|
113
|
+
o.value = o.value.substring(0, ss) + o.value.substring(ss + options.tabString.length); // put it back together omitting one character to the right
|
114
|
+
o.focus();
|
115
|
+
o.setSelectionRange(ss,ss);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
// TAB
|
119
|
+
else {
|
120
|
+
o.value = o.value.substring(0, ss) + options.tabString + o.value.substring(ss);
|
121
|
+
o.focus();
|
122
|
+
o.setSelectionRange(ss + options.tabString.length, ss + options.tabString.length);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
// selections will always add/remove tabs from the start of the line
|
126
|
+
else {
|
127
|
+
// split the textarea up into lines and figure out which lines are included in the selection
|
128
|
+
var lines = o.value.split("\n");
|
129
|
+
var indices = new Array();
|
130
|
+
var sl = 0; // start of the line
|
131
|
+
var el = 0; // end of the line
|
132
|
+
var sel = false;
|
133
|
+
for (var i in lines) {
|
134
|
+
el = sl + lines[i].length;
|
135
|
+
indices.push({start: sl, end: el, selected: (sl <= ss && el > ss) || (el >= es && sl < es) || (sl > ss && el < es)});
|
136
|
+
sl = el + 1;// for "\n"
|
137
|
+
}
|
138
|
+
|
139
|
+
// walk through the array of lines (indices) and add tabs where appropriate
|
140
|
+
var modifier = 0;
|
141
|
+
for (var i in indices) {
|
142
|
+
if (indices[i].selected) {
|
143
|
+
var pos = indices[i].start + modifier; // adjust for tabs already inserted/removed
|
144
|
+
// SHIFT+TAB
|
145
|
+
if (shft && options.tabString == o.value.substring(pos,pos+options.tabString.length)) { // only SHIFT+TAB if there's a tab at the start of the line
|
146
|
+
o.value = o.value.substring(0,pos) + o.value.substring(pos + options.tabString.length); // omit the tabstring to the right
|
147
|
+
modifier -= options.tabString.length;
|
148
|
+
}
|
149
|
+
// TAB
|
150
|
+
else if (!shft) {
|
151
|
+
o.value = o.value.substring(0,pos) + options.tabString + o.value.substring(pos); // insert the tabstring
|
152
|
+
modifier += options.tabString.length;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
o.focus();
|
157
|
+
var ns = ss + ((modifier > 0) ? options.tabString.length : (modifier < 0) ? -options.tabString.length : 0);
|
158
|
+
var ne = es + modifier;
|
159
|
+
o.setSelectionRange(ns,ne);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
function ie_tab (o, shft, options) {
|
164
|
+
var range = document.selection.createRange();
|
165
|
+
|
166
|
+
if (o == range.parentElement()) {
|
167
|
+
// when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control
|
168
|
+
if ('' == range.text) {
|
169
|
+
// SHIFT+TAB
|
170
|
+
if (shft) {
|
171
|
+
var bookmark = range.getBookmark();
|
172
|
+
//first try to the left by moving opening up our empty range to the left
|
173
|
+
range.moveStart('character', -options.tabString.length);
|
174
|
+
if (options.tabString == range.text) {
|
175
|
+
range.text = '';
|
176
|
+
} else {
|
177
|
+
// if that didn't work then reset the range and try opening it to the right
|
178
|
+
range.moveToBookmark(bookmark);
|
179
|
+
range.moveEnd('character', options.tabString.length);
|
180
|
+
if (options.tabString == range.text)
|
181
|
+
range.text = '';
|
182
|
+
}
|
183
|
+
// move the pointer to the start of them empty range and select it
|
184
|
+
range.collapse(true);
|
185
|
+
range.select();
|
186
|
+
}
|
187
|
+
|
188
|
+
else {
|
189
|
+
// very simple here. just insert the tab into the range and put the pointer at the end
|
190
|
+
range.text = options.tabString;
|
191
|
+
range.collapse(false);
|
192
|
+
range.select();
|
193
|
+
}
|
194
|
+
}
|
195
|
+
// selections will always add/remove tabs from the start of the line
|
196
|
+
else {
|
197
|
+
|
198
|
+
var selection_text = range.text;
|
199
|
+
var selection_len = selection_text.length;
|
200
|
+
var selection_arr = selection_text.split("\r\n");
|
201
|
+
|
202
|
+
var before_range = document.body.createTextRange();
|
203
|
+
before_range.moveToElementText(o);
|
204
|
+
before_range.setEndPoint("EndToStart", range);
|
205
|
+
var before_text = before_range.text;
|
206
|
+
var before_arr = before_text.split("\r\n");
|
207
|
+
var before_len = before_text.length; // - before_arr.length + 1;
|
208
|
+
|
209
|
+
var after_range = document.body.createTextRange();
|
210
|
+
after_range.moveToElementText(o);
|
211
|
+
after_range.setEndPoint("StartToEnd", range);
|
212
|
+
var after_text = after_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n
|
213
|
+
|
214
|
+
var end_range = document.body.createTextRange();
|
215
|
+
end_range.moveToElementText(o);
|
216
|
+
end_range.setEndPoint("StartToEnd", before_range);
|
217
|
+
var end_text = end_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n
|
218
|
+
|
219
|
+
var check_html = $(o).html();
|
220
|
+
$("#r3").text(before_len + " + " + selection_len + " + " + after_text.length + " = " + check_html.length);
|
221
|
+
if((before_len + end_text.length) < check_html.length) {
|
222
|
+
before_arr.push("");
|
223
|
+
before_len += 2; // for the \r\n that was trimmed
|
224
|
+
if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length))
|
225
|
+
selection_arr[0] = selection_arr[0].substring(options.tabString.length);
|
226
|
+
else if (!shft) selection_arr[0] = options.tabString + selection_arr[0];
|
227
|
+
} else {
|
228
|
+
if (shft && options.tabString == before_arr[before_arr.length-1].substring(0,options.tabString.length))
|
229
|
+
before_arr[before_arr.length-1] = before_arr[before_arr.length-1].substring(options.tabString.length);
|
230
|
+
else if (!shft) before_arr[before_arr.length-1] = options.tabString + before_arr[before_arr.length-1];
|
231
|
+
}
|
232
|
+
|
233
|
+
for (var i = 1; i < selection_arr.length; i++) {
|
234
|
+
if (shft && options.tabString == selection_arr[i].substring(0,options.tabString.length))
|
235
|
+
selection_arr[i] = selection_arr[i].substring(options.tabString.length);
|
236
|
+
else if (!shft) selection_arr[i] = options.tabString + selection_arr[i];
|
237
|
+
}
|
238
|
+
|
239
|
+
if (1 == before_arr.length && 0 == before_len) {
|
240
|
+
if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length))
|
241
|
+
selection_arr[0] = selection_arr[0].substring(options.tabString.length);
|
242
|
+
else if (!shft) selection_arr[0] = options.tabString + selection_arr[0];
|
243
|
+
}
|
244
|
+
|
245
|
+
if ((before_len + selection_len + after_text.length) < check_html.length) {
|
246
|
+
selection_arr.push("");
|
247
|
+
selection_len += 2; // for the \r\n that was trimmed
|
248
|
+
}
|
249
|
+
|
250
|
+
before_range.text = before_arr.join("\r\n");
|
251
|
+
range.text = selection_arr.join("\r\n");
|
252
|
+
|
253
|
+
var new_range = document.body.createTextRange();
|
254
|
+
new_range.moveToElementText(o);
|
255
|
+
|
256
|
+
if (0 < before_len) new_range.setEndPoint("StartToEnd", before_range);
|
257
|
+
else new_range.setEndPoint("StartToStart", before_range);
|
258
|
+
new_range.setEndPoint("EndToEnd", range);
|
259
|
+
|
260
|
+
new_range.select();
|
261
|
+
|
262
|
+
}
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
// end of closure
|
267
|
+
})(jQuery);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/* PEG.js 0.6.2 (http://pegjs.majda.cz/) */(function(){function contains(a,b){var c=a.length;for(var d=0;d<c;d++)if(a[d]===b)return!0;return!1}function each(a,b){var c=a.length;for(var d=0;d<c;d++)b(a[d])}function map(a,b){var c=[],d=a.length;for(var e=0;e<d;e++)c[e]=b(a[e]);return c}function padLeft(a,b,c){var d=a,e=c-a.length;for(var f=0;f<e;f++)d=b+d;return d}function escape(a){var b=a.charCodeAt(0);if(b<=255)var c="x",d=2;else var c="u",d=4;return"\\"+c+padLeft(b.toString(16).toUpperCase(),"0",d)}function quote(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/[\x80-\uFFFF]/g,escape)+'"'}function quoteForRegexpClass(a){return a.replace(/\\/g,"\\\\").replace(/\0/g,"\\0").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/-/g,"\\-").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/[\x80-\uFFFF]/g,escape)}function buildNodeVisitor(a){return function(b){return a[b.type].apply(null,arguments)}}var undefined,PEG={VERSION:"0.6.2",buildParser:function(a){return PEG.compiler.compile(PEG.parser.parse(a))}};PEG.GrammarError=function(a){this.name="PEG.GrammarError",this.message=a},PEG.GrammarError.prototype=Error.prototype,PEG.parser=function(){var a={parse:function(a,b){function i(a,b,c){var d=a,e=c-a.length;for(var f=0;f<e;f++)d=b+d;return d}function j(a){var b=a.charCodeAt(0);if(b<=255)var c="x",d=2;else var c="u",d=4;return"\\"+c+i(b.toString(16).toUpperCase(),"0",d)}function k(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/[\x80-\uFFFF]/g,j)+'"'}function l(a){if(d<f)return;d>f&&(f=d,g=[]),g.push(a)}function m(){var a="grammar@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=bg();if(f!==null){var g=n(),i=g!==null?g:"";if(i!==null){var j=o();if(j!==null){var k=[];while(j!==null){k.push(j);var j=o()}}else var k=null;if(k!==null)var l=[f,i,k];else{var l=null;d=e}}else{var l=null;d=e}}else{var l=null;d=e}var m=l!==null?function(a,b){var c={};return each(b,function(a){c[a.name]=a}),{type:"grammar",initializer:a!==""?a:null,rules:c,startRule:b[0].name}}(l[1],l[2]):null;if(m!==null)var p=m;else{var p=null;d=c}return h[a]={nextPos:d,result:p},p}function n(){var a="initializer@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=v();if(f!==null){var g=B(),i=g!==null?g:"";if(i!==null)var j=[f,i];else{var j=null;d=e}}else{var j=null;d=e}var k=j!==null?function(a){return{type:"initializer",code:a}}(j[0]):null;if(k!==null)var l=k;else{var l=null;d=c}return h[a]={nextPos:d,result:l},l}function o(){var b="rule@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=L();if(i!==null){var j=M();if(j!==null)var k=j;else{if(a.substr(d,0)===""){var m="";d+=0}else{var m=null;e&&l('""')}if(m!==null)var k=m;else var k=null}if(k!==null){var n=z();if(n!==null){var o=p();if(o!==null){var q=B(),r=q!==null?q:"";if(r!==null)var s=[i,k,n,o,r];else{var s=null;d=g}}else{var s=null;d=g}}else{var s=null;d=g}}else{var s=null;d=g}}else{var s=null;d=g}var t=s!==null?function(a,b,c){return{type:"rule",name:a,displayName:b!==""?b:null,expression:c}}(s[0],s[1],s[3]):null;if(t!==null)var u=t;else{var u=null;d=f}return h[b]={nextPos:d,result:u},u}function p(){var a="choice@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=q();if(f!==null){var g=[],i=d,j=C();if(j!==null){var k=q();if(k!==null)var l=[j,k];else{var l=null;d=i}}else{var l=null;d=i}while(l!==null){g.push(l);var i=d,j=C();if(j!==null){var k=q();if(k!==null)var l=[j,k];else{var l=null;d=i}}else{var l=null;d=i}}if(g!==null)var m=[f,g];else{var m=null;d=e}}else{var m=null;d=e}var n=m!==null?function(a,b){if(b.length>0){var c=[a].concat(map(b,function(a){return a[1]}));return{type:"choice",alternatives:c}}return a}(m[0],m[1]):null;if(n!==null)var o=n;else{var o=null;d=c}return h[a]={nextPos:d,result:o},o}function q(){var a="sequence@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=[],g=r();while(g!==null){f.push(g);var g=r()}if(f!==null){var i=v();if(i!==null)var j=[f,i];else{var j=null;d=e}}else{var j=null;d=e}var k=j!==null?function(a,b){var c=a.length!=1?{type:"sequence",elements:a}:a[0];return{type:"action",expression:c,code:b}}(j[0],j[1]):null;if(k!==null)var l=k;else{var l=null;d=c}if(l!==null)var m=l;else{var n=d,o=[],p=r();while(p!==null){o.push(p);var p=r()}var q=o!==null?function(a){return a.length!=1?{type:"sequence",elements:a}:a[0]}(o):null;if(q!==null)var s=q;else{var s=null;d=n}if(s!==null)var m=s;else var m=null}return h[a]={nextPos:d,result:m},m}function r(){var a="labeled@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=L();if(f!==null){var g=A();if(g!==null){var i=s();if(i!==null)var j=[f,g,i];else{var j=null;d=e}}else{var j=null;d=e}}else{var j=null;d=e}var k=j!==null?function(a,b){return{type:"labeled",label:a,expression:b}}(j[0],j[2]):null;if(k!==null)var l=k;else{var l=null;d=c}if(l!==null)var m=l;else{var n=s();if(n!==null)var m=n;else var m=null}return h[a]={nextPos:d,result:m},m}function s(){var a="prefixed@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=D();if(f!==null){var g=v();if(g!==null)var i=[f,g];else{var i=null;d=e}}else{var i=null;d=e}var j=i!==null?function(a){return{type:"semantic_and",code:a}}(i[1]):null;if(j!==null)var k=j;else{var k=null;d=c}if(k!==null)var l=k;else{var m=d,n=d,o=D();if(o!==null){var p=t();if(p!==null)var q=[o,p];else{var q=null;d=n}}else{var q=null;d=n}var r=q!==null?function(a){return{type:"simple_and",expression:a}}(q[1]):null;if(r!==null)var s=r;else{var s=null;d=m}if(s!==null)var l=s;else{var u=d,w=d,x=E();if(x!==null){var y=v();if(y!==null)var z=[x,y];else{var z=null;d=w}}else{var z=null;d=w}var A=z!==null?function(a){return{type:"semantic_not",code:a}}(z[1]):null;if(A!==null)var B=A;else{var B=null;d=u}if(B!==null)var l=B;else{var C=d,F=d,G=E();if(G!==null){var H=t();if(H!==null)var I=[G,H];else{var I=null;d=F}}else{var I=null;d=F}var J=I!==null?function(a){return{type:"simple_not",expression:a}}(I[1]):null;if(J!==null)var K=J;else{var K=null;d=C}if(K!==null)var l=K;else{var L=t();if(L!==null)var l=L;else var l=null}}}}return h[a]={nextPos:d,result:l},l}function t(){var a="suffixed@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=d,f=u();if(f!==null){var g=F();if(g!==null)var i=[f,g];else{var i=null;d=e}}else{var i=null;d=e}var j=i!==null?function(a){return{type:"optional",expression:a}}(i[0]):null;if(j!==null)var k=j;else{var k=null;d=c}if(k!==null)var l=k;else{var m=d,n=d,o=u();if(o!==null){var p=G();if(p!==null)var q=[o,p];else{var q=null;d=n}}else{var q=null;d=n}var r=q!==null?function(a){return{type:"zero_or_more",expression:a}}(q[0]):null;if(r!==null)var s=r;else{var s=null;d=m}if(s!==null)var l=s;else{var t=d,v=d,w=u();if(w!==null){var x=H();if(x!==null)var y=[w,x];else{var y=null;d=v}}else{var y=null;d=v}var z=y!==null?function(a){return{type:"one_or_more",expression:a}}(y[0]):null;if(z!==null)var A=z;else{var A=null;d=t}if(A!==null)var l=A;else{var B=u();if(B!==null)var l=B;else var l=null}}}return h[a]={nextPos:d,result:l},l}function u(){var b="primary@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=L();if(i!==null){var j=d,k=e;e=!1;var m=d,n=M();if(n!==null)var o=n;else{if(a.substr(d,0)===""){var q="";d+=0}else{var q=null;e&&l('""')}if(q!==null)var o=q;else var o=null}if(o!==null){var r=z();if(r!==null)var s=[o,r];else{var s=null;d=m}}else{var s=null;d=m}e=k;if(s===null)var t="";else{var t=null;d=j}if(t!==null)var u=[i,t];else{var u=null;d=g}}else{var u=null;d=g}var v=u!==null?function(a){return{type:"rule_ref",name:a}}(u[0]):null;if(v!==null)var w=v;else{var w=null;d=f}if(w!==null)var x=w;else{var y=d,A=M(),B=A!==null?function(a){return{type:"literal",value:a}}(A):null;if(B!==null)var C=B;else{var C=null;d=y}if(C!==null)var x=C;else{var D=d,E=K(),F=E!==null?function(){return{type:"any"}}():null;if(F!==null)var G=F;else{var G=null;d=D}if(G!==null)var x=G;else{var H=T();if(H!==null)var x=H;else{var N=d,O=d,P=I();if(P!==null){var Q=p();if(Q!==null){var R=J();if(R!==null)var S=[P,Q,R];else{var S=null;d=O}}else{var S=null;d=O}}else{var S=null;d=O}var U=S!==null?function(a){return a}(S[1]):null;if(U!==null)var V=U;else{var V=null;d=N}if(V!==null)var x=V;else var x=null}}}}return h[b]={nextPos:d,result:x},x}function v(){var a="action@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=e;e=!1;var f=d,g=d,i=w();if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(a){return a.substr(1,a.length-2)}(k[0]):null;if(m!==null)var n=m;else{var n=null;d=f}return e=c,e&&n===null&&l("action"),h[a]={nextPos:d,result:n},n}function w(){var b="braced@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="{"){var i="{";d+=1}else{var i=null;e&&l('"{"')}if(i!==null){var j=[],k=w();if(k!==null)var m=k;else{var n=y();if(n!==null)var m=n;else var m=null}while(m!==null){j.push(m);var k=w();if(k!==null)var m=k;else{var n=y();if(n!==null)var m=n;else var m=null}}if(j!==null){if(a.substr(d,1)==="}"){var o="}";d+=1}else{var o=null;e&&l('"}"')}if(o!==null)var p=[i,j,o];else{var p=null;d=g}}else{var p=null;d=g}}else{var p=null;d=g}var q=p!==null?function(a){return"{"+a.join("")+"}"}(p[1]):null;if(q!==null)var r=q;else{var r=null;d=f}return h[b]={nextPos:d,result:r},r}function x(){var a="nonBraceCharacters@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=y();if(e!==null){var f=[];while(e!==null){f.push(e);var e=y()}}else var f=null;var g=f!==null?function(a){return a.join("")}(f):null;if(g!==null)var i=g;else{var i=null;d=c}return h[a]={nextPos:d,result:i},i}function y(){var b="nonBraceCharacter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[^{}]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[^{}]")}return h[b]={nextPos:d,result:f},f}function z(){var b="equals@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="="){var i="=";d+=1}else{var i=null;e&&l('"="')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"="}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function A(){var b="colon@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)===":"){var i=":";d+=1}else{var i=null;e&&l('":"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return":"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function B(){var b="semicolon@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)===";"){var i=";";d+=1}else{var i=null;e&&l('";"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return";"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function C(){var b="slash@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="/"){var i="/";d+=1}else{var i=null;e&&l('"/"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"/"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function D(){var b="and@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="&"){var i="&";d+=1}else{var i=null;e&&l('"&"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"&"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function E(){var b="not@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="!"){var i="!";d+=1}else{var i=null;e&&l('"!"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"!"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function F(){var b="question@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="?"){var i="?";d+=1}else{var i=null;e&&l('"?"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"?"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function G(){var b="star@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="*"){var i="*";d+=1}else{var i=null;e&&l('"*"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"*"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function H(){var b="plus@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="+"){var i="+";d+=1}else{var i=null;e&&l('"+"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"+"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function I(){var b="lparen@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="("){var i="(";d+=1}else{var i=null;e&&l('"("')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"("}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function J(){var b="rparen@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)===")"){var i=")";d+=1}else{var i=null;e&&l('")"')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return")"}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function K(){var b="dot@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="."){var i=".";d+=1}else{var i=null;e&&l('"."')}if(i!==null){var j=bg();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(){return"."}():null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function L(){var b="identifier@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=e;e=!1;var g=d,i=d,j=bd();if(j!==null)var k=j;else{if(a.substr(d,1)==="_"){var m="_";d+=1}else{var m=null;e&&l('"_"')}if(m!==null)var k=m;else{if(a.substr(d,1)==="$"){var n="$";d+=1}else{var n=null;e&&l('"$"')}if(n!==null)var k=n;else var k=null}}if(k!==null){var o=[],p=bd();if(p!==null)var q=p;else{var r=bb();if(r!==null)var q=r;else{if(a.substr(d,1)==="_"){var s="_";d+=1}else{var s=null;e&&l('"_"')}if(s!==null)var q=s;else{if(a.substr(d,1)==="$"){var t="$";d+=1}else{var t=null;e&&l('"$"')}if(t!==null)var q=t;else var q=null}}}while(q!==null){o.push(q);var p=bd();if(p!==null)var q=p;else{var r=bb();if(r!==null)var q=r;else{if(a.substr(d,1)==="_"){var s="_";d+=1}else{var s=null;e&&l('"_"')}if(s!==null)var q=s;else{if(a.substr(d,1)==="$"){var t="$";d+=1}else{var t=null;e&&l('"$"')}if(t!==null)var q=t;else var q=null}}}}if(o!==null){var u=bg();if(u!==null)var v=[k,o,u];else{var v=null;d=i}}else{var v=null;d=i}}else{var v=null;d=i}var w=v!==null?function(a,b){return a+b.join("")}(v[0],v[1]):null;if(w!==null)var x=w;else{var x=null;d=g}return e=f,e&&x===null&&l("identifier"),h[b]={nextPos:d,result:x},x}function M(){var a="literal@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=e;e=!1;var f=d,g=d,i=N();if(i!==null)var j=i;else{var k=Q();if(k!==null)var j=k;else var j=null}if(j!==null){var m=bg();if(m!==null)var n=[j,m];else{var n=null;d=g}}else{var n=null;d=g}var o=n!==null?function(a){return a}(n[0]):null;if(o!==null)var p=o;else{var p=null;d=f}return e=c,e&&p===null&&l("literal"),h[a]={nextPos:d,result:p},p}function N(){var b="doubleQuotedLiteral@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==='"'){var i='"';d+=1}else{var i=null;e&&l('"\\""')}if(i!==null){var j=[],k=O();while(k!==null){j.push(k);var k=O()}if(j!==null){if(a.substr(d,1)==='"'){var m='"';d+=1}else{var m=null;e&&l('"\\""')}if(m!==null)var n=[i,j,m];else{var n=null;d=g}}else{var n=null;d=g}}else{var n=null;d=g}var o=n!==null?function(a){return a.join("")}(n[1]):null;if(o!==null)var p=o;else{var p=null;d=f}return h[b]={nextPos:d,result:p},p}function O(){var a="doubleQuotedCharacter@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=P();if(c!==null)var e=c;else{var f=Y();if(f!==null)var e=f;else{var g=Z();if(g!==null)var e=g;else{var i=$();if(i!==null)var e=i;else{var j=_();if(j!==null)var e=j;else{var k=ba();if(k!==null)var e=k;else var e=null}}}}}return h[a]={nextPos:d,result:e},e}function P(){var b="simpleDoubleQuotedCharacter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=d,j=e;e=!1;if(a.substr(d,1)==='"'){var k='"';d+=1}else{var k=null;e&&l('"\\""')}if(k!==null)var m=k;else{if(a.substr(d,1)==="\\"){var n="\\";d+=1}else{var n=null;e&&l('"\\\\"')}if(n!==null)var m=n;else{var o=bl();if(o!==null)var m=o;else var m=null}}e=j;if(m===null)var p="";else{var p=null;d=i}if(p!==null){if(a.length>d){var q=a.charAt(d);d++}else{var q=null;e&&l("any character")}if(q!==null)var r=[p,q];else{var r=null;d=g}}else{var r=null;d=g}var s=r!==null?function(a){return a}(r[1]):null;if(s!==null)var t=s;else{var t=null;d=f}return h[b]={nextPos:d,result:t},t}function Q(){var b="singleQuotedLiteral@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="'"){var i="'";d+=1}else{var i=null;e&&l('"\'"')}if(i!==null){var j=[],k=R();while(k!==null){j.push(k);var k=R()}if(j!==null){if(a.substr(d,1)==="'"){var m="'";d+=1}else{var m=null;e&&l('"\'"')}if(m!==null)var n=[i,j,m];else{var n=null;d=g}}else{var n=null;d=g}}else{var n=null;d=g}var o=n!==null?function(a){return a.join("")}(n[1]):null;if(o!==null)var p=o;else{var p=null;d=f}return h[b]={nextPos:d,result:p},p}function R(){var a="singleQuotedCharacter@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=S();if(c!==null)var e=c;else{var f=Y();if(f!==null)var e=f;else{var g=Z();if(g!==null)var e=g;else{var i=$();if(i!==null)var e=i;else{var j=_();if(j!==null)var e=j;else{var k=ba();if(k!==null)var e=k;else var e=null}}}}}return h[a]={nextPos:d,result:e},e}function S(){var b="simpleSingleQuotedCharacter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=d,j=e;e=!1;if(a.substr(d,1)==="'"){var k="'";d+=1}else{var k=null;e&&l('"\'"')}if(k!==null)var m=k;else{if(a.substr(d,1)==="\\"){var n="\\";d+=1}else{var n=null;e&&l('"\\\\"')}if(n!==null)var m=n;else{var o=bl();if(o!==null)var m=o;else var m=null}}e=j;if(m===null)var p="";else{var p=null;d=i}if(p!==null){if(a.length>d){var q=a.charAt(d);d++}else{var q=null;e&&l("any character")}if(q!==null)var r=[p,q];else{var r=null;d=g}}else{var r=null;d=g}var s=r!==null?function(a){return a}(r[1]):null;if(s!==null)var t=s;else{var t=null;d=f}return h[b]={nextPos:d,result:t},t}function T(){var b="class@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=e;e=!1;var g=d,i=d;if(a.substr(d,1)==="["){var j="[";d+=1}else{var j=null;e&&l('"["')}if(j!==null){if(a.substr(d,1)==="^"){var k="^";d+=1}else{var k=null;e&&l('"^"')}var m=k!==null?k:"";if(m!==null){var n=[],o=U();if(o!==null)var p=o;else{var q=V();if(q!==null)var p=q;else var p=null}while(p!==null){n.push(p);var o=U();if(o!==null)var p=o;else{var q=V();if(q!==null)var p=q;else var p=null}}if(n!==null){if(a.substr(d,1)==="]"){var r="]";d+=1}else{var r=null;e&&l('"]"')}if(r!==null){var s=bg();if(s!==null)var t=[j,m,n,r,s];else{var t=null;d=i}}else{var t=null;d=i}}else{var t=null;d=i}}else{var t=null;d=i}}else{var t=null;d=i}var u=t!==null?function(a,b){var c=map(b,function(a){return a.data}),d="["+a+map(b,function(a){return a.rawText}).join("")+"]";return{type:"class",inverted:a==="^",parts:c,rawText:d}}(t[1],t[2]):null;if(u!==null)var v=u;else{var v=null;d=g}return e=f,e&&v===null&&l("character class"),h[b]={nextPos:d,result:v},v}function U(){var b="classCharacterRange@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=V();if(i!==null){if(a.substr(d,1)==="-"){var j="-";d+=1}else{var j=null;e&&l('"-"')}if(j!==null){var k=V();if(k!==null)var m=[i,j,k];else{var m=null;d=g}}else{var m=null;d=g}}else{var m=null;d=g}var n=m!==null?function(a,b){if(a.data.charCodeAt(0)>b.data.charCodeAt(0))throw new this.SyntaxError("Invalid character range: "+a.rawText+"-"+b.rawText+".");return{data:[a.data,b.data],rawText:a.rawText+"-"+b.rawText}}(m[0],m[2]):null;if(n!==null)var o=n;else{var o=null;d=f}return h[b]={nextPos:d,result:o},o}function V(){var a="classCharacter@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=d,e=W(),f=e!==null?function(a){return{data:a,rawText:quoteForRegexpClass(a)}}(e):null;if(f!==null)var g=f;else{var g=null;d=c}return h[a]={nextPos:d,result:g},g}function W(){var a="bracketDelimitedCharacter@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=X();if(c!==null)var e=c;else{var f=Y();if(f!==null)var e=f;else{var g=Z();if(g!==null)var e=g;else{var i=$();if(i!==null)var e=i;else{var j=_();if(j!==null)var e=j;else{var k=ba();if(k!==null)var e=k;else var e=null}}}}}return h[a]={nextPos:d,result:e},e}function X(){var b="simpleBracketDelimitedCharacter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d,i=d,j=e;e=!1;if(a.substr(d,1)==="]"){var k="]";d+=1}else{var k=null;e&&l('"]"')}if(k!==null)var m=k;else{if(a.substr(d,1)==="\\"){var n="\\";d+=1}else{var n=null;e&&l('"\\\\"')}if(n!==null)var m=n;else{var o=bl();if(o!==null)var m=o;else var m=null}}e=j;if(m===null)var p="";else{var p=null;d=i}if(p!==null){if(a.length>d){var q=a.charAt(d);d++}else{var q=null;e&&l("any character")}if(q!==null)var r=[p,q];else{var r=null;d=g}}else{var r=null;d=g}var s=r!==null?function(a){return a}(r[1]):null;if(s!==null)var t=s;else{var t=null;d=f}return h[b]={nextPos:d,result:t},t}function Y(){var b="simpleEscapeSequence@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="\\"){var i="\\";d+=1}else{var i=null;e&&l('"\\\\"')}if(i!==null){var j=d,k=e;e=!1;var m=bb();if(m!==null)var n=m;else{if(a.substr(d,1)==="x"){var o="x";d+=1}else{var o=null;e&&l('"x"')}if(o!==null)var n=o;else{if(a.substr(d,1)==="u"){var p="u";d+=1}else{var p=null;e&&l('"u"')}if(p!==null)var n=p;else{var q=bl();if(q!==null)var n=q;else var n=null}}}e=k;if(n===null)var r="";else{var r=null;d=j}if(r!==null){if(a.length>d){var s=a.charAt(d);d++}else{var s=null;e&&l("any character")}if(s!==null)var t=[i,r,s];else{var t=null;d=g}}else{var t=null;d=g}}else{var t=null;d=g}var u=t!==null?function(a){return a.replace("b","\b").replace("f","\f").replace("n","\n").replace("r","\r").replace("t","\t").replace("v","")}(t[2]):null;if(u!==null)var v=u;else{var v=null;d=f}return h[b]={nextPos:d,result:v},v}function Z(){var b="zeroEscapeSequence@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,2)==="\\0"){var i="\\0";d+=2}else{var i=null;e&&l('"\\\\0"')}if(i!==null){var j=d,k=e;e=!1;var m=bb();e=k;if(m===null)var n="";else{var n=null;d=j}if(n!==null)var o=[i,n];else{var o=null;d=g}}else{var o=null;d=g}var p=o!==null?function(){return""}():null;if(p!==null)var q=p;else{var q=null;d=f}return h[b]={nextPos:d,result:q},q}function $(){var b="hexEscapeSequence@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,2)==="\\x"){var i="\\x";d+=2}else{var i=null;e&&l('"\\\\x"')}if(i!==null){var j=bc();if(j!==null){var k=bc();if(k!==null)var m=[i,j,k];else{var m=null;d=g}}else{var m=null;d=g}}else{var m=null;d=g}var n=m!==null?function(a,b){return String.fromCharCode(parseInt("0x"+a+b))}(m[1],m[2]):null;if(n!==null)var o=n;else{var o=null;d=f}return h[b]={nextPos:d,result:o},o}function _(){var b="unicodeEscapeSequence@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,2)==="\\u"){var i="\\u";d+=2}else{var i=null;e&&l('"\\\\u"')}if(i!==null){var j=bc();if(j!==null){var k=bc();if(k!==null){var m=bc();if(m!==null){var n=bc();if(n!==null)var o=[i,j,k,m,n];else{var o=null;d=g}}else{var o=null;d=g}}else{var o=null;d=g}}else{var o=null;d=g}}else{var o=null;d=g}var p=o!==null?function(a,b,c,d){return String.fromCharCode(parseInt("0x"+a+b+c+d))}(o[1],o[2],o[3],o[4]):null;if(p!==null)var q=p;else{var q=null;d=f}return h[b]={nextPos:d,result:q},q}function ba(){var b="eolEscapeSequence@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d,g=d;if(a.substr(d,1)==="\\"){var i="\\";d+=1}else{var i=null;e&&l('"\\\\"')}if(i!==null){var j=bk();if(j!==null)var k=[i,j];else{var k=null;d=g}}else{var k=null;d=g}var m=k!==null?function(a){return a}(k[1]):null;if(m!==null)var n=m;else{var n=null;d=f}return h[b]={nextPos:d,result:n},n}function bb(){var b="digit@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[0-9]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[0-9]")}return h[b]={nextPos:d,result:f},f}function bc(){var b="hexDigit@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[0-9a-fA-F]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[0-9a-fA-F]")}return h[b]={nextPos:d,result:f},f}function bd(){var a="letter@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=be();if(c!==null)var e=c;else{var f=bf();if(f!==null)var e=f;else var e=null}return h[a]={nextPos:d,result:e},e}function be(){var b="lowerCaseLetter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[a-z]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[a-z]")}return h[b]={nextPos:d,result:f},f}function bf(){var b="upperCaseLetter@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[A-Z]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[A-Z]")}return h[b]={nextPos:d,result:f},f}function bg(){var a="__@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=[],e=bm();if(e!==null)var f=e;else{var g=bk();if(g!==null)var f=g;else{var i=bh();if(i!==null)var f=i;else var f=null}}while(f!==null){c.push(f);var e=bm();if(e!==null)var f=e;else{var g=bk();if(g!==null)var f=g;else{var i=bh();if(i!==null)var f=i;else var f=null}}}return h[a]={nextPos:d,result:c},c}function bh(){var a="comment@"+d,b=h[a];if(b)return d=b.nextPos,b.result;var c=e;e=!1;var f=bi();if(f!==null)var g=f;else{var i=bj();if(i!==null)var g=i;else var g=null}return e=c,e&&g===null&&l("comment"),h[a]={nextPos:d,result:g},g}function bi(){var b="singleLineComment@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d;if(a.substr(d,2)==="//"){var g="//";d+=2}else{var g=null;e&&l('"//"')}if(g!==null){var i=[],j=d,k=d,m=e;e=!1;var n=bl();e=m;if(n===null)var o="";else{var o=null;d=k}if(o!==null){if(a.length>d){var p=a.charAt(d);d++}else{var p=null;e&&l("any character")}if(p!==null)var q=[o,p];else{var q=null;d=j}}else{var q=null;d=j}while(q!==null){i.push(q);var j=d,k=d,m=e;e=!1;var n=bl();e=m;if(n===null)var o="";else{var o=null;d=k}if(o!==null){if(a.length>d){var p=a.charAt(d);d++}else{var p=null;e&&l("any character")}if(p!==null)var q=[o,p];else{var q=null;d=j}}else{var q=null;d=j}}if(i!==null)var r=[g,i];else{var r=null;d=f}}else{var r=null;d=f}return h[b]={nextPos:d,result:r},r}function bj(){var b="multiLineComment@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=d;if(a.substr(d,2)==="/*"){var g="/*";d+=2}else{var g=null;e&&l('"/*"')}if(g!==null){var i=[],j=d,k=d,m=e;e=!1;if(a.substr(d,2)==="*/"){var n="*/";d+=2}else{var n=null;e&&l('"*/"')}e=m;if(n===null)var o="";else{var o=null;d=k}if(o!==null){if(a.length>d){var p=a.charAt(d);d++}else{var p=null;e&&l("any character")}if(p!==null)var q=[o,p];else{var q=null;d=j}}else{var q=null;d=j}while(q!==null){i.push(q);var j=d,k=d,m=e;e=!1;if(a.substr(d,2)==="*/"){var n="*/";d+=2}else{var n=null;e&&l('"*/"')}e=m;if(n===null)var o="";else{var o=null;d=k}if(o!==null){if(a.length>d){var p=a.charAt(d);d++}else{var p=null;e&&l("any character")}if(p!==null)var q=[o,p];else{var q=null;d=j}}else{var q=null;d=j}}if(i!==null){if(a.substr(d,2)==="*/"){var r="*/";d+=2}else{var r=null;e&&l('"*/"')}if(r!==null)var s=[g,i,r];else{var s=null;d=f}}else{var s=null;d=f}}else{var s=null;d=f}return h[b]={nextPos:d,result:s},s}function bk(){var b="eol@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=e;e=!1;if(a.substr(d,1)==="\n"){var g="\n";d+=1}else{var g=null;e&&l('"\\n"')}if(g!==null)var i=g;else{if(a.substr(d,2)==="\r\n"){var j="\r\n";d+=2}else{var j=null;e&&l('"\\r\\n"')}if(j!==null)var i=j;else{if(a.substr(d,1)==="\r"){var k="\r";d+=1}else{var k=null;e&&l('"\\r"')}if(k!==null)var i=k;else{if(a.substr(d,1)==="\u2028"){var m="\u2028";d+=1}else{var m=null;e&&l('"\\u2028"')}if(m!==null)var i=m;else{if(a.substr(d,1)==="\u2029"){var n="\u2029";d+=1}else{var n=null;e&&l('"\\u2029"')}if(n!==null)var i=n;else var i=null}}}}return e=f,e&&i===null&&l("end of line"),h[b]={nextPos:d,result:i},i}function bl(){var b="eolChar@"+d,c=h[b];if(c)return d=c.nextPos,c.result;if(a.substr(d).match(/^[\n\r\u2028\u2029]/)!==null){var f=a.charAt(d);d++}else{var f=null;e&&l("[\\n\\r\\u2028\\u2029]")}return h[b]={nextPos:d,result:f},f}function bm(){var b="whitespace@"+d,c=h[b];if(c)return d=c.nextPos,c.result;var f=e;e=!1;if(a.substr(d).match(/^[ \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/)!==null){var g=a.charAt(d);d++}else{var g=null;e&&l("[ \t\f\\xA0\\uFEFF\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]")}return e=f,e&&g===null&&l("whitespace"),h[b]={nextPos:d,result:g},g}function bn(){function b(a){a.sort();var b=null,c=[];for(var d=0;d<a.length;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);switch(c.length){case 0:return"end of input";case 1:return c[0];default:return c.slice(0,c.length-1).join(", ")+" or "+c[c.length-1]}}var c=b(g),e=Math.max(d,f),h=e<a.length?k(a.charAt(e)):"end of input";return"Expected "+c+" but "+h+" found."}function bo(){var b=1,c=1,d=!1;for(var e=0;e<f;e++){var g=a.charAt(e);g==="\n"?(d||b++,c=1,d=!1):g==="\r"|g==="\u2028"||g==="\u2029"?(b++,c=1,d=!0):(c++,d=!1)}return{line:b,column:c}}var c={__:bg,action:v,and:D,braced:w,bracketDelimitedCharacter:W,choice:p,"class":T,classCharacter:V,classCharacterRange:U,colon:A,comment:bh,digit:bb,dot:K,doubleQuotedCharacter:O,doubleQuotedLiteral:N,eol:bk,eolChar:bl,eolEscapeSequence:ba,equals:z,grammar:m,hexDigit:bc,hexEscapeSequence:$,identifier:L,initializer:n,labeled:r,letter:bd,literal:M,lowerCaseLetter:be,lparen:I,multiLineComment:bj,nonBraceCharacter:y,nonBraceCharacters:x,not:E,plus:H,prefixed:s,primary:u,question:F,rparen:J,rule:o,semicolon:B,sequence:q,simpleBracketDelimitedCharacter:X,simpleDoubleQuotedCharacter:P,simpleEscapeSequence:Y,simpleSingleQuotedCharacter:S,singleLineComment:bi,singleQuotedCharacter:R,singleQuotedLiteral:Q,slash:C,star:G,suffixed:t,unicodeEscapeSequence:_,upperCaseLetter:bf,whitespace:bm,zeroEscapeSequence:Z};if(b!==undefined){if(c[b]===undefined)throw new Error("Invalid rule name: "+k(b)+".")}else b="grammar";var d=0,e=!0,f=0,g=[],h={},bp=c[b]();if(bp===null||d!==a.length){var bq=bo();throw new this.SyntaxError(bn(),bq.line,bq.column)}return bp},toSource:function(){return this._source}};return a.SyntaxError=function(a,b,c){this.name="SyntaxError",this.message=a,this.line=b,this.column=c},a.SyntaxError.prototype=Error.prototype,a}(),PEG.compiler={compile:function(ast){var CHECK_NAMES=["missingReferencedRules","leftRecursion"],PASS_NAMES=["proxyRules"];for(var i=0;i<CHECK_NAMES.length;i++)this.checks[CHECK_NAMES[i]](ast);for(var i=0;i<PASS_NAMES.length;i++)ast=this.passes[PASS_NAMES[i]](ast);var source=this.emitter(ast),result=eval(source);return result._source=source,result}},PEG.compiler.checks={missingReferencedRules:function(a){function b(){}function c(a){e(a.expression)}function d(a){return function(b){each(b[a],e)}}var e=buildNodeVisitor({grammar:function(a){for(var b in a.rules)e(a.rules[b])},rule:c,choice:d("alternatives"),sequence:d("elements"),labeled:c,simple_and:c,simple_not:c,semantic_and:b,semantic_not:b,optional:c,zero_or_more:c,one_or_more:c,action:c,rule_ref:function(b){if(a.rules[b.name]===undefined)throw new PEG.GrammarError('Referenced rule "'+b.name+'" does not exist.')},literal:b,any:b,"class":b});e(a)},leftRecursion:function(a){function b(){}function c(a,b){d(a.expression,b)}var d=buildNodeVisitor({grammar:function(a,b){for(var c in a.rules)d(a.rules[c],b)},rule:function(a,b){d(a.expression,b.concat(a.name))},choice:function(a,b){each(a.alternatives,function(a){d(a,b)})},sequence:function(a,b){a.elements.length>0&&d(a.elements[0],b)},labeled:c,simple_and:c,simple_not:c,semantic_and:b,semantic_not:b,optional:c,zero_or_more:c,one_or_more:c,action:c,rule_ref:function(b,c){if(contains(c,b.name))throw new PEG.GrammarError('Left recursion detected for rule "'+b.name+'".');d(a.rules[b.name],c)},literal:b,any:b,"class":b});d(a,[])}},PEG.compiler.passes={proxyRules:function(a){function b(a){return a.type==="rule"&&a.expression.type==="rule_ref"}function c(a,b,c){function d(){}function e(a,b,c){g(a.expression,b,c)}function f(a){return function(b,c,d){each(b[a],function(a){g(a,c,d)})}}var g=buildNodeVisitor({grammar:function(a,b,c){for(var d in a.rules)
|
2
|
+
g(a.rules[d],b,c)},rule:e,choice:f("alternatives"),sequence:f("elements"),labeled:e,simple_and:e,simple_not:e,semantic_and:d,semantic_not:d,optional:e,zero_or_more:e,one_or_more:e,action:e,rule_ref:function(a,b,c){a.name===b&&(a.name=c)},literal:d,any:d,"class":d});g(a,b,c)}for(var d in a.rules)b(a.rules[d])&&(c(a,a.rules[d].name,a.rules[d].expression.name),d===a.startRule&&(a.startRule=a.rules[d].expression.name),delete a.rules[d]);return a}},PEG.compiler.emitter=function(a){function b(){function a(a){return map(a,function(a){return a.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)(\|([a-zA-Z_][a-zA-Z0-9_]*))?\}/g,function(a,b,c,e){var f=d[b];if(f===undefined)throw new Error('Undefined variable: "'+b+'".');if(e!==undefined&&e!=""){if(e==="string")return quote(f);throw new Error('Unrecognized filter: "'+e+'".')}return f})})}function b(a){return map(a,function(a){if(!/\n/.test(a))return a;var b=a.match(/^\s*/)[0],c=a.split("\n"),d=[c[0]].concat(map(c.slice(1),function(a){return b+a}));return d.join("\n")})}var c=Array.prototype.slice.call(arguments),d=c[c.length-1]instanceof Object?c.pop():{};return b(a(c)).join("\n")}var c={_counters:{},next:function(a){return this._counters[a]=this._counters[a]||0,a+this._counters[a]++},reset:function(){this._counters={}}},d=buildNodeVisitor({grammar:function(a){var c=a.initializer!==null?d(a.initializer):"",e=[];for(var f in a.rules)e.push(quote(f)+": parse_"+f);e.sort();var g=[];for(var f in a.rules)g.push(d(a.rules[f]));return b("(function(){"," /* Generated by PEG.js 0.6.2 (http://pegjs.majda.cz/). */"," "," var result = {"," /*"," * Parses the input with a generated parser. If the parsing is successfull,"," * returns a value explicitly or implicitly specified by the grammar from"," * which the parser was generated (see |PEG.buildParser|). If the parsing is"," * unsuccessful, throws |PEG.parser.SyntaxError| describing the error."," */"," parse: function(input, startRule) {"," var parseFunctions = {"," ${parseFunctionTableItems}"," };"," "," if (startRule !== undefined) {"," if (parseFunctions[startRule] === undefined) {",' throw new Error("Invalid rule name: " + quote(startRule) + ".");'," }"," } else {"," startRule = ${startRule|string};"," }"," "," var pos = 0;"," var reportMatchFailures = true;"," var rightmostMatchFailuresPos = 0;"," var rightmostMatchFailuresExpected = [];"," var cache = {};"," "," function padLeft(input, padding, length) {"," var result = input;"," "," var padLength = length - input.length;"," for (var i = 0; i < padLength; i++) {"," result = padding + result;"," }"," "," return result;"," }"," "," function escape(ch) {"," var charCode = ch.charCodeAt(0);"," "," if (charCode <= 0xFF) {"," var escapeChar = 'x';"," var length = 2;"," } else {"," var escapeChar = 'u';"," var length = 4;"," }"," "," return '\\\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length);"," }"," "," function quote(s) {"," /*"," * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a"," * string literal except for the closing quote character, backslash,"," * carriage return, line separator, paragraph separator, and line feed."," * Any character may appear in the form of an escape sequence."," */"," return '\"' + s"," .replace(/\\\\/g, '\\\\\\\\') // backslash"," .replace(/\"/g, '\\\\\"') // closing quote character"," .replace(/\\r/g, '\\\\r') // carriage return"," .replace(/\\n/g, '\\\\n') // line feed"," .replace(/[\\x80-\\uFFFF]/g, escape) // non-ASCII characters"," + '\"';"," }"," "," function matchFailed(failure) {"," if (pos < rightmostMatchFailuresPos) {"," return;"," }"," "," if (pos > rightmostMatchFailuresPos) {"," rightmostMatchFailuresPos = pos;"," rightmostMatchFailuresExpected = [];"," }"," "," rightmostMatchFailuresExpected.push(failure);"," }"," "," ${parseFunctionDefinitions}"," "," function buildErrorMessage() {"," function buildExpected(failuresExpected) {"," failuresExpected.sort();"," "," var lastFailure = null;"," var failuresExpectedUnique = [];"," for (var i = 0; i < failuresExpected.length; i++) {"," if (failuresExpected[i] !== lastFailure) {"," failuresExpectedUnique.push(failuresExpected[i]);"," lastFailure = failuresExpected[i];"," }"," }"," "," switch (failuresExpectedUnique.length) {"," case 0:"," return 'end of input';"," case 1:"," return failuresExpectedUnique[0];"," default:"," return failuresExpectedUnique.slice(0, failuresExpectedUnique.length - 1).join(', ')"," + ' or '"," + failuresExpectedUnique[failuresExpectedUnique.length - 1];"," }"," }"," "," var expected = buildExpected(rightmostMatchFailuresExpected);"," var actualPos = Math.max(pos, rightmostMatchFailuresPos);"," var actual = actualPos < input.length"," ? quote(input.charAt(actualPos))"," : 'end of input';"," "," return 'Expected ' + expected + ' but ' + actual + ' found.';"," }"," "," function computeErrorPosition() {"," /*"," * The first idea was to use |String.split| to break the input up to the"," * error position along newlines and derive the line and column from"," * there. However IE's |split| implementation is so broken that it was"," * enough to prevent it."," */"," "," var line = 1;"," var column = 1;"," var seenCR = false;"," "," for (var i = 0; i < rightmostMatchFailuresPos; i++) {"," var ch = input.charAt(i);"," if (ch === '\\n') {"," if (!seenCR) { line++; }"," column = 1;"," seenCR = false;"," } else if (ch === '\\r' | ch === '\\u2028' || ch === '\\u2029') {"," line++;"," column = 1;"," seenCR = true;"," } else {"," column++;"," seenCR = false;"," }"," }"," "," return { line: line, column: column };"," }"," "," ${initializerCode}"," "," var result = parseFunctions[startRule]();"," "," /*"," * The parser is now in one of the following three states:"," *"," * 1. The parser successfully parsed the whole input."," *"," * - |result !== null|"," * - |pos === input.length|"," * - |rightmostMatchFailuresExpected| may or may not contain something"," *"," * 2. The parser successfully parsed only a part of the input."," *"," * - |result !== null|"," * - |pos < input.length|"," * - |rightmostMatchFailuresExpected| may or may not contain something"," *"," * 3. The parser did not successfully parse any part of the input."," *"," * - |result === null|"," * - |pos === 0|"," * - |rightmostMatchFailuresExpected| contains at least one failure"," *"," * All code following this comment (including called functions) must"," * handle these states."," */"," if (result === null || pos !== input.length) {"," var errorPosition = computeErrorPosition();"," throw new this.SyntaxError("," buildErrorMessage(),"," errorPosition.line,"," errorPosition.column"," );"," }"," "," return result;"," },"," "," /* Returns the parser source code. */"," toSource: function() { return this._source; }"," };"," "," /* Thrown when a parser encounters a syntax error. */"," "," result.SyntaxError = function(message, line, column) {"," this.name = 'SyntaxError';"," this.message = message;"," this.line = line;"," this.column = column;"," };"," "," result.SyntaxError.prototype = Error.prototype;"," "," return result;","})()",{initializerCode:c,parseFunctionTableItems:e.join(",\n"),parseFunctionDefinitions:g.join("\n\n"),startRule:a.startRule})},initializer:function(a){return a.code},rule:function(a){c.reset();var e=c.next("result");if(a.displayName!==null)var f=b("var savedReportMatchFailures = reportMatchFailures;","reportMatchFailures = false;"),g=b("reportMatchFailures = savedReportMatchFailures;"),h=b("if (reportMatchFailures && ${resultVar} === null) {"," matchFailed(${displayName|string});","}",{displayName:a.displayName,resultVar:e});else var f="",g="",h="";return b("function parse_${name}() {"," var cacheKey = '${name}@' + pos;"," var cachedResult = cache[cacheKey];"," if (cachedResult) {"," pos = cachedResult.nextPos;"," return cachedResult.result;"," }"," "," ${setReportMatchFailuresCode}"," ${code}"," ${restoreReportMatchFailuresCode}"," ${reportMatchFailureCode}"," "," cache[cacheKey] = {"," nextPos: pos,"," result: ${resultVar}"," };"," return ${resultVar};","}",{name:a.name,setReportMatchFailuresCode:f,restoreReportMatchFailuresCode:g,reportMatchFailureCode:h,code:d(a.expression,e),resultVar:e})},choice:function(a,e){var f=b("var ${resultVar} = null;",{resultVar:e});for(var g=a.alternatives.length-1;g>=0;g--){var h=c.next("result");f=b("${alternativeCode}","if (${alternativeResultVar} !== null) {"," var ${resultVar} = ${alternativeResultVar};","} else {"," ${code};","}",{alternativeCode:d(a.alternatives[g],h),alternativeResultVar:h,code:f,resultVar:e})}return f},sequence:function(a,e){var f=c.next("savedPos"),g=map(a.elements,function(){return c.next("result")}),h=b("var ${resultVar} = ${elementResultVarArray};",{resultVar:e,elementResultVarArray:"["+g.join(", ")+"]"});for(var i=a.elements.length-1;i>=0;i--)h=b("${elementCode}","if (${elementResultVar} !== null) {"," ${code}","} else {"," var ${resultVar} = null;"," pos = ${savedPosVar};","}",{elementCode:d(a.elements[i],g[i]),elementResultVar:g[i],code:h,savedPosVar:f,resultVar:e});return b("var ${savedPosVar} = pos;","${code}",{code:h,savedPosVar:f})},labeled:function(a,b){return d(a.expression,b)},simple_and:function(a,e){var f=c.next("savedPos"),g=c.next("savedReportMatchFailuresVar"),h=c.next("result");return b("var ${savedPosVar} = pos;","var ${savedReportMatchFailuresVar} = reportMatchFailures;","reportMatchFailures = false;","${expressionCode}","reportMatchFailures = ${savedReportMatchFailuresVar};","if (${expressionResultVar} !== null) {"," var ${resultVar} = '';"," pos = ${savedPosVar};","} else {"," var ${resultVar} = null;","}",{expressionCode:d(a.expression,h),expressionResultVar:h,savedPosVar:f,savedReportMatchFailuresVar:g,resultVar:e})},simple_not:function(a,e){var f=c.next("savedPos"),g=c.next("savedReportMatchFailuresVar"),h=c.next("result");return b("var ${savedPosVar} = pos;","var ${savedReportMatchFailuresVar} = reportMatchFailures;","reportMatchFailures = false;","${expressionCode}","reportMatchFailures = ${savedReportMatchFailuresVar};","if (${expressionResultVar} === null) {"," var ${resultVar} = '';","} else {"," var ${resultVar} = null;"," pos = ${savedPosVar};","}",{expressionCode:d(a.expression,h),expressionResultVar:h,savedPosVar:f,savedReportMatchFailuresVar:g,resultVar:e})},semantic_and:function(a,c){return b("var ${resultVar} = (function() {${actionCode}})() ? '' : null;",{actionCode:a.code,resultVar:c})},semantic_not:function(a,c){return b("var ${resultVar} = (function() {${actionCode}})() ? null : '';",{actionCode:a.code,resultVar:c})},optional:function(a,e){var f=c.next("result");return b("${expressionCode}","var ${resultVar} = ${expressionResultVar} !== null ? ${expressionResultVar} : '';",{expressionCode:d(a.expression,f),expressionResultVar:f,resultVar:e})},zero_or_more:function(a,e){var f=c.next("result");return b("var ${resultVar} = [];","${expressionCode}","while (${expressionResultVar} !== null) {"," ${resultVar}.push(${expressionResultVar});"," ${expressionCode}","}",{expressionCode:d(a.expression,f),expressionResultVar:f,resultVar:e})},one_or_more:function(a,e){var f=c.next("result");return b("${expressionCode}","if (${expressionResultVar} !== null) {"," var ${resultVar} = [];"," while (${expressionResultVar} !== null) {"," ${resultVar}.push(${expressionResultVar});"," ${expressionCode}"," }","} else {"," var ${resultVar} = null;","}",{expressionCode:d(a.expression,f),expressionResultVar:f,resultVar:e})},action:function(a,e){var f=c.next("result"),g=c.next("result"),h=c.next("savedPos");if(a.expression.type==="sequence"){var i=[],j=[],k=a.expression.elements,l=k.length;for(var m=0;m<l;m++)k[m].type==="labeled"&&(i.push(k[m].label),j.push(f+"["+m+"]"))}else if(a.expression.type==="labeled")var i=[a.expression.label],j=[f];else var i=[],j=[];return b("var ${savedPosVar} = pos;","${expressionCode}","var ${actionResultVar} = ${expressionResultVar} !== null"," ? (function(${formalParams}) {${actionCode}})(${actualParams})"," : null;","if (${actionResultVar} !== null) {"," var ${resultVar} = ${actionResultVar};","} else {"," var ${resultVar} = null;"," pos = ${savedPosVar};","}",{expressionCode:d(a.expression,f),expressionResultVar:f,actionCode:a.code,actionResultVar:g,formalParams:i.join(", "),actualParams:j.join(", "),savedPosVar:h,resultVar:e})},rule_ref:function(a,c){return b("var ${resultVar} = ${ruleMethod}();",{ruleMethod:"parse_"+a.name,resultVar:c})},literal:function(a,c){return b("if (input.substr(pos, ${length}) === ${value|string}) {"," var ${resultVar} = ${value|string};"," pos += ${length};","} else {"," var ${resultVar} = null;"," if (reportMatchFailures) {"," matchFailed(${valueQuoted|string});"," }","}",{value:a.value,valueQuoted:quote(a.value),length:a.value.length,resultVar:c})},any:function(a,c){return b("if (input.length > pos) {"," var ${resultVar} = input.charAt(pos);"," pos++;","} else {"," var ${resultVar} = null;"," if (reportMatchFailures) {"," matchFailed('any character');"," }","}",{resultVar:c})},"class":function(a,c){if(a.parts.length>0)var d="/^["+(a.inverted?"^":"")+map(a.parts,function(a){return a instanceof Array?quoteForRegexpClass(a[0])+"-"+quoteForRegexpClass(a[1]):quoteForRegexpClass(a)}).join("")+"]/";else var d=a.inverted?"/^[\\S\\s]/":"/^(?!)/";return b("if (input.substr(pos).match(${regexp}) !== null) {"," var ${resultVar} = input.charAt(pos);"," pos++;","} else {"," var ${resultVar} = null;"," if (reportMatchFailures) {"," matchFailed(${rawText|string});"," }","}",{regexp:d,rawText:a.rawText,resultVar:c})}});return d(a)};if(typeof module=="object")module.exports=PEG;else if(typeof window=="object")window.PEG=PEG;else throw new Error('Can\'t export PEG library (no "module" nor "window" object detected).')})()
|
@@ -0,0 +1,419 @@
|
|
1
|
+
/*
|
2
|
+
A A L Source code at:
|
3
|
+
T C A <http://www.attacklab.net/>
|
4
|
+
T K B
|
5
|
+
*/
|
6
|
+
|
7
|
+
var Showdown={};
|
8
|
+
Showdown.converter=function(){
|
9
|
+
var _1;
|
10
|
+
var _2;
|
11
|
+
var _3;
|
12
|
+
var _4=0;
|
13
|
+
this.makeHtml=function(_5){
|
14
|
+
_1=new Array();
|
15
|
+
_2=new Array();
|
16
|
+
_3=new Array();
|
17
|
+
_5=_5.replace(/~/g,"~T");
|
18
|
+
_5=_5.replace(/\$/g,"~D");
|
19
|
+
_5=_5.replace(/\r\n/g,"\n");
|
20
|
+
_5=_5.replace(/\r/g,"\n");
|
21
|
+
_5="\n\n"+_5+"\n\n";
|
22
|
+
_5=_6(_5);
|
23
|
+
_5=_5.replace(/^[ \t]+$/mg,"");
|
24
|
+
_5=_7(_5);
|
25
|
+
_5=_8(_5);
|
26
|
+
_5=_9(_5);
|
27
|
+
_5=_a(_5);
|
28
|
+
_5=_5.replace(/~D/g,"$$");
|
29
|
+
_5=_5.replace(/~T/g,"~");
|
30
|
+
return _5;
|
31
|
+
};
|
32
|
+
var _8=function(_b){
|
33
|
+
var _b=_b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(_c,m1,m2,m3,m4){
|
34
|
+
m1=m1.toLowerCase();
|
35
|
+
_1[m1]=_11(m2);
|
36
|
+
if(m3){
|
37
|
+
return m3+m4;
|
38
|
+
}else{
|
39
|
+
if(m4){
|
40
|
+
_2[m1]=m4.replace(/"/g,""");
|
41
|
+
}
|
42
|
+
}
|
43
|
+
return "";
|
44
|
+
});
|
45
|
+
return _b;
|
46
|
+
};
|
47
|
+
var _7=function(_12){
|
48
|
+
_12=_12.replace(/\n/g,"\n\n");
|
49
|
+
var _13="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";
|
50
|
+
var _14="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";
|
51
|
+
_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,_15);
|
52
|
+
_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,_15);
|
53
|
+
_12=_12.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,_15);
|
54
|
+
_12=_12.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,_15);
|
55
|
+
_12=_12.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,_15);
|
56
|
+
_12=_12.replace(/\n\n/g,"\n");
|
57
|
+
return _12;
|
58
|
+
};
|
59
|
+
var _15=function(_16,m1){
|
60
|
+
var _18=m1;
|
61
|
+
_18=_18.replace(/\n\n/g,"\n");
|
62
|
+
_18=_18.replace(/^\n/,"");
|
63
|
+
_18=_18.replace(/\n+$/g,"");
|
64
|
+
_18="\n\n~K"+(_3.push(_18)-1)+"K\n\n";
|
65
|
+
return _18;
|
66
|
+
};
|
67
|
+
var _9=function(_19){
|
68
|
+
_19=_1a(_19);
|
69
|
+
var key=_1c("<hr />");
|
70
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
|
71
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
|
72
|
+
_19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
|
73
|
+
_19=_1d(_19);
|
74
|
+
_19=_1e(_19);
|
75
|
+
_19=_1f(_19);
|
76
|
+
_19=_7(_19);
|
77
|
+
_19=_20(_19);
|
78
|
+
return _19;
|
79
|
+
};
|
80
|
+
var _21=function(_22){
|
81
|
+
_22=_23(_22);
|
82
|
+
_22=_24(_22);
|
83
|
+
_22=_25(_22);
|
84
|
+
_22=_26(_22);
|
85
|
+
_22=_27(_22);
|
86
|
+
_22=_28(_22);
|
87
|
+
_22=_11(_22);
|
88
|
+
_22=_29(_22);
|
89
|
+
_22=_22.replace(/ +\n/g," <br />\n");
|
90
|
+
return _22;
|
91
|
+
};
|
92
|
+
var _24=function(_2a){
|
93
|
+
var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;
|
94
|
+
_2a=_2a.replace(_2b,function(_2c){
|
95
|
+
var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
|
96
|
+
tag=_2e(tag,"\\`*_");
|
97
|
+
return tag;
|
98
|
+
});
|
99
|
+
return _2a;
|
100
|
+
};
|
101
|
+
var _27=function(_2f){
|
102
|
+
_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
|
103
|
+
_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
|
104
|
+
_2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
|
105
|
+
return _2f;
|
106
|
+
};
|
107
|
+
var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
|
108
|
+
if(m7==undefined){
|
109
|
+
m7="";
|
110
|
+
}
|
111
|
+
var _39=m1;
|
112
|
+
var _3a=m2;
|
113
|
+
var _3b=m3.toLowerCase();
|
114
|
+
var url=m4;
|
115
|
+
var _3d=m7;
|
116
|
+
if(url==""){
|
117
|
+
if(_3b==""){
|
118
|
+
_3b=_3a.toLowerCase().replace(/ ?\n/g," ");
|
119
|
+
}
|
120
|
+
url="#"+_3b;
|
121
|
+
if(_1[_3b]!=undefined){
|
122
|
+
url=_1[_3b];
|
123
|
+
if(_2[_3b]!=undefined){
|
124
|
+
_3d=_2[_3b];
|
125
|
+
}
|
126
|
+
}else{
|
127
|
+
if(_39.search(/\(\s*\)$/m)>-1){
|
128
|
+
url="";
|
129
|
+
}else{
|
130
|
+
return _39;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
url=_2e(url,"*_");
|
135
|
+
var _3e="<a href=\""+url+"\"";
|
136
|
+
if(_3d!=""){
|
137
|
+
_3d=_3d.replace(/"/g,""");
|
138
|
+
_3d=_2e(_3d,"*_");
|
139
|
+
_3e+=" title=\""+_3d+"\"";
|
140
|
+
}
|
141
|
+
_3e+=">"+_3a+"</a>";
|
142
|
+
return _3e;
|
143
|
+
};
|
144
|
+
var _26=function(_3f){
|
145
|
+
_3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
|
146
|
+
_3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
|
147
|
+
return _3f;
|
148
|
+
};
|
149
|
+
var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
|
150
|
+
var _49=m1;
|
151
|
+
var _4a=m2;
|
152
|
+
var _4b=m3.toLowerCase();
|
153
|
+
var url=m4;
|
154
|
+
var _4d=m7;
|
155
|
+
if(!_4d){
|
156
|
+
_4d="";
|
157
|
+
}
|
158
|
+
if(url==""){
|
159
|
+
if(_4b==""){
|
160
|
+
_4b=_4a.toLowerCase().replace(/ ?\n/g," ");
|
161
|
+
}
|
162
|
+
url="#"+_4b;
|
163
|
+
if(_1[_4b]!=undefined){
|
164
|
+
url=_1[_4b];
|
165
|
+
if(_2[_4b]!=undefined){
|
166
|
+
_4d=_2[_4b];
|
167
|
+
}
|
168
|
+
}else{
|
169
|
+
return _49;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
_4a=_4a.replace(/"/g,""");
|
173
|
+
url=_2e(url,"*_");
|
174
|
+
var _4e="<img src=\""+url+"\" alt=\""+_4a+"\"";
|
175
|
+
_4d=_4d.replace(/"/g,""");
|
176
|
+
_4d=_2e(_4d,"*_");
|
177
|
+
_4e+=" title=\""+_4d+"\"";
|
178
|
+
_4e+=" />";
|
179
|
+
return _4e;
|
180
|
+
};
|
181
|
+
var _1a=function(_4f){
|
182
|
+
_4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
|
183
|
+
return _1c("<h1>"+_21(m1)+"</h1>");
|
184
|
+
});
|
185
|
+
_4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
|
186
|
+
return _1c("<h2>"+_21(m1)+"</h2>");
|
187
|
+
});
|
188
|
+
_4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
|
189
|
+
var _57=m1.length;
|
190
|
+
return _1c("<h"+_57+">"+_21(m2)+"</h"+_57+">");
|
191
|
+
});
|
192
|
+
return _4f;
|
193
|
+
};
|
194
|
+
var _58;
|
195
|
+
var _1d=function(_59){
|
196
|
+
_59+="~0";
|
197
|
+
var _5a=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
|
198
|
+
if(_4){
|
199
|
+
_59=_59.replace(_5a,function(_5b,m1,m2){
|
200
|
+
var _5e=m1;
|
201
|
+
var _5f=(m2.search(/[*+-]/g)>-1)?"ul":"ol";
|
202
|
+
_5e=_5e.replace(/\n{2,}/g,"\n\n\n");
|
203
|
+
var _60=_58(_5e);
|
204
|
+
_60=_60.replace(/\s+$/,"");
|
205
|
+
_60="<"+_5f+">"+_60+"</"+_5f+">\n";
|
206
|
+
return _60;
|
207
|
+
});
|
208
|
+
}else{
|
209
|
+
_5a=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
|
210
|
+
_59=_59.replace(_5a,function(_61,m1,m2,m3){
|
211
|
+
var _65=m1;
|
212
|
+
var _66=m2;
|
213
|
+
var _67=(m3.search(/[*+-]/g)>-1)?"ul":"ol";
|
214
|
+
var _66=_66.replace(/\n{2,}/g,"\n\n\n");
|
215
|
+
var _68=_58(_66);
|
216
|
+
_68=_65+"<"+_67+">\n"+_68+"</"+_67+">\n";
|
217
|
+
return _68;
|
218
|
+
});
|
219
|
+
}
|
220
|
+
_59=_59.replace(/~0/,"");
|
221
|
+
return _59;
|
222
|
+
};
|
223
|
+
_58=function(_69){
|
224
|
+
_4++;
|
225
|
+
_69=_69.replace(/\n{2,}$/,"\n");
|
226
|
+
_69+="~0";
|
227
|
+
_69=_69.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(_6a,m1,m2,m3,m4){
|
228
|
+
var _6f=m4;
|
229
|
+
var _70=m1;
|
230
|
+
var _71=m2;
|
231
|
+
if(_70||(_6f.search(/\n{2,}/)>-1)){
|
232
|
+
_6f=_9(_72(_6f));
|
233
|
+
}else{
|
234
|
+
_6f=_1d(_72(_6f));
|
235
|
+
_6f=_6f.replace(/\n$/,"");
|
236
|
+
_6f=_21(_6f);
|
237
|
+
}
|
238
|
+
return "<li>"+_6f+"</li>\n";
|
239
|
+
});
|
240
|
+
_69=_69.replace(/~0/g,"");
|
241
|
+
_4--;
|
242
|
+
return _69;
|
243
|
+
};
|
244
|
+
var _1e=function(_73){
|
245
|
+
_73+="~0";
|
246
|
+
_73=_73.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(_74,m1,m2){
|
247
|
+
var _77=m1;
|
248
|
+
var _78=m2;
|
249
|
+
_77=_79(_72(_77));
|
250
|
+
_77=_6(_77);
|
251
|
+
_77=_77.replace(/^\n+/g,"");
|
252
|
+
_77=_77.replace(/\n+$/g,"");
|
253
|
+
_77="<pre><code>"+_77+"\n</code></pre>";
|
254
|
+
return _1c(_77)+_78;
|
255
|
+
});
|
256
|
+
_73=_73.replace(/~0/,"");
|
257
|
+
return _73;
|
258
|
+
};
|
259
|
+
var _1c=function(_7a){
|
260
|
+
_7a=_7a.replace(/(^\n+|\n+$)/g,"");
|
261
|
+
return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
|
262
|
+
};
|
263
|
+
var _23=function(_7b){
|
264
|
+
_7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
|
265
|
+
var c=m3;
|
266
|
+
c=c.replace(/^([ \t]*)/g,"");
|
267
|
+
c=c.replace(/[ \t]*$/g,"");
|
268
|
+
c=_79(c);
|
269
|
+
return m1+"<code>"+c+"</code>";
|
270
|
+
});
|
271
|
+
return _7b;
|
272
|
+
};
|
273
|
+
var _79=function(_82){
|
274
|
+
_82=_82.replace(/&/g,"&");
|
275
|
+
_82=_82.replace(/</g,"<");
|
276
|
+
_82=_82.replace(/>/g,">");
|
277
|
+
_82=_2e(_82,"*_{}[]\\",false);
|
278
|
+
return _82;
|
279
|
+
};
|
280
|
+
var _29=function(_83){
|
281
|
+
_83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");
|
282
|
+
_83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");
|
283
|
+
return _83;
|
284
|
+
};
|
285
|
+
var _1f=function(_84){
|
286
|
+
_84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
|
287
|
+
var bq=m1;
|
288
|
+
bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
|
289
|
+
bq=bq.replace(/~0/g,"");
|
290
|
+
bq=bq.replace(/^[ \t]+$/gm,"");
|
291
|
+
bq=_9(bq);
|
292
|
+
bq=bq.replace(/(^|\n)/g,"$1 ");
|
293
|
+
bq=bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(_88,m1){
|
294
|
+
var pre=m1;
|
295
|
+
pre=pre.replace(/^ /mg,"~0");
|
296
|
+
pre=pre.replace(/~0/g,"");
|
297
|
+
return pre;
|
298
|
+
});
|
299
|
+
return _1c("<blockquote>\n"+bq+"\n</blockquote>");
|
300
|
+
});
|
301
|
+
return _84;
|
302
|
+
};
|
303
|
+
var _20=function(_8b){
|
304
|
+
_8b=_8b.replace(/^\n+/g,"");
|
305
|
+
_8b=_8b.replace(/\n+$/g,"");
|
306
|
+
var _8c=_8b.split(/\n{2,}/g);
|
307
|
+
var _8d=new Array();
|
308
|
+
var end=_8c.length;
|
309
|
+
for(var i=0;i<end;i++){
|
310
|
+
var str=_8c[i];
|
311
|
+
if(str.search(/~K(\d+)K/g)>=0){
|
312
|
+
_8d.push(str);
|
313
|
+
}else{
|
314
|
+
if(str.search(/\S/)>=0){
|
315
|
+
str=_21(str);
|
316
|
+
str=str.replace(/^([ \t]*)/g,"<p>");
|
317
|
+
str+="</p>";
|
318
|
+
_8d.push(str);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
}
|
322
|
+
end=_8d.length;
|
323
|
+
for(var i=0;i<end;i++){
|
324
|
+
while(_8d[i].search(/~K(\d+)K/)>=0){
|
325
|
+
var _91=_3[RegExp.$1];
|
326
|
+
_91=_91.replace(/\$/g,"$$$$");
|
327
|
+
_8d[i]=_8d[i].replace(/~K\d+K/,_91);
|
328
|
+
}
|
329
|
+
}
|
330
|
+
return _8d.join("\n\n");
|
331
|
+
};
|
332
|
+
var _11=function(_92){
|
333
|
+
_92=_92.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&");
|
334
|
+
_92=_92.replace(/<(?![a-z\/?\$!])/gi,"<");
|
335
|
+
return _92;
|
336
|
+
};
|
337
|
+
var _25=function(_93){
|
338
|
+
_93=_93.replace(/\\(\\)/g,_94);
|
339
|
+
_93=_93.replace(/\\([`*_{}\[\]()>#+-.!])/g,_94);
|
340
|
+
return _93;
|
341
|
+
};
|
342
|
+
var _28=function(_95){
|
343
|
+
_95=_95.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"<a href=\"$1\">$1</a>");
|
344
|
+
_95=_95.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(_96,m1){
|
345
|
+
return _98(_a(m1));
|
346
|
+
});
|
347
|
+
return _95;
|
348
|
+
};
|
349
|
+
var _98=function(_99){
|
350
|
+
function char2hex(ch){
|
351
|
+
var _9b="0123456789ABCDEF";
|
352
|
+
var dec=ch.charCodeAt(0);
|
353
|
+
return (_9b.charAt(dec>>4)+_9b.charAt(dec&15));
|
354
|
+
}
|
355
|
+
var _9d=[function(ch){
|
356
|
+
return "&#"+ch.charCodeAt(0)+";";
|
357
|
+
},function(ch){
|
358
|
+
return "&#x"+char2hex(ch)+";";
|
359
|
+
},function(ch){
|
360
|
+
return ch;
|
361
|
+
}];
|
362
|
+
_99="mailto:"+_99;
|
363
|
+
_99=_99.replace(/./g,function(ch){
|
364
|
+
if(ch=="@"){
|
365
|
+
ch=_9d[Math.floor(Math.random()*2)](ch);
|
366
|
+
}else{
|
367
|
+
if(ch!=":"){
|
368
|
+
var r=Math.random();
|
369
|
+
ch=(r>0.9?_9d[2](ch):r>0.45?_9d[1](ch):_9d[0](ch));
|
370
|
+
}
|
371
|
+
}
|
372
|
+
return ch;
|
373
|
+
});
|
374
|
+
_99="<a href=\""+_99+"\">"+_99+"</a>";
|
375
|
+
_99=_99.replace(/">.+:/g,"\">");
|
376
|
+
return _99;
|
377
|
+
};
|
378
|
+
var _a=function(_a3){
|
379
|
+
_a3=_a3.replace(/~E(\d+)E/g,function(_a4,m1){
|
380
|
+
var _a6=parseInt(m1);
|
381
|
+
return String.fromCharCode(_a6);
|
382
|
+
});
|
383
|
+
return _a3;
|
384
|
+
};
|
385
|
+
var _72=function(_a7){
|
386
|
+
_a7=_a7.replace(/^(\t|[ ]{1,4})/gm,"~0");
|
387
|
+
_a7=_a7.replace(/~0/g,"");
|
388
|
+
return _a7;
|
389
|
+
};
|
390
|
+
var _6=function(_a8){
|
391
|
+
_a8=_a8.replace(/\t(?=\t)/g," ");
|
392
|
+
_a8=_a8.replace(/\t/g,"~A~B");
|
393
|
+
_a8=_a8.replace(/~B(.+?)~A/g,function(_a9,m1,m2){
|
394
|
+
var _ac=m1;
|
395
|
+
var _ad=4-_ac.length%4;
|
396
|
+
for(var i=0;i<_ad;i++){
|
397
|
+
_ac+=" ";
|
398
|
+
}
|
399
|
+
return _ac;
|
400
|
+
});
|
401
|
+
_a8=_a8.replace(/~A/g," ");
|
402
|
+
_a8=_a8.replace(/~B/g,"");
|
403
|
+
return _a8;
|
404
|
+
};
|
405
|
+
var _2e=function(_af,_b0,_b1){
|
406
|
+
var _b2="(["+_b0.replace(/([\[\]\\])/g,"\\$1")+"])";
|
407
|
+
if(_b1){
|
408
|
+
_b2="\\\\"+_b2;
|
409
|
+
}
|
410
|
+
var _b3=new RegExp(_b2,"g");
|
411
|
+
_af=_af.replace(_b3,_94);
|
412
|
+
return _af;
|
413
|
+
};
|
414
|
+
var _94=function(_b4,m1){
|
415
|
+
var _b6=m1.charCodeAt(0);
|
416
|
+
return "~E"+_b6+"E";
|
417
|
+
};
|
418
|
+
};
|
419
|
+
if(typeof exports!='undefined')exports.Showdown=Showdown;
|