tui_editor-rails 1.0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.ruby-version +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -0
- data/README.md +69 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/.gitignore +30 -0
- data/example/.ruby-version +1 -0
- data/example/Gemfile +64 -0
- data/example/Gemfile.lock +224 -0
- data/example/README.md +67 -0
- data/example/Rakefile +6 -0
- data/example/app/assets/config/manifest.js +3 -0
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/images/screen_capture.png +0 -0
- data/example/app/assets/javascripts/application.js +23 -0
- data/example/app/assets/javascripts/cable.js +13 -0
- data/example/app/assets/javascripts/channels/.keep +0 -0
- data/example/app/assets/javascripts/home.coffee +3 -0
- data/example/app/assets/javascripts/posts.coffee +3 -0
- data/example/app/assets/stylesheets/application.scss +4 -0
- data/example/app/assets/stylesheets/home.scss +3 -0
- data/example/app/assets/stylesheets/posts.scss +3 -0
- data/example/app/assets/stylesheets/scaffolds.scss +84 -0
- data/example/app/channels/application_cable/channel.rb +4 -0
- data/example/app/channels/application_cable/connection.rb +4 -0
- data/example/app/controllers/application_controller.rb +2 -0
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/controllers/home_controller.rb +4 -0
- data/example/app/controllers/posts_controller.rb +74 -0
- data/example/app/helpers/application_helper.rb +2 -0
- data/example/app/helpers/home_helper.rb +2 -0
- data/example/app/helpers/posts_helper.rb +2 -0
- data/example/app/jobs/application_job.rb +2 -0
- data/example/app/mailers/application_mailer.rb +4 -0
- data/example/app/models/application_record.rb +3 -0
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/models/post.rb +2 -0
- data/example/app/views/home/index.html.erb +11 -0
- data/example/app/views/layouts/application.html.erb +14 -0
- data/example/app/views/layouts/mailer.html.erb +13 -0
- data/example/app/views/layouts/mailer.text.erb +1 -0
- data/example/app/views/posts/_form.html.erb +27 -0
- data/example/app/views/posts/_post.json.jbuilder +2 -0
- data/example/app/views/posts/edit.html.erb +6 -0
- data/example/app/views/posts/index.html.erb +29 -0
- data/example/app/views/posts/index.json.jbuilder +1 -0
- data/example/app/views/posts/new.html.erb +5 -0
- data/example/app/views/posts/show.html.erb +14 -0
- data/example/app/views/posts/show.json.jbuilder +1 -0
- data/example/bin/bundle +3 -0
- data/example/bin/rails +9 -0
- data/example/bin/rake +9 -0
- data/example/bin/setup +36 -0
- data/example/bin/spring +17 -0
- data/example/bin/update +31 -0
- data/example/bin/yarn +11 -0
- data/example/config.ru +5 -0
- data/example/config/application.rb +19 -0
- data/example/config/boot.rb +4 -0
- data/example/config/cable.yml +10 -0
- data/example/config/credentials.yml.enc +1 -0
- data/example/config/database.yml +25 -0
- data/example/config/environment.rb +5 -0
- data/example/config/environments/development.rb +61 -0
- data/example/config/environments/production.rb +94 -0
- data/example/config/environments/test.rb +46 -0
- data/example/config/initializers/application_controller_renderer.rb +8 -0
- data/example/config/initializers/assets.rb +14 -0
- data/example/config/initializers/backtrace_silencers.rb +7 -0
- data/example/config/initializers/content_security_policy.rb +22 -0
- data/example/config/initializers/cookies_serializer.rb +5 -0
- data/example/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/config/initializers/inflections.rb +16 -0
- data/example/config/initializers/mime_types.rb +4 -0
- data/example/config/initializers/wrap_parameters.rb +14 -0
- data/example/config/locales/en.yml +33 -0
- data/example/config/puma.rb +34 -0
- data/example/config/routes.rb +6 -0
- data/example/config/spring.rb +6 -0
- data/example/config/storage.yml +35 -0
- data/example/db/migrate/20180208210404_create_posts.rb +10 -0
- data/example/db/schema.rb +22 -0
- data/example/db/seeds.rb +7 -0
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/log/.keep +0 -0
- data/example/package.json +5 -0
- data/example/public/404.html +67 -0
- data/example/public/422.html +67 -0
- data/example/public/500.html +66 -0
- data/example/public/apple-touch-icon-precomposed.png +0 -0
- data/example/public/apple-touch-icon.png +0 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +1 -0
- data/example/test/application_system_test_case.rb +5 -0
- data/example/test/controllers/.keep +0 -0
- data/example/test/controllers/home_controller_test.rb +9 -0
- data/example/test/controllers/posts_controller_test.rb +48 -0
- data/example/test/fixtures/.keep +0 -0
- data/example/test/fixtures/files/.keep +0 -0
- data/example/test/fixtures/posts.yml +9 -0
- data/example/test/helpers/.keep +0 -0
- data/example/test/integration/.keep +0 -0
- data/example/test/mailers/.keep +0 -0
- data/example/test/models/.keep +0 -0
- data/example/test/models/post_test.rb +7 -0
- data/example/test/system/.keep +0 -0
- data/example/test/system/posts_test.rb +45 -0
- data/example/test/test_helper.rb +10 -0
- data/example/tmp/.keep +0 -0
- data/example/vendor/.keep +0 -0
- data/lib/tui_editor/rails.rb +8 -0
- data/lib/tui_editor/rails/version.rb +5 -0
- data/tui_editor-rails.gemspec +34 -0
- data/vendor/assets/components/codemirror/.bower.json +31 -0
- data/vendor/assets/components/codemirror/AUTHORS +714 -0
- data/vendor/assets/components/codemirror/CHANGELOG.md +1316 -0
- data/vendor/assets/components/codemirror/CONTRIBUTING.md +92 -0
- data/vendor/assets/components/codemirror/LICENSE +21 -0
- data/vendor/assets/components/codemirror/README.md +35 -0
- data/vendor/assets/components/codemirror/addon/comment/comment.js +209 -0
- data/vendor/assets/components/codemirror/addon/comment/continuecomment.js +78 -0
- data/vendor/assets/components/codemirror/addon/dialog/dialog.css +32 -0
- data/vendor/assets/components/codemirror/addon/dialog/dialog.js +157 -0
- data/vendor/assets/components/codemirror/addon/display/autorefresh.js +47 -0
- data/vendor/assets/components/codemirror/addon/display/fullscreen.css +6 -0
- data/vendor/assets/components/codemirror/addon/display/fullscreen.js +41 -0
- data/vendor/assets/components/codemirror/addon/display/panel.js +123 -0
- data/vendor/assets/components/codemirror/addon/display/placeholder.js +63 -0
- data/vendor/assets/components/codemirror/addon/display/rulers.js +51 -0
- data/vendor/assets/components/codemirror/addon/edit/closebrackets.js +194 -0
- data/vendor/assets/components/codemirror/addon/edit/closetag.js +175 -0
- data/vendor/assets/components/codemirror/addon/edit/continuelist.js +89 -0
- data/vendor/assets/components/codemirror/addon/edit/matchbrackets.js +145 -0
- data/vendor/assets/components/codemirror/addon/edit/matchtags.js +66 -0
- data/vendor/assets/components/codemirror/addon/edit/trailingspace.js +27 -0
- data/vendor/assets/components/codemirror/addon/fold/brace-fold.js +105 -0
- data/vendor/assets/components/codemirror/addon/fold/comment-fold.js +59 -0
- data/vendor/assets/components/codemirror/addon/fold/foldcode.js +152 -0
- data/vendor/assets/components/codemirror/addon/fold/foldgutter.css +20 -0
- data/vendor/assets/components/codemirror/addon/fold/foldgutter.js +146 -0
- data/vendor/assets/components/codemirror/addon/fold/indent-fold.js +48 -0
- data/vendor/assets/components/codemirror/addon/fold/markdown-fold.js +49 -0
- data/vendor/assets/components/codemirror/addon/fold/xml-fold.js +182 -0
- data/vendor/assets/components/codemirror/addon/hint/anyword-hint.js +41 -0
- data/vendor/assets/components/codemirror/addon/hint/css-hint.js +60 -0
- data/vendor/assets/components/codemirror/addon/hint/html-hint.js +348 -0
- data/vendor/assets/components/codemirror/addon/hint/javascript-hint.js +155 -0
- data/vendor/assets/components/codemirror/addon/hint/show-hint.css +36 -0
- data/vendor/assets/components/codemirror/addon/hint/show-hint.js +432 -0
- data/vendor/assets/components/codemirror/addon/hint/sql-hint.js +286 -0
- data/vendor/assets/components/codemirror/addon/hint/xml-hint.js +110 -0
- data/vendor/assets/components/codemirror/addon/lint/coffeescript-lint.js +47 -0
- data/vendor/assets/components/codemirror/addon/lint/css-lint.js +40 -0
- data/vendor/assets/components/codemirror/addon/lint/html-lint.js +53 -0
- data/vendor/assets/components/codemirror/addon/lint/javascript-lint.js +63 -0
- data/vendor/assets/components/codemirror/addon/lint/json-lint.js +37 -0
- data/vendor/assets/components/codemirror/addon/lint/lint.css +73 -0
- data/vendor/assets/components/codemirror/addon/lint/lint.js +252 -0
- data/vendor/assets/components/codemirror/addon/lint/yaml-lint.js +41 -0
- data/vendor/assets/components/codemirror/addon/merge/merge.css +113 -0
- data/vendor/assets/components/codemirror/addon/merge/merge.js +1001 -0
- data/vendor/assets/components/codemirror/addon/mode/loadmode.js +64 -0
- data/vendor/assets/components/codemirror/addon/mode/multiplex.js +123 -0
- data/vendor/assets/components/codemirror/addon/mode/multiplex_test.js +33 -0
- data/vendor/assets/components/codemirror/addon/mode/overlay.js +90 -0
- data/vendor/assets/components/codemirror/addon/mode/simple.js +216 -0
- data/vendor/assets/components/codemirror/addon/runmode/colorize.js +40 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode-standalone.js +158 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode.js +72 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode.node.js +197 -0
- data/vendor/assets/components/codemirror/addon/scroll/annotatescrollbar.js +122 -0
- data/vendor/assets/components/codemirror/addon/scroll/scrollpastend.js +48 -0
- data/vendor/assets/components/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/components/codemirror/addon/scroll/simplescrollbars.js +152 -0
- data/vendor/assets/components/codemirror/addon/search/jump-to-line.js +49 -0
- data/vendor/assets/components/codemirror/addon/search/match-highlighter.js +165 -0
- data/vendor/assets/components/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/components/codemirror/addon/search/matchesonscrollbar.js +97 -0
- data/vendor/assets/components/codemirror/addon/search/search.js +252 -0
- data/vendor/assets/components/codemirror/addon/search/searchcursor.js +289 -0
- data/vendor/assets/components/codemirror/addon/selection/active-line.js +72 -0
- data/vendor/assets/components/codemirror/addon/selection/mark-selection.js +119 -0
- data/vendor/assets/components/codemirror/addon/selection/selection-pointer.js +98 -0
- data/vendor/assets/components/codemirror/addon/tern/tern.css +87 -0
- data/vendor/assets/components/codemirror/addon/tern/tern.js +718 -0
- data/vendor/assets/components/codemirror/addon/tern/worker.js +44 -0
- data/vendor/assets/components/codemirror/addon/wrap/hardwrap.js +144 -0
- data/vendor/assets/components/codemirror/bower.json +17 -0
- data/vendor/assets/components/codemirror/component-tools/bower.json +17 -0
- data/vendor/assets/components/codemirror/component-tools/build.sh +31 -0
- data/vendor/assets/components/codemirror/component-tools/update.py +38 -0
- data/vendor/assets/components/codemirror/keymap/emacs.js +416 -0
- data/vendor/assets/components/codemirror/keymap/sublime.js +685 -0
- data/vendor/assets/components/codemirror/keymap/vim.js +5219 -0
- data/vendor/assets/components/codemirror/lib/codemirror.css +346 -0
- data/vendor/assets/components/codemirror/lib/codemirror.js +9669 -0
- data/vendor/assets/components/codemirror/mode/apl/apl.js +174 -0
- data/vendor/assets/components/codemirror/mode/asciiarmor/asciiarmor.js +74 -0
- data/vendor/assets/components/codemirror/mode/asn.1/asn.1.js +204 -0
- data/vendor/assets/components/codemirror/mode/asterisk/asterisk.js +196 -0
- data/vendor/assets/components/codemirror/mode/brainfuck/brainfuck.js +85 -0
- data/vendor/assets/components/codemirror/mode/clike/clike.js +817 -0
- data/vendor/assets/components/codemirror/mode/clojure/clojure.js +306 -0
- data/vendor/assets/components/codemirror/mode/cmake/cmake.js +97 -0
- data/vendor/assets/components/codemirror/mode/cobol/cobol.js +255 -0
- data/vendor/assets/components/codemirror/mode/coffeescript/coffeescript.js +359 -0
- data/vendor/assets/components/codemirror/mode/commonlisp/commonlisp.js +124 -0
- data/vendor/assets/components/codemirror/mode/crystal/crystal.js +433 -0
- data/vendor/assets/components/codemirror/mode/css/css.js +832 -0
- data/vendor/assets/components/codemirror/mode/cypher/cypher.js +150 -0
- data/vendor/assets/components/codemirror/mode/d/d.js +218 -0
- data/vendor/assets/components/codemirror/mode/dart/dart.js +157 -0
- data/vendor/assets/components/codemirror/mode/diff/diff.js +47 -0
- data/vendor/assets/components/codemirror/mode/django/django.js +356 -0
- data/vendor/assets/components/codemirror/mode/dockerfile/dockerfile.js +79 -0
- data/vendor/assets/components/codemirror/mode/dtd/dtd.js +142 -0
- data/vendor/assets/components/codemirror/mode/dylan/dylan.js +352 -0
- data/vendor/assets/components/codemirror/mode/ebnf/ebnf.js +195 -0
- data/vendor/assets/components/codemirror/mode/ecl/ecl.js +206 -0
- data/vendor/assets/components/codemirror/mode/eiffel/eiffel.js +160 -0
- data/vendor/assets/components/codemirror/mode/elm/elm.js +205 -0
- data/vendor/assets/components/codemirror/mode/erlang/erlang.js +619 -0
- data/vendor/assets/components/codemirror/mode/factor/factor.js +85 -0
- data/vendor/assets/components/codemirror/mode/fcl/fcl.js +173 -0
- data/vendor/assets/components/codemirror/mode/forth/forth.js +180 -0
- data/vendor/assets/components/codemirror/mode/fortran/fortran.js +188 -0
- data/vendor/assets/components/codemirror/mode/gas/gas.js +345 -0
- data/vendor/assets/components/codemirror/mode/gfm/gfm.js +129 -0
- data/vendor/assets/components/codemirror/mode/gherkin/gherkin.js +178 -0
- data/vendor/assets/components/codemirror/mode/go/go.js +187 -0
- data/vendor/assets/components/codemirror/mode/groovy/groovy.js +230 -0
- data/vendor/assets/components/codemirror/mode/haml/haml.js +161 -0
- data/vendor/assets/components/codemirror/mode/handlebars/handlebars.js +62 -0
- data/vendor/assets/components/codemirror/mode/haskell-literate/haskell-literate.js +43 -0
- data/vendor/assets/components/codemirror/mode/haskell/haskell.js +267 -0
- data/vendor/assets/components/codemirror/mode/haxe/haxe.js +515 -0
- data/vendor/assets/components/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
- data/vendor/assets/components/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
- data/vendor/assets/components/codemirror/mode/http/http.js +113 -0
- data/vendor/assets/components/codemirror/mode/idl/idl.js +290 -0
- data/vendor/assets/components/codemirror/mode/javascript/javascript.js +865 -0
- data/vendor/assets/components/codemirror/mode/jinja2/jinja2.js +142 -0
- data/vendor/assets/components/codemirror/mode/jsx/jsx.js +148 -0
- data/vendor/assets/components/codemirror/mode/julia/julia.js +418 -0
- data/vendor/assets/components/codemirror/mode/livescript/livescript.js +280 -0
- data/vendor/assets/components/codemirror/mode/lua/lua.js +159 -0
- data/vendor/assets/components/codemirror/mode/markdown/markdown.js +872 -0
- data/vendor/assets/components/codemirror/mode/mathematica/mathematica.js +176 -0
- data/vendor/assets/components/codemirror/mode/mbox/mbox.js +129 -0
- data/vendor/assets/components/codemirror/mode/meta.js +217 -0
- data/vendor/assets/components/codemirror/mode/mirc/mirc.js +193 -0
- data/vendor/assets/components/codemirror/mode/mllike/mllike.js +356 -0
- data/vendor/assets/components/codemirror/mode/modelica/modelica.js +245 -0
- data/vendor/assets/components/codemirror/mode/mscgen/mscgen.js +175 -0
- data/vendor/assets/components/codemirror/mode/mumps/mumps.js +148 -0
- data/vendor/assets/components/codemirror/mode/nginx/nginx.js +178 -0
- data/vendor/assets/components/codemirror/mode/nsis/nsis.js +95 -0
- data/vendor/assets/components/codemirror/mode/ntriples/ntriples.js +195 -0
- data/vendor/assets/components/codemirror/mode/octave/octave.js +139 -0
- data/vendor/assets/components/codemirror/mode/oz/oz.js +252 -0
- data/vendor/assets/components/codemirror/mode/pascal/pascal.js +109 -0
- data/vendor/assets/components/codemirror/mode/pegjs/pegjs.js +114 -0
- data/vendor/assets/components/codemirror/mode/perl/perl.js +837 -0
- data/vendor/assets/components/codemirror/mode/php/php.js +234 -0
- data/vendor/assets/components/codemirror/mode/pig/pig.js +178 -0
- data/vendor/assets/components/codemirror/mode/powershell/powershell.js +398 -0
- data/vendor/assets/components/codemirror/mode/properties/properties.js +78 -0
- data/vendor/assets/components/codemirror/mode/protobuf/protobuf.js +69 -0
- data/vendor/assets/components/codemirror/mode/pug/pug.js +591 -0
- data/vendor/assets/components/codemirror/mode/puppet/puppet.js +220 -0
- data/vendor/assets/components/codemirror/mode/python/python.js +334 -0
- data/vendor/assets/components/codemirror/mode/q/q.js +139 -0
- data/vendor/assets/components/codemirror/mode/r/r.js +183 -0
- data/vendor/assets/components/codemirror/mode/rpm/rpm.js +109 -0
- data/vendor/assets/components/codemirror/mode/rst/rst.js +557 -0
- data/vendor/assets/components/codemirror/mode/ruby/ruby.js +296 -0
- data/vendor/assets/components/codemirror/mode/rust/rust.js +72 -0
- data/vendor/assets/components/codemirror/mode/sas/sas.js +303 -0
- data/vendor/assets/components/codemirror/mode/sass/sass.js +454 -0
- data/vendor/assets/components/codemirror/mode/scheme/scheme.js +249 -0
- data/vendor/assets/components/codemirror/mode/shell/shell.js +151 -0
- data/vendor/assets/components/codemirror/mode/sieve/sieve.js +193 -0
- data/vendor/assets/components/codemirror/mode/slim/slim.js +575 -0
- data/vendor/assets/components/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/vendor/assets/components/codemirror/mode/smarty/smarty.js +225 -0
- data/vendor/assets/components/codemirror/mode/solr/solr.js +104 -0
- data/vendor/assets/components/codemirror/mode/soy/soy.js +354 -0
- data/vendor/assets/components/codemirror/mode/sparql/sparql.js +180 -0
- data/vendor/assets/components/codemirror/mode/spreadsheet/spreadsheet.js +112 -0
- data/vendor/assets/components/codemirror/mode/sql/sql.js +488 -0
- data/vendor/assets/components/codemirror/mode/stex/stex.js +251 -0
- data/vendor/assets/components/codemirror/mode/stylus/stylus.js +771 -0
- data/vendor/assets/components/codemirror/mode/swift/swift.js +219 -0
- data/vendor/assets/components/codemirror/mode/tcl/tcl.js +139 -0
- data/vendor/assets/components/codemirror/mode/textile/textile.js +469 -0
- data/vendor/assets/components/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/vendor/assets/components/codemirror/mode/tiddlywiki/tiddlywiki.js +308 -0
- data/vendor/assets/components/codemirror/mode/tiki/tiki.css +26 -0
- data/vendor/assets/components/codemirror/mode/tiki/tiki.js +312 -0
- data/vendor/assets/components/codemirror/mode/toml/toml.js +88 -0
- data/vendor/assets/components/codemirror/mode/tornado/tornado.js +68 -0
- data/vendor/assets/components/codemirror/mode/troff/troff.js +84 -0
- data/vendor/assets/components/codemirror/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- data/vendor/assets/components/codemirror/mode/ttcn/ttcn.js +283 -0
- data/vendor/assets/components/codemirror/mode/turtle/turtle.js +162 -0
- data/vendor/assets/components/codemirror/mode/twig/twig.js +141 -0
- data/vendor/assets/components/codemirror/mode/vb/vb.js +275 -0
- data/vendor/assets/components/codemirror/mode/vbscript/vbscript.js +350 -0
- data/vendor/assets/components/codemirror/mode/velocity/velocity.js +201 -0
- data/vendor/assets/components/codemirror/mode/verilog/verilog.js +675 -0
- data/vendor/assets/components/codemirror/mode/vhdl/vhdl.js +189 -0
- data/vendor/assets/components/codemirror/mode/vue/vue.js +77 -0
- data/vendor/assets/components/codemirror/mode/webidl/webidl.js +195 -0
- data/vendor/assets/components/codemirror/mode/xml/xml.js +401 -0
- data/vendor/assets/components/codemirror/mode/xquery/xquery.js +448 -0
- data/vendor/assets/components/codemirror/mode/yacas/yacas.js +204 -0
- data/vendor/assets/components/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/vendor/assets/components/codemirror/mode/yaml/yaml.js +118 -0
- data/vendor/assets/components/codemirror/mode/z80/z80.js +116 -0
- data/vendor/assets/components/codemirror/rollup.config.js +18 -0
- data/vendor/assets/components/codemirror/src/codemirror.js +3 -0
- data/vendor/assets/components/codemirror/src/display/Display.js +106 -0
- data/vendor/assets/components/codemirror/src/display/focus.js +47 -0
- data/vendor/assets/components/codemirror/src/display/gutters.js +34 -0
- data/vendor/assets/components/codemirror/src/display/highlight_worker.js +55 -0
- data/vendor/assets/components/codemirror/src/display/line_numbers.js +48 -0
- data/vendor/assets/components/codemirror/src/display/mode_state.js +22 -0
- data/vendor/assets/components/codemirror/src/display/operations.js +205 -0
- data/vendor/assets/components/codemirror/src/display/scroll_events.js +115 -0
- data/vendor/assets/components/codemirror/src/display/scrollbars.js +192 -0
- data/vendor/assets/components/codemirror/src/display/scrolling.js +184 -0
- data/vendor/assets/components/codemirror/src/display/selection.js +158 -0
- data/vendor/assets/components/codemirror/src/display/update_display.js +260 -0
- data/vendor/assets/components/codemirror/src/display/update_line.js +188 -0
- data/vendor/assets/components/codemirror/src/display/update_lines.js +64 -0
- data/vendor/assets/components/codemirror/src/display/view_tracking.js +153 -0
- data/vendor/assets/components/codemirror/src/edit/CodeMirror.js +214 -0
- data/vendor/assets/components/codemirror/src/edit/commands.js +178 -0
- data/vendor/assets/components/codemirror/src/edit/deleteNearSelection.js +30 -0
- data/vendor/assets/components/codemirror/src/edit/drop_events.js +119 -0
- data/vendor/assets/components/codemirror/src/edit/fromTextArea.js +61 -0
- data/vendor/assets/components/codemirror/src/edit/global_events.js +44 -0
- data/vendor/assets/components/codemirror/src/edit/key_events.js +159 -0
- data/vendor/assets/components/codemirror/src/edit/legacy.js +62 -0
- data/vendor/assets/components/codemirror/src/edit/main.js +69 -0
- data/vendor/assets/components/codemirror/src/edit/methods.js +539 -0
- data/vendor/assets/components/codemirror/src/edit/mouse_events.js +407 -0
- data/vendor/assets/components/codemirror/src/edit/options.js +191 -0
- data/vendor/assets/components/codemirror/src/edit/utils.js +7 -0
- data/vendor/assets/components/codemirror/src/input/ContentEditableInput.js +517 -0
- data/vendor/assets/components/codemirror/src/input/TextareaInput.js +350 -0
- data/vendor/assets/components/codemirror/src/input/indent.js +71 -0
- data/vendor/assets/components/codemirror/src/input/input.js +135 -0
- data/vendor/assets/components/codemirror/src/input/keymap.js +148 -0
- data/vendor/assets/components/codemirror/src/input/keynames.js +17 -0
- data/vendor/assets/components/codemirror/src/input/movement.js +110 -0
- data/vendor/assets/components/codemirror/src/line/highlight.js +284 -0
- data/vendor/assets/components/codemirror/src/line/line_data.js +337 -0
- data/vendor/assets/components/codemirror/src/line/pos.js +40 -0
- data/vendor/assets/components/codemirror/src/line/saw_special_spans.js +10 -0
- data/vendor/assets/components/codemirror/src/line/spans.js +372 -0
- data/vendor/assets/components/codemirror/src/line/utils_line.js +85 -0
- data/vendor/assets/components/codemirror/src/measurement/position_measurement.js +700 -0
- data/vendor/assets/components/codemirror/src/measurement/widgets.js +26 -0
- data/vendor/assets/components/codemirror/src/model/Doc.js +432 -0
- data/vendor/assets/components/codemirror/src/model/change_measurement.js +61 -0
- data/vendor/assets/components/codemirror/src/model/changes.js +330 -0
- data/vendor/assets/components/codemirror/src/model/chunk.js +167 -0
- data/vendor/assets/components/codemirror/src/model/document_data.js +111 -0
- data/vendor/assets/components/codemirror/src/model/history.js +228 -0
- data/vendor/assets/components/codemirror/src/model/line_widget.js +78 -0
- data/vendor/assets/components/codemirror/src/model/mark_text.js +292 -0
- data/vendor/assets/components/codemirror/src/model/selection.js +82 -0
- data/vendor/assets/components/codemirror/src/model/selection_updates.js +208 -0
- data/vendor/assets/components/codemirror/src/modes.js +96 -0
- data/vendor/assets/components/codemirror/src/util/StringStream.js +90 -0
- data/vendor/assets/components/codemirror/src/util/bidi.js +214 -0
- data/vendor/assets/components/codemirror/src/util/browser.js +33 -0
- data/vendor/assets/components/codemirror/src/util/dom.js +97 -0
- data/vendor/assets/components/codemirror/src/util/event.js +103 -0
- data/vendor/assets/components/codemirror/src/util/feature_detection.js +84 -0
- data/vendor/assets/components/codemirror/src/util/misc.js +150 -0
- data/vendor/assets/components/codemirror/src/util/operation_group.js +72 -0
- data/vendor/assets/components/codemirror/theme/3024-day.css +41 -0
- data/vendor/assets/components/codemirror/theme/3024-night.css +39 -0
- data/vendor/assets/components/codemirror/theme/abcdef.css +32 -0
- data/vendor/assets/components/codemirror/theme/ambiance-mobile.css +5 -0
- data/vendor/assets/components/codemirror/theme/ambiance.css +74 -0
- data/vendor/assets/components/codemirror/theme/base16-dark.css +38 -0
- data/vendor/assets/components/codemirror/theme/base16-light.css +38 -0
- data/vendor/assets/components/codemirror/theme/bespin.css +34 -0
- data/vendor/assets/components/codemirror/theme/blackboard.css +32 -0
- data/vendor/assets/components/codemirror/theme/cobalt.css +25 -0
- data/vendor/assets/components/codemirror/theme/colorforth.css +33 -0
- data/vendor/assets/components/codemirror/theme/dracula.css +40 -0
- data/vendor/assets/components/codemirror/theme/duotone-dark.css +35 -0
- data/vendor/assets/components/codemirror/theme/duotone-light.css +36 -0
- data/vendor/assets/components/codemirror/theme/eclipse.css +23 -0
- data/vendor/assets/components/codemirror/theme/elegant.css +13 -0
- data/vendor/assets/components/codemirror/theme/erlang-dark.css +34 -0
- data/vendor/assets/components/codemirror/theme/hopscotch.css +34 -0
- data/vendor/assets/components/codemirror/theme/icecoder.css +43 -0
- data/vendor/assets/components/codemirror/theme/isotope.css +34 -0
- data/vendor/assets/components/codemirror/theme/lesser-dark.css +47 -0
- data/vendor/assets/components/codemirror/theme/liquibyte.css +95 -0
- data/vendor/assets/components/codemirror/theme/material.css +53 -0
- data/vendor/assets/components/codemirror/theme/mbo.css +37 -0
- data/vendor/assets/components/codemirror/theme/mdn-like.css +46 -0
- data/vendor/assets/components/codemirror/theme/midnight.css +43 -0
- data/vendor/assets/components/codemirror/theme/monokai.css +36 -0
- data/vendor/assets/components/codemirror/theme/neat.css +12 -0
- data/vendor/assets/components/codemirror/theme/neo.css +43 -0
- data/vendor/assets/components/codemirror/theme/night.css +27 -0
- data/vendor/assets/components/codemirror/theme/oceanic-next.css +44 -0
- data/vendor/assets/components/codemirror/theme/panda-syntax.css +85 -0
- data/vendor/assets/components/codemirror/theme/paraiso-dark.css +38 -0
- data/vendor/assets/components/codemirror/theme/paraiso-light.css +38 -0
- data/vendor/assets/components/codemirror/theme/pastel-on-dark.css +52 -0
- data/vendor/assets/components/codemirror/theme/railscasts.css +34 -0
- data/vendor/assets/components/codemirror/theme/rubyblue.css +25 -0
- data/vendor/assets/components/codemirror/theme/seti.css +44 -0
- data/vendor/assets/components/codemirror/theme/shadowfox.css +52 -0
- data/vendor/assets/components/codemirror/theme/solarized.css +168 -0
- data/vendor/assets/components/codemirror/theme/the-matrix.css +30 -0
- data/vendor/assets/components/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/vendor/assets/components/codemirror/theme/tomorrow-night-eighties.css +38 -0
- data/vendor/assets/components/codemirror/theme/ttcn.css +64 -0
- data/vendor/assets/components/codemirror/theme/twilight.css +32 -0
- data/vendor/assets/components/codemirror/theme/vibrant-ink.css +34 -0
- data/vendor/assets/components/codemirror/theme/xq-dark.css +53 -0
- data/vendor/assets/components/codemirror/theme/xq-light.css +43 -0
- data/vendor/assets/components/codemirror/theme/yeti.css +44 -0
- data/vendor/assets/components/codemirror/theme/zenburn.css +37 -0
- data/vendor/assets/components/eve/.bower.json +12 -0
- data/vendor/assets/components/eve/LICENSE +202 -0
- data/vendor/assets/components/eve/README.md +7 -0
- data/vendor/assets/components/eve/component.json +13 -0
- data/vendor/assets/components/eve/e.html +66 -0
- data/vendor/assets/components/eve/eve.js +371 -0
- data/vendor/assets/components/eve/package.json +18 -0
- data/vendor/assets/components/highlightjs/.bower.json +24 -0
- data/vendor/assets/components/highlightjs/LICENSE +24 -0
- data/vendor/assets/components/highlightjs/Makefile +21 -0
- data/vendor/assets/components/highlightjs/README.md +12 -0
- data/vendor/assets/components/highlightjs/bower.json +14 -0
- data/vendor/assets/components/highlightjs/component.json +12 -0
- data/vendor/assets/components/highlightjs/composer.json +26 -0
- data/vendor/assets/components/highlightjs/highlight.pack.js +16645 -0
- data/vendor/assets/components/highlightjs/highlight.pack.min.js +15 -0
- data/vendor/assets/components/highlightjs/package.json +8 -0
- data/vendor/assets/components/highlightjs/styles/agate.css +108 -0
- data/vendor/assets/components/highlightjs/styles/androidstudio.css +66 -0
- data/vendor/assets/components/highlightjs/styles/arduino-light.css +88 -0
- data/vendor/assets/components/highlightjs/styles/arta.css +73 -0
- data/vendor/assets/components/highlightjs/styles/ascetic.css +45 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave-dark.css +83 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave-light.css +85 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atom-one-dark.css +96 -0
- data/vendor/assets/components/highlightjs/styles/atom-one-light.css +96 -0
- data/vendor/assets/components/highlightjs/styles/brown-paper.css +64 -0
- data/vendor/assets/components/highlightjs/styles/brown-papersq.png +0 -0
- data/vendor/assets/components/highlightjs/styles/brown_paper.css +103 -0
- data/vendor/assets/components/highlightjs/styles/brown_papersq.png +0 -0
- data/vendor/assets/components/highlightjs/styles/codepen-embed.css +60 -0
- data/vendor/assets/components/highlightjs/styles/color-brewer.css +71 -0
- data/vendor/assets/components/highlightjs/styles/darcula.css +77 -0
- data/vendor/assets/components/highlightjs/styles/dark.css +63 -0
- data/vendor/assets/components/highlightjs/styles/darkula.css +6 -0
- data/vendor/assets/components/highlightjs/styles/default.css +99 -0
- data/vendor/assets/components/highlightjs/styles/docco.css +97 -0
- data/vendor/assets/components/highlightjs/styles/dracula.css +76 -0
- data/vendor/assets/components/highlightjs/styles/far.css +71 -0
- data/vendor/assets/components/highlightjs/styles/foundation.css +88 -0
- data/vendor/assets/components/highlightjs/styles/github-gist.css +71 -0
- data/vendor/assets/components/highlightjs/styles/github.css +99 -0
- data/vendor/assets/components/highlightjs/styles/googlecode.css +89 -0
- data/vendor/assets/components/highlightjs/styles/grayscale.css +101 -0
- data/vendor/assets/components/highlightjs/styles/gruvbox-dark.css +108 -0
- data/vendor/assets/components/highlightjs/styles/gruvbox-light.css +108 -0
- data/vendor/assets/components/highlightjs/styles/hopscotch.css +83 -0
- data/vendor/assets/components/highlightjs/styles/hybrid.css +102 -0
- data/vendor/assets/components/highlightjs/styles/idea.css +97 -0
- data/vendor/assets/components/highlightjs/styles/ir-black.css +73 -0
- data/vendor/assets/components/highlightjs/styles/ir_black.css +106 -0
- data/vendor/assets/components/highlightjs/styles/kimbie.dark.css +74 -0
- data/vendor/assets/components/highlightjs/styles/kimbie.light.css +74 -0
- data/vendor/assets/components/highlightjs/styles/magula.css +70 -0
- data/vendor/assets/components/highlightjs/styles/mono-blue.css +59 -0
- data/vendor/assets/components/highlightjs/styles/monokai-sublime.css +83 -0
- data/vendor/assets/components/highlightjs/styles/monokai.css +70 -0
- data/vendor/assets/components/highlightjs/styles/monokai_sublime.css +154 -0
- data/vendor/assets/components/highlightjs/styles/obsidian.css +88 -0
- data/vendor/assets/components/highlightjs/styles/ocean.css +74 -0
- data/vendor/assets/components/highlightjs/styles/paraiso-dark.css +72 -0
- data/vendor/assets/components/highlightjs/styles/paraiso-light.css +72 -0
- data/vendor/assets/components/highlightjs/styles/paraiso.dark.css +96 -0
- data/vendor/assets/components/highlightjs/styles/paraiso.light.css +96 -0
- data/vendor/assets/components/highlightjs/styles/pojoaque.css +83 -0
- data/vendor/assets/components/highlightjs/styles/pojoaque.jpg +0 -0
- data/vendor/assets/components/highlightjs/styles/purebasic.css +96 -0
- data/vendor/assets/components/highlightjs/styles/qtcreator_dark.css +83 -0
- data/vendor/assets/components/highlightjs/styles/qtcreator_light.css +83 -0
- data/vendor/assets/components/highlightjs/styles/railscasts.css +106 -0
- data/vendor/assets/components/highlightjs/styles/rainbow.css +85 -0
- data/vendor/assets/components/highlightjs/styles/routeros.css +108 -0
- data/vendor/assets/components/highlightjs/styles/school-book.css +72 -0
- data/vendor/assets/components/highlightjs/styles/school-book.png +0 -0
- data/vendor/assets/components/highlightjs/styles/school_book.css +111 -0
- data/vendor/assets/components/highlightjs/styles/school_book.png +0 -0
- data/vendor/assets/components/highlightjs/styles/solarized-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/solarized-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/solarized_dark.css +107 -0
- data/vendor/assets/components/highlightjs/styles/solarized_light.css +107 -0
- data/vendor/assets/components/highlightjs/styles/sunburst.css +102 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-blue.css +75 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-bright.css +74 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night.css +75 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow.css +72 -0
- data/vendor/assets/components/highlightjs/styles/vs.css +68 -0
- data/vendor/assets/components/highlightjs/styles/vs2015.css +115 -0
- data/vendor/assets/components/highlightjs/styles/xcode.css +93 -0
- data/vendor/assets/components/highlightjs/styles/xt256.css +92 -0
- data/vendor/assets/components/highlightjs/styles/zenburn.css +80 -0
- data/vendor/assets/components/jquery/.bower.json +25 -0
- data/vendor/assets/components/jquery/AUTHORS.txt +313 -0
- data/vendor/assets/components/jquery/LICENSE.txt +36 -0
- data/vendor/assets/components/jquery/README.md +67 -0
- data/vendor/assets/components/jquery/bower.json +14 -0
- data/vendor/assets/components/jquery/dist/core.js +399 -0
- data/vendor/assets/components/jquery/dist/jquery.js +10364 -0
- data/vendor/assets/components/jquery/dist/jquery.min.js +2 -0
- data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.js +8269 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.min.js +2 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.min.map +1 -0
- data/vendor/assets/components/jquery/external/sizzle/LICENSE.txt +36 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.js +2272 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/vendor/assets/components/jquery/src/.eslintrc.json +5 -0
- data/vendor/assets/components/jquery/src/ajax.js +856 -0
- data/vendor/assets/components/jquery/src/ajax/jsonp.js +103 -0
- data/vendor/assets/components/jquery/src/ajax/load.js +77 -0
- data/vendor/assets/components/jquery/src/ajax/parseXML.js +30 -0
- data/vendor/assets/components/jquery/src/ajax/script.js +77 -0
- data/vendor/assets/components/jquery/src/ajax/var/location.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/var/rquery.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/xhr.js +170 -0
- data/vendor/assets/components/jquery/src/attributes.js +13 -0
- data/vendor/assets/components/jquery/src/attributes/attr.js +141 -0
- data/vendor/assets/components/jquery/src/attributes/classes.js +186 -0
- data/vendor/assets/components/jquery/src/attributes/prop.js +143 -0
- data/vendor/assets/components/jquery/src/attributes/support.js +33 -0
- data/vendor/assets/components/jquery/src/attributes/val.js +191 -0
- data/vendor/assets/components/jquery/src/callbacks.js +236 -0
- data/vendor/assets/components/jquery/src/core.js +399 -0
- data/vendor/assets/components/jquery/src/core/DOMEval.js +30 -0
- data/vendor/assets/components/jquery/src/core/access.js +72 -0
- data/vendor/assets/components/jquery/src/core/camelCase.js +23 -0
- data/vendor/assets/components/jquery/src/core/init.js +129 -0
- data/vendor/assets/components/jquery/src/core/nodeName.js +13 -0
- data/vendor/assets/components/jquery/src/core/parseHTML.js +65 -0
- data/vendor/assets/components/jquery/src/core/ready-no-deferred.js +97 -0
- data/vendor/assets/components/jquery/src/core/ready.js +86 -0
- data/vendor/assets/components/jquery/src/core/readyException.js +13 -0
- data/vendor/assets/components/jquery/src/core/stripAndCollapse.js +14 -0
- data/vendor/assets/components/jquery/src/core/support.js +20 -0
- data/vendor/assets/components/jquery/src/core/toType.js +20 -0
- data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +6 -0
- data/vendor/assets/components/jquery/src/css.js +481 -0
- data/vendor/assets/components/jquery/src/css/addGetHookIf.js +26 -0
- data/vendor/assets/components/jquery/src/css/adjustCSS.js +73 -0
- data/vendor/assets/components/jquery/src/css/curCSS.js +65 -0
- data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/vendor/assets/components/jquery/src/css/showHide.js +105 -0
- data/vendor/assets/components/jquery/src/css/support.js +102 -0
- data/vendor/assets/components/jquery/src/css/var/cssExpand.js +5 -0
- data/vendor/assets/components/jquery/src/css/var/getStyles.js +17 -0
- data/vendor/assets/components/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/vendor/assets/components/jquery/src/css/var/rboxStyle.js +7 -0
- data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +7 -0
- data/vendor/assets/components/jquery/src/css/var/swap.js +26 -0
- data/vendor/assets/components/jquery/src/data.js +180 -0
- data/vendor/assets/components/jquery/src/data/Data.js +162 -0
- data/vendor/assets/components/jquery/src/data/var/acceptData.js +19 -0
- data/vendor/assets/components/jquery/src/data/var/dataPriv.js +7 -0
- data/vendor/assets/components/jquery/src/data/var/dataUser.js +7 -0
- data/vendor/assets/components/jquery/src/deferred.js +399 -0
- data/vendor/assets/components/jquery/src/deferred/exceptionHook.js +21 -0
- data/vendor/assets/components/jquery/src/deprecated.js +98 -0
- data/vendor/assets/components/jquery/src/dimensions.js +57 -0
- data/vendor/assets/components/jquery/src/effects.js +702 -0
- data/vendor/assets/components/jquery/src/effects/Tween.js +123 -0
- data/vendor/assets/components/jquery/src/effects/animatedSelector.js +15 -0
- data/vendor/assets/components/jquery/src/event.js +748 -0
- data/vendor/assets/components/jquery/src/event/ajax.js +22 -0
- data/vendor/assets/components/jquery/src/event/alias.js +29 -0
- data/vendor/assets/components/jquery/src/event/focusin.js +55 -0
- data/vendor/assets/components/jquery/src/event/support.js +11 -0
- data/vendor/assets/components/jquery/src/event/trigger.js +199 -0
- data/vendor/assets/components/jquery/src/exports/amd.js +26 -0
- data/vendor/assets/components/jquery/src/exports/global.js +34 -0
- data/vendor/assets/components/jquery/src/jquery.js +40 -0
- data/vendor/assets/components/jquery/src/manipulation.js +486 -0
- data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +23 -0
- data/vendor/assets/components/jquery/src/manipulation/buildFragment.js +105 -0
- data/vendor/assets/components/jquery/src/manipulation/getAll.js +32 -0
- data/vendor/assets/components/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/vendor/assets/components/jquery/src/manipulation/support.js +35 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rtagName.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/wrapMap.js +29 -0
- data/vendor/assets/components/jquery/src/offset.js +233 -0
- data/vendor/assets/components/jquery/src/queue.js +145 -0
- data/vendor/assets/components/jquery/src/queue/delay.js +24 -0
- data/vendor/assets/components/jquery/src/selector-native.js +237 -0
- data/vendor/assets/components/jquery/src/selector-sizzle.js +19 -0
- data/vendor/assets/components/jquery/src/selector.js +3 -0
- data/vendor/assets/components/jquery/src/serialize.js +132 -0
- data/vendor/assets/components/jquery/src/traversing.js +191 -0
- data/vendor/assets/components/jquery/src/traversing/findFilter.js +97 -0
- data/vendor/assets/components/jquery/src/traversing/var/dir.js +22 -0
- data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/vendor/assets/components/jquery/src/traversing/var/siblings.js +17 -0
- data/vendor/assets/components/jquery/src/var/ObjectFunctionString.js +7 -0
- data/vendor/assets/components/jquery/src/var/arr.js +5 -0
- data/vendor/assets/components/jquery/src/var/class2type.js +6 -0
- data/vendor/assets/components/jquery/src/var/concat.js +7 -0
- data/vendor/assets/components/jquery/src/var/document.js +5 -0
- data/vendor/assets/components/jquery/src/var/documentElement.js +7 -0
- data/vendor/assets/components/jquery/src/var/fnToString.js +7 -0
- data/vendor/assets/components/jquery/src/var/getProto.js +5 -0
- data/vendor/assets/components/jquery/src/var/hasOwn.js +7 -0
- data/vendor/assets/components/jquery/src/var/indexOf.js +7 -0
- data/vendor/assets/components/jquery/src/var/isFunction.js +13 -0
- data/vendor/assets/components/jquery/src/var/isWindow.js +8 -0
- data/vendor/assets/components/jquery/src/var/pnum.js +5 -0
- data/vendor/assets/components/jquery/src/var/push.js +7 -0
- data/vendor/assets/components/jquery/src/var/rcssNum.js +9 -0
- data/vendor/assets/components/jquery/src/var/rnothtmlwhite.js +8 -0
- data/vendor/assets/components/jquery/src/var/slice.js +7 -0
- data/vendor/assets/components/jquery/src/var/support.js +6 -0
- data/vendor/assets/components/jquery/src/var/toString.js +7 -0
- data/vendor/assets/components/jquery/src/wrap.js +78 -0
- data/vendor/assets/components/markdown-it/.bower.json +38 -0
- data/vendor/assets/components/markdown-it/CHANGELOG.md +442 -0
- data/vendor/assets/components/markdown-it/CONTRIBUTING.md +15 -0
- data/vendor/assets/components/markdown-it/LICENSE +22 -0
- data/vendor/assets/components/markdown-it/Procfile +1 -0
- data/vendor/assets/components/markdown-it/README.md +294 -0
- data/vendor/assets/components/markdown-it/bin/markdown-it.js +113 -0
- data/vendor/assets/components/markdown-it/bower.json +28 -0
- data/vendor/assets/components/markdown-it/dist/markdown-it.js +7963 -0
- data/vendor/assets/components/markdown-it/dist/markdown-it.min.js +1 -0
- data/vendor/assets/components/markdown-it/package.json +64 -0
- data/vendor/assets/components/plantuml-encoder/.bower.json +29 -0
- data/vendor/assets/components/plantuml-encoder/LICENSE +19 -0
- data/vendor/assets/components/plantuml-encoder/README.md +38 -0
- data/vendor/assets/components/plantuml-encoder/bower.json +20 -0
- data/vendor/assets/components/plantuml-encoder/dist/plantuml-encoder.js +3994 -0
- data/vendor/assets/components/plantuml-encoder/dist/plantuml-encoder.min.js +1 -0
- data/vendor/assets/components/plantuml-encoder/package.json +33 -0
- data/vendor/assets/components/raphael/.bower.json +45 -0
- data/vendor/assets/components/raphael/bower.json +31 -0
- data/vendor/assets/components/raphael/dev/banner.txt +8 -0
- data/vendor/assets/components/raphael/dev/raphael.amd.js +14 -0
- data/vendor/assets/components/raphael/dev/raphael.core.js +5413 -0
- data/vendor/assets/components/raphael/dev/raphael.svg.js +1428 -0
- data/vendor/assets/components/raphael/dev/raphael.vml.js +1010 -0
- data/vendor/assets/components/raphael/dev/test/svg/dom.js +295 -0
- data/vendor/assets/components/raphael/dev/test/vml/dom.js +5 -0
- data/vendor/assets/components/raphael/license.txt +21 -0
- data/vendor/assets/components/raphael/raphael.js +8330 -0
- data/vendor/assets/components/raphael/raphael.min.js +3 -0
- data/vendor/assets/components/raphael/raphael.no-deps.js +7959 -0
- data/vendor/assets/components/raphael/raphael.no-deps.min.js +3 -0
- data/vendor/assets/components/raphael/webpack.config.js +62 -0
- data/vendor/assets/components/squire-rte/.bower.json +34 -0
- data/vendor/assets/components/squire-rte/Demo.html +143 -0
- data/vendor/assets/components/squire-rte/LICENSE +21 -0
- data/vendor/assets/components/squire-rte/Makefile +22 -0
- data/vendor/assets/components/squire-rte/README.md +473 -0
- data/vendor/assets/components/squire-rte/bower.json +24 -0
- data/vendor/assets/components/squire-rte/build/document.html +54 -0
- data/vendor/assets/components/squire-rte/build/squire-raw.js +4722 -0
- data/vendor/assets/components/squire-rte/build/squire.js +2 -0
- data/vendor/assets/components/squire-rte/package.json +31 -0
- data/vendor/assets/components/squire-rte/source/Clean.js +358 -0
- data/vendor/assets/components/squire-rte/source/Clipboard.js +331 -0
- data/vendor/assets/components/squire-rte/source/Constants.js +60 -0
- data/vendor/assets/components/squire-rte/source/Editor.js +2201 -0
- data/vendor/assets/components/squire-rte/source/KeyHandlers.js +502 -0
- data/vendor/assets/components/squire-rte/source/Node.js +553 -0
- data/vendor/assets/components/squire-rte/source/Range.js +540 -0
- data/vendor/assets/components/squire-rte/source/TreeWalker.js +118 -0
- data/vendor/assets/components/squire-rte/source/document.html +54 -0
- data/vendor/assets/components/squire-rte/source/exports.js +42 -0
- data/vendor/assets/components/squire-rte/source/intro.js +6 -0
- data/vendor/assets/components/squire-rte/source/outro.js +22 -0
- data/vendor/assets/components/to-mark/.bower.json +35 -0
- data/vendor/assets/components/to-mark/bower.json +22 -0
- data/vendor/assets/components/to-mark/demo/demo.html +24 -0
- data/vendor/assets/components/to-mark/demo/demo2.html +94 -0
- data/vendor/assets/components/to-mark/dist/to-mark.js +1283 -0
- data/vendor/assets/components/to-mark/dist/to-mark.min.js +1 -0
- data/vendor/assets/components/to-mark/gulpfile.js +112 -0
- data/vendor/assets/components/to-mark/karma.conf.js +260 -0
- data/vendor/assets/components/to-mark/package-lock.json +13061 -0
- data/vendor/assets/components/to-mark/package.json +53 -0
- data/vendor/assets/components/tui-chart/.bower.json +44 -0
- data/vendor/assets/components/tui-chart/CODE_OF_CONDUCT.md +73 -0
- data/vendor/assets/components/tui-chart/CONTRIBUTING.md +91 -0
- data/vendor/assets/components/tui-chart/LICENSE +21 -0
- data/vendor/assets/components/tui-chart/README.md +142 -0
- data/vendor/assets/components/tui-chart/bower.json +33 -0
- data/vendor/assets/components/tui-chart/dist/maps/china.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/japan.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/singapore.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/south-korea.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/taiwan.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/thailand.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/usa.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/world.js +11 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.css +704 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.js +40567 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.min.css +10 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.min.js +20 -0
- data/vendor/assets/components/tui-chart/docs/COMMIT_MESSAGE_CONVENTION.md +49 -0
- data/vendor/assets/components/tui-chart/docs/ISSUE_TEMPLATE.md +24 -0
- data/vendor/assets/components/tui-chart/docs/PULL_REQUEST_TEMPLATE.md +42 -0
- data/vendor/assets/components/tui-chart/docs/README.md +11 -0
- data/vendor/assets/components/tui-chart/docs/wiki/README.md +27 -0
- data/vendor/assets/components/tui-chart/docs/wiki/_Sidebar.md +31 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-export-menu.md +66 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-type-radial.md +121 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-bar,column.md +312 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-bubble.md +63 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-column-line-combo.md +104 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-heatmap.md +39 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line,area.md +333 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line-area-combo.md +78 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line-scatter-combo.md +101 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-map.md +153 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-pie-donut-combo.md +98 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-pie.md +186 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-scatter.md +58 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-treemap.md +158 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-china-map.md +38 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-japan-map.md +51 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-singapore-map.md +9 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-south-korea-map.md +21 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-taiwan-map.md +26 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-thailand-map.md +82 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-usa-map.md +55 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-world-map.md +180 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-axes.md +209 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-chart.md +157 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-circle-legend.md +20 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-legend.md +89 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-plot.md +141 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-series.md +240 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-tooltip.md +223 -0
- data/vendor/assets/components/tui-chart/docs/wiki/getting-started.md +74 -0
- data/vendor/assets/components/tui-chart/docs/wiki/import-chart-data-from-existing-table-element.md +150 -0
- data/vendor/assets/components/tui-chart/docs/wiki/table-of-supported-options.md +344 -0
- data/vendor/assets/components/tui-chart/docs/wiki/theme.md +338 -0
- data/vendor/assets/components/tui-chart/package-lock.json +8881 -0
- data/vendor/assets/components/tui-code-snippet/.bower.json +31 -0
- data/vendor/assets/components/tui-code-snippet/LICENSE +21 -0
- data/vendor/assets/components/tui-code-snippet/README.md +109 -0
- data/vendor/assets/components/tui-code-snippet/bower.json +20 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/README.md +26 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/public/popup.html +27 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/public/postBridge.html +31 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/server.js +28 -0
- data/vendor/assets/components/tui-code-snippet/dist/tui-code-snippet.js +4228 -0
- data/vendor/assets/components/tui-code-snippet/dist/tui-code-snippet.min.js +7 -0
- data/vendor/assets/components/tui-code-snippet/package-lock.json +6038 -0
- data/vendor/assets/components/tui-color-picker/.bower.json +37 -0
- data/vendor/assets/components/tui-color-picker/ISSUE_TEMPLATE.md +26 -0
- data/vendor/assets/components/tui-color-picker/LICENSE +34 -0
- data/vendor/assets/components/tui-color-picker/README.md +69 -0
- data/vendor/assets/components/tui-color-picker/bower.json +26 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.css +148 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.js +3146 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.min.css +7 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.min.js +9 -0
- data/vendor/assets/components/tui-color-picker/package-lock.json +8440 -0
- data/vendor/assets/components/tui-editor/.bower.json +71 -0
- data/vendor/assets/components/tui-editor/CODE_OF_CONDUCT.md +73 -0
- data/vendor/assets/components/tui-editor/CONTRIBUTING.md +92 -0
- data/vendor/assets/components/tui-editor/LICENSE +21 -0
- data/vendor/assets/components/tui-editor/README.md +204 -0
- data/vendor/assets/components/tui-editor/bower.json +59 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor-all.js +36850 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor-all.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor.js +24646 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer-all.js +14768 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer-all.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer.js +3686 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-contents.css +239 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-contents.min.css +1 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extChart.js +7040 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extChart.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extColorSyntax.js +472 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extColorSyntax.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extScrollSync.js +1241 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extScrollSync.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extTable.js +3930 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extTable.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extUML.js +212 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extUML.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor.css +1166 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor.min.css +1 -0
- data/vendor/assets/components/tui-editor/docs/COMMIT_MESSAGE_CONVENTION.md +49 -0
- data/vendor/assets/components/tui-editor/docs/PULL_REQUEST_TEMPLATE.md +41 -0
- data/vendor/assets/components/tui-editor/docs/README.md +13 -0
- data/vendor/assets/components/tui-editor/docs/getting-started-with-bower.md +93 -0
- data/vendor/assets/components/tui-editor/docs/getting-started.md +76 -0
- data/vendor/assets/components/tui-editor/docs/using-extensions.md +91 -0
- data/vendor/assets/components/tui-editor/docs/writing-your-own-extension.md +167 -0
- data/vendor/assets/components/tui-editor/examples/example00-demo.html +85 -0
- data/vendor/assets/components/tui-editor/examples/example01-basic.html +37 -0
- data/vendor/assets/components/tui-editor/examples/example02-viewer-basic.html +68 -0
- data/vendor/assets/components/tui-editor/examples/example03-jquery.html +36 -0
- data/vendor/assets/components/tui-editor/examples/example04-viewer-jquery.html +67 -0
- data/vendor/assets/components/tui-editor/examples/example05-scrollsync.html +77 -0
- data/vendor/assets/components/tui-editor/examples/example06-colorsyntax.html +44 -0
- data/vendor/assets/components/tui-editor/examples/example07-table.html +48 -0
- data/vendor/assets/components/tui-editor/examples/example08-uml.html +69 -0
- data/vendor/assets/components/tui-editor/examples/example09-multiple-extensions.html +85 -0
- data/vendor/assets/components/tui-editor/examples/example10-viewer-multiple-extensions.html +86 -0
- data/vendor/assets/components/tui-editor/examples/example11-chart.html +60 -0
- data/vendor/assets/components/tui-editor/examples/example12-writing-extension.html +66 -0
- data/vendor/assets/components/tui-editor/examples/examples.json +41 -0
- data/vendor/assets/components/tui-editor/examples/explain.css +7 -0
- data/vendor/assets/components/tui-editor/package-lock.json +13289 -0
- data/vendor/assets/components/tui-editor/package.json +90 -0
- metadata +956 -0
@@ -0,0 +1,1428 @@
|
|
1
|
+
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
2
|
+
// │ Raphaël @@VERSION - JavaScript Vector Library │ \\
|
3
|
+
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
4
|
+
// │ SVG Module │ \\
|
5
|
+
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
6
|
+
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
7
|
+
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
|
8
|
+
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
|
9
|
+
// └─────────────────────────────────────────────────────────────────────┘ \\
|
10
|
+
|
11
|
+
define(["./raphael.core"], function(R) {
|
12
|
+
if (R && !R.svg) {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
|
16
|
+
var has = "hasOwnProperty",
|
17
|
+
Str = String,
|
18
|
+
toFloat = parseFloat,
|
19
|
+
toInt = parseInt,
|
20
|
+
math = Math,
|
21
|
+
mmax = math.max,
|
22
|
+
abs = math.abs,
|
23
|
+
pow = math.pow,
|
24
|
+
separator = /[, ]+/,
|
25
|
+
eve = R.eve,
|
26
|
+
E = "",
|
27
|
+
S = " ";
|
28
|
+
var xlink = "http://www.w3.org/1999/xlink",
|
29
|
+
markers = {
|
30
|
+
block: "M5,0 0,2.5 5,5z",
|
31
|
+
classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z",
|
32
|
+
diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z",
|
33
|
+
open: "M6,1 1,3.5 6,6",
|
34
|
+
oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"
|
35
|
+
},
|
36
|
+
markerCounter = {};
|
37
|
+
R.toString = function () {
|
38
|
+
return "Your browser supports SVG.\nYou are running Rapha\xebl " + this.version;
|
39
|
+
};
|
40
|
+
var $ = function (el, attr) {
|
41
|
+
if (attr) {
|
42
|
+
if (typeof el == "string") {
|
43
|
+
el = $(el);
|
44
|
+
}
|
45
|
+
for (var key in attr) if (attr[has](key)) {
|
46
|
+
if (key.substring(0, 6) == "xlink:") {
|
47
|
+
el.setAttributeNS(xlink, key.substring(6), Str(attr[key]));
|
48
|
+
} else {
|
49
|
+
el.setAttribute(key, Str(attr[key]));
|
50
|
+
}
|
51
|
+
}
|
52
|
+
} else {
|
53
|
+
el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el);
|
54
|
+
el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
|
55
|
+
}
|
56
|
+
return el;
|
57
|
+
},
|
58
|
+
addGradientFill = function (element, gradient) {
|
59
|
+
var type = "linear",
|
60
|
+
id = element.id + gradient,
|
61
|
+
fx = .5, fy = .5,
|
62
|
+
o = element.node,
|
63
|
+
SVG = element.paper,
|
64
|
+
s = o.style,
|
65
|
+
el = R._g.doc.getElementById(id);
|
66
|
+
if (!el) {
|
67
|
+
gradient = Str(gradient).replace(R._radial_gradient, function (all, _fx, _fy) {
|
68
|
+
type = "radial";
|
69
|
+
if (_fx && _fy) {
|
70
|
+
fx = toFloat(_fx);
|
71
|
+
fy = toFloat(_fy);
|
72
|
+
var dir = ((fy > .5) * 2 - 1);
|
73
|
+
pow(fx - .5, 2) + pow(fy - .5, 2) > .25 &&
|
74
|
+
(fy = math.sqrt(.25 - pow(fx - .5, 2)) * dir + .5) &&
|
75
|
+
fy != .5 &&
|
76
|
+
(fy = fy.toFixed(5) - 1e-5 * dir);
|
77
|
+
}
|
78
|
+
return E;
|
79
|
+
});
|
80
|
+
gradient = gradient.split(/\s*\-\s*/);
|
81
|
+
if (type == "linear") {
|
82
|
+
var angle = gradient.shift();
|
83
|
+
angle = -toFloat(angle);
|
84
|
+
if (isNaN(angle)) {
|
85
|
+
return null;
|
86
|
+
}
|
87
|
+
var vector = [0, 0, math.cos(R.rad(angle)), math.sin(R.rad(angle))],
|
88
|
+
max = 1 / (mmax(abs(vector[2]), abs(vector[3])) || 1);
|
89
|
+
vector[2] *= max;
|
90
|
+
vector[3] *= max;
|
91
|
+
if (vector[2] < 0) {
|
92
|
+
vector[0] = -vector[2];
|
93
|
+
vector[2] = 0;
|
94
|
+
}
|
95
|
+
if (vector[3] < 0) {
|
96
|
+
vector[1] = -vector[3];
|
97
|
+
vector[3] = 0;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
var dots = R._parseDots(gradient);
|
101
|
+
if (!dots) {
|
102
|
+
return null;
|
103
|
+
}
|
104
|
+
id = id.replace(/[\(\)\s,\xb0#]/g, "_");
|
105
|
+
|
106
|
+
if (element.gradient && id != element.gradient.id) {
|
107
|
+
SVG.defs.removeChild(element.gradient);
|
108
|
+
delete element.gradient;
|
109
|
+
}
|
110
|
+
|
111
|
+
if (!element.gradient) {
|
112
|
+
el = $(type + "Gradient", {id: id});
|
113
|
+
element.gradient = el;
|
114
|
+
$(el, type == "radial" ? {
|
115
|
+
fx: fx,
|
116
|
+
fy: fy
|
117
|
+
} : {
|
118
|
+
x1: vector[0],
|
119
|
+
y1: vector[1],
|
120
|
+
x2: vector[2],
|
121
|
+
y2: vector[3],
|
122
|
+
gradientTransform: element.matrix.invert()
|
123
|
+
});
|
124
|
+
SVG.defs.appendChild(el);
|
125
|
+
for (var i = 0, ii = dots.length; i < ii; i++) {
|
126
|
+
el.appendChild($("stop", {
|
127
|
+
offset: dots[i].offset ? dots[i].offset : i ? "100%" : "0%",
|
128
|
+
"stop-color": dots[i].color || "#fff",
|
129
|
+
"stop-opacity": isFinite(dots[i].opacity) ? dots[i].opacity : 1
|
130
|
+
}));
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
$(o, {
|
135
|
+
fill: fillurl(id),
|
136
|
+
opacity: 1,
|
137
|
+
"fill-opacity": 1
|
138
|
+
});
|
139
|
+
s.fill = E;
|
140
|
+
s.opacity = 1;
|
141
|
+
s.fillOpacity = 1;
|
142
|
+
return 1;
|
143
|
+
},
|
144
|
+
isIE9or10 = function () {
|
145
|
+
var mode = document.documentMode;
|
146
|
+
return mode && (mode === 9 || mode === 10);
|
147
|
+
},
|
148
|
+
fillurl = function (id) {
|
149
|
+
if (isIE9or10()) {
|
150
|
+
return "url('#" + id + "')";
|
151
|
+
}
|
152
|
+
var location = document.location;
|
153
|
+
var locationString = (
|
154
|
+
location.protocol + '//' +
|
155
|
+
location.host +
|
156
|
+
location.pathname +
|
157
|
+
location.search
|
158
|
+
);
|
159
|
+
return "url('" + locationString + "#" + id + "')";
|
160
|
+
},
|
161
|
+
updatePosition = function (o) {
|
162
|
+
var bbox = o.getBBox(1);
|
163
|
+
$(o.pattern, {patternTransform: o.matrix.invert() + " translate(" + bbox.x + "," + bbox.y + ")"});
|
164
|
+
},
|
165
|
+
addArrow = function (o, value, isEnd) {
|
166
|
+
if (o.type == "path") {
|
167
|
+
var values = Str(value).toLowerCase().split("-"),
|
168
|
+
p = o.paper,
|
169
|
+
se = isEnd ? "end" : "start",
|
170
|
+
node = o.node,
|
171
|
+
attrs = o.attrs,
|
172
|
+
stroke = attrs["stroke-width"],
|
173
|
+
i = values.length,
|
174
|
+
type = "classic",
|
175
|
+
from,
|
176
|
+
to,
|
177
|
+
dx,
|
178
|
+
refX,
|
179
|
+
attr,
|
180
|
+
w = 3,
|
181
|
+
h = 3,
|
182
|
+
t = 5;
|
183
|
+
while (i--) {
|
184
|
+
switch (values[i]) {
|
185
|
+
case "block":
|
186
|
+
case "classic":
|
187
|
+
case "oval":
|
188
|
+
case "diamond":
|
189
|
+
case "open":
|
190
|
+
case "none":
|
191
|
+
type = values[i];
|
192
|
+
break;
|
193
|
+
case "wide": h = 5; break;
|
194
|
+
case "narrow": h = 2; break;
|
195
|
+
case "long": w = 5; break;
|
196
|
+
case "short": w = 2; break;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
if (type == "open") {
|
200
|
+
w += 2;
|
201
|
+
h += 2;
|
202
|
+
t += 2;
|
203
|
+
dx = 1;
|
204
|
+
refX = isEnd ? 4 : 1;
|
205
|
+
attr = {
|
206
|
+
fill: "none",
|
207
|
+
stroke: attrs.stroke
|
208
|
+
};
|
209
|
+
} else {
|
210
|
+
refX = dx = w / 2;
|
211
|
+
attr = {
|
212
|
+
fill: attrs.stroke,
|
213
|
+
stroke: "none"
|
214
|
+
};
|
215
|
+
}
|
216
|
+
if (o._.arrows) {
|
217
|
+
if (isEnd) {
|
218
|
+
o._.arrows.endPath && markerCounter[o._.arrows.endPath]--;
|
219
|
+
o._.arrows.endMarker && markerCounter[o._.arrows.endMarker]--;
|
220
|
+
} else {
|
221
|
+
o._.arrows.startPath && markerCounter[o._.arrows.startPath]--;
|
222
|
+
o._.arrows.startMarker && markerCounter[o._.arrows.startMarker]--;
|
223
|
+
}
|
224
|
+
} else {
|
225
|
+
o._.arrows = {};
|
226
|
+
}
|
227
|
+
if (type != "none") {
|
228
|
+
var pathId = "raphael-marker-" + type,
|
229
|
+
markerId = "raphael-marker-" + se + type + w + h + "-obj" + o.id;
|
230
|
+
if (!R._g.doc.getElementById(pathId)) {
|
231
|
+
p.defs.appendChild($($("path"), {
|
232
|
+
"stroke-linecap": "round",
|
233
|
+
d: markers[type],
|
234
|
+
id: pathId
|
235
|
+
}));
|
236
|
+
markerCounter[pathId] = 1;
|
237
|
+
} else {
|
238
|
+
markerCounter[pathId]++;
|
239
|
+
}
|
240
|
+
var marker = R._g.doc.getElementById(markerId),
|
241
|
+
use;
|
242
|
+
if (!marker) {
|
243
|
+
marker = $($("marker"), {
|
244
|
+
id: markerId,
|
245
|
+
markerHeight: h,
|
246
|
+
markerWidth: w,
|
247
|
+
orient: "auto",
|
248
|
+
refX: refX,
|
249
|
+
refY: h / 2
|
250
|
+
});
|
251
|
+
use = $($("use"), {
|
252
|
+
"xlink:href": "#" + pathId,
|
253
|
+
transform: (isEnd ? "rotate(180 " + w / 2 + " " + h / 2 + ") " : E) + "scale(" + w / t + "," + h / t + ")",
|
254
|
+
"stroke-width": (1 / ((w / t + h / t) / 2)).toFixed(4)
|
255
|
+
});
|
256
|
+
marker.appendChild(use);
|
257
|
+
p.defs.appendChild(marker);
|
258
|
+
markerCounter[markerId] = 1;
|
259
|
+
} else {
|
260
|
+
markerCounter[markerId]++;
|
261
|
+
use = marker.getElementsByTagName("use")[0];
|
262
|
+
}
|
263
|
+
$(use, attr);
|
264
|
+
var delta = dx * (type != "diamond" && type != "oval");
|
265
|
+
if (isEnd) {
|
266
|
+
from = o._.arrows.startdx * stroke || 0;
|
267
|
+
to = R.getTotalLength(attrs.path) - delta * stroke;
|
268
|
+
} else {
|
269
|
+
from = delta * stroke;
|
270
|
+
to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0);
|
271
|
+
}
|
272
|
+
attr = {};
|
273
|
+
attr["marker-" + se] = "url(#" + markerId + ")";
|
274
|
+
if (to || from) {
|
275
|
+
attr.d = R.getSubpath(attrs.path, from, to);
|
276
|
+
}
|
277
|
+
$(node, attr);
|
278
|
+
o._.arrows[se + "Path"] = pathId;
|
279
|
+
o._.arrows[se + "Marker"] = markerId;
|
280
|
+
o._.arrows[se + "dx"] = delta;
|
281
|
+
o._.arrows[se + "Type"] = type;
|
282
|
+
o._.arrows[se + "String"] = value;
|
283
|
+
} else {
|
284
|
+
if (isEnd) {
|
285
|
+
from = o._.arrows.startdx * stroke || 0;
|
286
|
+
to = R.getTotalLength(attrs.path) - from;
|
287
|
+
} else {
|
288
|
+
from = 0;
|
289
|
+
to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0);
|
290
|
+
}
|
291
|
+
o._.arrows[se + "Path"] && $(node, {d: R.getSubpath(attrs.path, from, to)});
|
292
|
+
delete o._.arrows[se + "Path"];
|
293
|
+
delete o._.arrows[se + "Marker"];
|
294
|
+
delete o._.arrows[se + "dx"];
|
295
|
+
delete o._.arrows[se + "Type"];
|
296
|
+
delete o._.arrows[se + "String"];
|
297
|
+
}
|
298
|
+
for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) {
|
299
|
+
var item = R._g.doc.getElementById(attr);
|
300
|
+
item && item.parentNode.removeChild(item);
|
301
|
+
}
|
302
|
+
}
|
303
|
+
},
|
304
|
+
dasharray = {
|
305
|
+
"-": [3, 1],
|
306
|
+
".": [1, 1],
|
307
|
+
"-.": [3, 1, 1, 1],
|
308
|
+
"-..": [3, 1, 1, 1, 1, 1],
|
309
|
+
". ": [1, 3],
|
310
|
+
"- ": [4, 3],
|
311
|
+
"--": [8, 3],
|
312
|
+
"- .": [4, 3, 1, 3],
|
313
|
+
"--.": [8, 3, 1, 3],
|
314
|
+
"--..": [8, 3, 1, 3, 1, 3]
|
315
|
+
},
|
316
|
+
addDashes = function (o, value, params) {
|
317
|
+
value = dasharray[Str(value).toLowerCase()];
|
318
|
+
if (value) {
|
319
|
+
var width = o.attrs["stroke-width"] || "1",
|
320
|
+
butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0,
|
321
|
+
dashes = [],
|
322
|
+
i = value.length;
|
323
|
+
while (i--) {
|
324
|
+
dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt;
|
325
|
+
}
|
326
|
+
$(o.node, {"stroke-dasharray": dashes.join(",")});
|
327
|
+
}
|
328
|
+
else {
|
329
|
+
$(o.node, {"stroke-dasharray": "none"});
|
330
|
+
}
|
331
|
+
},
|
332
|
+
setFillAndStroke = function (o, params) {
|
333
|
+
var node = o.node,
|
334
|
+
attrs = o.attrs,
|
335
|
+
vis = node.style.visibility;
|
336
|
+
node.style.visibility = "hidden";
|
337
|
+
for (var att in params) {
|
338
|
+
if (params[has](att)) {
|
339
|
+
if (!R._availableAttrs[has](att)) {
|
340
|
+
continue;
|
341
|
+
}
|
342
|
+
var value = params[att];
|
343
|
+
attrs[att] = value;
|
344
|
+
switch (att) {
|
345
|
+
case "blur":
|
346
|
+
o.blur(value);
|
347
|
+
break;
|
348
|
+
case "title":
|
349
|
+
var title = node.getElementsByTagName("title");
|
350
|
+
|
351
|
+
// Use the existing <title>.
|
352
|
+
if (title.length && (title = title[0])) {
|
353
|
+
title.firstChild.nodeValue = value;
|
354
|
+
} else {
|
355
|
+
title = $("title");
|
356
|
+
var val = R._g.doc.createTextNode(value);
|
357
|
+
title.appendChild(val);
|
358
|
+
node.appendChild(title);
|
359
|
+
}
|
360
|
+
break;
|
361
|
+
case "href":
|
362
|
+
case "target":
|
363
|
+
var pn = node.parentNode;
|
364
|
+
if (pn.tagName.toLowerCase() != "a") {
|
365
|
+
var hl = $("a");
|
366
|
+
pn.insertBefore(hl, node);
|
367
|
+
hl.appendChild(node);
|
368
|
+
pn = hl;
|
369
|
+
}
|
370
|
+
if (att == "target") {
|
371
|
+
pn.setAttributeNS(xlink, "show", value == "blank" ? "new" : value);
|
372
|
+
} else {
|
373
|
+
pn.setAttributeNS(xlink, att, value);
|
374
|
+
}
|
375
|
+
break;
|
376
|
+
case "cursor":
|
377
|
+
node.style.cursor = value;
|
378
|
+
break;
|
379
|
+
case "transform":
|
380
|
+
o.transform(value);
|
381
|
+
break;
|
382
|
+
case "arrow-start":
|
383
|
+
addArrow(o, value);
|
384
|
+
break;
|
385
|
+
case "arrow-end":
|
386
|
+
addArrow(o, value, 1);
|
387
|
+
break;
|
388
|
+
case "clip-rect":
|
389
|
+
var rect = Str(value).split(separator);
|
390
|
+
if (rect.length == 4) {
|
391
|
+
o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);
|
392
|
+
var el = $("clipPath"),
|
393
|
+
rc = $("rect");
|
394
|
+
el.id = R.createUUID();
|
395
|
+
$(rc, {
|
396
|
+
x: rect[0],
|
397
|
+
y: rect[1],
|
398
|
+
width: rect[2],
|
399
|
+
height: rect[3]
|
400
|
+
});
|
401
|
+
el.appendChild(rc);
|
402
|
+
o.paper.defs.appendChild(el);
|
403
|
+
$(node, {"clip-path": "url(#" + el.id + ")"});
|
404
|
+
o.clip = rc;
|
405
|
+
}
|
406
|
+
if (!value) {
|
407
|
+
var path = node.getAttribute("clip-path");
|
408
|
+
if (path) {
|
409
|
+
var clip = R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g, E));
|
410
|
+
clip && clip.parentNode.removeChild(clip);
|
411
|
+
$(node, {"clip-path": E});
|
412
|
+
delete o.clip;
|
413
|
+
}
|
414
|
+
}
|
415
|
+
break;
|
416
|
+
case "path":
|
417
|
+
if (o.type == "path") {
|
418
|
+
$(node, {d: value ? attrs.path = R._pathToAbsolute(value) : "M0,0"});
|
419
|
+
o._.dirty = 1;
|
420
|
+
if (o._.arrows) {
|
421
|
+
"startString" in o._.arrows && addArrow(o, o._.arrows.startString);
|
422
|
+
"endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
|
423
|
+
}
|
424
|
+
}
|
425
|
+
break;
|
426
|
+
case "width":
|
427
|
+
node.setAttribute(att, value);
|
428
|
+
o._.dirty = 1;
|
429
|
+
if (attrs.fx) {
|
430
|
+
att = "x";
|
431
|
+
value = attrs.x;
|
432
|
+
} else {
|
433
|
+
break;
|
434
|
+
}
|
435
|
+
case "x":
|
436
|
+
if (attrs.fx) {
|
437
|
+
value = -attrs.x - (attrs.width || 0);
|
438
|
+
}
|
439
|
+
case "rx":
|
440
|
+
if (att == "rx" && o.type == "rect") {
|
441
|
+
break;
|
442
|
+
}
|
443
|
+
case "cx":
|
444
|
+
node.setAttribute(att, value);
|
445
|
+
o.pattern && updatePosition(o);
|
446
|
+
o._.dirty = 1;
|
447
|
+
break;
|
448
|
+
case "height":
|
449
|
+
node.setAttribute(att, value);
|
450
|
+
o._.dirty = 1;
|
451
|
+
if (attrs.fy) {
|
452
|
+
att = "y";
|
453
|
+
value = attrs.y;
|
454
|
+
} else {
|
455
|
+
break;
|
456
|
+
}
|
457
|
+
case "y":
|
458
|
+
if (attrs.fy) {
|
459
|
+
value = -attrs.y - (attrs.height || 0);
|
460
|
+
}
|
461
|
+
case "ry":
|
462
|
+
if (att == "ry" && o.type == "rect") {
|
463
|
+
break;
|
464
|
+
}
|
465
|
+
case "cy":
|
466
|
+
node.setAttribute(att, value);
|
467
|
+
o.pattern && updatePosition(o);
|
468
|
+
o._.dirty = 1;
|
469
|
+
break;
|
470
|
+
case "r":
|
471
|
+
if (o.type == "rect") {
|
472
|
+
$(node, {rx: value, ry: value});
|
473
|
+
} else {
|
474
|
+
node.setAttribute(att, value);
|
475
|
+
}
|
476
|
+
o._.dirty = 1;
|
477
|
+
break;
|
478
|
+
case "src":
|
479
|
+
if (o.type == "image") {
|
480
|
+
node.setAttributeNS(xlink, "href", value);
|
481
|
+
}
|
482
|
+
break;
|
483
|
+
case "stroke-width":
|
484
|
+
if (o._.sx != 1 || o._.sy != 1) {
|
485
|
+
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
|
486
|
+
}
|
487
|
+
node.setAttribute(att, value);
|
488
|
+
if (attrs["stroke-dasharray"]) {
|
489
|
+
addDashes(o, attrs["stroke-dasharray"], params);
|
490
|
+
}
|
491
|
+
if (o._.arrows) {
|
492
|
+
"startString" in o._.arrows && addArrow(o, o._.arrows.startString);
|
493
|
+
"endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
|
494
|
+
}
|
495
|
+
break;
|
496
|
+
case "stroke-dasharray":
|
497
|
+
addDashes(o, value, params);
|
498
|
+
break;
|
499
|
+
case "fill":
|
500
|
+
var isURL = Str(value).match(R._ISURL);
|
501
|
+
if (isURL) {
|
502
|
+
el = $("pattern");
|
503
|
+
var ig = $("image");
|
504
|
+
el.id = R.createUUID();
|
505
|
+
$(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1});
|
506
|
+
$(ig, {x: 0, y: 0, "xlink:href": isURL[1]});
|
507
|
+
el.appendChild(ig);
|
508
|
+
|
509
|
+
(function (el) {
|
510
|
+
R._preload(isURL[1], function () {
|
511
|
+
var w = this.offsetWidth,
|
512
|
+
h = this.offsetHeight;
|
513
|
+
$(el, {width: w, height: h});
|
514
|
+
$(ig, {width: w, height: h});
|
515
|
+
});
|
516
|
+
})(el);
|
517
|
+
o.paper.defs.appendChild(el);
|
518
|
+
$(node, {fill: "url(#" + el.id + ")"});
|
519
|
+
o.pattern = el;
|
520
|
+
o.pattern && updatePosition(o);
|
521
|
+
break;
|
522
|
+
}
|
523
|
+
var clr = R.getRGB(value);
|
524
|
+
if (!clr.error) {
|
525
|
+
delete params.gradient;
|
526
|
+
delete attrs.gradient;
|
527
|
+
!R.is(attrs.opacity, "undefined") &&
|
528
|
+
R.is(params.opacity, "undefined") &&
|
529
|
+
$(node, {opacity: attrs.opacity});
|
530
|
+
!R.is(attrs["fill-opacity"], "undefined") &&
|
531
|
+
R.is(params["fill-opacity"], "undefined") &&
|
532
|
+
$(node, {"fill-opacity": attrs["fill-opacity"]});
|
533
|
+
} else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) {
|
534
|
+
if ("opacity" in attrs || "fill-opacity" in attrs) {
|
535
|
+
var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E));
|
536
|
+
if (gradient) {
|
537
|
+
var stops = gradient.getElementsByTagName("stop");
|
538
|
+
$(stops[stops.length - 1], {"stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1)});
|
539
|
+
}
|
540
|
+
}
|
541
|
+
attrs.gradient = value;
|
542
|
+
attrs.fill = "none";
|
543
|
+
break;
|
544
|
+
}
|
545
|
+
clr[has]("opacity") && $(node, {"fill-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity});
|
546
|
+
case "stroke":
|
547
|
+
clr = R.getRGB(value);
|
548
|
+
node.setAttribute(att, clr.hex);
|
549
|
+
att == "stroke" && clr[has]("opacity") && $(node, {"stroke-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity});
|
550
|
+
if (att == "stroke" && o._.arrows) {
|
551
|
+
"startString" in o._.arrows && addArrow(o, o._.arrows.startString);
|
552
|
+
"endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
|
553
|
+
}
|
554
|
+
break;
|
555
|
+
case "gradient":
|
556
|
+
(o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value);
|
557
|
+
break;
|
558
|
+
case "opacity":
|
559
|
+
if (attrs.gradient && !attrs[has]("stroke-opacity")) {
|
560
|
+
$(node, {"stroke-opacity": value > 1 ? value / 100 : value});
|
561
|
+
}
|
562
|
+
// fall
|
563
|
+
case "fill-opacity":
|
564
|
+
if (attrs.gradient) {
|
565
|
+
gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E));
|
566
|
+
if (gradient) {
|
567
|
+
stops = gradient.getElementsByTagName("stop");
|
568
|
+
$(stops[stops.length - 1], {"stop-opacity": value});
|
569
|
+
}
|
570
|
+
break;
|
571
|
+
}
|
572
|
+
default:
|
573
|
+
att == "font-size" && (value = toInt(value, 10) + "px");
|
574
|
+
var cssrule = att.replace(/(\-.)/g, function (w) {
|
575
|
+
return w.substring(1).toUpperCase();
|
576
|
+
});
|
577
|
+
node.style[cssrule] = value;
|
578
|
+
o._.dirty = 1;
|
579
|
+
node.setAttribute(att, value);
|
580
|
+
break;
|
581
|
+
}
|
582
|
+
}
|
583
|
+
}
|
584
|
+
|
585
|
+
tuneText(o, params);
|
586
|
+
node.style.visibility = vis;
|
587
|
+
},
|
588
|
+
leading = 1.2,
|
589
|
+
tuneText = function (el, params) {
|
590
|
+
if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) {
|
591
|
+
return;
|
592
|
+
}
|
593
|
+
var a = el.attrs,
|
594
|
+
node = el.node,
|
595
|
+
fontSize = node.firstChild ? toInt(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10;
|
596
|
+
|
597
|
+
if (params[has]("text")) {
|
598
|
+
a.text = params.text;
|
599
|
+
while (node.firstChild) {
|
600
|
+
node.removeChild(node.firstChild);
|
601
|
+
}
|
602
|
+
var texts = Str(params.text).split("\n"),
|
603
|
+
tspans = [],
|
604
|
+
tspan;
|
605
|
+
for (var i = 0, ii = texts.length; i < ii; i++) {
|
606
|
+
tspan = $("tspan");
|
607
|
+
i && $(tspan, {dy: fontSize * leading, x: a.x});
|
608
|
+
tspan.appendChild(R._g.doc.createTextNode(texts[i]));
|
609
|
+
node.appendChild(tspan);
|
610
|
+
tspans[i] = tspan;
|
611
|
+
}
|
612
|
+
} else {
|
613
|
+
tspans = node.getElementsByTagName("tspan");
|
614
|
+
for (i = 0, ii = tspans.length; i < ii; i++) if (i) {
|
615
|
+
$(tspans[i], {dy: fontSize * leading, x: a.x});
|
616
|
+
} else {
|
617
|
+
$(tspans[0], {dy: 0});
|
618
|
+
}
|
619
|
+
}
|
620
|
+
$(node, {x: a.x, y: a.y});
|
621
|
+
el._.dirty = 1;
|
622
|
+
var bb = el._getBBox(),
|
623
|
+
dif = a.y - (bb.y + (bb.height / 2));
|
624
|
+
if (bb.height) dif && R.is(dif, "finite") && $(tspans[0], {dy: dif});
|
625
|
+
},
|
626
|
+
getRealNode = function (node) {
|
627
|
+
if (node.parentNode && node.parentNode.tagName.toLowerCase() === "a") {
|
628
|
+
return node.parentNode;
|
629
|
+
} else {
|
630
|
+
return node;
|
631
|
+
}
|
632
|
+
},
|
633
|
+
Element = function (node, svg) {
|
634
|
+
var X = 0,
|
635
|
+
Y = 0;
|
636
|
+
/*\
|
637
|
+
* Element.node
|
638
|
+
[ property (object) ]
|
639
|
+
**
|
640
|
+
* Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
|
641
|
+
**
|
642
|
+
* Note: Don’t mess with it.
|
643
|
+
> Usage
|
644
|
+
| // draw a circle at coordinate 10,10 with radius of 10
|
645
|
+
| var c = paper.circle(10, 10, 10);
|
646
|
+
| c.node.onclick = function () {
|
647
|
+
| c.attr("fill", "red");
|
648
|
+
| };
|
649
|
+
\*/
|
650
|
+
this[0] = this.node = node;
|
651
|
+
/*\
|
652
|
+
* Element.raphael
|
653
|
+
[ property (object) ]
|
654
|
+
**
|
655
|
+
* Internal reference to @Raphael object. In case it is not available.
|
656
|
+
> Usage
|
657
|
+
| Raphael.el.red = function () {
|
658
|
+
| var hsb = this.paper.raphael.rgb2hsb(this.attr("fill"));
|
659
|
+
| hsb.h = 1;
|
660
|
+
| this.attr({fill: this.paper.raphael.hsb2rgb(hsb).hex});
|
661
|
+
| }
|
662
|
+
\*/
|
663
|
+
node.raphael = true;
|
664
|
+
/*\
|
665
|
+
* Element.id
|
666
|
+
[ property (number) ]
|
667
|
+
**
|
668
|
+
* Unique id of the element. Especially useful when you want to listen to events of the element,
|
669
|
+
* because all events are fired in format `<module>.<action>.<id>`. Also useful for @Paper.getById method.
|
670
|
+
\*/
|
671
|
+
this.id = R._oid++;
|
672
|
+
node.raphaelid = this.id;
|
673
|
+
this.matrix = R.matrix();
|
674
|
+
this.realPath = null;
|
675
|
+
/*\
|
676
|
+
* Element.paper
|
677
|
+
[ property (object) ]
|
678
|
+
**
|
679
|
+
* Internal reference to “paper” where object drawn. Mainly for use in plugins and element extensions.
|
680
|
+
> Usage
|
681
|
+
| Raphael.el.cross = function () {
|
682
|
+
| this.attr({fill: "red"});
|
683
|
+
| this.paper.path("M10,10L50,50M50,10L10,50")
|
684
|
+
| .attr({stroke: "red"});
|
685
|
+
| }
|
686
|
+
\*/
|
687
|
+
this.paper = svg;
|
688
|
+
this.attrs = this.attrs || {};
|
689
|
+
this._ = {
|
690
|
+
transform: [],
|
691
|
+
sx: 1,
|
692
|
+
sy: 1,
|
693
|
+
deg: 0,
|
694
|
+
dx: 0,
|
695
|
+
dy: 0,
|
696
|
+
dirty: 1
|
697
|
+
};
|
698
|
+
!svg.bottom && (svg.bottom = this);
|
699
|
+
/*\
|
700
|
+
* Element.prev
|
701
|
+
[ property (object) ]
|
702
|
+
**
|
703
|
+
* Reference to the previous element in the hierarchy.
|
704
|
+
\*/
|
705
|
+
this.prev = svg.top;
|
706
|
+
svg.top && (svg.top.next = this);
|
707
|
+
svg.top = this;
|
708
|
+
/*\
|
709
|
+
* Element.next
|
710
|
+
[ property (object) ]
|
711
|
+
**
|
712
|
+
* Reference to the next element in the hierarchy.
|
713
|
+
\*/
|
714
|
+
this.next = null;
|
715
|
+
},
|
716
|
+
elproto = R.el;
|
717
|
+
|
718
|
+
Element.prototype = elproto;
|
719
|
+
elproto.constructor = Element;
|
720
|
+
|
721
|
+
R._engine.path = function (pathString, SVG) {
|
722
|
+
var el = $("path");
|
723
|
+
SVG.canvas && SVG.canvas.appendChild(el);
|
724
|
+
var p = new Element(el, SVG);
|
725
|
+
p.type = "path";
|
726
|
+
setFillAndStroke(p, {
|
727
|
+
fill: "none",
|
728
|
+
stroke: "#000",
|
729
|
+
path: pathString
|
730
|
+
});
|
731
|
+
return p;
|
732
|
+
};
|
733
|
+
/*\
|
734
|
+
* Element.rotate
|
735
|
+
[ method ]
|
736
|
+
**
|
737
|
+
* Deprecated! Use @Element.transform instead.
|
738
|
+
* Adds rotation by given angle around given point to the list of
|
739
|
+
* transformations of the element.
|
740
|
+
> Parameters
|
741
|
+
- deg (number) angle in degrees
|
742
|
+
- cx (number) #optional x coordinate of the centre of rotation
|
743
|
+
- cy (number) #optional y coordinate of the centre of rotation
|
744
|
+
* If cx & cy aren’t specified centre of the shape is used as a point of rotation.
|
745
|
+
= (object) @Element
|
746
|
+
\*/
|
747
|
+
elproto.rotate = function (deg, cx, cy) {
|
748
|
+
if (this.removed) {
|
749
|
+
return this;
|
750
|
+
}
|
751
|
+
deg = Str(deg).split(separator);
|
752
|
+
if (deg.length - 1) {
|
753
|
+
cx = toFloat(deg[1]);
|
754
|
+
cy = toFloat(deg[2]);
|
755
|
+
}
|
756
|
+
deg = toFloat(deg[0]);
|
757
|
+
(cy == null) && (cx = cy);
|
758
|
+
if (cx == null || cy == null) {
|
759
|
+
var bbox = this.getBBox(1);
|
760
|
+
cx = bbox.x + bbox.width / 2;
|
761
|
+
cy = bbox.y + bbox.height / 2;
|
762
|
+
}
|
763
|
+
this.transform(this._.transform.concat([["r", deg, cx, cy]]));
|
764
|
+
return this;
|
765
|
+
};
|
766
|
+
/*\
|
767
|
+
* Element.scale
|
768
|
+
[ method ]
|
769
|
+
**
|
770
|
+
* Deprecated! Use @Element.transform instead.
|
771
|
+
* Adds scale by given amount relative to given point to the list of
|
772
|
+
* transformations of the element.
|
773
|
+
> Parameters
|
774
|
+
- sx (number) horisontal scale amount
|
775
|
+
- sy (number) vertical scale amount
|
776
|
+
- cx (number) #optional x coordinate of the centre of scale
|
777
|
+
- cy (number) #optional y coordinate of the centre of scale
|
778
|
+
* If cx & cy aren’t specified centre of the shape is used instead.
|
779
|
+
= (object) @Element
|
780
|
+
\*/
|
781
|
+
elproto.scale = function (sx, sy, cx, cy) {
|
782
|
+
if (this.removed) {
|
783
|
+
return this;
|
784
|
+
}
|
785
|
+
sx = Str(sx).split(separator);
|
786
|
+
if (sx.length - 1) {
|
787
|
+
sy = toFloat(sx[1]);
|
788
|
+
cx = toFloat(sx[2]);
|
789
|
+
cy = toFloat(sx[3]);
|
790
|
+
}
|
791
|
+
sx = toFloat(sx[0]);
|
792
|
+
(sy == null) && (sy = sx);
|
793
|
+
(cy == null) && (cx = cy);
|
794
|
+
if (cx == null || cy == null) {
|
795
|
+
var bbox = this.getBBox(1);
|
796
|
+
}
|
797
|
+
cx = cx == null ? bbox.x + bbox.width / 2 : cx;
|
798
|
+
cy = cy == null ? bbox.y + bbox.height / 2 : cy;
|
799
|
+
this.transform(this._.transform.concat([["s", sx, sy, cx, cy]]));
|
800
|
+
return this;
|
801
|
+
};
|
802
|
+
/*\
|
803
|
+
* Element.translate
|
804
|
+
[ method ]
|
805
|
+
**
|
806
|
+
* Deprecated! Use @Element.transform instead.
|
807
|
+
* Adds translation by given amount to the list of transformations of the element.
|
808
|
+
> Parameters
|
809
|
+
- dx (number) horisontal shift
|
810
|
+
- dy (number) vertical shift
|
811
|
+
= (object) @Element
|
812
|
+
\*/
|
813
|
+
elproto.translate = function (dx, dy) {
|
814
|
+
if (this.removed) {
|
815
|
+
return this;
|
816
|
+
}
|
817
|
+
dx = Str(dx).split(separator);
|
818
|
+
if (dx.length - 1) {
|
819
|
+
dy = toFloat(dx[1]);
|
820
|
+
}
|
821
|
+
dx = toFloat(dx[0]) || 0;
|
822
|
+
dy = +dy || 0;
|
823
|
+
this.transform(this._.transform.concat([["t", dx, dy]]));
|
824
|
+
return this;
|
825
|
+
};
|
826
|
+
/*\
|
827
|
+
* Element.transform
|
828
|
+
[ method ]
|
829
|
+
**
|
830
|
+
* Adds transformation to the element which is separate to other attributes,
|
831
|
+
* i.e. translation doesn’t change `x` or `y` of the rectange. The format
|
832
|
+
* of transformation string is similar to the path string syntax:
|
833
|
+
| "t100,100r30,100,100s2,2,100,100r45s1.5"
|
834
|
+
* Each letter is a command. There are four commands: `t` is for translate, `r` is for rotate, `s` is for
|
835
|
+
* scale and `m` is for matrix.
|
836
|
+
*
|
837
|
+
* There are also alternative “absolute” translation, rotation and scale: `T`, `R` and `S`. They will not take previous transformation into account. For example, `...T100,0` will always move element 100 px horisontally, while `...t100,0` could move it vertically if there is `r90` before. Just compare results of `r90t100,0` and `r90T100,0`.
|
838
|
+
*
|
839
|
+
* So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100;
|
840
|
+
* rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin
|
841
|
+
* coordinates as optional parameters, the default is the centre point of the element.
|
842
|
+
* Matrix accepts six parameters.
|
843
|
+
> Usage
|
844
|
+
| var el = paper.rect(10, 20, 300, 200);
|
845
|
+
| // translate 100, 100, rotate 45°, translate -100, 0
|
846
|
+
| el.transform("t100,100r45t-100,0");
|
847
|
+
| // if you want you can append or prepend transformations
|
848
|
+
| el.transform("...t50,50");
|
849
|
+
| el.transform("s2...");
|
850
|
+
| // or even wrap
|
851
|
+
| el.transform("t50,50...t-50-50");
|
852
|
+
| // to reset transformation call method with empty string
|
853
|
+
| el.transform("");
|
854
|
+
| // to get current value call it without parameters
|
855
|
+
| console.log(el.transform());
|
856
|
+
> Parameters
|
857
|
+
- tstr (string) #optional transformation string
|
858
|
+
* If tstr isn’t specified
|
859
|
+
= (string) current transformation string
|
860
|
+
* else
|
861
|
+
= (object) @Element
|
862
|
+
\*/
|
863
|
+
elproto.transform = function (tstr) {
|
864
|
+
var _ = this._;
|
865
|
+
if (tstr == null) {
|
866
|
+
return _.transform;
|
867
|
+
}
|
868
|
+
R._extractTransform(this, tstr);
|
869
|
+
|
870
|
+
this.clip && $(this.clip, {transform: this.matrix.invert()});
|
871
|
+
this.pattern && updatePosition(this);
|
872
|
+
this.node && $(this.node, {transform: this.matrix});
|
873
|
+
|
874
|
+
if (_.sx != 1 || _.sy != 1) {
|
875
|
+
var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1;
|
876
|
+
this.attr({"stroke-width": sw});
|
877
|
+
}
|
878
|
+
|
879
|
+
//Reduce transform string
|
880
|
+
_.transform = this.matrix.toTransformString();
|
881
|
+
|
882
|
+
return this;
|
883
|
+
};
|
884
|
+
/*\
|
885
|
+
* Element.hide
|
886
|
+
[ method ]
|
887
|
+
**
|
888
|
+
* Makes element invisible. See @Element.show.
|
889
|
+
= (object) @Element
|
890
|
+
\*/
|
891
|
+
elproto.hide = function () {
|
892
|
+
if(!this.removed) this.node.style.display = "none";
|
893
|
+
return this;
|
894
|
+
};
|
895
|
+
/*\
|
896
|
+
* Element.show
|
897
|
+
[ method ]
|
898
|
+
**
|
899
|
+
* Makes element visible. See @Element.hide.
|
900
|
+
= (object) @Element
|
901
|
+
\*/
|
902
|
+
elproto.show = function () {
|
903
|
+
if(!this.removed) this.node.style.display = "";
|
904
|
+
return this;
|
905
|
+
};
|
906
|
+
/*\
|
907
|
+
* Element.remove
|
908
|
+
[ method ]
|
909
|
+
**
|
910
|
+
* Removes element from the paper.
|
911
|
+
\*/
|
912
|
+
elproto.remove = function () {
|
913
|
+
var node = getRealNode(this.node);
|
914
|
+
if (this.removed || !node.parentNode) {
|
915
|
+
return;
|
916
|
+
}
|
917
|
+
var paper = this.paper;
|
918
|
+
paper.__set__ && paper.__set__.exclude(this);
|
919
|
+
eve.unbind("raphael.*.*." + this.id);
|
920
|
+
if (this.gradient) {
|
921
|
+
paper.defs.removeChild(this.gradient);
|
922
|
+
}
|
923
|
+
R._tear(this, paper);
|
924
|
+
|
925
|
+
node.parentNode.removeChild(node);
|
926
|
+
|
927
|
+
// Remove custom data for element
|
928
|
+
this.removeData();
|
929
|
+
|
930
|
+
for (var i in this) {
|
931
|
+
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
|
932
|
+
}
|
933
|
+
this.removed = true;
|
934
|
+
};
|
935
|
+
elproto._getBBox = function () {
|
936
|
+
if (this.node.style.display == "none") {
|
937
|
+
this.show();
|
938
|
+
var hide = true;
|
939
|
+
}
|
940
|
+
var canvasHidden = false,
|
941
|
+
containerStyle;
|
942
|
+
if (this.paper.canvas.parentElement) {
|
943
|
+
containerStyle = this.paper.canvas.parentElement.style;
|
944
|
+
} //IE10+ can't find parentElement
|
945
|
+
else if (this.paper.canvas.parentNode) {
|
946
|
+
containerStyle = this.paper.canvas.parentNode.style;
|
947
|
+
}
|
948
|
+
|
949
|
+
if(containerStyle && containerStyle.display == "none") {
|
950
|
+
canvasHidden = true;
|
951
|
+
containerStyle.display = "";
|
952
|
+
}
|
953
|
+
var bbox = {};
|
954
|
+
try {
|
955
|
+
bbox = this.node.getBBox();
|
956
|
+
} catch(e) {
|
957
|
+
// Firefox 3.0.x, 25.0.1 (probably more versions affected) play badly here - possible fix
|
958
|
+
bbox = {
|
959
|
+
x: this.node.clientLeft,
|
960
|
+
y: this.node.clientTop,
|
961
|
+
width: this.node.clientWidth,
|
962
|
+
height: this.node.clientHeight
|
963
|
+
}
|
964
|
+
} finally {
|
965
|
+
bbox = bbox || {};
|
966
|
+
if(canvasHidden){
|
967
|
+
containerStyle.display = "none";
|
968
|
+
}
|
969
|
+
}
|
970
|
+
hide && this.hide();
|
971
|
+
return bbox;
|
972
|
+
};
|
973
|
+
/*\
|
974
|
+
* Element.attr
|
975
|
+
[ method ]
|
976
|
+
**
|
977
|
+
* Sets the attributes of the element.
|
978
|
+
> Parameters
|
979
|
+
- attrName (string) attribute’s name
|
980
|
+
- value (string) value
|
981
|
+
* or
|
982
|
+
- params (object) object of name/value pairs
|
983
|
+
* or
|
984
|
+
- attrName (string) attribute’s name
|
985
|
+
* or
|
986
|
+
- attrNames (array) in this case method returns array of current values for given attribute names
|
987
|
+
= (object) @Element if attrsName & value or params are passed in.
|
988
|
+
= (...) value of the attribute if only attrsName is passed in.
|
989
|
+
= (array) array of values of the attribute if attrsNames is passed in.
|
990
|
+
= (object) object of attributes if nothing is passed in.
|
991
|
+
> Possible parameters
|
992
|
+
# <p>Please refer to the <a href="http://www.w3.org/TR/SVG/" title="The W3C Recommendation for the SVG language describes these properties in detail.">SVG specification</a> for an explanation of these parameters.</p>
|
993
|
+
o arrow-end (string) arrowhead on the end of the path. The format for string is `<type>[-<width>[-<length>]]`. Possible types: `classic`, `block`, `open`, `oval`, `diamond`, `none`, width: `wide`, `narrow`, `medium`, length: `long`, `short`, `midium`.
|
994
|
+
o clip-rect (string) comma or space separated values: x, y, width and height
|
995
|
+
o cursor (string) CSS type of the cursor
|
996
|
+
o cx (number) the x-axis coordinate of the center of the circle, or ellipse
|
997
|
+
o cy (number) the y-axis coordinate of the center of the circle, or ellipse
|
998
|
+
o fill (string) colour, gradient or image
|
999
|
+
o fill-opacity (number)
|
1000
|
+
o font (string)
|
1001
|
+
o font-family (string)
|
1002
|
+
o font-size (number) font size in pixels
|
1003
|
+
o font-weight (string)
|
1004
|
+
o height (number)
|
1005
|
+
o href (string) URL, if specified element behaves as hyperlink
|
1006
|
+
o opacity (number)
|
1007
|
+
o path (string) SVG path string format
|
1008
|
+
o r (number) radius of the circle, ellipse or rounded corner on the rect
|
1009
|
+
o rx (number) horisontal radius of the ellipse
|
1010
|
+
o ry (number) vertical radius of the ellipse
|
1011
|
+
o src (string) image URL, only works for @Element.image element
|
1012
|
+
o stroke (string) stroke colour
|
1013
|
+
o stroke-dasharray (string) [“”, “none”, “`-`”, “`.`”, “`-.`”, “`-..`”, “`. `”, “`- `”, “`--`”, “`- .`”, “`--.`”, “`--..`”]
|
1014
|
+
o stroke-linecap (string) [“`butt`”, “`square`”, “`round`”]
|
1015
|
+
o stroke-linejoin (string) [“`bevel`”, “`round`”, “`miter`”]
|
1016
|
+
o stroke-miterlimit (number)
|
1017
|
+
o stroke-opacity (number)
|
1018
|
+
o stroke-width (number) stroke width in pixels, default is '1'
|
1019
|
+
o target (string) used with href
|
1020
|
+
o text (string) contents of the text element. Use `\n` for multiline text
|
1021
|
+
o text-anchor (string) [“`start`”, “`middle`”, “`end`”], default is “`middle`”
|
1022
|
+
o title (string) will create tooltip with a given text
|
1023
|
+
o transform (string) see @Element.transform
|
1024
|
+
o width (number)
|
1025
|
+
o x (number)
|
1026
|
+
o y (number)
|
1027
|
+
> Gradients
|
1028
|
+
* Linear gradient format: “`‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›`”, example: “`90-#fff-#000`” – 90°
|
1029
|
+
* gradient from white to black or “`0-#fff-#f00:20-#000`” – 0° gradient from white via red (at 20%) to black.
|
1030
|
+
*
|
1031
|
+
* radial gradient: “`r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›`”, example: “`r#fff-#000`” –
|
1032
|
+
* gradient from white to black or “`r(0.25, 0.75)#fff-#000`” – gradient from white to black with focus point
|
1033
|
+
* at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
|
1034
|
+
> Path String
|
1035
|
+
# <p>Please refer to <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path’s data attribute’s format are described in the SVG specification.">SVG documentation regarding path string</a>. Raphaël fully supports it.</p>
|
1036
|
+
> Colour Parsing
|
1037
|
+
# <ul>
|
1038
|
+
# <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
|
1039
|
+
# <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
|
1040
|
+
# <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
|
1041
|
+
# <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200, 100, 0)</code>”)</li>
|
1042
|
+
# <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%, 175%, 0%)</code>”)</li>
|
1043
|
+
# <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200, 100, 0, .5)</code>”)</li>
|
1044
|
+
# <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%, 175%, 0%, 50%)</code>”)</li>
|
1045
|
+
# <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5, 0.25, 1)</code>”)</li>
|
1046
|
+
# <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
|
1047
|
+
# <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
|
1048
|
+
# <li>hsl(•••, •••, •••) — almost the same as hsb, see <a href="http://en.wikipedia.org/wiki/HSL_and_HSV" title="HSL and HSV - Wikipedia, the free encyclopedia">Wikipedia page</a></li>
|
1049
|
+
# <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
|
1050
|
+
# <li>hsla(•••, •••, •••, •••) — same as above, but with opacity</li>
|
1051
|
+
# <li>Optionally for hsb and hsl you could specify hue as a degree: “<code>hsl(240deg, 1, .5)</code>” or, if you want to go fancy, “<code>hsl(240°, 1, .5)</code>”</li>
|
1052
|
+
# </ul>
|
1053
|
+
\*/
|
1054
|
+
elproto.attr = function (name, value) {
|
1055
|
+
if (this.removed) {
|
1056
|
+
return this;
|
1057
|
+
}
|
1058
|
+
if (name == null) {
|
1059
|
+
var res = {};
|
1060
|
+
for (var a in this.attrs) if (this.attrs[has](a)) {
|
1061
|
+
res[a] = this.attrs[a];
|
1062
|
+
}
|
1063
|
+
res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
|
1064
|
+
res.transform = this._.transform;
|
1065
|
+
return res;
|
1066
|
+
}
|
1067
|
+
if (value == null && R.is(name, "string")) {
|
1068
|
+
if (name == "fill" && this.attrs.fill == "none" && this.attrs.gradient) {
|
1069
|
+
return this.attrs.gradient;
|
1070
|
+
}
|
1071
|
+
if (name == "transform") {
|
1072
|
+
return this._.transform;
|
1073
|
+
}
|
1074
|
+
var names = name.split(separator),
|
1075
|
+
out = {};
|
1076
|
+
for (var i = 0, ii = names.length; i < ii; i++) {
|
1077
|
+
name = names[i];
|
1078
|
+
if (name in this.attrs) {
|
1079
|
+
out[name] = this.attrs[name];
|
1080
|
+
} else if (R.is(this.paper.customAttributes[name], "function")) {
|
1081
|
+
out[name] = this.paper.customAttributes[name].def;
|
1082
|
+
} else {
|
1083
|
+
out[name] = R._availableAttrs[name];
|
1084
|
+
}
|
1085
|
+
}
|
1086
|
+
return ii - 1 ? out : out[names[0]];
|
1087
|
+
}
|
1088
|
+
if (value == null && R.is(name, "array")) {
|
1089
|
+
out = {};
|
1090
|
+
for (i = 0, ii = name.length; i < ii; i++) {
|
1091
|
+
out[name[i]] = this.attr(name[i]);
|
1092
|
+
}
|
1093
|
+
return out;
|
1094
|
+
}
|
1095
|
+
if (value != null) {
|
1096
|
+
var params = {};
|
1097
|
+
params[name] = value;
|
1098
|
+
} else if (name != null && R.is(name, "object")) {
|
1099
|
+
params = name;
|
1100
|
+
}
|
1101
|
+
for (var key in params) {
|
1102
|
+
eve("raphael.attr." + key + "." + this.id, this, params[key]);
|
1103
|
+
}
|
1104
|
+
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
|
1105
|
+
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
|
1106
|
+
this.attrs[key] = params[key];
|
1107
|
+
for (var subkey in par) if (par[has](subkey)) {
|
1108
|
+
params[subkey] = par[subkey];
|
1109
|
+
}
|
1110
|
+
}
|
1111
|
+
setFillAndStroke(this, params);
|
1112
|
+
return this;
|
1113
|
+
};
|
1114
|
+
/*\
|
1115
|
+
* Element.toFront
|
1116
|
+
[ method ]
|
1117
|
+
**
|
1118
|
+
* Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
|
1119
|
+
= (object) @Element
|
1120
|
+
\*/
|
1121
|
+
elproto.toFront = function () {
|
1122
|
+
if (this.removed) {
|
1123
|
+
return this;
|
1124
|
+
}
|
1125
|
+
var node = getRealNode(this.node);
|
1126
|
+
node.parentNode.appendChild(node);
|
1127
|
+
var svg = this.paper;
|
1128
|
+
svg.top != this && R._tofront(this, svg);
|
1129
|
+
return this;
|
1130
|
+
};
|
1131
|
+
/*\
|
1132
|
+
* Element.toBack
|
1133
|
+
[ method ]
|
1134
|
+
**
|
1135
|
+
* Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
|
1136
|
+
= (object) @Element
|
1137
|
+
\*/
|
1138
|
+
elproto.toBack = function () {
|
1139
|
+
if (this.removed) {
|
1140
|
+
return this;
|
1141
|
+
}
|
1142
|
+
var node = getRealNode(this.node);
|
1143
|
+
var parentNode = node.parentNode;
|
1144
|
+
parentNode.insertBefore(node, parentNode.firstChild);
|
1145
|
+
R._toback(this, this.paper);
|
1146
|
+
var svg = this.paper;
|
1147
|
+
return this;
|
1148
|
+
};
|
1149
|
+
/*\
|
1150
|
+
* Element.insertAfter
|
1151
|
+
[ method ]
|
1152
|
+
**
|
1153
|
+
* Inserts current object after the given one.
|
1154
|
+
= (object) @Element
|
1155
|
+
\*/
|
1156
|
+
elproto.insertAfter = function (element) {
|
1157
|
+
if (this.removed || !element) {
|
1158
|
+
return this;
|
1159
|
+
}
|
1160
|
+
|
1161
|
+
var node = getRealNode(this.node);
|
1162
|
+
var afterNode = getRealNode(element.node || element[element.length - 1].node);
|
1163
|
+
if (afterNode.nextSibling) {
|
1164
|
+
afterNode.parentNode.insertBefore(node, afterNode.nextSibling);
|
1165
|
+
} else {
|
1166
|
+
afterNode.parentNode.appendChild(node);
|
1167
|
+
}
|
1168
|
+
R._insertafter(this, element, this.paper);
|
1169
|
+
return this;
|
1170
|
+
};
|
1171
|
+
/*\
|
1172
|
+
* Element.insertBefore
|
1173
|
+
[ method ]
|
1174
|
+
**
|
1175
|
+
* Inserts current object before the given one.
|
1176
|
+
= (object) @Element
|
1177
|
+
\*/
|
1178
|
+
elproto.insertBefore = function (element) {
|
1179
|
+
if (this.removed || !element) {
|
1180
|
+
return this;
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
var node = getRealNode(this.node);
|
1184
|
+
var beforeNode = getRealNode(element.node || element[0].node);
|
1185
|
+
beforeNode.parentNode.insertBefore(node, beforeNode);
|
1186
|
+
R._insertbefore(this, element, this.paper);
|
1187
|
+
return this;
|
1188
|
+
};
|
1189
|
+
elproto.blur = function (size) {
|
1190
|
+
// Experimental. No Safari support. Use it on your own risk.
|
1191
|
+
var t = this;
|
1192
|
+
if (+size !== 0) {
|
1193
|
+
var fltr = $("filter"),
|
1194
|
+
blur = $("feGaussianBlur");
|
1195
|
+
t.attrs.blur = size;
|
1196
|
+
fltr.id = R.createUUID();
|
1197
|
+
$(blur, {stdDeviation: +size || 1.5});
|
1198
|
+
fltr.appendChild(blur);
|
1199
|
+
t.paper.defs.appendChild(fltr);
|
1200
|
+
t._blur = fltr;
|
1201
|
+
$(t.node, {filter: "url(#" + fltr.id + ")"});
|
1202
|
+
} else {
|
1203
|
+
if (t._blur) {
|
1204
|
+
t._blur.parentNode.removeChild(t._blur);
|
1205
|
+
delete t._blur;
|
1206
|
+
delete t.attrs.blur;
|
1207
|
+
}
|
1208
|
+
t.node.removeAttribute("filter");
|
1209
|
+
}
|
1210
|
+
return t;
|
1211
|
+
};
|
1212
|
+
R._engine.circle = function (svg, x, y, r) {
|
1213
|
+
var el = $("circle");
|
1214
|
+
svg.canvas && svg.canvas.appendChild(el);
|
1215
|
+
var res = new Element(el, svg);
|
1216
|
+
res.attrs = {cx: x, cy: y, r: r, fill: "none", stroke: "#000"};
|
1217
|
+
res.type = "circle";
|
1218
|
+
$(el, res.attrs);
|
1219
|
+
return res;
|
1220
|
+
};
|
1221
|
+
R._engine.rect = function (svg, x, y, w, h, r) {
|
1222
|
+
var el = $("rect");
|
1223
|
+
svg.canvas && svg.canvas.appendChild(el);
|
1224
|
+
var res = new Element(el, svg);
|
1225
|
+
res.attrs = {x: x, y: y, width: w, height: h, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"};
|
1226
|
+
res.type = "rect";
|
1227
|
+
$(el, res.attrs);
|
1228
|
+
return res;
|
1229
|
+
};
|
1230
|
+
R._engine.ellipse = function (svg, x, y, rx, ry) {
|
1231
|
+
var el = $("ellipse");
|
1232
|
+
svg.canvas && svg.canvas.appendChild(el);
|
1233
|
+
var res = new Element(el, svg);
|
1234
|
+
res.attrs = {cx: x, cy: y, rx: rx, ry: ry, fill: "none", stroke: "#000"};
|
1235
|
+
res.type = "ellipse";
|
1236
|
+
$(el, res.attrs);
|
1237
|
+
return res;
|
1238
|
+
};
|
1239
|
+
R._engine.image = function (svg, src, x, y, w, h) {
|
1240
|
+
var el = $("image");
|
1241
|
+
$(el, {x: x, y: y, width: w, height: h, preserveAspectRatio: "none"});
|
1242
|
+
el.setAttributeNS(xlink, "href", src);
|
1243
|
+
svg.canvas && svg.canvas.appendChild(el);
|
1244
|
+
var res = new Element(el, svg);
|
1245
|
+
res.attrs = {x: x, y: y, width: w, height: h, src: src};
|
1246
|
+
res.type = "image";
|
1247
|
+
return res;
|
1248
|
+
};
|
1249
|
+
R._engine.text = function (svg, x, y, text) {
|
1250
|
+
var el = $("text");
|
1251
|
+
svg.canvas && svg.canvas.appendChild(el);
|
1252
|
+
var res = new Element(el, svg);
|
1253
|
+
res.attrs = {
|
1254
|
+
x: x,
|
1255
|
+
y: y,
|
1256
|
+
"text-anchor": "middle",
|
1257
|
+
text: text,
|
1258
|
+
"font-family": R._availableAttrs["font-family"],
|
1259
|
+
"font-size": R._availableAttrs["font-size"],
|
1260
|
+
stroke: "none",
|
1261
|
+
fill: "#000"
|
1262
|
+
};
|
1263
|
+
res.type = "text";
|
1264
|
+
setFillAndStroke(res, res.attrs);
|
1265
|
+
return res;
|
1266
|
+
};
|
1267
|
+
R._engine.setSize = function (width, height) {
|
1268
|
+
this.width = width || this.width;
|
1269
|
+
this.height = height || this.height;
|
1270
|
+
this.canvas.setAttribute("width", this.width);
|
1271
|
+
this.canvas.setAttribute("height", this.height);
|
1272
|
+
if (this._viewBox) {
|
1273
|
+
this.setViewBox.apply(this, this._viewBox);
|
1274
|
+
}
|
1275
|
+
return this;
|
1276
|
+
};
|
1277
|
+
R._engine.create = function () {
|
1278
|
+
var con = R._getContainer.apply(0, arguments),
|
1279
|
+
container = con && con.container,
|
1280
|
+
x = con.x,
|
1281
|
+
y = con.y,
|
1282
|
+
width = con.width,
|
1283
|
+
height = con.height;
|
1284
|
+
if (!container) {
|
1285
|
+
throw new Error("SVG container not found.");
|
1286
|
+
}
|
1287
|
+
var cnvs = $("svg"),
|
1288
|
+
css = "overflow:hidden;",
|
1289
|
+
isFloating;
|
1290
|
+
x = x || 0;
|
1291
|
+
y = y || 0;
|
1292
|
+
width = width || 512;
|
1293
|
+
height = height || 342;
|
1294
|
+
$(cnvs, {
|
1295
|
+
height: height,
|
1296
|
+
version: 1.1,
|
1297
|
+
width: width,
|
1298
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1299
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
1300
|
+
});
|
1301
|
+
if (container == 1) {
|
1302
|
+
cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px";
|
1303
|
+
R._g.doc.body.appendChild(cnvs);
|
1304
|
+
isFloating = 1;
|
1305
|
+
} else {
|
1306
|
+
cnvs.style.cssText = css + "position:relative";
|
1307
|
+
if (container.firstChild) {
|
1308
|
+
container.insertBefore(cnvs, container.firstChild);
|
1309
|
+
} else {
|
1310
|
+
container.appendChild(cnvs);
|
1311
|
+
}
|
1312
|
+
}
|
1313
|
+
container = new R._Paper;
|
1314
|
+
container.width = width;
|
1315
|
+
container.height = height;
|
1316
|
+
container.canvas = cnvs;
|
1317
|
+
container.clear();
|
1318
|
+
container._left = container._top = 0;
|
1319
|
+
isFloating && (container.renderfix = function () {});
|
1320
|
+
container.renderfix();
|
1321
|
+
return container;
|
1322
|
+
};
|
1323
|
+
R._engine.setViewBox = function (x, y, w, h, fit) {
|
1324
|
+
eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
|
1325
|
+
var paperSize = this.getSize(),
|
1326
|
+
size = mmax(w / paperSize.width, h / paperSize.height),
|
1327
|
+
top = this.top,
|
1328
|
+
aspectRatio = fit ? "xMidYMid meet" : "xMinYMin",
|
1329
|
+
vb,
|
1330
|
+
sw;
|
1331
|
+
if (x == null) {
|
1332
|
+
if (this._vbSize) {
|
1333
|
+
size = 1;
|
1334
|
+
}
|
1335
|
+
delete this._vbSize;
|
1336
|
+
vb = "0 0 " + this.width + S + this.height;
|
1337
|
+
} else {
|
1338
|
+
this._vbSize = size;
|
1339
|
+
vb = x + S + y + S + w + S + h;
|
1340
|
+
}
|
1341
|
+
$(this.canvas, {
|
1342
|
+
viewBox: vb,
|
1343
|
+
preserveAspectRatio: aspectRatio
|
1344
|
+
});
|
1345
|
+
while (size && top) {
|
1346
|
+
sw = "stroke-width" in top.attrs ? top.attrs["stroke-width"] : 1;
|
1347
|
+
top.attr({"stroke-width": sw});
|
1348
|
+
top._.dirty = 1;
|
1349
|
+
top._.dirtyT = 1;
|
1350
|
+
top = top.prev;
|
1351
|
+
}
|
1352
|
+
this._viewBox = [x, y, w, h, !!fit];
|
1353
|
+
return this;
|
1354
|
+
};
|
1355
|
+
/*\
|
1356
|
+
* Paper.renderfix
|
1357
|
+
[ method ]
|
1358
|
+
**
|
1359
|
+
* Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependant
|
1360
|
+
* on other elements after reflow it could shift half pixel which cause for lines to lost their crispness.
|
1361
|
+
* This method fixes the issue.
|
1362
|
+
**
|
1363
|
+
Special thanks to Mariusz Nowak (http://www.medikoo.com/) for this method.
|
1364
|
+
\*/
|
1365
|
+
R.prototype.renderfix = function () {
|
1366
|
+
var cnvs = this.canvas,
|
1367
|
+
s = cnvs.style,
|
1368
|
+
pos;
|
1369
|
+
try {
|
1370
|
+
pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix();
|
1371
|
+
} catch (e) {
|
1372
|
+
pos = cnvs.createSVGMatrix();
|
1373
|
+
}
|
1374
|
+
var left = -pos.e % 1,
|
1375
|
+
top = -pos.f % 1;
|
1376
|
+
if (left || top) {
|
1377
|
+
if (left) {
|
1378
|
+
this._left = (this._left + left) % 1;
|
1379
|
+
s.left = this._left + "px";
|
1380
|
+
}
|
1381
|
+
if (top) {
|
1382
|
+
this._top = (this._top + top) % 1;
|
1383
|
+
s.top = this._top + "px";
|
1384
|
+
}
|
1385
|
+
}
|
1386
|
+
};
|
1387
|
+
/*\
|
1388
|
+
* Paper.clear
|
1389
|
+
[ method ]
|
1390
|
+
**
|
1391
|
+
* Clears the paper, i.e. removes all the elements.
|
1392
|
+
\*/
|
1393
|
+
R.prototype.clear = function () {
|
1394
|
+
R.eve("raphael.clear", this);
|
1395
|
+
var c = this.canvas;
|
1396
|
+
while (c.firstChild) {
|
1397
|
+
c.removeChild(c.firstChild);
|
1398
|
+
}
|
1399
|
+
this.bottom = this.top = null;
|
1400
|
+
(this.desc = $("desc")).appendChild(R._g.doc.createTextNode("Created with Rapha\xebl " + R.version));
|
1401
|
+
c.appendChild(this.desc);
|
1402
|
+
c.appendChild(this.defs = $("defs"));
|
1403
|
+
};
|
1404
|
+
/*\
|
1405
|
+
* Paper.remove
|
1406
|
+
[ method ]
|
1407
|
+
**
|
1408
|
+
* Removes the paper from the DOM.
|
1409
|
+
\*/
|
1410
|
+
R.prototype.remove = function () {
|
1411
|
+
eve("raphael.remove", this);
|
1412
|
+
this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
|
1413
|
+
for (var i in this) {
|
1414
|
+
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
|
1415
|
+
}
|
1416
|
+
};
|
1417
|
+
var setproto = R.st;
|
1418
|
+
for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) {
|
1419
|
+
setproto[method] = (function (methodname) {
|
1420
|
+
return function () {
|
1421
|
+
var arg = arguments;
|
1422
|
+
return this.forEach(function (el) {
|
1423
|
+
el[methodname].apply(el, arg);
|
1424
|
+
});
|
1425
|
+
};
|
1426
|
+
})(method);
|
1427
|
+
}
|
1428
|
+
});
|