marty 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +84 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/marty/application.js +15 -0
- data/app/assets/stylesheets/marty/application.css +13 -0
- data/app/components/marty/api_auth_view.rb +32 -0
- data/app/components/marty/auth_app.rb +55 -0
- data/app/components/marty/auth_app.rb~ +51 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js +91 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js~ +91 -0
- data/app/components/marty/cm_form_panel.rb~ +5 -0
- data/app/components/marty/cm_grid_panel.rb~ +35 -0
- data/app/components/marty/data_import_view.rb~ +142 -0
- data/app/components/marty/extras/layout.rb +46 -0
- data/app/components/marty/extras/layout.rb~ +46 -0
- data/app/components/marty/extras/misc.rb +18 -0
- data/app/components/marty/form.rb +6 -0
- data/app/components/marty/grid.rb +45 -0
- data/app/components/marty/grid_append_only.rb +12 -0
- data/app/components/marty/import_type_view.rb +53 -0
- data/app/components/marty/live_search_grid_panel.rb +46 -0
- data/app/components/marty/live_search_grid_panel.rb~ +49 -0
- data/app/components/marty/main_auth_app.rb +269 -0
- data/app/components/marty/main_auth_app.rb~ +238 -0
- data/app/components/marty/mcfly_grid_panel.rb +62 -0
- data/app/components/marty/mcfly_grid_panel.rb~ +80 -0
- data/app/components/marty/new_posting_form.rb +46 -0
- data/app/components/marty/new_posting_form.rb~ +46 -0
- data/app/components/marty/new_posting_window.rb +21 -0
- data/app/components/marty/new_posting_window.rb~ +21 -0
- data/app/components/marty/panel.rb +12 -0
- data/app/components/marty/pivot_grid.rb +52 -0
- data/app/components/marty/pivot_grid/endpoints.rb +45 -0
- data/app/components/marty/pivot_grid/javascripts/extensions.js +150 -0
- data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +86 -0
- data/app/components/marty/pivot_grid/services.rb +44 -0
- data/app/components/marty/posting_grid.rb +139 -0
- data/app/components/marty/posting_grid.rb~ +140 -0
- data/app/components/marty/posting_window.rb +27 -0
- data/app/components/marty/promise_view.rb +177 -0
- data/app/components/marty/promise_view.rb~ +157 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css +26 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css~ +15 -0
- data/app/components/marty/report_form.rb +225 -0
- data/app/components/marty/report_form.rb~ +217 -0
- data/app/components/marty/report_select.rb +145 -0
- data/app/components/marty/report_select.rb~ +133 -0
- data/app/components/marty/reporting.rb +39 -0
- data/app/components/marty/reporting.rb~ +39 -0
- data/app/components/marty/script_detail.rb~ +430 -0
- data/app/components/marty/script_form.rb +233 -0
- data/app/components/marty/script_form.rb~ +233 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js +698 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +909 -0
- data/app/components/marty/script_form/javascripts/codemirror.js +3130 -0
- data/app/components/marty/script_form/javascripts/mode/clike/clike.js +284 -0
- data/app/components/marty/script_form/javascripts/mode/clike/index.html +102 -0
- data/app/components/marty/script_form/javascripts/mode/clike/scala.html +766 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/clojure.js +206 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/index.html +67 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/LICENSE +22 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/coffeescript.js +346 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/index.html +728 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/commonlisp.js +101 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/index.html +165 -0
- data/app/components/marty/script_form/javascripts/mode/css/css.js +448 -0
- data/app/components/marty/script_form/javascripts/mode/css/index.html +58 -0
- data/app/components/marty/script_form/javascripts/mode/css/test.js +501 -0
- data/app/components/marty/script_form/javascripts/mode/delorean/delorean.js +189 -0
- data/app/components/marty/script_form/javascripts/mode/diff/diff.js +32 -0
- data/app/components/marty/script_form/javascripts/mode/diff/index.html +105 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/ecl.js +203 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/erlang.js +463 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/gfm.js +150 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/index.html +48 -0
- data/app/components/marty/script_form/javascripts/mode/go/go.js +170 -0
- data/app/components/marty/script_form/javascripts/mode/go/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/groovy.js +210 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/index.html +72 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/haskell.js +242 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/index.html +61 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/haxe.js +429 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/index.html +91 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/htmlembedded.js +72 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/htmlmixed.js +84 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/index.html +52 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/index.html +78 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/javascript.js +361 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/index.html +38 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/jinja2.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/less/index.html +740 -0
- data/app/components/marty/script_form/javascripts/mode/less/less.js +266 -0
- data/app/components/marty/script_form/javascripts/mode/lua/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/lua/lua.js +140 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/index.html +343 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/markdown.js +382 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/test.js +1084 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/mysql.js +186 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/index.html +33 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/ntriples.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/index.html +130 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/ocaml.js +114 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/LICENSE +7 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/pascal.js +94 -0
- data/app/components/marty/script_form/javascripts/mode/perl/LICENSE +19 -0
- data/app/components/marty/script_form/javascripts/mode/perl/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/perl/perl.js +816 -0
- data/app/components/marty/script_form/javascripts/mode/php/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/php/php.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/pig/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/pig/pig.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/plsql.js +217 -0
- data/app/components/marty/script_form/javascripts/mode/properties/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/properties/properties.js +63 -0
- data/app/components/marty/script_form/javascripts/mode/python/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/python/index.html +123 -0
- data/app/components/marty/script_form/javascripts/mode/python/python.js +338 -0
- data/app/components/marty/script_form/javascripts/mode/r/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/r/index.html +74 -0
- data/app/components/marty/script_form/javascripts/mode/r/r.js +141 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/changes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/index.html +54 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/index.html +100 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.css +5 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.js +66 -0
- data/app/components/marty/script_form/javascripts/mode/rst/index.html +526 -0
- data/app/components/marty/script_form/javascripts/mode/rst/rst.js +326 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/index.html +172 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/ruby.js +195 -0
- data/app/components/marty/script_form/javascripts/mode/rust/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/rust/rust.js +432 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/index.html +65 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/scheme.js +230 -0
- data/app/components/marty/script_form/javascripts/mode/shell/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/shell/shell.js +118 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/LICENSE +23 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/index.html +81 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/sieve.js +156 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/index.html +56 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/smalltalk.js +139 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/smarty.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/sparql.js +143 -0
- data/app/components/marty/script_form/javascripts/mode/stex/index.html +98 -0
- data/app/components/marty/script_form/javascripts/mode/stex/stex.js +182 -0
- data/app/components/marty/script_form/javascripts/mode/stex/test.js +343 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/index.html +141 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.css +26 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.js +309 -0
- data/app/components/marty/script_form/javascripts/mode/vb/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/vb/index.html +89 -0
- data/app/components/marty/script_form/javascripts/mode/vb/vb.js +260 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/vbscript.js +26 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/index.html +104 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/velocity.js +146 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/index.html +211 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/verilog.js +194 -0
- data/app/components/marty/script_form/javascripts/mode/xml/index.html +45 -0
- data/app/components/marty/script_form/javascripts/mode/xml/xml.js +318 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/LICENSE +20 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/index.html +223 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/index.html +27 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testBase.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testNamespaces.js +91 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testQuotes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/xquery.js +451 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/index.html +68 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/yaml.js +95 -0
- data/app/components/marty/script_form/javascripts/util/closetag.js +164 -0
- data/app/components/marty/script_form/javascripts/util/dialog.css +27 -0
- data/app/components/marty/script_form/javascripts/util/dialog.js +70 -0
- data/app/components/marty/script_form/javascripts/util/foldcode.js +196 -0
- data/app/components/marty/script_form/javascripts/util/formatting.js +193 -0
- data/app/components/marty/script_form/javascripts/util/javascript-hint.js +134 -0
- data/app/components/marty/script_form/javascripts/util/loadmode.js +51 -0
- data/app/components/marty/script_form/javascripts/util/match-highlighter.js +44 -0
- data/app/components/marty/script_form/javascripts/util/multiplex.js +77 -0
- data/app/components/marty/script_form/javascripts/util/overlay.js +54 -0
- data/app/components/marty/script_form/javascripts/util/pig-hint.js +123 -0
- data/app/components/marty/script_form/javascripts/util/runmode-standalone.js +90 -0
- data/app/components/marty/script_form/javascripts/util/runmode.js +53 -0
- data/app/components/marty/script_form/javascripts/util/search.js +118 -0
- data/app/components/marty/script_form/javascripts/util/searchcursor.js +119 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.css +16 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.js +97 -0
- data/app/components/marty/script_form/javascripts/util/xml-hint.js +137 -0
- data/app/components/marty/script_form/stylesheets/codemirror.css +172 -0
- data/app/components/marty/script_form/stylesheets/delorean.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/ambiance.css +81 -0
- data/app/components/marty/script_form/stylesheets/theme/blackboard.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/cobalt.css +18 -0
- data/app/components/marty/script_form/stylesheets/theme/eclipse.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/elegant.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/erlang-dark.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/lesser-dark.css +44 -0
- data/app/components/marty/script_form/stylesheets/theme/monokai.css +28 -0
- data/app/components/marty/script_form/stylesheets/theme/neat.css +9 -0
- data/app/components/marty/script_form/stylesheets/theme/night.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/rubyblue.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/vibrant-ink.css +27 -0
- data/app/components/marty/script_form/stylesheets/theme/xq-dark.css +46 -0
- data/app/components/marty/script_grid.rb +104 -0
- data/app/components/marty/script_grid.rb~ +99 -0
- data/app/components/marty/script_tester.rb +114 -0
- data/app/components/marty/script_tester.rb~ +213 -0
- data/app/components/marty/scripting.rb +132 -0
- data/app/components/marty/scripting.rb~ +124 -0
- data/app/components/marty/select_report.rb~ +143 -0
- data/app/components/marty/simple_app.rb +97 -0
- data/app/components/marty/simple_app.rb~ +101 -0
- data/app/components/marty/simple_app/javascripts/simple_app.js +50 -0
- data/app/components/marty/simple_app/javascripts/statusbar_ext.js +8 -0
- data/app/components/marty/tag_grid.rb +83 -0
- data/app/components/marty/tag_grid.rb~ +89 -0
- data/app/components/marty/tree_panel.rb~ +256 -0
- data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +317 -0
- data/app/components/marty/user_pivot.rb +128 -0
- data/app/components/marty/user_view.rb +181 -0
- data/app/components/marty/user_view.rb~ +188 -0
- data/app/controllers/marty/application_controller.rb +124 -0
- data/app/controllers/marty/application_controller.rb~ +133 -0
- data/app/controllers/marty/components_controller.rb +41 -0
- data/app/controllers/marty/components_controller.rb~ +37 -0
- data/app/controllers/marty/job_controller.rb +28 -0
- data/app/controllers/marty/job_controller.rb~ +28 -0
- data/app/controllers/marty/rpc_controller.rb +64 -0
- data/app/controllers/marty/rpc_controller.rb~ +61 -0
- data/app/helpers/marty/application_helper.rb +4 -0
- data/app/helpers/marty/script_set.rb +57 -0
- data/app/helpers/marty/script_set.rb~ +59 -0
- data/app/models/marty/api_auth.rb +44 -0
- data/app/models/marty/api_auth.rb~ +48 -0
- data/app/models/marty/base.rb +4 -0
- data/app/models/marty/data_change.rb +179 -0
- data/app/models/marty/data_change.rb~ +141 -0
- data/app/models/marty/enum.rb +22 -0
- data/app/models/marty/enum.rb~ +16 -0
- data/app/models/marty/import_type.rb +44 -0
- data/app/models/marty/import_type.rb~ +48 -0
- data/app/models/marty/poop.rb~ +169 -0
- data/app/models/marty/posting.rb +101 -0
- data/app/models/marty/posting.rb~ +86 -0
- data/app/models/marty/posting_type.rb +12 -0
- data/app/models/marty/posting_type.rb~ +21 -0
- data/app/models/marty/promise.rb +252 -0
- data/app/models/marty/promise.rb~ +196 -0
- data/app/models/marty/role.rb +6 -0
- data/app/models/marty/role.rb~ +10 -0
- data/app/models/marty/script.rb +144 -0
- data/app/models/marty/script.rb~ +62 -0
- data/app/models/marty/tag.rb +96 -0
- data/app/models/marty/tag.rb~ +91 -0
- data/app/models/marty/token.rb +30 -0
- data/app/models/marty/user.rb +146 -0
- data/app/models/marty/user.rb~ +148 -0
- data/app/models/marty/user_role.rb +7 -0
- data/app/models/marty/user_role.rb~ +13 -0
- data/app/views/layouts/marty/application.html.erb +12 -0
- data/app/views/layouts/marty/application.html.erb~ +11 -0
- data/config/locales/en.yml +134 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +10 -0
- data/db/migrate/001_create_marty_scripts.rb +14 -0
- data/db/migrate/003_create_marty_users.rb +12 -0
- data/db/migrate/004_create_marty_roles.rb +7 -0
- data/db/migrate/005_create_marty_user_roles.rb +14 -0
- data/db/migrate/006_create_marty_tokens.rb +14 -0
- data/db/migrate/008_create_marty_posting_types.rb +7 -0
- data/db/migrate/019_create_marty_postings.rb +18 -0
- data/db/migrate/019_create_marty_postings.rb~ +19 -0
- data/db/migrate/068_create_marty_import_types.rb +12 -0
- data/db/migrate/069_create_marty_import_synonyms.rb +15 -0
- data/db/migrate/070_create_versions.rb +18 -0
- data/db/migrate/071_add_object_changes_column_to_versions.rb +9 -0
- data/db/migrate/072_add_validation_function_to_import_types.rb +6 -0
- data/db/migrate/073_add_preprocess_function_to_import_types.rb +5 -0
- data/db/migrate/090_create_delayed_jobs.rb +22 -0
- data/db/migrate/091_create_marty_promises.rb +36 -0
- data/db/migrate/095_create_marty_tags.rb +14 -0
- data/db/migrate/095_create_marty_tags.rb~ +19 -0
- data/db/migrate/096_add_user_roles_to_import_types.rb +11 -0
- data/db/migrate/097_drop_versions.rb +9 -0
- data/db/migrate/098_create_marty_api_auths.rb +20 -0
- data/db/seeds.rb +48 -0
- data/lib/marty.rb +18 -0
- data/lib/marty.rb~ +13 -0
- data/lib/marty/content_handler.rb +97 -0
- data/lib/marty/content_handler.rb~ +93 -0
- data/lib/marty/data_conversion.rb +298 -0
- data/lib/marty/data_exporter.rb +150 -0
- data/lib/marty/data_exporter.rb~ +137 -0
- data/lib/marty/data_importer.rb +122 -0
- data/lib/marty/data_importer.rb~ +114 -0
- data/lib/marty/data_row_processor.rb~ +206 -0
- data/lib/marty/drop_folder_hook.rb~ +17 -0
- data/lib/marty/engine.rb +10 -0
- data/lib/marty/folder_hook.rb~ +9 -0
- data/lib/marty/lazy_column_loader.rb +57 -0
- data/lib/marty/lazy_column_loader.rb~ +47 -0
- data/lib/marty/mcfly_query.rb +189 -0
- data/lib/marty/mcfly_query.rb~ +188 -0
- data/lib/marty/migrations.rb +108 -0
- data/lib/marty/migrations.rb~ +65 -0
- data/lib/marty/monkey.rb +163 -0
- data/lib/marty/monkey.rb~ +160 -0
- data/lib/marty/permissions.rb +64 -0
- data/lib/marty/permissions.rb~ +69 -0
- data/lib/marty/promise.rb~ +41 -0
- data/lib/marty/promise_job.rb +123 -0
- data/lib/marty/promise_job.rb~ +121 -0
- data/lib/marty/promise_proxy.rb +94 -0
- data/lib/marty/promise_proxy.rb~ +69 -0
- data/lib/marty/railtie.rb +5 -0
- data/lib/marty/relation.rb +39 -0
- data/lib/marty/util.rb +110 -0
- data/lib/marty/util.rb~ +80 -0
- data/lib/marty/version.rb +3 -0
- data/lib/marty/version.rb~ +3 -0
- data/lib/marty/xl.rb +527 -0
- data/lib/marty/xl.rb~ +526 -0
- data/lib/pyxll/README.txt +19 -0
- data/lib/pyxll/README.txt~ +16 -0
- data/lib/pyxll/gemini.py +155 -0
- data/lib/pyxll/gemini.py~ +110 -0
- data/lib/pyxll/pyxll.cfg +12 -0
- data/lib/pyxll/pyxll.cfg~ +12 -0
- data/lib/pyxll/sample.xlsx +0 -0
- data/lib/tasks/marty_tasks.rake +37 -0
- metadata +517 -0
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
This is a modified version of the ExtJS Codemirror component from
|
|
4
|
+
http://www.mzsolutions.eu/Extjs-CodeMirror-component.html. It's been
|
|
5
|
+
modified to remove the toolbar and also it uses delorean mode by
|
|
6
|
+
default.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
* @class Ext.ux.layout.component.field.CodeMirror
|
|
13
|
+
* @extends Ext.layout.component.field.Field
|
|
14
|
+
* @author Adrian Teodorescu (ateodorescu@gmail.com)
|
|
15
|
+
*
|
|
16
|
+
* Layout class for {@link Ext.ux.form.field.CodeMirror} fields. Handles sizing the codemirror field.
|
|
17
|
+
*/
|
|
18
|
+
Ext.define('Ext.ux.layout.component.field.CodeMirror', {
|
|
19
|
+
extend: 'Ext.layout.component.Auto',
|
|
20
|
+
alias: ['layout.codemirror'],
|
|
21
|
+
|
|
22
|
+
type: 'codemirror',
|
|
23
|
+
|
|
24
|
+
beginLayout: function(ownerContext) {
|
|
25
|
+
this.callParent(arguments);
|
|
26
|
+
|
|
27
|
+
ownerContext.textAreaContext = ownerContext.getEl('textareaEl');
|
|
28
|
+
ownerContext.editorContext = ownerContext.getEl('editorEl');
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
renderItems: Ext.emptyFn,
|
|
32
|
+
|
|
33
|
+
getRenderTarget: function() {
|
|
34
|
+
return this.owner.bodyEl;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
publishInnerHeight: function (ownerContext, height) {
|
|
38
|
+
var me = this,
|
|
39
|
+
innerHeight = height - me.measureLabelErrorHeight(ownerContext) -
|
|
40
|
+
ownerContext.bodyCellContext.getPaddingInfo().height;
|
|
41
|
+
if (Ext.isNumber(innerHeight)) {
|
|
42
|
+
ownerContext.textAreaContext.setHeight(innerHeight);
|
|
43
|
+
ownerContext.editorContext.setHeight(innerHeight);
|
|
44
|
+
} else {
|
|
45
|
+
me.done = false;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
publishInnerWidth: function (ownerContext, width) {
|
|
50
|
+
var me = this;
|
|
51
|
+
|
|
52
|
+
if (Ext.isNumber(width)) {
|
|
53
|
+
ownerContext.textAreaContext.setWidth(width);
|
|
54
|
+
ownerContext.editorContext.setWidth(width);
|
|
55
|
+
} else {
|
|
56
|
+
me.done = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
Ext.define('Ext.ux.form.field.CodeMirror', {
|
|
62
|
+
extend: 'Ext.Component',
|
|
63
|
+
mixins: {
|
|
64
|
+
labelable: 'Ext.form.Labelable',
|
|
65
|
+
field: 'Ext.form.field.Field'
|
|
66
|
+
},
|
|
67
|
+
alias: 'widget.codemirror',
|
|
68
|
+
alternateClassName: 'Ext.form.CodeMirror',
|
|
69
|
+
requires: [
|
|
70
|
+
'Ext.tip.QuickTipManager',
|
|
71
|
+
'Ext.util.Format',
|
|
72
|
+
'Ext.ux.layout.component.field.CodeMirror'
|
|
73
|
+
],
|
|
74
|
+
|
|
75
|
+
childEls: [
|
|
76
|
+
'editorEl', 'textareaEl'
|
|
77
|
+
],
|
|
78
|
+
|
|
79
|
+
fieldSubTpl: [
|
|
80
|
+
'<textarea id="{cmpId}-textareaEl" name="{name}" tabIndex="-1" class="{textareaCls}" ',
|
|
81
|
+
'style="{size}" autocomplete="off"></textarea>',
|
|
82
|
+
'<div id="{cmpId}-editorEl" class="{editorCls}" name="{editorName}" style="{size}"></div>',
|
|
83
|
+
{
|
|
84
|
+
disableFormats: true
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
|
|
88
|
+
// FIXME: the layout mechanism is currently busted
|
|
89
|
+
// componentLayout: 'codemirror',
|
|
90
|
+
|
|
91
|
+
editorWrapCls: Ext.baseCSSPrefix + 'html-editor-wrap',
|
|
92
|
+
|
|
93
|
+
maskOnDisable: true,
|
|
94
|
+
|
|
95
|
+
afterBodyEl: '</div>',
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
// map tabs to 4 spaces -- arman (doesn't work - may need new version)
|
|
99
|
+
extraKeys: {
|
|
100
|
+
"Tab": function() {
|
|
101
|
+
editor.replaceSelection(" " , "end");
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @cfg {String} mode The default mode to use when the editor is initialized. When not given, this will default to the first mode that was loaded.
|
|
108
|
+
* It may be a string, which either simply names the mode or is a MIME type associated with the mode. Alternatively,
|
|
109
|
+
* it may be an object containing configuration options for the mode, with a name property that names the mode
|
|
110
|
+
* (for example {name: "javascript", json: true}). The demo pages for each mode contain information about what
|
|
111
|
+
* configuration parameters the mode supports.
|
|
112
|
+
*/
|
|
113
|
+
mode: 'text/plain',
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @cfg {Boolean} showAutoIndent Enable auto indent button for indenting the selected range
|
|
117
|
+
*/
|
|
118
|
+
showAutoIndent: true,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @cfg {Boolean} showLineNumbers Enable line numbers button in the toolbar.
|
|
122
|
+
*/
|
|
123
|
+
showLineNumbers: true,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @cfg {Boolean} enableMatchBrackets Force matching-bracket-highlighting to happen
|
|
127
|
+
*/
|
|
128
|
+
enableMatchBrackets: true,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @cfg {Boolean} enableElectricChars Configures whether the editor should re-indent the current line when a character is typed
|
|
132
|
+
* that might change its proper indentation (only works if the mode supports indentation).
|
|
133
|
+
*/
|
|
134
|
+
enableElectricChars: false,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @cfg {Boolean} enableIndentWithTabs Whether, when indenting, the first N*tabSize spaces should be replaced by N tabs.
|
|
138
|
+
*/
|
|
139
|
+
enableIndentWithTabs: true,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @cfg {Boolean} enableSmartIndent Whether to use the context-sensitive indentation that the mode provides (or just indent the same as the line before).
|
|
143
|
+
*/
|
|
144
|
+
enableSmartIndent: true,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @cfg {Boolean} enableLineWrapping Whether CodeMirror should scroll or wrap for long lines.
|
|
148
|
+
*/
|
|
149
|
+
enableLineWrapping: false,
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @cfg {Boolean} enableLineNumbers Whether to show line numbers to the left of the editor.
|
|
153
|
+
*/
|
|
154
|
+
enableLineNumbers: true,
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @cfg {Boolean} enableGutter Can be used to force a 'gutter' (empty space on the left of the editor) to be shown even
|
|
158
|
+
* when no line numbers are active. This is useful for setting markers.
|
|
159
|
+
*/
|
|
160
|
+
enableGutter: true,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @cfg {Boolean} enableFixedGutter When enabled (off by default), this will make the gutter stay visible when the
|
|
164
|
+
* document is scrolled horizontally.
|
|
165
|
+
*/
|
|
166
|
+
enableFixedGutter: false,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @cfg {Number} firstLineNumber At which number to start counting lines.
|
|
170
|
+
*/
|
|
171
|
+
firstLineNumber: 1,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @cfg {Boolean} readOnly <tt>true</tt> to mark the field as readOnly.
|
|
175
|
+
*/
|
|
176
|
+
readOnly : false,
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @cfg {Number} pollInterval Indicates how quickly (miliseconds) CodeMirror should poll its input textarea for changes.
|
|
180
|
+
* Most input is captured by events, but some things, like IME input on some browsers, doesn't generate events
|
|
181
|
+
* that allow CodeMirror to properly detect it. Thus, it polls.
|
|
182
|
+
*/
|
|
183
|
+
pollInterval: 100,
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @cfg {Number} indentUnit How many spaces a block (whatever that means in the edited language) should be indented.
|
|
187
|
+
*/
|
|
188
|
+
indentUnit: 4,
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @cfg {Number} tabSize The width of a tab character.
|
|
192
|
+
*/
|
|
193
|
+
tabSize: 4,
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @cfg {String} theme The theme to style the editor with. You must make sure the CSS file defining the corresponding
|
|
197
|
+
* .cm-s-[name] styles is loaded (see the theme directory in the distribution). The default is "default", for which
|
|
198
|
+
* colors are included in codemirror.css. It is possible to use multiple theming classes at once—for example
|
|
199
|
+
* "foo bar" will assign both the cm-s-foo and the cm-s-bar classes to the editor.
|
|
200
|
+
*/
|
|
201
|
+
theme: 'default',
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @property {String} pathModes Path to the modes folder to dinamically load the required scripts. You could also
|
|
205
|
+
* include all your required modes in a big script file and this path will be ignored.
|
|
206
|
+
* Do not fill in the trailing slash.
|
|
207
|
+
*/
|
|
208
|
+
pathModes: 'mode',
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* @property {String} pathExtensions Path to the extensions folder to dinamically load the required scripts. You could also
|
|
212
|
+
* include all your required extensions in a big script file and this path will be ignored.
|
|
213
|
+
* Do not fill in the trailing slash.
|
|
214
|
+
*/
|
|
215
|
+
pathExtensions: 'lib/util',
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @property {Array} extensions Define here extensions script dependencies; This is used by toolbar buttons to automatically
|
|
219
|
+
* load the scripts before using an extension.
|
|
220
|
+
*/
|
|
221
|
+
extensions:{
|
|
222
|
+
format: {
|
|
223
|
+
dependencies: ['formatting.js']
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
scriptsLoaded: [],
|
|
228
|
+
lastMode: '',
|
|
229
|
+
|
|
230
|
+
initComponent : function(){
|
|
231
|
+
var me = this;
|
|
232
|
+
|
|
233
|
+
me.callParent(arguments);
|
|
234
|
+
|
|
235
|
+
me.initLabelable();
|
|
236
|
+
me.initField();
|
|
237
|
+
|
|
238
|
+
/*
|
|
239
|
+
Fix resize issues as suggested by user koblass on the Extjs forums
|
|
240
|
+
http://www.sencha.com/forum/showthread.php?167047-Ext.ux.form.field.CodeMirror-for-Ext-4.x&p=860535&viewfull=1#post860535
|
|
241
|
+
*/
|
|
242
|
+
me.on('resize', function() {
|
|
243
|
+
if (me.editor) {
|
|
244
|
+
me.editor.refresh();
|
|
245
|
+
}
|
|
246
|
+
}, me);
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
getMaskTarget: function(){
|
|
250
|
+
return this.bodyEl;
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @private override
|
|
255
|
+
*/
|
|
256
|
+
getSubTplData: function() {
|
|
257
|
+
var cssPrefix = Ext.baseCSSPrefix;
|
|
258
|
+
return {
|
|
259
|
+
$comp : this,
|
|
260
|
+
cmpId : this.id,
|
|
261
|
+
id : this.getInputId(),
|
|
262
|
+
toolbarWrapCls : cssPrefix + 'html-editor-tb',
|
|
263
|
+
textareaCls : cssPrefix + 'hidden',
|
|
264
|
+
editorCls : cssPrefix + 'codemirror',
|
|
265
|
+
editorName : Ext.id(),
|
|
266
|
+
//size : 'height:100px;width:100%'
|
|
267
|
+
// PennyMac: setting height to 100%.
|
|
268
|
+
size : 'height:100%;width:100%',
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
getSubTplMarkup: function() {
|
|
273
|
+
return this.getTpl('fieldSubTpl').apply(this.getSubTplData());
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @private override
|
|
278
|
+
*/
|
|
279
|
+
onRender: function() {
|
|
280
|
+
var me = this;
|
|
281
|
+
|
|
282
|
+
me.callParent(arguments);
|
|
283
|
+
me.editorEl = me.getEl('editorEl');
|
|
284
|
+
me.bodyEl = me.getEl('bodyEl');
|
|
285
|
+
|
|
286
|
+
me.disableItems(true);
|
|
287
|
+
me.initEditor();
|
|
288
|
+
|
|
289
|
+
me.rendered = true;
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
initRenderData: function() {
|
|
293
|
+
this.beforeSubTpl = '<div class="' + this.editorWrapCls + '">';
|
|
294
|
+
return Ext.applyIf(this.callParent(), this.getLabelableRenderData());
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @private override
|
|
299
|
+
*/
|
|
300
|
+
initEditor : function(){
|
|
301
|
+
var me = this,
|
|
302
|
+
mode = "text/x-delorean";
|
|
303
|
+
|
|
304
|
+
// if no mode is loaded we could get an error like "Object #<Object> has no method 'startState'"
|
|
305
|
+
// search mime to find script dependencies
|
|
306
|
+
var item = me.getMime(me.mode);
|
|
307
|
+
if(item) {
|
|
308
|
+
mode = me.getMimeMode(me.mode);
|
|
309
|
+
if(!mode){
|
|
310
|
+
mode = "text/x-delorean";
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
me.editor = CodeMirror(me.editorEl, {
|
|
315
|
+
matchBrackets: me.enableMatchBrackets,
|
|
316
|
+
electricChars: me.enableElectricChars,
|
|
317
|
+
autoClearEmptyLines:true,
|
|
318
|
+
value: me.rawValue,
|
|
319
|
+
indentUnit: me.indentUnit,
|
|
320
|
+
smartIndent: me.enableSmartIndent,
|
|
321
|
+
indentWithTabs: me.indentWithTabs,
|
|
322
|
+
pollInterval: me.pollInterval,
|
|
323
|
+
lineNumbers: me.enableLineNumbers,
|
|
324
|
+
lineWrapping: me.enableLineWrapping,
|
|
325
|
+
firstLineNumber: me.firstLineNumber,
|
|
326
|
+
tabSize: me.tabSize,
|
|
327
|
+
gutter: me.enableGutter,
|
|
328
|
+
fixedGutter: me.enableFixedGutter,
|
|
329
|
+
theme: me.theme,
|
|
330
|
+
mode: mode,
|
|
331
|
+
onChange: function(editor, tc){
|
|
332
|
+
me.checkChange();
|
|
333
|
+
//me.fireEvent('change', me, tc.from, tc.to, tc.text, tc.next || null);
|
|
334
|
+
},
|
|
335
|
+
onCursorActivity: function(editor){
|
|
336
|
+
me.fireEvent('cursoractivity', me);
|
|
337
|
+
},
|
|
338
|
+
onGutterClick: function(editor, line, event){
|
|
339
|
+
me.fireEvent('gutterclick', me, line, event);
|
|
340
|
+
},
|
|
341
|
+
onFocus: function(editor){
|
|
342
|
+
me.fireEvent('activate', me);
|
|
343
|
+
},
|
|
344
|
+
onBlur: function(editor){
|
|
345
|
+
me.fireEvent('deactivate', me);
|
|
346
|
+
},
|
|
347
|
+
onScroll: function(editor){
|
|
348
|
+
me.fireEvent('scroll', me);
|
|
349
|
+
},
|
|
350
|
+
onHighlightComplete: function(editor){
|
|
351
|
+
me.fireEvent('highlightcomplete', me);
|
|
352
|
+
},
|
|
353
|
+
onUpdate: function(editor){
|
|
354
|
+
me.fireEvent('update', me);
|
|
355
|
+
},
|
|
356
|
+
onKeyEvent: function(editor, event){
|
|
357
|
+
event.cancelBubble = true; // fix suggested by koblass user on Sencha forums (http://www.sencha.com/forum/showthread.php?167047-Ext.ux.form.field.CodeMirror-for-Ext-4.x&p=862029&viewfull=1#post862029)
|
|
358
|
+
me.fireEvent('keyevent', me, event);
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
//me.editor.setValue(me.rawValue);
|
|
362
|
+
me.setMode(me.mode);
|
|
363
|
+
me.setReadOnly(me.readOnly);
|
|
364
|
+
me.fireEvent('initialize', me);
|
|
365
|
+
|
|
366
|
+
// change the codemirror css
|
|
367
|
+
var css = Ext.util.CSS.getRule('.CodeMirror');
|
|
368
|
+
if(css){
|
|
369
|
+
css.style.height = '100%';
|
|
370
|
+
css.style.position = 'relative';
|
|
371
|
+
css.style.overflow = 'hidden';
|
|
372
|
+
}
|
|
373
|
+
var css = Ext.util.CSS.getRule('.CodeMirror-Scroll');
|
|
374
|
+
if(css){
|
|
375
|
+
css.style.height = '100%';
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// PennyMac: align the body to the top. Otherwise it ends up
|
|
379
|
+
// in the center of the enclosing table.
|
|
380
|
+
var el = document.getElementById(me.bodyEl.id);
|
|
381
|
+
el.setAttribute("valign", "top");
|
|
382
|
+
},
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @private
|
|
386
|
+
*/
|
|
387
|
+
relayBtnCmd: function(btn){
|
|
388
|
+
this.relayCmd(btn.getItemId());
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @private
|
|
393
|
+
*/
|
|
394
|
+
relayCmd: function(cmd){
|
|
395
|
+
Ext.defer(function() {
|
|
396
|
+
var me = this;
|
|
397
|
+
me.editor.focus();
|
|
398
|
+
switch(cmd){
|
|
399
|
+
// auto formatting
|
|
400
|
+
case 'justifycenter':
|
|
401
|
+
if(!CodeMirror.extensions.autoIndentRange){
|
|
402
|
+
me.loadDependencies(me.extensions.format, me.pathExtensions, me.doIndentSelection, me);
|
|
403
|
+
}else{
|
|
404
|
+
me.doIndentSelection();
|
|
405
|
+
}
|
|
406
|
+
break;
|
|
407
|
+
|
|
408
|
+
// line numbers
|
|
409
|
+
case 'insertorderedlist':
|
|
410
|
+
me.doChangeLineNumbers();
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}, 10, this);
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @private
|
|
418
|
+
* Reload all CodeMirror extensions for the current instance;
|
|
419
|
+
*
|
|
420
|
+
*/
|
|
421
|
+
reloadExtentions: function(){
|
|
422
|
+
var me = this;
|
|
423
|
+
|
|
424
|
+
for (var ext in CodeMirror.extensions)
|
|
425
|
+
if (CodeMirror.extensions.propertyIsEnumerable(ext) &&
|
|
426
|
+
!me.editor.propertyIsEnumerable(ext))
|
|
427
|
+
me.editor[ext] = CodeMirror.extensions[ext];
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
doChangeLineNumbers: function(){
|
|
431
|
+
var me = this;
|
|
432
|
+
|
|
433
|
+
me.enableLineNumbers = !me.enableLineNumbers;
|
|
434
|
+
me.editor.setOption('lineNumbers', me.enableLineNumbers);
|
|
435
|
+
},
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* @private
|
|
439
|
+
*/
|
|
440
|
+
doIndentSelection: function(){
|
|
441
|
+
var me = this;
|
|
442
|
+
|
|
443
|
+
me.reloadExtentions();
|
|
444
|
+
|
|
445
|
+
try{
|
|
446
|
+
var range = { from: me.editor.getCursor(true), to: me.editor.getCursor(false) };
|
|
447
|
+
me.editor.autoIndentRange(range.from, range.to);
|
|
448
|
+
}catch(err){}
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
modes: [
|
|
452
|
+
{
|
|
453
|
+
mime: ["text/x-delorean"],
|
|
454
|
+
dependencies: []
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* @private
|
|
460
|
+
*/
|
|
461
|
+
getMime: function(mime){
|
|
462
|
+
var me = this, item, found = false;
|
|
463
|
+
|
|
464
|
+
for(var i=0;i<me.modes.length;i++){
|
|
465
|
+
item = me.modes[i];
|
|
466
|
+
if(Ext.isArray(item.mime)){
|
|
467
|
+
if(Ext.Array.contains(item.mime, mime)){
|
|
468
|
+
found = true;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
}else{
|
|
472
|
+
if(item == mime){
|
|
473
|
+
found = true;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if(found)
|
|
479
|
+
return item;
|
|
480
|
+
else
|
|
481
|
+
return null;
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* @private
|
|
486
|
+
*/
|
|
487
|
+
loadDependencies: function(item, path, handler, scope){
|
|
488
|
+
var me = this;
|
|
489
|
+
|
|
490
|
+
me.scripts = [];
|
|
491
|
+
me.scriptIndex = -1;
|
|
492
|
+
|
|
493
|
+
// load the dependencies
|
|
494
|
+
for(var i=0; i < item.dependencies.length; i++){
|
|
495
|
+
if(!Ext.Array.contains(me.scriptsLoaded, path + '/' + item.dependencies[i])){
|
|
496
|
+
var options = {
|
|
497
|
+
url: path + '/' + item.dependencies[i],
|
|
498
|
+
index: ++me.scriptIndex,
|
|
499
|
+
onLoad: function(options){
|
|
500
|
+
var ok = true;
|
|
501
|
+
for(j=0; j < me.scripts.length; j++){
|
|
502
|
+
if(me.scripts[j].called) {// this event could be raised before one script if fetched
|
|
503
|
+
ok = ok && me.scripts[j].success;
|
|
504
|
+
if(me.scripts[j].success && !Ext.Array.contains(me.scriptsLoaded, me.scripts[j].url)){
|
|
505
|
+
me.scriptsLoaded.push(me.scripts[j].url);
|
|
506
|
+
}
|
|
507
|
+
}else{
|
|
508
|
+
ok = false;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if(ok){
|
|
512
|
+
handler.call(scope || me.editor);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
me.scripts[me.scriptIndex] = {
|
|
518
|
+
url: options.url,
|
|
519
|
+
success: true,
|
|
520
|
+
called: false,
|
|
521
|
+
options: options,
|
|
522
|
+
onLoad: options.onLoad || Ext.emptyFn,
|
|
523
|
+
onError: options.onError || Ext.emptyFn
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
for(var i=0; i < me.scripts.length; i++){
|
|
528
|
+
me.loadScript(me.scripts[i].options);
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @private
|
|
534
|
+
*/
|
|
535
|
+
loadScript: function(options){
|
|
536
|
+
var me = this;
|
|
537
|
+
Ext.Ajax.request({
|
|
538
|
+
url: options.url,
|
|
539
|
+
scriptIndex: options.index,
|
|
540
|
+
success: function(response, options) {
|
|
541
|
+
var script = 'Ext.getCmp("' + this.id + '").scripts[' + options.scriptIndex + ']';
|
|
542
|
+
window.setTimeout('try { ' + response.responseText + ' } catch(e) { '+script+'.success = false; '+script+'.onError('+script+'.options, e); }; ' + script + '.called = true; if ('+script+'.success) '+script+'.onLoad('+script+'.options);', 0);
|
|
543
|
+
},
|
|
544
|
+
failure: function(response, options) {
|
|
545
|
+
var script = this.scripts[options.scriptIndex];
|
|
546
|
+
script.success = false;
|
|
547
|
+
script.called = true;
|
|
548
|
+
script.onError(script.options, response.status);
|
|
549
|
+
},
|
|
550
|
+
scope: me
|
|
551
|
+
});
|
|
552
|
+
},
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @private
|
|
556
|
+
* Return mode depending on the mime; If the mime is not loaded then return null
|
|
557
|
+
*
|
|
558
|
+
* @param mime
|
|
559
|
+
*/
|
|
560
|
+
getMimeMode: function(mime){
|
|
561
|
+
var mode = null;
|
|
562
|
+
var mimes = CodeMirror.listMIMEs();
|
|
563
|
+
for(var i=0; i<mimes.length; i++){
|
|
564
|
+
if(mimes[i].mime == mime){
|
|
565
|
+
mode = mimes[i].mode;
|
|
566
|
+
if(typeof mode == "object")
|
|
567
|
+
mode = mode.name;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return mode;
|
|
572
|
+
},
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Change the CodeMirror mode to the specified mime.
|
|
576
|
+
*
|
|
577
|
+
* @param {String} mime The MIME value according to the CodeMirror documentation
|
|
578
|
+
*/
|
|
579
|
+
setMode: function(mime){
|
|
580
|
+
var me = this,
|
|
581
|
+
found = false;
|
|
582
|
+
// search mime to find script dependencies
|
|
583
|
+
var item = me.getMime(mime);
|
|
584
|
+
|
|
585
|
+
if(!item) {
|
|
586
|
+
// mime not found
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
var mode = me.getMimeMode(mime);
|
|
591
|
+
|
|
592
|
+
if(!mode){
|
|
593
|
+
me.loadDependencies(item, me.pathModes, function(){
|
|
594
|
+
var mode = me.getMimeMode(mime);
|
|
595
|
+
if(typeof mode == "string")
|
|
596
|
+
me.editor.setOption('mode', mime);
|
|
597
|
+
else
|
|
598
|
+
me.editor.setOption('mode', mode);
|
|
599
|
+
});
|
|
600
|
+
}else{
|
|
601
|
+
if(typeof mode == "string")
|
|
602
|
+
me.editor.setOption('mode', mime);
|
|
603
|
+
else
|
|
604
|
+
me.editor.setOption('mode', mode);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if(me.modesSelect){
|
|
608
|
+
me.modesSelect.dom.value = mime;
|
|
609
|
+
}
|
|
610
|
+
try{
|
|
611
|
+
me.fireEvent('modechanged', me, mime, me.lastMode);
|
|
612
|
+
me.lastMode = mime;
|
|
613
|
+
}catch(err){}
|
|
614
|
+
},
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Set the editor as read only
|
|
618
|
+
*
|
|
619
|
+
* @param {Boolean} readOnly
|
|
620
|
+
*/
|
|
621
|
+
setReadOnly: function(readOnly) {
|
|
622
|
+
var me = this;
|
|
623
|
+
|
|
624
|
+
if(me.editor){
|
|
625
|
+
me.editor.setOption('readOnly', readOnly);
|
|
626
|
+
me.disableItems(readOnly);
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
onDisable: function() {
|
|
631
|
+
this.bodyEl.mask();
|
|
632
|
+
this.callParent(arguments);
|
|
633
|
+
},
|
|
634
|
+
|
|
635
|
+
onEnable: function() {
|
|
636
|
+
this.bodyEl.unmask();
|
|
637
|
+
this.callParent(arguments);
|
|
638
|
+
},
|
|
639
|
+
|
|
640
|
+
disableItems: function(disabled) {
|
|
641
|
+
},
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Sets a data value into the field and runs the change detection.
|
|
645
|
+
* @param {Mixed} value The value to set
|
|
646
|
+
* @return {Ext.ux.form.field.CodeMirror} this
|
|
647
|
+
*/
|
|
648
|
+
setValue: function(value){
|
|
649
|
+
var me = this;
|
|
650
|
+
|
|
651
|
+
me.mixins.field.setValue.call(me, value);
|
|
652
|
+
me.rawValue = value;
|
|
653
|
+
if(me.editor)
|
|
654
|
+
me.editor.setValue(value);
|
|
655
|
+
return me;
|
|
656
|
+
},
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Return submit value to the owner form.
|
|
660
|
+
* @return {Mixed} The field value
|
|
661
|
+
*/
|
|
662
|
+
getSubmitValue: function(){
|
|
663
|
+
var me = this;
|
|
664
|
+
return me.getValue();
|
|
665
|
+
},
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Return the value of the CodeMirror editor
|
|
669
|
+
* @return {Mixed} The field value
|
|
670
|
+
*/
|
|
671
|
+
getValue: function(){
|
|
672
|
+
var me = this;
|
|
673
|
+
|
|
674
|
+
if(me.editor)
|
|
675
|
+
return me.editor.getValue();
|
|
676
|
+
else
|
|
677
|
+
return null;
|
|
678
|
+
},
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* @private
|
|
682
|
+
*/
|
|
683
|
+
onDestroy: function(){
|
|
684
|
+
var me = this;
|
|
685
|
+
if(me.rendered){
|
|
686
|
+
try {
|
|
687
|
+
Ext.EventManager.removeAll(me.editor);
|
|
688
|
+
for (prop in me.editor) {
|
|
689
|
+
if (me.editor.hasOwnProperty(prop)) {
|
|
690
|
+
delete me.editor[prop];
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}catch(e){}
|
|
694
|
+
}
|
|
695
|
+
me.callParent();
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
});
|