bedrock_sass 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -5
- data/assets/_vendor/ace/ace.js +21635 -0
- data/assets/_vendor/ace/ext-beautify.js +318 -0
- data/assets/_vendor/ace/ext-elastic_tabstops_lite.js +277 -0
- data/assets/_vendor/ace/ext-emmet.js +1226 -0
- data/assets/_vendor/ace/ext-error_marker.js +10 -0
- data/assets/_vendor/ace/ext-keybinding_menu.js +189 -0
- data/assets/_vendor/ace/ext-language_tools.js +1997 -0
- data/assets/_vendor/ace/ext-linking.js +65 -0
- data/assets/_vendor/ace/ext-modelist.js +228 -0
- data/assets/_vendor/ace/ext-options.js +750 -0
- data/assets/_vendor/ace/ext-rtl.js +110 -0
- data/assets/_vendor/ace/ext-searchbox.js +512 -0
- data/assets/_vendor/ace/ext-settings_menu.js +771 -0
- data/assets/_vendor/ace/ext-spellcheck.js +75 -0
- data/assets/_vendor/ace/ext-split.js +208 -0
- data/assets/_vendor/ace/ext-static_highlight.js +226 -0
- data/assets/_vendor/ace/ext-statusbar.js +57 -0
- data/assets/_vendor/ace/ext-textarea.js +567 -0
- data/assets/_vendor/ace/ext-themelist.js +67 -0
- data/assets/_vendor/ace/ext-whitespace.js +210 -0
- data/assets/_vendor/ace/keybinding-emacs.js +1165 -0
- data/assets/_vendor/ace/keybinding-vim.js +5673 -0
- data/assets/_vendor/ace/mode-abap.js +222 -0
- data/assets/_vendor/ace/mode-abc.js +267 -0
- data/assets/_vendor/ace/mode-actionscript.js +274 -0
- data/assets/_vendor/ace/mode-ada.js +138 -0
- data/assets/_vendor/ace/mode-apache_conf.js +363 -0
- data/assets/_vendor/ace/mode-applescript.js +279 -0
- data/assets/_vendor/ace/mode-asciidoc.js +349 -0
- data/assets/_vendor/ace/mode-asl.js +422 -0
- data/assets/_vendor/ace/mode-assembly_x86.js +193 -0
- data/assets/_vendor/ace/mode-autohotkey.js +243 -0
- data/assets/_vendor/ace/mode-batchfile.js +230 -0
- data/assets/_vendor/ace/mode-bro.js +334 -0
- data/assets/_vendor/ace/mode-c9search.js +294 -0
- data/assets/_vendor/ace/mode-c_cpp.js +502 -0
- data/assets/_vendor/ace/mode-cirru.js +211 -0
- data/assets/_vendor/ace/mode-clojure.js +314 -0
- data/assets/_vendor/ace/mode-cobol.js +102 -0
- data/assets/_vendor/ace/mode-coffee.js +400 -0
- data/assets/_vendor/ace/mode-coldfusion.js +2596 -0
- data/assets/_vendor/ace/mode-csharp.js +502 -0
- data/assets/_vendor/ace/mode-csound_document.js +3749 -0
- data/assets/_vendor/ace/mode-csound_orchestra.js +2687 -0
- data/assets/_vendor/ace/mode-csound_score.js +454 -0
- data/assets/_vendor/ace/mode-csp.js +60 -0
- data/assets/_vendor/ace/mode-css.js +723 -0
- data/assets/_vendor/ace/mode-curly.js +2564 -0
- data/assets/_vendor/ace/mode-d.js +520 -0
- data/assets/_vendor/ace/mode-dart.js +703 -0
- data/assets/_vendor/ace/mode-diff.js +146 -0
- data/assets/_vendor/ace/mode-django.js +2594 -0
- data/assets/_vendor/ace/mode-dockerfile.js +498 -0
- data/assets/_vendor/ace/mode-dot.js +418 -0
- data/assets/_vendor/ace/mode-drools.js +496 -0
- data/assets/_vendor/ace/mode-edifact.js +165 -0
- data/assets/_vendor/ace/mode-eiffel.js +136 -0
- data/assets/_vendor/ace/mode-ejs.js +3026 -0
- data/assets/_vendor/ace/mode-elixir.js +501 -0
- data/assets/_vendor/ace/mode-elm.js +307 -0
- data/assets/_vendor/ace/mode-erlang.js +1009 -0
- data/assets/_vendor/ace/mode-forth.js +297 -0
- data/assets/_vendor/ace/mode-fortran.js +431 -0
- data/assets/_vendor/ace/mode-fsharp.js +314 -0
- data/assets/_vendor/ace/mode-ftl.js +1192 -0
- data/assets/_vendor/ace/mode-gcode.js +94 -0
- data/assets/_vendor/ace/mode-gherkin.js +172 -0
- data/assets/_vendor/ace/mode-gitignore.js +60 -0
- data/assets/_vendor/ace/mode-glsl.js +579 -0
- data/assets/_vendor/ace/mode-gobstones.js +929 -0
- data/assets/_vendor/ace/mode-golang.js +414 -0
- data/assets/_vendor/ace/mode-graphqlschema.js +214 -0
- data/assets/_vendor/ace/mode-groovy.js +986 -0
- data/assets/_vendor/ace/mode-haml.js +1555 -0
- data/assets/_vendor/ace/mode-handlebars.js +2622 -0
- data/assets/_vendor/ace/mode-haskell.js +379 -0
- data/assets/_vendor/ace/mode-haskell_cabal.js +142 -0
- data/assets/_vendor/ace/mode-haxe.js +386 -0
- data/assets/_vendor/ace/mode-hjson.js +353 -0
- data/assets/_vendor/ace/mode-html.js +2509 -0
- data/assets/_vendor/ace/mode-html_elixir.js +3087 -0
- data/assets/_vendor/ace/mode-html_ruby.js +3043 -0
- data/assets/_vendor/ace/mode-ini.js +163 -0
- data/assets/_vendor/ace/mode-io.js +253 -0
- data/assets/_vendor/ace/mode-jack.js +347 -0
- data/assets/_vendor/ace/mode-jade.js +2126 -0
- data/assets/_vendor/ace/mode-java.js +975 -0
- data/assets/_vendor/ace/mode-javascript.js +797 -0
- data/assets/_vendor/ace/mode-json.js +327 -0
- data/assets/_vendor/ace/mode-jsoniq.js +4940 -0
- data/assets/_vendor/ace/mode-jsp.js +1430 -0
- data/assets/_vendor/ace/mode-jssm.js +325 -0
- data/assets/_vendor/ace/mode-jsx.js +412 -0
- data/assets/_vendor/ace/mode-julia.js +303 -0
- data/assets/_vendor/ace/mode-kotlin.js +795 -0
- data/assets/_vendor/ace/mode-latex.js +297 -0
- data/assets/_vendor/ace/mode-less.js +841 -0
- data/assets/_vendor/ace/mode-liquid.js +1193 -0
- data/assets/_vendor/ace/mode-lisp.js +112 -0
- data/assets/_vendor/ace/mode-livescript.js +280 -0
- data/assets/_vendor/ace/mode-logiql.js +317 -0
- data/assets/_vendor/ace/mode-lsl.js +343 -0
- data/assets/_vendor/ace/mode-lua.js +432 -0
- data/assets/_vendor/ace/mode-luapage.js +3007 -0
- data/assets/_vendor/ace/mode-lucene.js +87 -0
- data/assets/_vendor/ace/mode-makefile.js +410 -0
- data/assets/_vendor/ace/mode-markdown.js +3189 -0
- data/assets/_vendor/ace/mode-mask.js +1802 -0
- data/assets/_vendor/ace/mode-matlab.js +264 -0
- data/assets/_vendor/ace/mode-maze.js +291 -0
- data/assets/_vendor/ace/mode-mel.js +263 -0
- data/assets/_vendor/ace/mode-mixal.js +123 -0
- data/assets/_vendor/ace/mode-mushcode.js +681 -0
- data/assets/_vendor/ace/mode-mysql.js +168 -0
- data/assets/_vendor/ace/mode-nix.js +646 -0
- data/assets/_vendor/ace/mode-nsis.js +312 -0
- data/assets/_vendor/ace/mode-objectivec.js +739 -0
- data/assets/_vendor/ace/mode-ocaml.js +422 -0
- data/assets/_vendor/ace/mode-pascal.js +205 -0
- data/assets/_vendor/ace/mode-perl.js +380 -0
- data/assets/_vendor/ace/mode-pgsql.js +1508 -0
- data/assets/_vendor/ace/mode-php.js +13088 -0
- data/assets/_vendor/ace/mode-php_laravel_blade.js +13289 -0
- data/assets/_vendor/ace/mode-pig.js +310 -0
- data/assets/_vendor/ace/mode-plain_text.js +33 -0
- data/assets/_vendor/ace/mode-powershell.js +418 -0
- data/assets/_vendor/ace/mode-praat.js +478 -0
- data/assets/_vendor/ace/mode-prolog.js +371 -0
- data/assets/_vendor/ace/mode-properties.js +81 -0
- data/assets/_vendor/ace/mode-protobuf.js +592 -0
- data/assets/_vendor/ace/mode-puppet.js +370 -0
- data/assets/_vendor/ace/mode-python.js +273 -0
- data/assets/_vendor/ace/mode-r.js +310 -0
- data/assets/_vendor/ace/mode-razor.js +2869 -0
- data/assets/_vendor/ace/mode-rdoc.js +243 -0
- data/assets/_vendor/ace/mode-red.js +450 -0
- data/assets/_vendor/ace/mode-redshift.js +361 -0
- data/assets/_vendor/ace/mode-rhtml.js +2806 -0
- data/assets/_vendor/ace/mode-rst.js +257 -0
- data/assets/_vendor/ace/mode-ruby.js +497 -0
- data/assets/_vendor/ace/mode-rust.js +279 -0
- data/assets/_vendor/ace/mode-sass.js +441 -0
- data/assets/_vendor/ace/mode-scad.js +414 -0
- data/assets/_vendor/ace/mode-scala.js +982 -0
- data/assets/_vendor/ace/mode-scheme.js +232 -0
- data/assets/_vendor/ace/mode-scss.js +606 -0
- data/assets/_vendor/ace/mode-sh.js +447 -0
- data/assets/_vendor/ace/mode-sjs.js +1014 -0
- data/assets/_vendor/ace/mode-slim.js +4736 -0
- data/assets/_vendor/ace/mode-smarty.js +2635 -0
- data/assets/_vendor/ace/mode-snippets.js +207 -0
- data/assets/_vendor/ace/mode-soy_template.js +2847 -0
- data/assets/_vendor/ace/mode-space.js +168 -0
- data/assets/_vendor/ace/mode-sparql.js +320 -0
- data/assets/_vendor/ace/mode-sql.js +111 -0
- data/assets/_vendor/ace/mode-sqlserver.js +444 -0
- data/assets/_vendor/ace/mode-stylus.js +471 -0
- data/assets/_vendor/ace/mode-svg.js +1581 -0
- data/assets/_vendor/ace/mode-swift.js +390 -0
- data/assets/_vendor/ace/mode-tcl.js +383 -0
- data/assets/_vendor/ace/mode-terraform.js +398 -0
- data/assets/_vendor/ace/mode-tex.js +159 -0
- data/assets/_vendor/ace/mode-text.js +10 -0
- data/assets/_vendor/ace/mode-textile.js +150 -0
- data/assets/_vendor/ace/mode-toml.js +154 -0
- data/assets/_vendor/ace/mode-tsx.js +887 -0
- data/assets/_vendor/ace/mode-turtle.js +296 -0
- data/assets/_vendor/ace/mode-twig.js +2693 -0
- data/assets/_vendor/ace/mode-typescript.js +868 -0
- data/assets/_vendor/ace/mode-vala.js +676 -0
- data/assets/_vendor/ace/mode-vbscript.js +207 -0
- data/assets/_vendor/ace/mode-velocity.js +2790 -0
- data/assets/_vendor/ace/mode-verilog.js +119 -0
- data/assets/_vendor/ace/mode-vhdl.js +118 -0
- data/assets/_vendor/ace/mode-wollok.js +911 -0
- data/assets/_vendor/ace/mode-xml.js +677 -0
- data/assets/_vendor/ace/mode-xquery.js +4922 -0
- data/assets/_vendor/ace/mode-yaml.js +300 -0
- data/assets/_vendor/ace/snippets/abap.js +15 -0
- data/assets/_vendor/ace/snippets/abc.js +46 -0
- data/assets/_vendor/ace/snippets/actionscript.js +172 -0
- data/assets/_vendor/ace/snippets/ada.js +15 -0
- data/assets/_vendor/ace/snippets/apache_conf.js +15 -0
- data/assets/_vendor/ace/snippets/applescript.js +15 -0
- data/assets/_vendor/ace/snippets/asciidoc.js +15 -0
- data/assets/_vendor/ace/snippets/asl.js +14 -0
- data/assets/_vendor/ace/snippets/assembly_x86.js +15 -0
- data/assets/_vendor/ace/snippets/autohotkey.js +15 -0
- data/assets/_vendor/ace/snippets/batchfile.js +15 -0
- data/assets/_vendor/ace/snippets/bro.js +15 -0
- data/assets/_vendor/ace/snippets/c9search.js +15 -0
- data/assets/_vendor/ace/snippets/c_cpp.js +146 -0
- data/assets/_vendor/ace/snippets/cirru.js +15 -0
- data/assets/_vendor/ace/snippets/clojure.js +105 -0
- data/assets/_vendor/ace/snippets/cobol.js +15 -0
- data/assets/_vendor/ace/snippets/coffee.js +110 -0
- data/assets/_vendor/ace/snippets/coldfusion.js +15 -0
- data/assets/_vendor/ace/snippets/csharp.js +15 -0
- data/assets/_vendor/ace/snippets/csound_document.js +25 -0
- data/assets/_vendor/ace/snippets/csound_orchestra.js +62 -0
- data/assets/_vendor/ace/snippets/csound_score.js +15 -0
- data/assets/_vendor/ace/snippets/csp.js +15 -0
- data/assets/_vendor/ace/snippets/css.js +982 -0
- data/assets/_vendor/ace/snippets/curly.js +15 -0
- data/assets/_vendor/ace/snippets/d.js +15 -0
- data/assets/_vendor/ace/snippets/dart.js +98 -0
- data/assets/_vendor/ace/snippets/diff.js +26 -0
- data/assets/_vendor/ace/snippets/django.js +123 -0
- data/assets/_vendor/ace/snippets/dockerfile.js +15 -0
- data/assets/_vendor/ace/snippets/dot.js +15 -0
- data/assets/_vendor/ace/snippets/drools.js +34 -0
- data/assets/_vendor/ace/snippets/edifact.js +255 -0
- data/assets/_vendor/ace/snippets/eiffel.js +15 -0
- data/assets/_vendor/ace/snippets/ejs.js +15 -0
- data/assets/_vendor/ace/snippets/elixir.js +15 -0
- data/assets/_vendor/ace/snippets/elm.js +15 -0
- data/assets/_vendor/ace/snippets/erlang.js +175 -0
- data/assets/_vendor/ace/snippets/forth.js +15 -0
- data/assets/_vendor/ace/snippets/fortran.js +15 -0
- data/assets/_vendor/ace/snippets/fsharp.js +15 -0
- data/assets/_vendor/ace/snippets/ftl.js +15 -0
- data/assets/_vendor/ace/snippets/gcode.js +15 -0
- data/assets/_vendor/ace/snippets/gherkin.js +15 -0
- data/assets/_vendor/ace/snippets/gitignore.js +15 -0
- data/assets/_vendor/ace/snippets/glsl.js +15 -0
- data/assets/_vendor/ace/snippets/gobstones.js +49 -0
- data/assets/_vendor/ace/snippets/golang.js +15 -0
- data/assets/_vendor/ace/snippets/graphqlschema.js +47 -0
- data/assets/_vendor/ace/snippets/groovy.js +15 -0
- data/assets/_vendor/ace/snippets/haml.js +35 -0
- data/assets/_vendor/ace/snippets/handlebars.js +15 -0
- data/assets/_vendor/ace/snippets/haskell.js +97 -0
- data/assets/_vendor/ace/snippets/haskell_cabal.js +15 -0
- data/assets/_vendor/ace/snippets/haxe.js +15 -0
- data/assets/_vendor/ace/snippets/hjson.js +15 -0
- data/assets/_vendor/ace/snippets/html.js +870 -0
- data/assets/_vendor/ace/snippets/html_elixir.js +15 -0
- data/assets/_vendor/ace/snippets/html_ruby.js +15 -0
- data/assets/_vendor/ace/snippets/ini.js +15 -0
- data/assets/_vendor/ace/snippets/io.js +77 -0
- data/assets/_vendor/ace/snippets/jack.js +15 -0
- data/assets/_vendor/ace/snippets/jade.js +15 -0
- data/assets/_vendor/ace/snippets/java.js +255 -0
- data/assets/_vendor/ace/snippets/javascript.js +210 -0
- data/assets/_vendor/ace/snippets/json.js +15 -0
- data/assets/_vendor/ace/snippets/jsoniq.js +76 -0
- data/assets/_vendor/ace/snippets/jsp.js +114 -0
- data/assets/_vendor/ace/snippets/jssm.js +15 -0
- data/assets/_vendor/ace/snippets/jsx.js +15 -0
- data/assets/_vendor/ace/snippets/julia.js +15 -0
- data/assets/_vendor/ace/snippets/kotlin.js +15 -0
- data/assets/_vendor/ace/snippets/latex.js +15 -0
- data/assets/_vendor/ace/snippets/less.js +15 -0
- data/assets/_vendor/ace/snippets/liquid.js +15 -0
- data/assets/_vendor/ace/snippets/lisp.js +15 -0
- data/assets/_vendor/ace/snippets/livescript.js +15 -0
- data/assets/_vendor/ace/snippets/logiql.js +15 -0
- data/assets/_vendor/ace/snippets/lsl.js +1247 -0
- data/assets/_vendor/ace/snippets/lua.js +36 -0
- data/assets/_vendor/ace/snippets/luapage.js +15 -0
- data/assets/_vendor/ace/snippets/lucene.js +15 -0
- data/assets/_vendor/ace/snippets/makefile.js +19 -0
- data/assets/_vendor/ace/snippets/markdown.js +103 -0
- data/assets/_vendor/ace/snippets/mask.js +15 -0
- data/assets/_vendor/ace/snippets/matlab.js +15 -0
- data/assets/_vendor/ace/snippets/maze.js +24 -0
- data/assets/_vendor/ace/snippets/mel.js +15 -0
- data/assets/_vendor/ace/snippets/mixal.js +15 -0
- data/assets/_vendor/ace/snippets/mushcode.js +15 -0
- data/assets/_vendor/ace/snippets/mysql.js +15 -0
- data/assets/_vendor/ace/snippets/nix.js +15 -0
- data/assets/_vendor/ace/snippets/nsis.js +15 -0
- data/assets/_vendor/ace/snippets/objectivec.js +15 -0
- data/assets/_vendor/ace/snippets/ocaml.js +15 -0
- data/assets/_vendor/ace/snippets/pascal.js +15 -0
- data/assets/_vendor/ace/snippets/perl.js +362 -0
- data/assets/_vendor/ace/snippets/pgsql.js +15 -0
- data/assets/_vendor/ace/snippets/php.js +398 -0
- data/assets/_vendor/ace/snippets/php_laravel_blade.js +15 -0
- data/assets/_vendor/ace/snippets/pig.js +15 -0
- data/assets/_vendor/ace/snippets/plain_text.js +15 -0
- data/assets/_vendor/ace/snippets/powershell.js +15 -0
- data/assets/_vendor/ace/snippets/praat.js +15 -0
- data/assets/_vendor/ace/snippets/prolog.js +15 -0
- data/assets/_vendor/ace/snippets/properties.js +15 -0
- data/assets/_vendor/ace/snippets/protobuf.js +15 -0
- data/assets/_vendor/ace/snippets/puppet.js +15 -0
- data/assets/_vendor/ace/snippets/python.js +173 -0
- data/assets/_vendor/ace/snippets/r.js +136 -0
- data/assets/_vendor/ace/snippets/razor.js +18 -0
- data/assets/_vendor/ace/snippets/rdoc.js +15 -0
- data/assets/_vendor/ace/snippets/red.js +15 -0
- data/assets/_vendor/ace/snippets/redshift.js +15 -0
- data/assets/_vendor/ace/snippets/rhtml.js +15 -0
- data/assets/_vendor/ace/snippets/rst.js +37 -0
- data/assets/_vendor/ace/snippets/ruby.js +943 -0
- data/assets/_vendor/ace/snippets/rust.js +15 -0
- data/assets/_vendor/ace/snippets/sass.js +15 -0
- data/assets/_vendor/ace/snippets/scad.js +15 -0
- data/assets/_vendor/ace/snippets/scala.js +15 -0
- data/assets/_vendor/ace/snippets/scheme.js +15 -0
- data/assets/_vendor/ace/snippets/scss.js +15 -0
- data/assets/_vendor/ace/snippets/sh.js +98 -0
- data/assets/_vendor/ace/snippets/sjs.js +15 -0
- data/assets/_vendor/ace/snippets/slim.js +15 -0
- data/assets/_vendor/ace/snippets/smarty.js +15 -0
- data/assets/_vendor/ace/snippets/snippets.js +24 -0
- data/assets/_vendor/ace/snippets/soy_template.js +15 -0
- data/assets/_vendor/ace/snippets/space.js +15 -0
- data/assets/_vendor/ace/snippets/sparql.js +15 -0
- data/assets/_vendor/ace/snippets/sql.js +41 -0
- data/assets/_vendor/ace/snippets/sqlserver.js +84 -0
- data/assets/_vendor/ace/snippets/stylus.js +15 -0
- data/assets/_vendor/ace/snippets/svg.js +15 -0
- data/assets/_vendor/ace/snippets/swift.js +15 -0
- data/assets/_vendor/ace/snippets/tcl.js +107 -0
- data/assets/_vendor/ace/snippets/terraform.js +15 -0
- data/assets/_vendor/ace/snippets/tex.js +205 -0
- data/assets/_vendor/ace/snippets/text.js +15 -0
- data/assets/_vendor/ace/snippets/textile.js +45 -0
- data/assets/_vendor/ace/snippets/toml.js +15 -0
- data/assets/_vendor/ace/snippets/tsx.js +15 -0
- data/assets/_vendor/ace/snippets/turtle.js +15 -0
- data/assets/_vendor/ace/snippets/twig.js +15 -0
- data/assets/_vendor/ace/snippets/typescript.js +15 -0
- data/assets/_vendor/ace/snippets/vala.js +201 -0
- data/assets/_vendor/ace/snippets/vbscript.js +15 -0
- data/assets/_vendor/ace/snippets/velocity.js +44 -0
- data/assets/_vendor/ace/snippets/verilog.js +15 -0
- data/assets/_vendor/ace/snippets/vhdl.js +15 -0
- data/assets/_vendor/ace/snippets/wollok.js +99 -0
- data/assets/_vendor/ace/snippets/xml.js +15 -0
- data/assets/_vendor/ace/snippets/xquery.js +76 -0
- data/assets/_vendor/ace/snippets/yaml.js +15 -0
- data/assets/_vendor/ace/theme-ambiance.js +185 -0
- data/assets/_vendor/ace/theme-chaos.js +164 -0
- data/assets/_vendor/ace/theme-chrome.js +136 -0
- data/assets/_vendor/ace/theme-clouds.js +103 -0
- data/assets/_vendor/ace/theme-clouds_midnight.js +104 -0
- data/assets/_vendor/ace/theme-cobalt.js +121 -0
- data/assets/_vendor/ace/theme-crimson_editor.js +126 -0
- data/assets/_vendor/ace/theme-dawn.js +116 -0
- data/assets/_vendor/ace/theme-dracula.js +136 -0
- data/assets/_vendor/ace/theme-dreamweaver.js +149 -0
- data/assets/_vendor/ace/theme-eclipse.js +106 -0
- data/assets/_vendor/ace/theme-github.js +110 -0
- data/assets/_vendor/ace/theme-gob.js +120 -0
- data/assets/_vendor/ace/theme-gruvbox.js +90 -0
- data/assets/_vendor/ace/theme-idle_fingers.js +104 -0
- data/assets/_vendor/ace/theme-iplastic.js +129 -0
- data/assets/_vendor/ace/theme-katzenmilch.js +129 -0
- data/assets/_vendor/ace/theme-kr_theme.js +112 -0
- data/assets/_vendor/ace/theme-kuroir.js +69 -0
- data/assets/_vendor/ace/theme-merbivore.js +103 -0
- data/assets/_vendor/ace/theme-merbivore_soft.js +104 -0
- data/assets/_vendor/ace/theme-mono_industrial.js +115 -0
- data/assets/_vendor/ace/theme-monokai.js +113 -0
- data/assets/_vendor/ace/theme-pastel_on_dark.js +116 -0
- data/assets/_vendor/ace/theme-solarized_dark.js +96 -0
- data/assets/_vendor/ace/theme-solarized_light.js +99 -0
- data/assets/_vendor/ace/theme-sqlserver.js +146 -0
- data/assets/_vendor/ace/theme-terminal.js +122 -0
- data/assets/_vendor/ace/theme-textmate.js +138 -0
- data/assets/_vendor/ace/theme-tomorrow.js +116 -0
- data/assets/_vendor/ace/theme-tomorrow_night.js +116 -0
- data/assets/_vendor/ace/theme-tomorrow_night_blue.js +114 -0
- data/assets/_vendor/ace/theme-tomorrow_night_bright.js +129 -0
- data/assets/_vendor/ace/theme-tomorrow_night_eighties.js +116 -0
- data/assets/_vendor/ace/theme-twilight.js +117 -0
- data/assets/_vendor/ace/theme-vibrant_ink.js +102 -0
- data/assets/_vendor/ace/theme-xcode.js +96 -0
- data/assets/_vendor/ace/worker-coffee.js +2165 -0
- data/assets/_vendor/ace/worker-css.js +8764 -0
- data/assets/_vendor/ace/worker-html.js +11614 -0
- data/assets/_vendor/ace/worker-javascript.js +12491 -0
- data/assets/_vendor/ace/worker-json.js +2396 -0
- data/assets/_vendor/ace/worker-lua.js +3637 -0
- data/assets/_vendor/ace/worker-php.js +4313 -0
- data/assets/_vendor/ace/worker-xml.js +3899 -0
- data/assets/_vendor/ace/worker-xquery.js +70688 -0
- data/assets/_vendor/motion-ui/_settings.scss +1 -0
- data/assets/_vendor/motion-ui/effects/_fade.scss +1 -4
- data/assets/_vendor/motion-ui/effects/_hinge.scss +4 -3
- data/assets/_vendor/motion-ui/effects/_shake.scss +1 -1
- data/assets/_vendor/motion-ui/effects/_slide.scss +4 -3
- data/assets/_vendor/motion-ui/effects/_spin.scss +4 -3
- data/assets/_vendor/motion-ui/effects/_wiggle.scss +1 -1
- data/assets/_vendor/motion-ui/effects/_zoom.scss +2 -2
- data/assets/_vendor/motion-ui/motion-ui.scss +2 -0
- data/assets/_vendor/motion-ui/transitions/_fade.scss +6 -4
- data/assets/_vendor/motion-ui/transitions/_hinge.scss +3 -2
- data/assets/_vendor/motion-ui/transitions/_slide.scss +3 -2
- data/assets/_vendor/motion-ui/transitions/_spin.scss +2 -1
- data/assets/_vendor/motion-ui/transitions/_zoom.scss +6 -4
- data/assets/_vendor/motion-ui/util/_animation.scss +1 -1
- data/assets/_vendor/motion-ui/util/_args.scss +2 -2
- data/assets/_vendor/motion-ui/util/_function.scss +94 -0
- data/assets/_vendor/motion-ui/util/_keyframe.scss +5 -5
- data/assets/_vendor/motion-ui/util/_series.scss +20 -17
- data/assets/_vendor/motion-ui/util/_string.scss +36 -0
- data/assets/_vendor/tinymce/plugins/advlist/plugin.js +136 -404
- data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/anchor/plugin.js +103 -323
- data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/autolink/plugin.js +153 -377
- data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +145 -427
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/autosave/plugin.js +197 -579
- data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +88 -251
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/charmap/plugin.js +1243 -818
- data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/code/plugin.js +82 -326
- data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/codesample/plugin.js +829 -1444
- data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +111 -257
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +141 -469
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/directionality/plugin.js +57 -261
- data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +78 -247
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +463 -906
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +149 -427
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/help/plugin.js +634 -1434
- data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/hr/plugin.js +29 -185
- data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/image/plugin.js +1147 -1508
- data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +3319 -4079
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +1 -2
- data/assets/_vendor/tinymce/plugins/importcss/plugin.js +230 -543
- data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +151 -460
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +204 -379
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/link/plugin.js +644 -1162
- data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/lists/plugin.js +1005 -1875
- data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/media/plugin.js +1066 -1926
- data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +70 -298
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +96 -294
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +92 -337
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/paste/plugin.js +1363 -2801
- data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/preview/plugin.js +106 -393
- data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/print/plugin.js +29 -185
- data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/save/plugin.js +100 -350
- data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +491 -865
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +630 -1292
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +96 -391
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/table/plugin.js +9537 -14920
- data/assets/_vendor/tinymce/plugins/table/plugin.min.js +1 -5
- data/assets/_vendor/tinymce/plugins/template/plugin.js +309 -771
- data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +319 -592
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +326 -674
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/toc/plugin.js +199 -530
- data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +112 -436
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +428 -1248
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +307 -699
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -1
- data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -1
- data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -1
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +1 -1
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -1
- data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +1 -1
- data/assets/_vendor/tinymce/themes/inlite/theme.js +9693 -18245
- data/assets/_vendor/tinymce/themes/inlite/theme.min.js +1 -5
- data/assets/_vendor/tinymce/themes/mobile/theme.js +12629 -22467
- data/assets/_vendor/tinymce/themes/mobile/theme.min.js +1 -8
- data/assets/_vendor/tinymce/themes/modern/theme.js +9510 -17780
- data/assets/_vendor/tinymce/themes/modern/theme.min.js +1 -5
- data/assets/_vendor/tinymce/tinymce.js +25087 -42606
- data/assets/_vendor/yoastseo/css/_icons.scss +7 -7
- data/assets/_vendor/yoastseo/css/_snippet-editor.scss +1 -1
- data/assets/bedrock/js/bedrock.js +1 -71697
- data/assets/bedrock/scss/_bedrock-components.scss +20 -0
- data/assets/bedrock/scss/_bedrock-settings.scss +12 -4
- data/assets/bedrock/scss/_foundation-settings.scss +4 -2
- data/assets/bedrock/scss/components/ace-editor.scss +21 -0
- data/assets/bedrock/scss/components/attachments-grid.scss +18 -15
- data/assets/bedrock/scss/components/date-picker.scss +146 -0
- data/assets/bedrock/scss/components/dropzone-upload.scss +7 -0
- data/assets/bedrock/scss/components/file-input.scss +7 -0
- data/assets/bedrock/scss/components/file-preview.scss +36 -0
- data/assets/bedrock/scss/components/frame-embed.scss +23 -0
- data/assets/bedrock/scss/components/global.scss +27 -0
- data/assets/bedrock/scss/components/helper-classes.scss +1 -0
- data/assets/bedrock/scss/components/icon-box.scss +38 -0
- data/assets/bedrock/scss/components/item-list.scss +66 -0
- data/assets/bedrock/scss/components/lists.scss +58 -0
- data/assets/bedrock/scss/components/off-canvas-menu.scss +27 -15
- data/assets/bedrock/scss/components/place-autocomplete.scss +90 -0
- data/assets/bedrock/scss/components/rrule-generator.scss +102 -0
- data/assets/bedrock/scss/components/rrule-reveal.scss +14 -0
- data/assets/bedrock/scss/components/select-box.scss +1 -0
- data/assets/bedrock/scss/components/seo-analysis.scss +5 -0
- data/assets/bedrock/scss/components/textarea.scss +14 -2
- data/assets/bedrock/scss/components/tiny-mce-editor.scss +5 -16
- data/lib/bedrock_sass.rb +5 -0
- data/lib/bedrock_sass/version.rb +1 -1
- data/lib/tasks/before_assets_precompile.rake +1 -0
- metadata +395 -4
- data/CODE_OF_CONDUCT.md +0 -74
@@ -1 +1 @@
|
|
1
|
-
!function(){
|
1
|
+
!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");function h(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var u={findAndReplaceDOMText:function(t,n,r,a,i){var o,d,v,f,p,g,c=[],l=0;function s(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(v=n.ownerDocument,f=i.getBlockElements(),p=i.getWhiteSpaceElements(),g=i.getShortEndedElements(),d=function e(t){var n;if(3===t.nodeType)return t.data;if(p[t.nodeName]&&!f[t.nodeName])return"";if(n="",h(t))return"\n";if((f[t.nodeName]||g[t.nodeName])&&(n+="\n"),t=t.firstChild)for(;n+=e(t),t=t.nextSibling;);return n}(n)){if(t.global)for(;o=t.exec(d);)c.push(s(o,a));else o=d.match(t),c.push(s(o,a));return c.length&&(l=c.length,function(e,t,n){var r,a,i,o,d=[],c=0,l=e,s=t.shift(),u=0;e:for(;;){if((f[l.nodeName]||g[l.nodeName]||h(l))&&c++,3===l.nodeType&&(!a&&l.length+c>=s[1]?(a=l,o=s[1]-c):r&&d.push(l),!r&&l.length+c>s[0]&&(r=l,i=s[0]-c),c+=l.length),r&&a){if(l=n({startNode:r,startNodeIndex:i,endNode:a,endNodeIndex:o,innerNodes:d,match:s[2],matchIndex:u}),c-=a.length-o,a=r=null,d=[],u++,!(s=t.shift()))break}else if(p[l.nodeName]&&!f[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!h(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(n,c,function(e){var m;if("function"!=typeof e){var r=e.nodeType?e:v.createElement(e);m=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(v.createTextNode(e)),n}}else m=e;return function(e){var t,n,r,a=e.startNode,i=e.endNode,o=e.matchIndex;if(a===i){var d=a;r=d.parentNode,0<e.startNodeIndex&&(t=v.createTextNode(d.data.substring(0,e.startNodeIndex)),r.insertBefore(t,d));var c=m(e.match[0],o);return r.insertBefore(c,d),e.endNodeIndex<d.length&&(n=v.createTextNode(d.data.substring(e.endNodeIndex)),r.insertBefore(n,d)),d.parentNode.removeChild(d),c}t=v.createTextNode(a.data.substring(0,e.startNodeIndex)),n=v.createTextNode(i.data.substring(e.endNodeIndex));for(var l=m(a.data.substring(e.startNodeIndex),o),s=[],u=0,f=e.innerNodes.length;u<f;++u){var p=e.innerNodes[u],g=m(p.data,o);p.parentNode.replaceChild(g,p),s.push(g)}var h=m(i.data.substring(0,e.endNodeIndex),o);return(r=a.parentNode).insertBefore(t,a),r.insertBefore(l,a),r.removeChild(a),(r=i.parentNode).insertBefore(h,i),r.insertBefore(n,i),r.removeChild(i),h}}(r))),l}}},g=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},m=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},o=function(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var a=0;a<n.length;a++){var i=g(n[a]);null!==i&&i.length&&i===t.toString()&&r.push(n[a])}return r},f=function(e,t,n){var r=t.get(),a=e.dom;(n=!1!==n)?r++:r--,a.removeClass(o(e,t.get()),"mce-match-marker-selected");var i=o(e,r);return i.length?(a.addClass(o(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(i[0]),r):-1},v=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},x=function(e,t){var n=f(e,t,!0);-1!==n&&t.set(n)},b=function(e,t){var n=f(e,t,!1);-1!==n&&t.set(n)},N=function(e){var t=g(e);return null!==t&&0<t.length},y=function(e,t,n){var r,a,i,o;for(a=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<a.length;r++){var d=g(a[r]);null!==d&&d.length&&(d===t.get().toString()&&(i||(i=a[r].firstChild),o=a[r].firstChild),m(a[r]))}if(i&&o){var c=e.dom.createRng();return c.setStart(i,0),c.setEnd(o,o.data.length),!1!==n&&e.selection.setRng(c),c}},k=function(e,t){return 0<o(e,t.get()+1).length},C=function(e,t){return 0<o(e,t.get()-1).length},T={done:y,find:function(e,t,n,r,a){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"\\s"),n=a?"\\b"+n+"\\b":n;var i,o,d,c,l,s=(i=e,o=t,d=new RegExp(n,r?"g":"gi"),(l=i.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",c=i.getBody(),y(i,o,!1),u.findAndReplaceDOMText(d,c,l,!1,i.schema));return s&&(t.set(-1),t.set(f(e,t,!0))),s},next:x,prev:b,replace:function(e,t,n,r,a){var i,o,d,c,l,s,u=t.get();for(r=!1!==r,d=e.getBody(),o=p.grep(p.toArray(d.getElementsByTagName("span")),N),i=0;i<o.length;i++){var f=g(o[i]);if(c=l=parseInt(f,10),a||c===t.get()){for(n.length?(o[i].firstChild.nodeValue=n,m(o[i])):v(e.dom,o[i]);o[++i];){if((c=parseInt(g(o[i]),10))!==l){i--;break}v(e.dom,o[i])}r&&u--}else l>t.get()&&o[i].setAttribute("data-mce-index",l-1)}return t.set(u),r?(s=k(e,t),x(e,t)):(s=C(e,t),b(e,t)),!a&&s},hasNext:k,hasPrev:C},n=function(r,a){return{done:function(e){return T.done(r,a,e)},find:function(e,t,n){return T.find(r,a,e,t,n)},next:function(){return T.next(r,a)},prev:function(){return T.prev(r,a)},replace:function(e,t,n){return T.replace(r,a,e,t,n)}}},a=function(i,o){var e,d={};function c(){s.statusbar.find("#next").disabled(!1===T.hasNext(i,o)),s.statusbar.find("#prev").disabled(!1===T.hasPrev(i,o))}function l(){i.windowManager.alert("Could not find the specified string.",function(){s.find("#find")[0].focus()})}i.undoManager.add(),e=p.trim(i.selection.getContent({format:"text"}));var s=i.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){i.focus(),T.done(i,o),i.undoManager.add()},onSubmit:function(e){var t,n,r,a;return e.preventDefault(),n=s.find("#case").checked(),a=s.find("#words").checked(),(r=s.find("#find").value()).length?d.text===r&&d.caseState===n&&d.wholeWord===a?T.hasNext(i,o)?(T.next(i,o),void c()):void l():((t=T.find(i,o,r,n,a))||l(),s.statusbar.items().slice(1).disabled(0===t),c(),void(d={text:r,caseState:n,wholeWord:a})):(T.done(i,o,!1),void s.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){s.submit()}},{text:"Replace",disabled:!0,onclick:function(){T.replace(i,o,s.find("#replace").value())||(s.statusbar.items().slice(1).disabled(!0),o.set(-1),d={})}},{text:"Replace all",disabled:!0,onclick:function(){T.replace(i,o,s.find("#replace").value(),!0,!0),s.statusbar.items().slice(1).disabled(!0),d={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){T.prev(i,o),c()}},{text:"Next",name:"next",disabled:!0,onclick:function(){T.next(i,o),c()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:e},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})},i=function(e,t){e.addCommand("SearchReplace",function(){a(e,t)})},d=function(e,t){return function(){a(e,t)}},c=function(e,t){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:d(e,t),separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",onclick:d(e,t)}),e.shortcuts.add("Meta+F","",d(e,t))};e.add("searchreplace",function(e){var t=r(-1);return i(e,t),c(e,t),n(e,t)})}();
|
@@ -1,432 +1,150 @@
|
|
1
1
|
(function () {
|
2
|
+
var spellchecker = (function () {
|
3
|
+
'use strict';
|
2
4
|
|
3
|
-
var
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
var register_3795 = function (id) {
|
8
|
-
var module = dem(id);
|
9
|
-
var fragments = id.split('.');
|
10
|
-
var target = Function('return this;')();
|
11
|
-
for (var i = 0; i < fragments.length - 1; ++i) {
|
12
|
-
if (target[fragments[i]] === undefined)
|
13
|
-
target[fragments[i]] = {};
|
14
|
-
target = target[fragments[i]];
|
15
|
-
}
|
16
|
-
target[fragments[fragments.length - 1]] = module;
|
17
|
-
};
|
18
|
-
|
19
|
-
var instantiate = function (id) {
|
20
|
-
var actual = defs[id];
|
21
|
-
var dependencies = actual.deps;
|
22
|
-
var definition = actual.defn;
|
23
|
-
var len = dependencies.length;
|
24
|
-
var instances = new Array(len);
|
25
|
-
for (var i = 0; i < len; ++i)
|
26
|
-
instances[i] = dem(dependencies[i]);
|
27
|
-
var defResult = definition.apply(null, instances);
|
28
|
-
if (defResult === undefined)
|
29
|
-
throw 'module [' + id + '] returned undefined';
|
30
|
-
actual.instance = defResult;
|
31
|
-
};
|
32
|
-
|
33
|
-
var def = function (id, dependencies, definition) {
|
34
|
-
if (typeof id !== 'string')
|
35
|
-
throw 'module id must be a string';
|
36
|
-
else if (dependencies === undefined)
|
37
|
-
throw 'no dependencies for ' + id;
|
38
|
-
else if (definition === undefined)
|
39
|
-
throw 'no definition function for ' + id;
|
40
|
-
defs[id] = {
|
41
|
-
deps: dependencies,
|
42
|
-
defn: definition,
|
43
|
-
instance: undefined
|
44
|
-
};
|
45
|
-
};
|
46
|
-
|
47
|
-
var dem = function (id) {
|
48
|
-
var actual = defs[id];
|
49
|
-
if (actual === undefined)
|
50
|
-
throw 'module [' + id + '] was undefined';
|
51
|
-
else if (actual.instance === undefined)
|
52
|
-
instantiate(id);
|
53
|
-
return actual.instance;
|
54
|
-
};
|
55
|
-
|
56
|
-
var req = function (ids, callback) {
|
57
|
-
var len = ids.length;
|
58
|
-
var instances = new Array(len);
|
59
|
-
for (var i = 0; i < len; ++i)
|
60
|
-
instances[i] = dem(ids[i]);
|
61
|
-
callback.apply(null, instances);
|
62
|
-
};
|
63
|
-
|
64
|
-
var ephox = {};
|
65
|
-
|
66
|
-
ephox.bolt = {
|
67
|
-
module: {
|
68
|
-
api: {
|
69
|
-
define: def,
|
70
|
-
require: req,
|
71
|
-
demand: dem
|
72
|
-
}
|
73
|
-
}
|
74
|
-
};
|
75
|
-
|
76
|
-
var define = def;
|
77
|
-
var require = req;
|
78
|
-
var demand = dem;
|
79
|
-
// this helps with minification when using a lot of global references
|
80
|
-
var defineGlobal = function (id, ref) {
|
81
|
-
define(id, [], function () { return ref; });
|
82
|
-
};
|
83
|
-
/*jsc
|
84
|
-
["tinymce.plugins.spellchecker.Plugin","ephox.katamari.api.Cell","tinymce.core.PluginManager","tinymce.plugins.spellchecker.alien.DetectProPlugin","tinymce.plugins.spellchecker.api.Api","tinymce.plugins.spellchecker.api.Commands","tinymce.plugins.spellchecker.api.Settings","tinymce.plugins.spellchecker.ui.Buttons","tinymce.plugins.spellchecker.ui.SuggestionsMenu","global!tinymce.util.Tools.resolve","global!window","tinymce.plugins.spellchecker.core.Actions","tinymce.core.util.Tools","global!document","tinymce.core.dom.DOMUtils","tinymce.core.ui.Factory","tinymce.core.util.URI","tinymce.core.util.XHR","tinymce.plugins.spellchecker.api.Events","tinymce.plugins.spellchecker.core.DomTextMatcher"]
|
85
|
-
jsc*/
|
86
|
-
define(
|
87
|
-
'ephox.katamari.api.Cell',
|
88
|
-
|
89
|
-
[
|
90
|
-
],
|
91
|
-
|
92
|
-
function () {
|
93
|
-
var Cell = function (initial) {
|
94
|
-
var value = initial;
|
95
|
-
|
96
|
-
var get = function () {
|
97
|
-
return value;
|
98
|
-
};
|
99
|
-
|
100
|
-
var set = function (v) {
|
101
|
-
value = v;
|
102
|
-
};
|
103
|
-
|
104
|
-
var clone = function () {
|
105
|
-
return Cell(get());
|
106
|
-
};
|
107
|
-
|
108
|
-
return {
|
109
|
-
get: get,
|
110
|
-
set: set,
|
111
|
-
clone: clone
|
112
|
-
};
|
113
|
-
};
|
114
|
-
|
115
|
-
return Cell;
|
116
|
-
}
|
117
|
-
);
|
118
|
-
|
119
|
-
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
|
120
|
-
/**
|
121
|
-
* ResolveGlobal.js
|
122
|
-
*
|
123
|
-
* Released under LGPL License.
|
124
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
125
|
-
*
|
126
|
-
* License: http://www.tinymce.com/license
|
127
|
-
* Contributing: http://www.tinymce.com/contributing
|
128
|
-
*/
|
129
|
-
|
130
|
-
define(
|
131
|
-
'tinymce.core.PluginManager',
|
132
|
-
[
|
133
|
-
'global!tinymce.util.Tools.resolve'
|
134
|
-
],
|
135
|
-
function (resolve) {
|
136
|
-
return resolve('tinymce.PluginManager');
|
137
|
-
}
|
138
|
-
);
|
139
|
-
|
140
|
-
defineGlobal("global!window", window);
|
141
|
-
/**
|
142
|
-
* DetectProPlugin.js
|
143
|
-
*
|
144
|
-
* Released under LGPL License.
|
145
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
146
|
-
*
|
147
|
-
* License: http://www.tinymce.com/license
|
148
|
-
* Contributing: http://www.tinymce.com/contributing
|
149
|
-
*/
|
150
|
-
|
151
|
-
define(
|
152
|
-
'tinymce.plugins.spellchecker.alien.DetectProPlugin',
|
153
|
-
[
|
154
|
-
'global!window',
|
155
|
-
'tinymce.core.PluginManager'
|
156
|
-
],
|
157
|
-
function (window, PluginManager) {
|
158
|
-
var hasProPlugin = function (editor) {
|
159
|
-
// draw back if power version is requested and registered
|
160
|
-
if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && PluginManager.get('tinymcespellchecker')) {
|
161
|
-
/*eslint no-console:0 */
|
162
|
-
if (typeof window.console !== "undefined" && window.console.log) {
|
163
|
-
window.console.log(
|
164
|
-
"Spell Checker Pro is incompatible with Spell Checker plugin! " +
|
165
|
-
"Remove 'spellchecker' from the 'plugins' option."
|
166
|
-
);
|
167
|
-
}
|
168
|
-
return true;
|
169
|
-
} else {
|
170
|
-
return false;
|
171
|
-
}
|
172
|
-
};
|
173
|
-
|
174
|
-
return {
|
175
|
-
hasProPlugin: hasProPlugin
|
176
|
-
};
|
177
|
-
}
|
178
|
-
);
|
179
|
-
|
180
|
-
/**
|
181
|
-
* Settings.js
|
182
|
-
*
|
183
|
-
* Released under LGPL License.
|
184
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
185
|
-
*
|
186
|
-
* License: http://www.tinymce.com/license
|
187
|
-
* Contributing: http://www.tinymce.com/contributing
|
188
|
-
*/
|
189
|
-
|
190
|
-
define(
|
191
|
-
'tinymce.plugins.spellchecker.api.Settings',
|
192
|
-
[
|
193
|
-
],
|
194
|
-
function () {
|
195
|
-
var getLanguages = function (editor) {
|
196
|
-
var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv';
|
197
|
-
return editor.getParam('spellchecker_languages', defaultLanguages);
|
198
|
-
};
|
199
|
-
|
200
|
-
var getLanguage = function (editor) {
|
201
|
-
var defaultLanguage = editor.getParam('language', 'en');
|
202
|
-
return editor.getParam('spellchecker_language', defaultLanguage);
|
203
|
-
};
|
204
|
-
|
205
|
-
var getRpcUrl = function (editor) {
|
206
|
-
return editor.getParam('spellchecker_rpc_url');
|
5
|
+
var Cell = function (initial) {
|
6
|
+
var value = initial;
|
7
|
+
var get = function () {
|
8
|
+
return value;
|
207
9
|
};
|
208
|
-
|
209
|
-
|
210
|
-
return editor.getParam('spellchecker_callback');
|
10
|
+
var set = function (v) {
|
11
|
+
value = v;
|
211
12
|
};
|
212
|
-
|
213
|
-
|
214
|
-
var defaultPattern = new RegExp("[^" +
|
215
|
-
"\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" +
|
216
|
-
"\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" +
|
217
|
-
"\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009" +
|
218
|
-
"]+", "g");
|
219
|
-
return editor.getParam('spellchecker_wordchar_pattern', defaultPattern);
|
13
|
+
var clone = function () {
|
14
|
+
return Cell(get());
|
220
15
|
};
|
221
|
-
|
222
16
|
return {
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
getSpellcheckerCallback: getSpellcheckerCallback,
|
227
|
-
getSpellcheckerWordcharPattern: getSpellcheckerWordcharPattern
|
17
|
+
get: get,
|
18
|
+
set: set,
|
19
|
+
clone: clone
|
228
20
|
};
|
229
|
-
}
|
230
|
-
);
|
231
|
-
/**
|
232
|
-
* ResolveGlobal.js
|
233
|
-
*
|
234
|
-
* Released under LGPL License.
|
235
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
236
|
-
*
|
237
|
-
* License: http://www.tinymce.com/license
|
238
|
-
* Contributing: http://www.tinymce.com/contributing
|
239
|
-
*/
|
240
|
-
|
241
|
-
define(
|
242
|
-
'tinymce.core.util.Tools',
|
243
|
-
[
|
244
|
-
'global!tinymce.util.Tools.resolve'
|
245
|
-
],
|
246
|
-
function (resolve) {
|
247
|
-
return resolve('tinymce.util.Tools');
|
248
|
-
}
|
249
|
-
);
|
21
|
+
};
|
250
22
|
|
251
|
-
|
252
|
-
* ResolveGlobal.js
|
253
|
-
*
|
254
|
-
* Released under LGPL License.
|
255
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
256
|
-
*
|
257
|
-
* License: http://www.tinymce.com/license
|
258
|
-
* Contributing: http://www.tinymce.com/contributing
|
259
|
-
*/
|
23
|
+
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
260
24
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
25
|
+
var hasProPlugin = function (editor) {
|
26
|
+
if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && global.get('tinymcespellchecker')) {
|
27
|
+
if (typeof window.console !== 'undefined' && window.console.log) {
|
28
|
+
window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.');
|
29
|
+
}
|
30
|
+
return true;
|
31
|
+
} else {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
};
|
35
|
+
var $_9tnsahk7jm0ofzx4 = { hasProPlugin: hasProPlugin };
|
270
36
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
37
|
+
var getLanguages = function (editor) {
|
38
|
+
var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv';
|
39
|
+
return editor.getParam('spellchecker_languages', defaultLanguages);
|
40
|
+
};
|
41
|
+
var getLanguage = function (editor) {
|
42
|
+
var defaultLanguage = editor.getParam('language', 'en');
|
43
|
+
return editor.getParam('spellchecker_language', defaultLanguage);
|
44
|
+
};
|
45
|
+
var getRpcUrl = function (editor) {
|
46
|
+
return editor.getParam('spellchecker_rpc_url');
|
47
|
+
};
|
48
|
+
var getSpellcheckerCallback = function (editor) {
|
49
|
+
return editor.getParam('spellchecker_callback');
|
50
|
+
};
|
51
|
+
var getSpellcheckerWordcharPattern = function (editor) {
|
52
|
+
var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g');
|
53
|
+
return editor.getParam('spellchecker_wordchar_pattern', defaultPattern);
|
54
|
+
};
|
55
|
+
var $_1zygcfkajm0ofzxr = {
|
56
|
+
getLanguages: getLanguages,
|
57
|
+
getLanguage: getLanguage,
|
58
|
+
getRpcUrl: getRpcUrl,
|
59
|
+
getSpellcheckerCallback: getSpellcheckerCallback,
|
60
|
+
getSpellcheckerWordcharPattern: getSpellcheckerWordcharPattern
|
61
|
+
};
|
280
62
|
|
281
|
-
|
282
|
-
'tinymce.core.util.XHR',
|
283
|
-
[
|
284
|
-
'global!tinymce.util.Tools.resolve'
|
285
|
-
],
|
286
|
-
function (resolve) {
|
287
|
-
return resolve('tinymce.util.XHR');
|
288
|
-
}
|
289
|
-
);
|
63
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
290
64
|
|
291
|
-
|
292
|
-
* Events.js
|
293
|
-
*
|
294
|
-
* Released under LGPL License.
|
295
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
296
|
-
*
|
297
|
-
* License: http://www.tinymce.com/license
|
298
|
-
* Contributing: http://www.tinymce.com/contributing
|
299
|
-
*/
|
65
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
300
66
|
|
301
|
-
|
302
|
-
'tinymce.plugins.spellchecker.api.Events',
|
303
|
-
[
|
304
|
-
],
|
305
|
-
function () {
|
306
|
-
var fireSpellcheckStart = function (editor) {
|
307
|
-
return editor.fire('SpellcheckStart');
|
308
|
-
};
|
67
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR');
|
309
68
|
|
310
|
-
|
311
|
-
|
312
|
-
|
69
|
+
var fireSpellcheckStart = function (editor) {
|
70
|
+
return editor.fire('SpellcheckStart');
|
71
|
+
};
|
72
|
+
var fireSpellcheckEnd = function (editor) {
|
73
|
+
return editor.fire('SpellcheckEnd');
|
74
|
+
};
|
75
|
+
var $_3ve0l5kfjm0ofzxz = {
|
76
|
+
fireSpellcheckStart: fireSpellcheckStart,
|
77
|
+
fireSpellcheckEnd: fireSpellcheckEnd
|
78
|
+
};
|
313
79
|
|
314
|
-
|
315
|
-
|
316
|
-
fireSpellcheckEnd: fireSpellcheckEnd
|
317
|
-
};
|
80
|
+
function isContentEditableFalse(node) {
|
81
|
+
return node && node.nodeType === 1 && node.contentEditable === 'false';
|
318
82
|
}
|
319
|
-
)
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
return node && node.nodeType === 1 && node.contentEditable === "false";
|
83
|
+
var DomTextMatcher = function (node, editor) {
|
84
|
+
var m, matches = [], text;
|
85
|
+
var dom = editor.dom;
|
86
|
+
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
|
87
|
+
blockElementsMap = editor.schema.getBlockElements();
|
88
|
+
hiddenTextElementsMap = editor.schema.getWhiteSpaceElements();
|
89
|
+
shortEndedElementsMap = editor.schema.getShortEndedElements();
|
90
|
+
function createMatch(m, data) {
|
91
|
+
if (!m[0]) {
|
92
|
+
throw new Error('findAndReplaceDOMText cannot handle zero-length matches');
|
93
|
+
}
|
94
|
+
return {
|
95
|
+
start: m.index,
|
96
|
+
end: m.index + m[0].length,
|
97
|
+
text: m[0],
|
98
|
+
data: data
|
99
|
+
};
|
337
100
|
}
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
|
343
|
-
return function (node, editor) {
|
344
|
-
var m, matches = [], text, dom = editor.dom;
|
345
|
-
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
|
346
|
-
|
347
|
-
blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc
|
348
|
-
hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
|
349
|
-
shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT
|
350
|
-
|
351
|
-
function createMatch(m, data) {
|
352
|
-
if (!m[0]) {
|
353
|
-
throw 'findAndReplaceDOMText cannot handle zero-length matches';
|
354
|
-
}
|
355
|
-
|
356
|
-
return {
|
357
|
-
start: m.index,
|
358
|
-
end: m.index + m[0].length,
|
359
|
-
text: m[0],
|
360
|
-
data: data
|
361
|
-
};
|
101
|
+
function getText(node) {
|
102
|
+
var txt;
|
103
|
+
if (node.nodeType === 3) {
|
104
|
+
return node.data;
|
362
105
|
}
|
363
|
-
|
364
|
-
|
365
|
-
var txt;
|
366
|
-
|
367
|
-
if (node.nodeType === 3) {
|
368
|
-
return node.data;
|
369
|
-
}
|
370
|
-
|
371
|
-
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
|
372
|
-
return '';
|
373
|
-
}
|
374
|
-
|
375
|
-
if (isContentEditableFalse(node)) {
|
376
|
-
return '\n';
|
377
|
-
}
|
378
|
-
|
379
|
-
txt = '';
|
380
|
-
|
381
|
-
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
|
382
|
-
txt += '\n';
|
383
|
-
}
|
384
|
-
|
385
|
-
if ((node = node.firstChild)) {
|
386
|
-
do {
|
387
|
-
txt += getText(node);
|
388
|
-
} while ((node = node.nextSibling));
|
389
|
-
}
|
390
|
-
|
391
|
-
return txt;
|
106
|
+
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
|
107
|
+
return '';
|
392
108
|
}
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
109
|
+
if (isContentEditableFalse(node)) {
|
110
|
+
return '\n';
|
111
|
+
}
|
112
|
+
txt = '';
|
113
|
+
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
|
114
|
+
txt += '\n';
|
115
|
+
}
|
116
|
+
if (node = node.firstChild) {
|
117
|
+
do {
|
118
|
+
txt += getText(node);
|
119
|
+
} while (node = node.nextSibling);
|
120
|
+
}
|
121
|
+
return txt;
|
122
|
+
}
|
123
|
+
function stepThroughMatches(node, matches, replaceFn) {
|
124
|
+
var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation, matchIndex = 0;
|
125
|
+
matches = matches.slice(0);
|
126
|
+
matches.sort(function (a, b) {
|
127
|
+
return a.start - b.start;
|
128
|
+
});
|
129
|
+
matchLocation = matches.shift();
|
130
|
+
out:
|
131
|
+
while (true) {
|
407
132
|
if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) {
|
408
133
|
atIndex++;
|
409
134
|
}
|
410
|
-
|
411
135
|
if (curNode.nodeType === 3) {
|
412
136
|
if (!endNode && curNode.length + atIndex >= matchLocation.end) {
|
413
|
-
// We've found the ending
|
414
137
|
endNode = curNode;
|
415
138
|
endNodeIndex = matchLocation.end - atIndex;
|
416
139
|
} else if (startNode) {
|
417
|
-
// Intersecting node
|
418
140
|
innerNodes.push(curNode);
|
419
141
|
}
|
420
|
-
|
421
142
|
if (!startNode && curNode.length + atIndex > matchLocation.start) {
|
422
|
-
// We've found the match start
|
423
143
|
startNode = curNode;
|
424
144
|
startNodeIndex = matchLocation.start - atIndex;
|
425
145
|
}
|
426
|
-
|
427
146
|
atIndex += curNode.length;
|
428
147
|
}
|
429
|
-
|
430
148
|
if (startNode && endNode) {
|
431
149
|
curNode = replaceFn({
|
432
150
|
startNode: startNode,
|
@@ -437,34 +155,25 @@ define(
|
|
437
155
|
match: matchLocation.text,
|
438
156
|
matchIndex: matchIndex
|
439
157
|
});
|
440
|
-
|
441
|
-
// replaceFn has to return the node that replaced the endNode
|
442
|
-
// and then we step back so we can continue from the end of the
|
443
|
-
// match:
|
444
|
-
atIndex -= (endNode.length - endNodeIndex);
|
158
|
+
atIndex -= endNode.length - endNodeIndex;
|
445
159
|
startNode = null;
|
446
160
|
endNode = null;
|
447
161
|
innerNodes = [];
|
448
162
|
matchLocation = matches.shift();
|
449
163
|
matchIndex++;
|
450
|
-
|
451
164
|
if (!matchLocation) {
|
452
|
-
break;
|
165
|
+
break;
|
453
166
|
}
|
454
167
|
} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
|
455
168
|
if (!isContentEditableFalse(curNode)) {
|
456
|
-
// Move down
|
457
169
|
curNode = curNode.firstChild;
|
458
170
|
continue;
|
459
171
|
}
|
460
172
|
} else if (curNode.nextSibling) {
|
461
|
-
// Move forward:
|
462
173
|
curNode = curNode.nextSibling;
|
463
174
|
continue;
|
464
175
|
}
|
465
|
-
|
466
|
-
// Move forward or up:
|
467
|
-
while (true) { //eslint-disable-line no-constant-condition
|
176
|
+
while (true) {
|
468
177
|
if (curNode.nextSibling) {
|
469
178
|
curNode = curNode.nextSibling;
|
470
179
|
break;
|
@@ -475,945 +184,574 @@ define(
|
|
475
184
|
}
|
476
185
|
}
|
477
186
|
}
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
function genReplacer(callback) {
|
485
|
-
function makeReplacementNode(fill, matchIndex) {
|
486
|
-
var match = matches[matchIndex];
|
487
|
-
|
488
|
-
if (!match.stencil) {
|
489
|
-
match.stencil = callback(match);
|
490
|
-
}
|
491
|
-
|
492
|
-
var clone = match.stencil.cloneNode(false);
|
493
|
-
clone.setAttribute('data-mce-index', matchIndex);
|
494
|
-
|
495
|
-
if (fill) {
|
496
|
-
clone.appendChild(dom.doc.createTextNode(fill));
|
497
|
-
}
|
498
|
-
|
499
|
-
return clone;
|
187
|
+
}
|
188
|
+
function genReplacer(callback) {
|
189
|
+
function makeReplacementNode(fill, matchIndex) {
|
190
|
+
var match = matches[matchIndex];
|
191
|
+
if (!match.stencil) {
|
192
|
+
match.stencil = callback(match);
|
500
193
|
}
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
after = doc.createTextNode(node.data.substring(range.endNodeIndex));
|
523
|
-
parentNode.insertBefore(after, node);
|
524
|
-
}
|
525
|
-
|
526
|
-
node.parentNode.removeChild(node);
|
527
|
-
|
528
|
-
return el;
|
194
|
+
var clone = match.stencil.cloneNode(false);
|
195
|
+
clone.setAttribute('data-mce-index', matchIndex);
|
196
|
+
if (fill) {
|
197
|
+
clone.appendChild(dom.doc.createTextNode(fill));
|
198
|
+
}
|
199
|
+
return clone;
|
200
|
+
}
|
201
|
+
return function (range) {
|
202
|
+
var before;
|
203
|
+
var after;
|
204
|
+
var parentNode;
|
205
|
+
var startNode = range.startNode;
|
206
|
+
var endNode = range.endNode;
|
207
|
+
var matchIndex = range.matchIndex;
|
208
|
+
var doc = dom.doc;
|
209
|
+
if (startNode === endNode) {
|
210
|
+
var node_1 = startNode;
|
211
|
+
parentNode = node_1.parentNode;
|
212
|
+
if (range.startNodeIndex > 0) {
|
213
|
+
before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex));
|
214
|
+
parentNode.insertBefore(before, node_1);
|
529
215
|
}
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
var innerEls = [];
|
536
|
-
|
537
|
-
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
|
538
|
-
var innerNode = range.innerNodes[i];
|
539
|
-
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
|
540
|
-
innerNode.parentNode.replaceChild(innerEl, innerNode);
|
541
|
-
innerEls.push(innerEl);
|
542
|
-
}
|
543
|
-
|
544
|
-
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
|
545
|
-
|
546
|
-
parentNode = startNode.parentNode;
|
547
|
-
parentNode.insertBefore(before, startNode);
|
548
|
-
parentNode.insertBefore(elA, startNode);
|
549
|
-
parentNode.removeChild(startNode);
|
550
|
-
|
551
|
-
parentNode = endNode.parentNode;
|
552
|
-
parentNode.insertBefore(elB, endNode);
|
553
|
-
parentNode.insertBefore(after, endNode);
|
554
|
-
parentNode.removeChild(endNode);
|
555
|
-
|
556
|
-
return elB;
|
557
|
-
};
|
558
|
-
}
|
559
|
-
|
560
|
-
function unwrapElement(element) {
|
561
|
-
var parentNode = element.parentNode;
|
562
|
-
parentNode.insertBefore(element.firstChild, element);
|
563
|
-
element.parentNode.removeChild(element);
|
564
|
-
}
|
565
|
-
|
566
|
-
function hasClass(elm) {
|
567
|
-
return elm.className.indexOf('mce-spellchecker-word') !== -1;
|
568
|
-
}
|
569
|
-
|
570
|
-
function getWrappersByIndex(index) {
|
571
|
-
var elements = node.getElementsByTagName('*'), wrappers = [];
|
572
|
-
|
573
|
-
index = typeof index === "number" ? "" + index : null;
|
574
|
-
|
575
|
-
for (var i = 0; i < elements.length; i++) {
|
576
|
-
var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
|
577
|
-
|
578
|
-
if (dataIndex !== null && dataIndex.length && hasClass(element)) {
|
579
|
-
if (dataIndex === index || index === null) {
|
580
|
-
wrappers.push(element);
|
581
|
-
}
|
216
|
+
var el = makeReplacementNode(range.match, matchIndex);
|
217
|
+
parentNode.insertBefore(el, node_1);
|
218
|
+
if (range.endNodeIndex < node_1.length) {
|
219
|
+
after = doc.createTextNode(node_1.data.substring(range.endNodeIndex));
|
220
|
+
parentNode.insertBefore(after, node_1);
|
582
221
|
}
|
222
|
+
node_1.parentNode.removeChild(node_1);
|
223
|
+
return el;
|
583
224
|
}
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
*/
|
594
|
-
function indexOf(match) {
|
595
|
-
var i = matches.length;
|
596
|
-
while (i--) {
|
597
|
-
if (matches[i] === match) {
|
598
|
-
return i;
|
599
|
-
}
|
225
|
+
before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
|
226
|
+
after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
|
227
|
+
var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
|
228
|
+
var innerEls = [];
|
229
|
+
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
|
230
|
+
var innerNode = range.innerNodes[i];
|
231
|
+
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
|
232
|
+
innerNode.parentNode.replaceChild(innerEl, innerNode);
|
233
|
+
innerEls.push(innerEl);
|
600
234
|
}
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
* @param {Function} callback Callback to execute for each match.
|
630
|
-
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
631
|
-
*/
|
632
|
-
function each(callback) {
|
633
|
-
for (var i = 0, l = matches.length; i < l; i++) {
|
634
|
-
if (callback(matches[i], i) === false) {
|
635
|
-
break;
|
235
|
+
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
|
236
|
+
parentNode = startNode.parentNode;
|
237
|
+
parentNode.insertBefore(before, startNode);
|
238
|
+
parentNode.insertBefore(elA, startNode);
|
239
|
+
parentNode.removeChild(startNode);
|
240
|
+
parentNode = endNode.parentNode;
|
241
|
+
parentNode.insertBefore(elB, endNode);
|
242
|
+
parentNode.insertBefore(after, endNode);
|
243
|
+
parentNode.removeChild(endNode);
|
244
|
+
return elB;
|
245
|
+
};
|
246
|
+
}
|
247
|
+
function unwrapElement(element) {
|
248
|
+
var parentNode = element.parentNode;
|
249
|
+
parentNode.insertBefore(element.firstChild, element);
|
250
|
+
element.parentNode.removeChild(element);
|
251
|
+
}
|
252
|
+
function hasClass(elm) {
|
253
|
+
return elm.className.indexOf('mce-spellchecker-word') !== -1;
|
254
|
+
}
|
255
|
+
function getWrappersByIndex(index) {
|
256
|
+
var elements = node.getElementsByTagName('*'), wrappers = [];
|
257
|
+
index = typeof index === 'number' ? '' + index : null;
|
258
|
+
for (var i = 0; i < elements.length; i++) {
|
259
|
+
var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
|
260
|
+
if (dataIndex !== null && dataIndex.length && hasClass(element)) {
|
261
|
+
if (dataIndex === index || index === null) {
|
262
|
+
wrappers.push(element);
|
636
263
|
}
|
637
264
|
}
|
638
|
-
|
639
|
-
/*jshint validthis:true*/
|
640
|
-
return this;
|
641
265
|
}
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
*/
|
650
|
-
function wrap(callback) {
|
651
|
-
if (matches.length) {
|
652
|
-
stepThroughMatches(node, matches, genReplacer(callback));
|
266
|
+
return wrappers;
|
267
|
+
}
|
268
|
+
function indexOf(match) {
|
269
|
+
var i = matches.length;
|
270
|
+
while (i--) {
|
271
|
+
if (matches[i] === match) {
|
272
|
+
return i;
|
653
273
|
}
|
654
|
-
|
655
|
-
/*jshint validthis:true*/
|
656
|
-
return this;
|
657
274
|
}
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
*/
|
666
|
-
function find(regex, data) {
|
667
|
-
if (text && regex.global) {
|
668
|
-
while ((m = regex.exec(text))) {
|
669
|
-
matches.push(createMatch(m, data));
|
670
|
-
}
|
275
|
+
return -1;
|
276
|
+
}
|
277
|
+
function filter(callback) {
|
278
|
+
var filteredMatches = [];
|
279
|
+
each(function (match, i) {
|
280
|
+
if (callback(match, i)) {
|
281
|
+
filteredMatches.push(match);
|
671
282
|
}
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
681
|
-
*/
|
682
|
-
function unwrap(match) {
|
683
|
-
var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
|
684
|
-
|
685
|
-
i = elements.length;
|
686
|
-
while (i--) {
|
687
|
-
unwrapElement(elements[i]);
|
283
|
+
});
|
284
|
+
matches = filteredMatches;
|
285
|
+
return this;
|
286
|
+
}
|
287
|
+
function each(callback) {
|
288
|
+
for (var i = 0, l = matches.length; i < l; i++) {
|
289
|
+
if (callback(matches[i], i) === false) {
|
290
|
+
break;
|
688
291
|
}
|
689
|
-
|
690
|
-
return this;
|
691
|
-
}
|
692
|
-
|
693
|
-
/**
|
694
|
-
* Returns a match object by the specified DOM element.
|
695
|
-
*
|
696
|
-
* @param {DOMElement} element Element to return match object for.
|
697
|
-
* @return {Object} Match object for the specified element.
|
698
|
-
*/
|
699
|
-
function matchFromElement(element) {
|
700
|
-
return matches[element.getAttribute('data-mce-index')];
|
701
|
-
}
|
702
|
-
|
703
|
-
/**
|
704
|
-
* Returns a DOM element from the specified match element. This will be the first element if it's split
|
705
|
-
* on multiple nodes.
|
706
|
-
*
|
707
|
-
* @param {Object} match Match element to get first element of.
|
708
|
-
* @return {DOMElement} DOM element for the specified match object.
|
709
|
-
*/
|
710
|
-
function elementFromMatch(match) {
|
711
|
-
return getWrappersByIndex(indexOf(match))[0];
|
712
|
-
}
|
713
|
-
|
714
|
-
/**
|
715
|
-
* Adds match the specified range for example a grammar line.
|
716
|
-
*
|
717
|
-
* @param {Number} start Start offset.
|
718
|
-
* @param {Number} length Length of the text.
|
719
|
-
* @param {Object} data Custom data object for match.
|
720
|
-
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
721
|
-
*/
|
722
|
-
function add(start, length, data) {
|
723
|
-
matches.push({
|
724
|
-
start: start,
|
725
|
-
end: start + length,
|
726
|
-
text: text.substr(start, length),
|
727
|
-
data: data
|
728
|
-
});
|
729
|
-
|
730
|
-
return this;
|
731
292
|
}
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
* @return {DOMRange} DOM Range for the specified match.
|
738
|
-
*/
|
739
|
-
function rangeFromMatch(match) {
|
740
|
-
var wrappers = getWrappersByIndex(indexOf(match));
|
741
|
-
|
742
|
-
var rng = editor.dom.createRng();
|
743
|
-
rng.setStartBefore(wrappers[0]);
|
744
|
-
rng.setEndAfter(wrappers[wrappers.length - 1]);
|
745
|
-
|
746
|
-
return rng;
|
293
|
+
return this;
|
294
|
+
}
|
295
|
+
function wrap(callback) {
|
296
|
+
if (matches.length) {
|
297
|
+
stepThroughMatches(node, matches, genReplacer(callback));
|
747
298
|
}
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
* @return {DOMRange} DOM range produced after the replace.
|
755
|
-
*/
|
756
|
-
function replace(match, text) {
|
757
|
-
var rng = rangeFromMatch(match);
|
758
|
-
|
759
|
-
rng.deleteContents();
|
760
|
-
|
761
|
-
if (text.length > 0) {
|
762
|
-
rng.insertNode(editor.dom.doc.createTextNode(text));
|
299
|
+
return this;
|
300
|
+
}
|
301
|
+
function find(regex, data) {
|
302
|
+
if (text && regex.global) {
|
303
|
+
while (m = regex.exec(text)) {
|
304
|
+
matches.push(createMatch(m, data));
|
763
305
|
}
|
764
|
-
|
765
|
-
return rng;
|
766
|
-
}
|
767
|
-
|
768
|
-
/**
|
769
|
-
* Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches.
|
770
|
-
*
|
771
|
-
* @return {[type]} [description]
|
772
|
-
*/
|
773
|
-
function reset() {
|
774
|
-
matches.splice(0, matches.length);
|
775
|
-
unwrap();
|
776
|
-
|
777
|
-
return this;
|
778
306
|
}
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
)
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
'tinymce.plugins.spellchecker.api.Events',
|
818
|
-
'tinymce.plugins.spellchecker.api.Settings',
|
819
|
-
'tinymce.plugins.spellchecker.core.DomTextMatcher'
|
820
|
-
],
|
821
|
-
function (Tools, URI, XHR, Events, Settings, DomTextMatcher) {
|
822
|
-
var getTextMatcher = function (editor, textMatcherState) {
|
823
|
-
if (!textMatcherState.get()) {
|
824
|
-
var textMatcher = new DomTextMatcher(editor.getBody(), editor);
|
825
|
-
textMatcherState.set(textMatcher);
|
826
|
-
}
|
827
|
-
|
828
|
-
return textMatcherState.get();
|
829
|
-
};
|
830
|
-
|
831
|
-
var isEmpty = function (obj) {
|
832
|
-
for (var name in obj) {
|
833
|
-
return false;
|
307
|
+
return this;
|
308
|
+
}
|
309
|
+
function unwrap(match) {
|
310
|
+
var i;
|
311
|
+
var elements = getWrappersByIndex(match ? indexOf(match) : null);
|
312
|
+
i = elements.length;
|
313
|
+
while (i--) {
|
314
|
+
unwrapElement(elements[i]);
|
315
|
+
}
|
316
|
+
return this;
|
317
|
+
}
|
318
|
+
function matchFromElement(element) {
|
319
|
+
return matches[element.getAttribute('data-mce-index')];
|
320
|
+
}
|
321
|
+
function elementFromMatch(match) {
|
322
|
+
return getWrappersByIndex(indexOf(match))[0];
|
323
|
+
}
|
324
|
+
function add(start, length, data) {
|
325
|
+
matches.push({
|
326
|
+
start: start,
|
327
|
+
end: start + length,
|
328
|
+
text: text.substr(start, length),
|
329
|
+
data: data
|
330
|
+
});
|
331
|
+
return this;
|
332
|
+
}
|
333
|
+
function rangeFromMatch(match) {
|
334
|
+
var wrappers = getWrappersByIndex(indexOf(match));
|
335
|
+
var rng = editor.dom.createRng();
|
336
|
+
rng.setStartBefore(wrappers[0]);
|
337
|
+
rng.setEndAfter(wrappers[wrappers.length - 1]);
|
338
|
+
return rng;
|
339
|
+
}
|
340
|
+
function replace(match, text) {
|
341
|
+
var rng = rangeFromMatch(match);
|
342
|
+
rng.deleteContents();
|
343
|
+
if (text.length > 0) {
|
344
|
+
rng.insertNode(editor.dom.doc.createTextNode(text));
|
834
345
|
}
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
return
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
success: function (result) {
|
859
|
-
result = JSON.parse(result);
|
860
|
-
|
861
|
-
if (!result) {
|
862
|
-
var message = editor.translate("Server response wasn't proper JSON.");
|
863
|
-
errorCallback(message);
|
864
|
-
} else if (result.error) {
|
865
|
-
errorCallback(result.error);
|
866
|
-
} else {
|
867
|
-
doneCallback(result);
|
868
|
-
}
|
869
|
-
},
|
870
|
-
error: function () {
|
871
|
-
var message = editor.translate("The spelling service was not found: (") +
|
872
|
-
Settings.getRpcUrl(editor) +
|
873
|
-
editor.translate(")");
|
874
|
-
errorCallback(message);
|
875
|
-
}
|
876
|
-
});
|
877
|
-
};
|
878
|
-
};
|
879
|
-
|
880
|
-
var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) {
|
881
|
-
var userSpellcheckCallback = Settings.getSpellcheckerCallback(editor);
|
882
|
-
var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState);
|
883
|
-
spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback);
|
346
|
+
return rng;
|
347
|
+
}
|
348
|
+
function reset() {
|
349
|
+
matches.splice(0, matches.length);
|
350
|
+
unwrap();
|
351
|
+
return this;
|
352
|
+
}
|
353
|
+
text = getText(node);
|
354
|
+
return {
|
355
|
+
text: text,
|
356
|
+
matches: matches,
|
357
|
+
each: each,
|
358
|
+
filter: filter,
|
359
|
+
reset: reset,
|
360
|
+
matchFromElement: matchFromElement,
|
361
|
+
elementFromMatch: elementFromMatch,
|
362
|
+
find: find,
|
363
|
+
add: add,
|
364
|
+
wrap: wrap,
|
365
|
+
unwrap: unwrap,
|
366
|
+
replace: replace,
|
367
|
+
rangeFromMatch: rangeFromMatch,
|
368
|
+
indexOf: indexOf
|
884
369
|
};
|
370
|
+
};
|
885
371
|
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
372
|
+
var getTextMatcher = function (editor, textMatcherState) {
|
373
|
+
if (!textMatcherState.get()) {
|
374
|
+
var textMatcher = DomTextMatcher(editor.getBody(), editor);
|
375
|
+
textMatcherState.set(textMatcher);
|
376
|
+
}
|
377
|
+
return textMatcherState.get();
|
378
|
+
};
|
379
|
+
var isEmpty = function (obj) {
|
380
|
+
for (var _ in obj) {
|
381
|
+
return false;
|
382
|
+
}
|
383
|
+
return true;
|
384
|
+
};
|
385
|
+
var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) {
|
386
|
+
return function (method, text, doneCallback, errorCallback) {
|
387
|
+
var data = {
|
388
|
+
method: method,
|
389
|
+
lang: currentLanguageState.get()
|
899
390
|
};
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
if (!editor.dom.select('span.mce-spellchecker-word').length) {
|
908
|
-
finish(editor, startedState, textMatcherState);
|
909
|
-
}
|
910
|
-
};
|
911
|
-
|
912
|
-
var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, word, spans) {
|
913
|
-
editor.setProgressState(true);
|
914
|
-
|
915
|
-
sendRpcCall(editor, pluginUrl, 'addToDictionary', word, function () {
|
916
|
-
editor.setProgressState(false);
|
917
|
-
editor.dom.remove(spans, true);
|
918
|
-
checkIfFinished(editor, startedState, textMatcherState);
|
919
|
-
}, function (message) {
|
920
|
-
editor.notificationManager.open({ text: message, type: 'error' });
|
921
|
-
editor.setProgressState(false);
|
391
|
+
var postData = '';
|
392
|
+
data[method === 'addToDictionary' ? 'word' : 'text'] = text;
|
393
|
+
global$1.each(data, function (value, key) {
|
394
|
+
if (postData) {
|
395
|
+
postData += '&';
|
396
|
+
}
|
397
|
+
postData += key + '=' + encodeURIComponent(value);
|
922
398
|
});
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
if (
|
931
|
-
editor.
|
399
|
+
global$3.send({
|
400
|
+
url: new global$2(pluginUrl).toAbsolute($_1zygcfkajm0ofzxr.getRpcUrl(editor)),
|
401
|
+
type: 'post',
|
402
|
+
content_type: 'application/x-www-form-urlencoded',
|
403
|
+
data: postData,
|
404
|
+
success: function (result) {
|
405
|
+
result = JSON.parse(result);
|
406
|
+
if (!result) {
|
407
|
+
var message = editor.translate('Server response wasn\'t proper JSON.');
|
408
|
+
errorCallback(message);
|
409
|
+
} else if (result.error) {
|
410
|
+
errorCallback(result.error);
|
411
|
+
} else {
|
412
|
+
doneCallback(result);
|
932
413
|
}
|
933
|
-
}
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
414
|
+
},
|
415
|
+
error: function () {
|
416
|
+
var message = editor.translate('The spelling service was not found: (') + $_1zygcfkajm0ofzxr.getRpcUrl(editor) + editor.translate(')');
|
417
|
+
errorCallback(message);
|
418
|
+
}
|
419
|
+
});
|
939
420
|
};
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
421
|
+
};
|
422
|
+
var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) {
|
423
|
+
var userSpellcheckCallback = $_1zygcfkajm0ofzxr.getSpellcheckerCallback(editor);
|
424
|
+
var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState);
|
425
|
+
spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback);
|
426
|
+
};
|
427
|
+
var spellcheck = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) {
|
428
|
+
if (finish(editor, startedState, textMatcherState)) {
|
429
|
+
return;
|
430
|
+
}
|
431
|
+
var errorCallback = function (message) {
|
432
|
+
editor.notificationManager.open({
|
433
|
+
text: message,
|
434
|
+
type: 'error'
|
435
|
+
});
|
436
|
+
editor.setProgressState(false);
|
437
|
+
finish(editor, startedState, textMatcherState);
|
950
438
|
};
|
951
|
-
|
952
|
-
|
953
|
-
var value = elm.getAttribute('data-mce-index');
|
954
|
-
|
955
|
-
if (typeof value === "number") {
|
956
|
-
return "" + value;
|
957
|
-
}
|
958
|
-
|
959
|
-
return value;
|
439
|
+
var successCallback = function (data) {
|
440
|
+
markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data);
|
960
441
|
};
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
if (nodeIndex === index.toString()) {
|
975
|
-
spans.push(nodes[i]);
|
976
|
-
}
|
977
|
-
}
|
978
|
-
}
|
979
|
-
|
980
|
-
return spans;
|
981
|
-
};
|
982
|
-
|
983
|
-
var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) {
|
984
|
-
var suggestions, hasDictionarySupport;
|
985
|
-
|
986
|
-
if (data.words) {
|
987
|
-
hasDictionarySupport = !!data.dictionary;
|
988
|
-
suggestions = data.words;
|
989
|
-
} else {
|
990
|
-
// Fallback to old format
|
991
|
-
suggestions = data;
|
992
|
-
}
|
993
|
-
|
442
|
+
editor.setProgressState(true);
|
443
|
+
sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback);
|
444
|
+
editor.focus();
|
445
|
+
};
|
446
|
+
var checkIfFinished = function (editor, startedState, textMatcherState) {
|
447
|
+
if (!editor.dom.select('span.mce-spellchecker-word').length) {
|
448
|
+
finish(editor, startedState, textMatcherState);
|
449
|
+
}
|
450
|
+
};
|
451
|
+
var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans) {
|
452
|
+
editor.setProgressState(true);
|
453
|
+
sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () {
|
994
454
|
editor.setProgressState(false);
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
455
|
+
editor.dom.remove(spans, true);
|
456
|
+
checkIfFinished(editor, startedState, textMatcherState);
|
457
|
+
}, function (message) {
|
458
|
+
editor.notificationManager.open({
|
459
|
+
text: message,
|
460
|
+
type: 'error'
|
461
|
+
});
|
462
|
+
editor.setProgressState(false);
|
463
|
+
});
|
464
|
+
};
|
465
|
+
var ignoreWord = function (editor, startedState, textMatcherState, word, spans, all) {
|
466
|
+
editor.selection.collapse();
|
467
|
+
if (all) {
|
468
|
+
global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) {
|
469
|
+
if (span.getAttribute('data-mce-word') === word) {
|
470
|
+
editor.dom.remove(span, true);
|
471
|
+
}
|
472
|
+
});
|
473
|
+
} else {
|
474
|
+
editor.dom.remove(spans, true);
|
475
|
+
}
|
476
|
+
checkIfFinished(editor, startedState, textMatcherState);
|
477
|
+
};
|
478
|
+
var finish = function (editor, startedState, textMatcherState) {
|
479
|
+
getTextMatcher(editor, textMatcherState).reset();
|
480
|
+
textMatcherState.set(null);
|
481
|
+
if (startedState.get()) {
|
482
|
+
startedState.set(false);
|
483
|
+
$_3ve0l5kfjm0ofzxz.fireSpellcheckEnd(editor);
|
484
|
+
return true;
|
485
|
+
}
|
486
|
+
};
|
487
|
+
var getElmIndex = function (elm) {
|
488
|
+
var value = elm.getAttribute('data-mce-index');
|
489
|
+
if (typeof value === 'number') {
|
490
|
+
return '' + value;
|
491
|
+
}
|
492
|
+
return value;
|
493
|
+
};
|
494
|
+
var findSpansByIndex = function (editor, index) {
|
495
|
+
var nodes;
|
496
|
+
var spans = [];
|
497
|
+
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
|
498
|
+
if (nodes.length) {
|
499
|
+
for (var i = 0; i < nodes.length; i++) {
|
500
|
+
var nodeIndex = getElmIndex(nodes[i]);
|
501
|
+
if (nodeIndex === null || !nodeIndex.length) {
|
502
|
+
continue;
|
503
|
+
}
|
504
|
+
if (nodeIndex === index.toString()) {
|
505
|
+
spans.push(nodes[i]);
|
506
|
+
}
|
1001
507
|
}
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
508
|
+
}
|
509
|
+
return spans;
|
510
|
+
};
|
511
|
+
var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) {
|
512
|
+
var suggestions, hasDictionarySupport;
|
513
|
+
if (typeof data !== 'string' && data.words) {
|
514
|
+
hasDictionarySupport = !!data.dictionary;
|
515
|
+
suggestions = data.words;
|
516
|
+
} else {
|
517
|
+
suggestions = data;
|
518
|
+
}
|
519
|
+
editor.setProgressState(false);
|
520
|
+
if (isEmpty(suggestions)) {
|
521
|
+
var message = editor.translate('No misspellings found.');
|
522
|
+
editor.notificationManager.open({
|
523
|
+
text: message,
|
524
|
+
type: 'info'
|
1006
525
|
});
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
526
|
+
startedState.set(false);
|
527
|
+
return;
|
528
|
+
}
|
529
|
+
lastSuggestionsState.set({
|
530
|
+
suggestions: suggestions,
|
531
|
+
hasDictionarySupport: hasDictionarySupport
|
532
|
+
});
|
533
|
+
getTextMatcher(editor, textMatcherState).find($_1zygcfkajm0ofzxr.getSpellcheckerWordcharPattern(editor)).filter(function (match) {
|
534
|
+
return !!suggestions[match.text];
|
535
|
+
}).wrap(function (match) {
|
536
|
+
return editor.dom.create('span', {
|
537
|
+
'class': 'mce-spellchecker-word',
|
538
|
+
'data-mce-bogus': 1,
|
539
|
+
'data-mce-word': match.text
|
1016
540
|
});
|
541
|
+
});
|
542
|
+
startedState.set(true);
|
543
|
+
$_3ve0l5kfjm0ofzxz.fireSpellcheckStart(editor);
|
544
|
+
};
|
545
|
+
var $_92arclkbjm0ofzxt = {
|
546
|
+
spellcheck: spellcheck,
|
547
|
+
checkIfFinished: checkIfFinished,
|
548
|
+
addToDictionary: addToDictionary,
|
549
|
+
ignoreWord: ignoreWord,
|
550
|
+
findSpansByIndex: findSpansByIndex,
|
551
|
+
getElmIndex: getElmIndex,
|
552
|
+
markErrors: markErrors
|
553
|
+
};
|
1017
554
|
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
return {
|
1023
|
-
spellcheck: spellcheck,
|
1024
|
-
checkIfFinished: checkIfFinished,
|
1025
|
-
addToDictionary: addToDictionary,
|
1026
|
-
ignoreWord: ignoreWord,
|
1027
|
-
findSpansByIndex: findSpansByIndex,
|
1028
|
-
getElmIndex: getElmIndex,
|
1029
|
-
markErrors: markErrors
|
555
|
+
var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, url) {
|
556
|
+
var getLanguage = function () {
|
557
|
+
return currentLanguageState.get();
|
1030
558
|
};
|
1031
|
-
|
1032
|
-
);
|
1033
|
-
/**
|
1034
|
-
* Api.js
|
1035
|
-
*
|
1036
|
-
* Released under LGPL License.
|
1037
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1038
|
-
*
|
1039
|
-
* License: http://www.tinymce.com/license
|
1040
|
-
* Contributing: http://www.tinymce.com/contributing
|
1041
|
-
*/
|
1042
|
-
|
1043
|
-
define(
|
1044
|
-
'tinymce.plugins.spellchecker.api.Api',
|
1045
|
-
[
|
1046
|
-
'tinymce.plugins.spellchecker.api.Settings',
|
1047
|
-
'tinymce.plugins.spellchecker.core.Actions'
|
1048
|
-
],
|
1049
|
-
function (Settings, Actions) {
|
1050
|
-
var get = function (editor, startedState, lastSuggestionsState, textMatcherState, url) {
|
1051
|
-
var getLanguage = function () {
|
1052
|
-
return Settings.getLanguage(editor);
|
1053
|
-
};
|
1054
|
-
|
1055
|
-
var getWordCharPattern = function () {
|
1056
|
-
return Settings.getSpellcheckerWordcharPattern(editor);
|
1057
|
-
};
|
1058
|
-
|
1059
|
-
var markErrors = function (data) {
|
1060
|
-
Actions.markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data);
|
1061
|
-
};
|
1062
|
-
|
1063
|
-
var getTextMatcher = function () {
|
1064
|
-
return textMatcherState.get();
|
1065
|
-
};
|
1066
|
-
|
1067
|
-
return {
|
1068
|
-
getTextMatcher: getTextMatcher,
|
1069
|
-
getWordCharPattern: getWordCharPattern,
|
1070
|
-
markErrors: markErrors,
|
1071
|
-
getLanguage: getLanguage
|
1072
|
-
};
|
559
|
+
var getWordCharPattern = function () {
|
560
|
+
return $_1zygcfkajm0ofzxr.getSpellcheckerWordcharPattern(editor);
|
1073
561
|
};
|
1074
|
-
|
1075
|
-
|
1076
|
-
get: get
|
562
|
+
var markErrors = function (data) {
|
563
|
+
$_92arclkbjm0ofzxt.markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data);
|
1077
564
|
};
|
1078
|
-
|
1079
|
-
);
|
1080
|
-
/**
|
1081
|
-
* Commands.js
|
1082
|
-
*
|
1083
|
-
* Released under LGPL License.
|
1084
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1085
|
-
*
|
1086
|
-
* License: http://www.tinymce.com/license
|
1087
|
-
* Contributing: http://www.tinymce.com/contributing
|
1088
|
-
*/
|
1089
|
-
|
1090
|
-
define(
|
1091
|
-
'tinymce.plugins.spellchecker.api.Commands',
|
1092
|
-
[
|
1093
|
-
'tinymce.plugins.spellchecker.core.Actions'
|
1094
|
-
],
|
1095
|
-
function (Actions) {
|
1096
|
-
var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) {
|
1097
|
-
editor.addCommand('mceSpellCheck', function () {
|
1098
|
-
Actions.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
|
1099
|
-
});
|
565
|
+
var getTextMatcher = function () {
|
566
|
+
return textMatcherState.get();
|
1100
567
|
};
|
1101
|
-
|
1102
568
|
return {
|
1103
|
-
|
569
|
+
getTextMatcher: getTextMatcher,
|
570
|
+
getWordCharPattern: getWordCharPattern,
|
571
|
+
markErrors: markErrors,
|
572
|
+
getLanguage: getLanguage
|
1104
573
|
};
|
1105
|
-
}
|
1106
|
-
|
1107
|
-
/**
|
1108
|
-
* Buttons.js
|
1109
|
-
*
|
1110
|
-
* Released under LGPL License.
|
1111
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1112
|
-
*
|
1113
|
-
* License: http://www.tinymce.com/license
|
1114
|
-
* Contributing: http://www.tinymce.com/contributing
|
1115
|
-
*/
|
574
|
+
};
|
575
|
+
var $_683bglk9jm0ofzxp = { get: get };
|
1116
576
|
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
],
|
1124
|
-
function (Tools, Settings, Actions) {
|
1125
|
-
var buildMenuItems = function (listName, languageValues) {
|
1126
|
-
var items = [];
|
577
|
+
var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) {
|
578
|
+
editor.addCommand('mceSpellCheck', function () {
|
579
|
+
$_92arclkbjm0ofzxt.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
|
580
|
+
});
|
581
|
+
};
|
582
|
+
var $_te08fkhjm0ofzy7 = { register: register };
|
1127
583
|
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
584
|
+
var buildMenuItems = function (listName, languageValues) {
|
585
|
+
var items = [];
|
586
|
+
global$1.each(languageValues, function (languageValue) {
|
587
|
+
items.push({
|
588
|
+
selectable: true,
|
589
|
+
text: languageValue.name,
|
590
|
+
data: languageValue.value
|
1134
591
|
});
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
e.control.items().each(function (ctrl) {
|
1144
|
-
ctrl.active(ctrl.settings.data === selectedLanguage);
|
1145
|
-
});
|
1146
|
-
};
|
1147
|
-
};
|
1148
|
-
|
1149
|
-
var getItems = function (editor) {
|
1150
|
-
return Tools.map(Settings.getLanguages(editor).split(','), function (langPair) {
|
1151
|
-
langPair = langPair.split('=');
|
1152
|
-
|
1153
|
-
return {
|
1154
|
-
name: langPair[0],
|
1155
|
-
value: langPair[1]
|
1156
|
-
};
|
592
|
+
});
|
593
|
+
return items;
|
594
|
+
};
|
595
|
+
var updateSelection = function (editor, currentLanguageState) {
|
596
|
+
return function (e) {
|
597
|
+
var selectedLanguage = currentLanguageState.get();
|
598
|
+
e.control.items().each(function (ctrl) {
|
599
|
+
ctrl.active(ctrl.settings.data === selectedLanguage);
|
1157
600
|
});
|
1158
601
|
};
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
var buttonArgs = {
|
1167
|
-
tooltip: 'Spellcheck',
|
1168
|
-
onclick: startSpellchecking,
|
1169
|
-
onPostRender: function (e) {
|
1170
|
-
var ctrl = e.control;
|
1171
|
-
|
1172
|
-
editor.on('SpellcheckStart SpellcheckEnd', function () {
|
1173
|
-
ctrl.active(startedState.get());
|
1174
|
-
});
|
1175
|
-
}
|
602
|
+
};
|
603
|
+
var getItems = function (editor) {
|
604
|
+
return global$1.map($_1zygcfkajm0ofzxr.getLanguages(editor).split(','), function (langPair) {
|
605
|
+
langPair = langPair.split('=');
|
606
|
+
return {
|
607
|
+
name: langPair[0],
|
608
|
+
value: langPair[1]
|
1176
609
|
};
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
610
|
+
});
|
611
|
+
};
|
612
|
+
var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) {
|
613
|
+
var languageMenuItems = buildMenuItems('Language', getItems(editor));
|
614
|
+
var startSpellchecking = function () {
|
615
|
+
$_92arclkbjm0ofzxt.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
|
616
|
+
};
|
617
|
+
var buttonArgs = {
|
618
|
+
tooltip: 'Spellcheck',
|
619
|
+
onclick: startSpellchecking,
|
620
|
+
onPostRender: function (e) {
|
621
|
+
var ctrl = e.control;
|
622
|
+
editor.on('SpellcheckStart SpellcheckEnd', function () {
|
623
|
+
ctrl.active(startedState.get());
|
624
|
+
});
|
1185
625
|
}
|
1186
|
-
|
1187
|
-
editor.addButton('spellchecker', buttonArgs);
|
1188
|
-
|
1189
|
-
editor.addMenuItem('spellchecker', {
|
1190
|
-
text: 'Spellcheck',
|
1191
|
-
context: 'tools',
|
1192
|
-
onclick: startSpellchecking,
|
1193
|
-
selectable: true,
|
1194
|
-
onPostRender: function () {
|
1195
|
-
var self = this;
|
1196
|
-
|
1197
|
-
self.active(startedState.get());
|
1198
|
-
|
1199
|
-
editor.on('SpellcheckStart SpellcheckEnd', function () {
|
1200
|
-
self.active(startedState.get());
|
1201
|
-
});
|
1202
|
-
}
|
1203
|
-
});
|
1204
626
|
};
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
);
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
[
|
1225
|
-
'global!tinymce.util.Tools.resolve'
|
1226
|
-
],
|
1227
|
-
function (resolve) {
|
1228
|
-
return resolve('tinymce.dom.DOMUtils');
|
1229
|
-
}
|
1230
|
-
);
|
1231
|
-
|
1232
|
-
/**
|
1233
|
-
* ResolveGlobal.js
|
1234
|
-
*
|
1235
|
-
* Released under LGPL License.
|
1236
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1237
|
-
*
|
1238
|
-
* License: http://www.tinymce.com/license
|
1239
|
-
* Contributing: http://www.tinymce.com/contributing
|
1240
|
-
*/
|
1241
|
-
|
1242
|
-
define(
|
1243
|
-
'tinymce.core.ui.Factory',
|
1244
|
-
[
|
1245
|
-
'global!tinymce.util.Tools.resolve'
|
1246
|
-
],
|
1247
|
-
function (resolve) {
|
1248
|
-
return resolve('tinymce.ui.Factory');
|
1249
|
-
}
|
1250
|
-
);
|
1251
|
-
|
1252
|
-
/**
|
1253
|
-
* SuggestionsMenu.js
|
1254
|
-
*
|
1255
|
-
* Released under LGPL License.
|
1256
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1257
|
-
*
|
1258
|
-
* License: http://www.tinymce.com/license
|
1259
|
-
* Contributing: http://www.tinymce.com/contributing
|
1260
|
-
*/
|
1261
|
-
|
1262
|
-
define(
|
1263
|
-
'tinymce.plugins.spellchecker.ui.SuggestionsMenu',
|
1264
|
-
[
|
1265
|
-
'global!document',
|
1266
|
-
'tinymce.core.dom.DOMUtils',
|
1267
|
-
'tinymce.core.ui.Factory',
|
1268
|
-
'tinymce.core.util.Tools',
|
1269
|
-
'tinymce.plugins.spellchecker.api.Settings',
|
1270
|
-
'tinymce.plugins.spellchecker.core.Actions'
|
1271
|
-
],
|
1272
|
-
function (document, DOMUtils, Factory, Tools, Settings, Actions) {
|
1273
|
-
var suggestionsMenu;
|
1274
|
-
|
1275
|
-
var showSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, word, spans) {
|
1276
|
-
var items = [], suggestions = lastSuggestionsState.get().suggestions[word];
|
1277
|
-
|
1278
|
-
Tools.each(suggestions, function (suggestion) {
|
1279
|
-
items.push({
|
1280
|
-
text: suggestion,
|
1281
|
-
onclick: function () {
|
1282
|
-
editor.insertContent(editor.dom.encode(suggestion));
|
1283
|
-
editor.dom.remove(spans);
|
1284
|
-
Actions.checkIfFinished(editor, startedState, textMatcherState);
|
1285
|
-
}
|
1286
|
-
});
|
1287
|
-
});
|
1288
|
-
|
1289
|
-
items.push({ text: '-' });
|
1290
|
-
|
1291
|
-
var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport;
|
1292
|
-
if (hasDictionarySupport) {
|
1293
|
-
items.push({
|
1294
|
-
text: 'Add to Dictionary', onclick: function () {
|
1295
|
-
Actions.addToDictionary(editor, pluginUrl, startedState, textMatcherState, word, spans);
|
1296
|
-
}
|
627
|
+
if (languageMenuItems.length > 1) {
|
628
|
+
buttonArgs.type = 'splitbutton';
|
629
|
+
buttonArgs.menu = languageMenuItems;
|
630
|
+
buttonArgs.onshow = updateSelection(editor, currentLanguageState);
|
631
|
+
buttonArgs.onselect = function (e) {
|
632
|
+
currentLanguageState.set(e.control.settings.data);
|
633
|
+
};
|
634
|
+
}
|
635
|
+
editor.addButton('spellchecker', buttonArgs);
|
636
|
+
editor.addMenuItem('spellchecker', {
|
637
|
+
text: 'Spellcheck',
|
638
|
+
context: 'tools',
|
639
|
+
onclick: startSpellchecking,
|
640
|
+
selectable: true,
|
641
|
+
onPostRender: function () {
|
642
|
+
var self = this;
|
643
|
+
self.active(startedState.get());
|
644
|
+
editor.on('SpellcheckStart SpellcheckEnd', function () {
|
645
|
+
self.active(startedState.get());
|
1297
646
|
});
|
1298
647
|
}
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
648
|
+
});
|
649
|
+
};
|
650
|
+
var $_9frydykijm0ofzy9 = { register: register$1 };
|
651
|
+
|
652
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
653
|
+
|
654
|
+
var global$5 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
|
655
|
+
|
656
|
+
var suggestionsMenu;
|
657
|
+
var showSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, word, spans) {
|
658
|
+
var items = [], suggestions = lastSuggestionsState.get().suggestions[word];
|
659
|
+
global$1.each(suggestions, function (suggestion) {
|
660
|
+
items.push({
|
661
|
+
text: suggestion,
|
662
|
+
onclick: function () {
|
663
|
+
editor.insertContent(editor.dom.encode(suggestion));
|
664
|
+
editor.dom.remove(spans);
|
665
|
+
$_92arclkbjm0ofzxt.checkIfFinished(editor, startedState, textMatcherState);
|
1311
666
|
}
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
}
|
1322
|
-
},
|
1323
|
-
onhide: function () {
|
1324
|
-
suggestionsMenu.remove();
|
1325
|
-
suggestionsMenu = null;
|
667
|
+
});
|
668
|
+
});
|
669
|
+
items.push({ text: '-' });
|
670
|
+
var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport;
|
671
|
+
if (hasDictionarySupport) {
|
672
|
+
items.push({
|
673
|
+
text: 'Add to Dictionary',
|
674
|
+
onclick: function () {
|
675
|
+
$_92arclkbjm0ofzxt.addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans);
|
1326
676
|
}
|
1327
677
|
});
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
targetPos.x -= root.scrollLeft;
|
1342
|
-
targetPos.y -= root.scrollTop;
|
678
|
+
}
|
679
|
+
items.push.apply(items, [
|
680
|
+
{
|
681
|
+
text: 'Ignore',
|
682
|
+
onclick: function () {
|
683
|
+
$_92arclkbjm0ofzxt.ignoreWord(editor, startedState, textMatcherState, word, spans);
|
684
|
+
}
|
685
|
+
},
|
686
|
+
{
|
687
|
+
text: 'Ignore all',
|
688
|
+
onclick: function () {
|
689
|
+
$_92arclkbjm0ofzxt.ignoreWord(editor, startedState, textMatcherState, word, spans, true);
|
690
|
+
}
|
1343
691
|
}
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState) {
|
1352
|
-
editor.on('click', function (e) {
|
1353
|
-
var target = e.target;
|
1354
|
-
|
1355
|
-
if (target.className === "mce-spellchecker-word") {
|
692
|
+
]);
|
693
|
+
suggestionsMenu = global$5.create('menu', {
|
694
|
+
items: items,
|
695
|
+
context: 'contextmenu',
|
696
|
+
onautohide: function (e) {
|
697
|
+
if (e.target.className.indexOf('spellchecker') !== -1) {
|
1356
698
|
e.preventDefault();
|
1357
|
-
|
1358
|
-
var spans = Actions.findSpansByIndex(editor, Actions.getElmIndex(target));
|
1359
|
-
|
1360
|
-
if (spans.length > 0) {
|
1361
|
-
var rng = editor.dom.createRng();
|
1362
|
-
rng.setStartBefore(spans[0]);
|
1363
|
-
rng.setEndAfter(spans[spans.length - 1]);
|
1364
|
-
editor.selection.setRng(rng);
|
1365
|
-
showSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, target.getAttribute('data-mce-word'), spans);
|
1366
|
-
}
|
1367
699
|
}
|
1368
|
-
}
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
setup: setup
|
1373
|
-
};
|
1374
|
-
}
|
1375
|
-
);
|
1376
|
-
|
1377
|
-
/**
|
1378
|
-
* Plugin.js
|
1379
|
-
*
|
1380
|
-
* Released under LGPL License.
|
1381
|
-
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
1382
|
-
*
|
1383
|
-
* License: http://www.tinymce.com/license
|
1384
|
-
* Contributing: http://www.tinymce.com/contributing
|
1385
|
-
*/
|
1386
|
-
|
1387
|
-
define(
|
1388
|
-
'tinymce.plugins.spellchecker.Plugin',
|
1389
|
-
[
|
1390
|
-
'ephox.katamari.api.Cell',
|
1391
|
-
'tinymce.core.PluginManager',
|
1392
|
-
'tinymce.plugins.spellchecker.alien.DetectProPlugin',
|
1393
|
-
'tinymce.plugins.spellchecker.api.Api',
|
1394
|
-
'tinymce.plugins.spellchecker.api.Commands',
|
1395
|
-
'tinymce.plugins.spellchecker.api.Settings',
|
1396
|
-
'tinymce.plugins.spellchecker.ui.Buttons',
|
1397
|
-
'tinymce.plugins.spellchecker.ui.SuggestionsMenu'
|
1398
|
-
],
|
1399
|
-
function (Cell, PluginManager, DetectProPlugin, Api, Commands, Settings, Buttons, SuggestionsMenu) {
|
1400
|
-
PluginManager.add('spellchecker', function (editor, pluginUrl) {
|
1401
|
-
if (DetectProPlugin.hasProPlugin(editor) === false) {
|
1402
|
-
var startedState = Cell(false);
|
1403
|
-
var currentLanguageState = Cell(Settings.getLanguage(editor));
|
1404
|
-
var textMatcherState = Cell(null);
|
1405
|
-
var lastSuggestionsState = Cell({});
|
1406
|
-
|
1407
|
-
Buttons.register(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState);
|
1408
|
-
SuggestionsMenu.setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState);
|
1409
|
-
Commands.register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
|
1410
|
-
|
1411
|
-
return Api.get(editor, startedState, lastSuggestionsState, textMatcherState, pluginUrl);
|
700
|
+
},
|
701
|
+
onhide: function () {
|
702
|
+
suggestionsMenu.remove();
|
703
|
+
suggestionsMenu = null;
|
1412
704
|
}
|
1413
705
|
});
|
1414
|
-
|
1415
|
-
|
706
|
+
suggestionsMenu.renderTo(document.body);
|
707
|
+
var pos = global$4.DOM.getPos(editor.getContentAreaContainer());
|
708
|
+
var targetPos = editor.dom.getPos(spans[0]);
|
709
|
+
var root = editor.dom.getRoot();
|
710
|
+
if (root.nodeName === 'BODY') {
|
711
|
+
targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
|
712
|
+
targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
|
713
|
+
} else {
|
714
|
+
targetPos.x -= root.scrollLeft;
|
715
|
+
targetPos.y -= root.scrollTop;
|
716
|
+
}
|
717
|
+
pos.x += targetPos.x;
|
718
|
+
pos.y += targetPos.y;
|
719
|
+
suggestionsMenu.moveTo(pos.x, pos.y + spans[0].offsetHeight);
|
720
|
+
};
|
721
|
+
var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState) {
|
722
|
+
editor.on('click', function (e) {
|
723
|
+
var target = e.target;
|
724
|
+
if (target.className === 'mce-spellchecker-word') {
|
725
|
+
e.preventDefault();
|
726
|
+
var spans = $_92arclkbjm0ofzxt.findSpansByIndex(editor, $_92arclkbjm0ofzxt.getElmIndex(target));
|
727
|
+
if (spans.length > 0) {
|
728
|
+
var rng = editor.dom.createRng();
|
729
|
+
rng.setStartBefore(spans[0]);
|
730
|
+
rng.setEndAfter(spans[spans.length - 1]);
|
731
|
+
editor.selection.setRng(rng);
|
732
|
+
showSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans);
|
733
|
+
}
|
734
|
+
}
|
735
|
+
});
|
736
|
+
};
|
737
|
+
var $_1vacjdkjjm0ofzyb = { setup: setup };
|
738
|
+
|
739
|
+
global.add('spellchecker', function (editor, pluginUrl) {
|
740
|
+
if ($_9tnsahk7jm0ofzx4.hasProPlugin(editor) === false) {
|
741
|
+
var startedState = Cell(false);
|
742
|
+
var currentLanguageState = Cell($_1zygcfkajm0ofzxr.getLanguage(editor));
|
743
|
+
var textMatcherState = Cell(null);
|
744
|
+
var lastSuggestionsState = Cell(null);
|
745
|
+
$_9frydykijm0ofzy9.register(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState);
|
746
|
+
$_1vacjdkjjm0ofzyb.setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState);
|
747
|
+
$_te08fkhjm0ofzy7.register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
|
748
|
+
return $_683bglk9jm0ofzxp.get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, pluginUrl);
|
749
|
+
}
|
750
|
+
});
|
751
|
+
function Plugin () {
|
1416
752
|
}
|
1417
|
-
|
1418
|
-
|
753
|
+
|
754
|
+
return Plugin;
|
755
|
+
|
756
|
+
}());
|
1419
757
|
})();
|