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
@@ -0,0 +1,1226 @@
|
|
1
|
+
define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"], function(require, exports, module) {
|
2
|
+
"use strict";
|
3
|
+
var oop = require("./lib/oop");
|
4
|
+
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
5
|
+
var lang = require("./lib/lang");
|
6
|
+
var Range = require("./range").Range;
|
7
|
+
var Anchor = require("./anchor").Anchor;
|
8
|
+
var HashHandler = require("./keyboard/hash_handler").HashHandler;
|
9
|
+
var Tokenizer = require("./tokenizer").Tokenizer;
|
10
|
+
var comparePoints = Range.comparePoints;
|
11
|
+
|
12
|
+
var SnippetManager = function() {
|
13
|
+
this.snippetMap = {};
|
14
|
+
this.snippetNameMap = {};
|
15
|
+
};
|
16
|
+
|
17
|
+
(function() {
|
18
|
+
oop.implement(this, EventEmitter);
|
19
|
+
|
20
|
+
this.getTokenizer = function() {
|
21
|
+
function TabstopToken(str, _, stack) {
|
22
|
+
str = str.substr(1);
|
23
|
+
if (/^\d+$/.test(str) && !stack.inFormatString)
|
24
|
+
return [{tabstopId: parseInt(str, 10)}];
|
25
|
+
return [{text: str}];
|
26
|
+
}
|
27
|
+
function escape(ch) {
|
28
|
+
return "(?:[^\\\\" + ch + "]|\\\\.)";
|
29
|
+
}
|
30
|
+
SnippetManager.$tokenizer = new Tokenizer({
|
31
|
+
start: [
|
32
|
+
{regex: /:/, onMatch: function(val, state, stack) {
|
33
|
+
if (stack.length && stack[0].expectIf) {
|
34
|
+
stack[0].expectIf = false;
|
35
|
+
stack[0].elseBranch = stack[0];
|
36
|
+
return [stack[0]];
|
37
|
+
}
|
38
|
+
return ":";
|
39
|
+
}},
|
40
|
+
{regex: /\\./, onMatch: function(val, state, stack) {
|
41
|
+
var ch = val[1];
|
42
|
+
if (ch == "}" && stack.length) {
|
43
|
+
val = ch;
|
44
|
+
}else if ("`$\\".indexOf(ch) != -1) {
|
45
|
+
val = ch;
|
46
|
+
} else if (stack.inFormatString) {
|
47
|
+
if (ch == "n")
|
48
|
+
val = "\n";
|
49
|
+
else if (ch == "t")
|
50
|
+
val = "\n";
|
51
|
+
else if ("ulULE".indexOf(ch) != -1) {
|
52
|
+
val = {changeCase: ch, local: ch > "a"};
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
return [val];
|
57
|
+
}},
|
58
|
+
{regex: /}/, onMatch: function(val, state, stack) {
|
59
|
+
return [stack.length ? stack.shift() : val];
|
60
|
+
}},
|
61
|
+
{regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken},
|
62
|
+
{regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) {
|
63
|
+
var t = TabstopToken(str.substr(1), state, stack);
|
64
|
+
stack.unshift(t[0]);
|
65
|
+
return t;
|
66
|
+
}, next: "snippetVar"},
|
67
|
+
{regex: /\n/, token: "newline", merge: false}
|
68
|
+
],
|
69
|
+
snippetVar: [
|
70
|
+
{regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) {
|
71
|
+
stack[0].choices = val.slice(1, -1).split(",");
|
72
|
+
}, next: "start"},
|
73
|
+
{regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?",
|
74
|
+
onMatch: function(val, state, stack) {
|
75
|
+
var ts = stack[0];
|
76
|
+
ts.fmtString = val;
|
77
|
+
|
78
|
+
val = this.splitRegex.exec(val);
|
79
|
+
ts.guard = val[1];
|
80
|
+
ts.fmt = val[2];
|
81
|
+
ts.flag = val[3];
|
82
|
+
return "";
|
83
|
+
}, next: "start"},
|
84
|
+
{regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) {
|
85
|
+
stack[0].code = val.splice(1, -1);
|
86
|
+
return "";
|
87
|
+
}, next: "start"},
|
88
|
+
{regex: "\\?", onMatch: function(val, state, stack) {
|
89
|
+
if (stack[0])
|
90
|
+
stack[0].expectIf = true;
|
91
|
+
}, next: "start"},
|
92
|
+
{regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"}
|
93
|
+
],
|
94
|
+
formatString: [
|
95
|
+
{regex: "/(" + escape("/") + "+)/", token: "regex"},
|
96
|
+
{regex: "", onMatch: function(val, state, stack) {
|
97
|
+
stack.inFormatString = true;
|
98
|
+
}, next: "start"}
|
99
|
+
]
|
100
|
+
});
|
101
|
+
SnippetManager.prototype.getTokenizer = function() {
|
102
|
+
return SnippetManager.$tokenizer;
|
103
|
+
};
|
104
|
+
return SnippetManager.$tokenizer;
|
105
|
+
};
|
106
|
+
|
107
|
+
this.tokenizeTmSnippet = function(str, startState) {
|
108
|
+
return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) {
|
109
|
+
return x.value || x;
|
110
|
+
});
|
111
|
+
};
|
112
|
+
|
113
|
+
this.$getDefaultValue = function(editor, name) {
|
114
|
+
if (/^[A-Z]\d+$/.test(name)) {
|
115
|
+
var i = name.substr(1);
|
116
|
+
return (this.variables[name[0] + "__"] || {})[i];
|
117
|
+
}
|
118
|
+
if (/^\d+$/.test(name)) {
|
119
|
+
return (this.variables.__ || {})[name];
|
120
|
+
}
|
121
|
+
name = name.replace(/^TM_/, "");
|
122
|
+
|
123
|
+
if (!editor)
|
124
|
+
return;
|
125
|
+
var s = editor.session;
|
126
|
+
switch(name) {
|
127
|
+
case "CURRENT_WORD":
|
128
|
+
var r = s.getWordRange();
|
129
|
+
case "SELECTION":
|
130
|
+
case "SELECTED_TEXT":
|
131
|
+
return s.getTextRange(r);
|
132
|
+
case "CURRENT_LINE":
|
133
|
+
return s.getLine(editor.getCursorPosition().row);
|
134
|
+
case "PREV_LINE": // not possible in textmate
|
135
|
+
return s.getLine(editor.getCursorPosition().row - 1);
|
136
|
+
case "LINE_INDEX":
|
137
|
+
return editor.getCursorPosition().column;
|
138
|
+
case "LINE_NUMBER":
|
139
|
+
return editor.getCursorPosition().row + 1;
|
140
|
+
case "SOFT_TABS":
|
141
|
+
return s.getUseSoftTabs() ? "YES" : "NO";
|
142
|
+
case "TAB_SIZE":
|
143
|
+
return s.getTabSize();
|
144
|
+
case "FILENAME":
|
145
|
+
case "FILEPATH":
|
146
|
+
return "";
|
147
|
+
case "FULLNAME":
|
148
|
+
return "Ace";
|
149
|
+
}
|
150
|
+
};
|
151
|
+
this.variables = {};
|
152
|
+
this.getVariableValue = function(editor, varName) {
|
153
|
+
if (this.variables.hasOwnProperty(varName))
|
154
|
+
return this.variables[varName](editor, varName) || "";
|
155
|
+
return this.$getDefaultValue(editor, varName) || "";
|
156
|
+
};
|
157
|
+
this.tmStrFormat = function(str, ch, editor) {
|
158
|
+
var flag = ch.flag || "";
|
159
|
+
var re = ch.guard;
|
160
|
+
re = new RegExp(re, flag.replace(/[^gi]/, ""));
|
161
|
+
var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString");
|
162
|
+
var _self = this;
|
163
|
+
var formatted = str.replace(re, function() {
|
164
|
+
_self.variables.__ = arguments;
|
165
|
+
var fmtParts = _self.resolveVariables(fmtTokens, editor);
|
166
|
+
var gChangeCase = "E";
|
167
|
+
for (var i = 0; i < fmtParts.length; i++) {
|
168
|
+
var ch = fmtParts[i];
|
169
|
+
if (typeof ch == "object") {
|
170
|
+
fmtParts[i] = "";
|
171
|
+
if (ch.changeCase && ch.local) {
|
172
|
+
var next = fmtParts[i + 1];
|
173
|
+
if (next && typeof next == "string") {
|
174
|
+
if (ch.changeCase == "u")
|
175
|
+
fmtParts[i] = next[0].toUpperCase();
|
176
|
+
else
|
177
|
+
fmtParts[i] = next[0].toLowerCase();
|
178
|
+
fmtParts[i + 1] = next.substr(1);
|
179
|
+
}
|
180
|
+
} else if (ch.changeCase) {
|
181
|
+
gChangeCase = ch.changeCase;
|
182
|
+
}
|
183
|
+
} else if (gChangeCase == "U") {
|
184
|
+
fmtParts[i] = ch.toUpperCase();
|
185
|
+
} else if (gChangeCase == "L") {
|
186
|
+
fmtParts[i] = ch.toLowerCase();
|
187
|
+
}
|
188
|
+
}
|
189
|
+
return fmtParts.join("");
|
190
|
+
});
|
191
|
+
this.variables.__ = null;
|
192
|
+
return formatted;
|
193
|
+
};
|
194
|
+
|
195
|
+
this.resolveVariables = function(snippet, editor) {
|
196
|
+
var result = [];
|
197
|
+
for (var i = 0; i < snippet.length; i++) {
|
198
|
+
var ch = snippet[i];
|
199
|
+
if (typeof ch == "string") {
|
200
|
+
result.push(ch);
|
201
|
+
} else if (typeof ch != "object") {
|
202
|
+
continue;
|
203
|
+
} else if (ch.skip) {
|
204
|
+
gotoNext(ch);
|
205
|
+
} else if (ch.processed < i) {
|
206
|
+
continue;
|
207
|
+
} else if (ch.text) {
|
208
|
+
var value = this.getVariableValue(editor, ch.text);
|
209
|
+
if (value && ch.fmtString)
|
210
|
+
value = this.tmStrFormat(value, ch);
|
211
|
+
ch.processed = i;
|
212
|
+
if (ch.expectIf == null) {
|
213
|
+
if (value) {
|
214
|
+
result.push(value);
|
215
|
+
gotoNext(ch);
|
216
|
+
}
|
217
|
+
} else {
|
218
|
+
if (value) {
|
219
|
+
ch.skip = ch.elseBranch;
|
220
|
+
} else
|
221
|
+
gotoNext(ch);
|
222
|
+
}
|
223
|
+
} else if (ch.tabstopId != null) {
|
224
|
+
result.push(ch);
|
225
|
+
} else if (ch.changeCase != null) {
|
226
|
+
result.push(ch);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
function gotoNext(ch) {
|
230
|
+
var i1 = snippet.indexOf(ch, i + 1);
|
231
|
+
if (i1 != -1)
|
232
|
+
i = i1;
|
233
|
+
}
|
234
|
+
return result;
|
235
|
+
};
|
236
|
+
|
237
|
+
this.insertSnippetForSelection = function(editor, snippetText) {
|
238
|
+
var cursor = editor.getCursorPosition();
|
239
|
+
var line = editor.session.getLine(cursor.row);
|
240
|
+
var tabString = editor.session.getTabString();
|
241
|
+
var indentString = line.match(/^\s*/)[0];
|
242
|
+
|
243
|
+
if (cursor.column < indentString.length)
|
244
|
+
indentString = indentString.slice(0, cursor.column);
|
245
|
+
|
246
|
+
snippetText = snippetText.replace(/\r/g, "");
|
247
|
+
var tokens = this.tokenizeTmSnippet(snippetText);
|
248
|
+
tokens = this.resolveVariables(tokens, editor);
|
249
|
+
tokens = tokens.map(function(x) {
|
250
|
+
if (x == "\n")
|
251
|
+
return x + indentString;
|
252
|
+
if (typeof x == "string")
|
253
|
+
return x.replace(/\t/g, tabString);
|
254
|
+
return x;
|
255
|
+
});
|
256
|
+
var tabstops = [];
|
257
|
+
tokens.forEach(function(p, i) {
|
258
|
+
if (typeof p != "object")
|
259
|
+
return;
|
260
|
+
var id = p.tabstopId;
|
261
|
+
var ts = tabstops[id];
|
262
|
+
if (!ts) {
|
263
|
+
ts = tabstops[id] = [];
|
264
|
+
ts.index = id;
|
265
|
+
ts.value = "";
|
266
|
+
}
|
267
|
+
if (ts.indexOf(p) !== -1)
|
268
|
+
return;
|
269
|
+
ts.push(p);
|
270
|
+
var i1 = tokens.indexOf(p, i + 1);
|
271
|
+
if (i1 === -1)
|
272
|
+
return;
|
273
|
+
|
274
|
+
var value = tokens.slice(i + 1, i1);
|
275
|
+
var isNested = value.some(function(t) {return typeof t === "object";});
|
276
|
+
if (isNested && !ts.value) {
|
277
|
+
ts.value = value;
|
278
|
+
} else if (value.length && (!ts.value || typeof ts.value !== "string")) {
|
279
|
+
ts.value = value.join("");
|
280
|
+
}
|
281
|
+
});
|
282
|
+
tabstops.forEach(function(ts) {ts.length = 0;});
|
283
|
+
var expanding = {};
|
284
|
+
function copyValue(val) {
|
285
|
+
var copy = [];
|
286
|
+
for (var i = 0; i < val.length; i++) {
|
287
|
+
var p = val[i];
|
288
|
+
if (typeof p == "object") {
|
289
|
+
if (expanding[p.tabstopId])
|
290
|
+
continue;
|
291
|
+
var j = val.lastIndexOf(p, i - 1);
|
292
|
+
p = copy[j] || {tabstopId: p.tabstopId};
|
293
|
+
}
|
294
|
+
copy[i] = p;
|
295
|
+
}
|
296
|
+
return copy;
|
297
|
+
}
|
298
|
+
for (var i = 0; i < tokens.length; i++) {
|
299
|
+
var p = tokens[i];
|
300
|
+
if (typeof p != "object")
|
301
|
+
continue;
|
302
|
+
var id = p.tabstopId;
|
303
|
+
var i1 = tokens.indexOf(p, i + 1);
|
304
|
+
if (expanding[id]) {
|
305
|
+
if (expanding[id] === p)
|
306
|
+
expanding[id] = null;
|
307
|
+
continue;
|
308
|
+
}
|
309
|
+
|
310
|
+
var ts = tabstops[id];
|
311
|
+
var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value);
|
312
|
+
arg.unshift(i + 1, Math.max(0, i1 - i));
|
313
|
+
arg.push(p);
|
314
|
+
expanding[id] = p;
|
315
|
+
tokens.splice.apply(tokens, arg);
|
316
|
+
|
317
|
+
if (ts.indexOf(p) === -1)
|
318
|
+
ts.push(p);
|
319
|
+
}
|
320
|
+
var row = 0, column = 0;
|
321
|
+
var text = "";
|
322
|
+
tokens.forEach(function(t) {
|
323
|
+
if (typeof t === "string") {
|
324
|
+
var lines = t.split("\n");
|
325
|
+
if (lines.length > 1){
|
326
|
+
column = lines[lines.length - 1].length;
|
327
|
+
row += lines.length - 1;
|
328
|
+
} else
|
329
|
+
column += t.length;
|
330
|
+
text += t;
|
331
|
+
} else {
|
332
|
+
if (!t.start)
|
333
|
+
t.start = {row: row, column: column};
|
334
|
+
else
|
335
|
+
t.end = {row: row, column: column};
|
336
|
+
}
|
337
|
+
});
|
338
|
+
var range = editor.getSelectionRange();
|
339
|
+
var end = editor.session.replace(range, text);
|
340
|
+
|
341
|
+
var tabstopManager = new TabstopManager(editor);
|
342
|
+
var selectionId = editor.inVirtualSelectionMode && editor.selection.index;
|
343
|
+
tabstopManager.addTabstops(tabstops, range.start, end, selectionId);
|
344
|
+
};
|
345
|
+
|
346
|
+
this.insertSnippet = function(editor, snippetText) {
|
347
|
+
var self = this;
|
348
|
+
if (editor.inVirtualSelectionMode)
|
349
|
+
return self.insertSnippetForSelection(editor, snippetText);
|
350
|
+
|
351
|
+
editor.forEachSelection(function() {
|
352
|
+
self.insertSnippetForSelection(editor, snippetText);
|
353
|
+
}, null, {keepOrder: true});
|
354
|
+
|
355
|
+
if (editor.tabstopManager)
|
356
|
+
editor.tabstopManager.tabNext();
|
357
|
+
};
|
358
|
+
|
359
|
+
this.$getScope = function(editor) {
|
360
|
+
var scope = editor.session.$mode.$id || "";
|
361
|
+
scope = scope.split("/").pop();
|
362
|
+
if (scope === "html" || scope === "php") {
|
363
|
+
if (scope === "php" && !editor.session.$mode.inlinePhp)
|
364
|
+
scope = "html";
|
365
|
+
var c = editor.getCursorPosition();
|
366
|
+
var state = editor.session.getState(c.row);
|
367
|
+
if (typeof state === "object") {
|
368
|
+
state = state[0];
|
369
|
+
}
|
370
|
+
if (state.substring) {
|
371
|
+
if (state.substring(0, 3) == "js-")
|
372
|
+
scope = "javascript";
|
373
|
+
else if (state.substring(0, 4) == "css-")
|
374
|
+
scope = "css";
|
375
|
+
else if (state.substring(0, 4) == "php-")
|
376
|
+
scope = "php";
|
377
|
+
}
|
378
|
+
}
|
379
|
+
|
380
|
+
return scope;
|
381
|
+
};
|
382
|
+
|
383
|
+
this.getActiveScopes = function(editor) {
|
384
|
+
var scope = this.$getScope(editor);
|
385
|
+
var scopes = [scope];
|
386
|
+
var snippetMap = this.snippetMap;
|
387
|
+
if (snippetMap[scope] && snippetMap[scope].includeScopes) {
|
388
|
+
scopes.push.apply(scopes, snippetMap[scope].includeScopes);
|
389
|
+
}
|
390
|
+
scopes.push("_");
|
391
|
+
return scopes;
|
392
|
+
};
|
393
|
+
|
394
|
+
this.expandWithTab = function(editor, options) {
|
395
|
+
var self = this;
|
396
|
+
var result = editor.forEachSelection(function() {
|
397
|
+
return self.expandSnippetForSelection(editor, options);
|
398
|
+
}, null, {keepOrder: true});
|
399
|
+
if (result && editor.tabstopManager)
|
400
|
+
editor.tabstopManager.tabNext();
|
401
|
+
return result;
|
402
|
+
};
|
403
|
+
|
404
|
+
this.expandSnippetForSelection = function(editor, options) {
|
405
|
+
var cursor = editor.getCursorPosition();
|
406
|
+
var line = editor.session.getLine(cursor.row);
|
407
|
+
var before = line.substring(0, cursor.column);
|
408
|
+
var after = line.substr(cursor.column);
|
409
|
+
|
410
|
+
var snippetMap = this.snippetMap;
|
411
|
+
var snippet;
|
412
|
+
this.getActiveScopes(editor).some(function(scope) {
|
413
|
+
var snippets = snippetMap[scope];
|
414
|
+
if (snippets)
|
415
|
+
snippet = this.findMatchingSnippet(snippets, before, after);
|
416
|
+
return !!snippet;
|
417
|
+
}, this);
|
418
|
+
if (!snippet)
|
419
|
+
return false;
|
420
|
+
if (options && options.dryRun)
|
421
|
+
return true;
|
422
|
+
editor.session.doc.removeInLine(cursor.row,
|
423
|
+
cursor.column - snippet.replaceBefore.length,
|
424
|
+
cursor.column + snippet.replaceAfter.length
|
425
|
+
);
|
426
|
+
|
427
|
+
this.variables.M__ = snippet.matchBefore;
|
428
|
+
this.variables.T__ = snippet.matchAfter;
|
429
|
+
this.insertSnippetForSelection(editor, snippet.content);
|
430
|
+
|
431
|
+
this.variables.M__ = this.variables.T__ = null;
|
432
|
+
return true;
|
433
|
+
};
|
434
|
+
|
435
|
+
this.findMatchingSnippet = function(snippetList, before, after) {
|
436
|
+
for (var i = snippetList.length; i--;) {
|
437
|
+
var s = snippetList[i];
|
438
|
+
if (s.startRe && !s.startRe.test(before))
|
439
|
+
continue;
|
440
|
+
if (s.endRe && !s.endRe.test(after))
|
441
|
+
continue;
|
442
|
+
if (!s.startRe && !s.endRe)
|
443
|
+
continue;
|
444
|
+
|
445
|
+
s.matchBefore = s.startRe ? s.startRe.exec(before) : [""];
|
446
|
+
s.matchAfter = s.endRe ? s.endRe.exec(after) : [""];
|
447
|
+
s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : "";
|
448
|
+
s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : "";
|
449
|
+
return s;
|
450
|
+
}
|
451
|
+
};
|
452
|
+
|
453
|
+
this.snippetMap = {};
|
454
|
+
this.snippetNameMap = {};
|
455
|
+
this.register = function(snippets, scope) {
|
456
|
+
var snippetMap = this.snippetMap;
|
457
|
+
var snippetNameMap = this.snippetNameMap;
|
458
|
+
var self = this;
|
459
|
+
|
460
|
+
if (!snippets)
|
461
|
+
snippets = [];
|
462
|
+
|
463
|
+
function wrapRegexp(src) {
|
464
|
+
if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src))
|
465
|
+
src = "(?:" + src + ")";
|
466
|
+
|
467
|
+
return src || "";
|
468
|
+
}
|
469
|
+
function guardedRegexp(re, guard, opening) {
|
470
|
+
re = wrapRegexp(re);
|
471
|
+
guard = wrapRegexp(guard);
|
472
|
+
if (opening) {
|
473
|
+
re = guard + re;
|
474
|
+
if (re && re[re.length - 1] != "$")
|
475
|
+
re = re + "$";
|
476
|
+
} else {
|
477
|
+
re = re + guard;
|
478
|
+
if (re && re[0] != "^")
|
479
|
+
re = "^" + re;
|
480
|
+
}
|
481
|
+
return new RegExp(re);
|
482
|
+
}
|
483
|
+
|
484
|
+
function addSnippet(s) {
|
485
|
+
if (!s.scope)
|
486
|
+
s.scope = scope || "_";
|
487
|
+
scope = s.scope;
|
488
|
+
if (!snippetMap[scope]) {
|
489
|
+
snippetMap[scope] = [];
|
490
|
+
snippetNameMap[scope] = {};
|
491
|
+
}
|
492
|
+
|
493
|
+
var map = snippetNameMap[scope];
|
494
|
+
if (s.name) {
|
495
|
+
var old = map[s.name];
|
496
|
+
if (old)
|
497
|
+
self.unregister(old);
|
498
|
+
map[s.name] = s;
|
499
|
+
}
|
500
|
+
snippetMap[scope].push(s);
|
501
|
+
|
502
|
+
if (s.tabTrigger && !s.trigger) {
|
503
|
+
if (!s.guard && /^\w/.test(s.tabTrigger))
|
504
|
+
s.guard = "\\b";
|
505
|
+
s.trigger = lang.escapeRegExp(s.tabTrigger);
|
506
|
+
}
|
507
|
+
|
508
|
+
if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard)
|
509
|
+
return;
|
510
|
+
|
511
|
+
s.startRe = guardedRegexp(s.trigger, s.guard, true);
|
512
|
+
s.triggerRe = new RegExp(s.trigger);
|
513
|
+
|
514
|
+
s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true);
|
515
|
+
s.endTriggerRe = new RegExp(s.endTrigger);
|
516
|
+
}
|
517
|
+
|
518
|
+
if (snippets && snippets.content)
|
519
|
+
addSnippet(snippets);
|
520
|
+
else if (Array.isArray(snippets))
|
521
|
+
snippets.forEach(addSnippet);
|
522
|
+
|
523
|
+
this._signal("registerSnippets", {scope: scope});
|
524
|
+
};
|
525
|
+
this.unregister = function(snippets, scope) {
|
526
|
+
var snippetMap = this.snippetMap;
|
527
|
+
var snippetNameMap = this.snippetNameMap;
|
528
|
+
|
529
|
+
function removeSnippet(s) {
|
530
|
+
var nameMap = snippetNameMap[s.scope||scope];
|
531
|
+
if (nameMap && nameMap[s.name]) {
|
532
|
+
delete nameMap[s.name];
|
533
|
+
var map = snippetMap[s.scope||scope];
|
534
|
+
var i = map && map.indexOf(s);
|
535
|
+
if (i >= 0)
|
536
|
+
map.splice(i, 1);
|
537
|
+
}
|
538
|
+
}
|
539
|
+
if (snippets.content)
|
540
|
+
removeSnippet(snippets);
|
541
|
+
else if (Array.isArray(snippets))
|
542
|
+
snippets.forEach(removeSnippet);
|
543
|
+
};
|
544
|
+
this.parseSnippetFile = function(str) {
|
545
|
+
str = str.replace(/\r/g, "");
|
546
|
+
var list = [], snippet = {};
|
547
|
+
var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;
|
548
|
+
var m;
|
549
|
+
while (m = re.exec(str)) {
|
550
|
+
if (m[1]) {
|
551
|
+
try {
|
552
|
+
snippet = JSON.parse(m[1]);
|
553
|
+
list.push(snippet);
|
554
|
+
} catch (e) {}
|
555
|
+
} if (m[4]) {
|
556
|
+
snippet.content = m[4].replace(/^\t/gm, "");
|
557
|
+
list.push(snippet);
|
558
|
+
snippet = {};
|
559
|
+
} else {
|
560
|
+
var key = m[2], val = m[3];
|
561
|
+
if (key == "regex") {
|
562
|
+
var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g;
|
563
|
+
snippet.guard = guardRe.exec(val)[1];
|
564
|
+
snippet.trigger = guardRe.exec(val)[1];
|
565
|
+
snippet.endTrigger = guardRe.exec(val)[1];
|
566
|
+
snippet.endGuard = guardRe.exec(val)[1];
|
567
|
+
} else if (key == "snippet") {
|
568
|
+
snippet.tabTrigger = val.match(/^\S*/)[0];
|
569
|
+
if (!snippet.name)
|
570
|
+
snippet.name = val;
|
571
|
+
} else {
|
572
|
+
snippet[key] = val;
|
573
|
+
}
|
574
|
+
}
|
575
|
+
}
|
576
|
+
return list;
|
577
|
+
};
|
578
|
+
this.getSnippetByName = function(name, editor) {
|
579
|
+
var snippetMap = this.snippetNameMap;
|
580
|
+
var snippet;
|
581
|
+
this.getActiveScopes(editor).some(function(scope) {
|
582
|
+
var snippets = snippetMap[scope];
|
583
|
+
if (snippets)
|
584
|
+
snippet = snippets[name];
|
585
|
+
return !!snippet;
|
586
|
+
}, this);
|
587
|
+
return snippet;
|
588
|
+
};
|
589
|
+
|
590
|
+
}).call(SnippetManager.prototype);
|
591
|
+
|
592
|
+
|
593
|
+
var TabstopManager = function(editor) {
|
594
|
+
if (editor.tabstopManager)
|
595
|
+
return editor.tabstopManager;
|
596
|
+
editor.tabstopManager = this;
|
597
|
+
this.$onChange = this.onChange.bind(this);
|
598
|
+
this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule;
|
599
|
+
this.$onChangeSession = this.onChangeSession.bind(this);
|
600
|
+
this.$onAfterExec = this.onAfterExec.bind(this);
|
601
|
+
this.attach(editor);
|
602
|
+
};
|
603
|
+
(function() {
|
604
|
+
this.attach = function(editor) {
|
605
|
+
this.index = 0;
|
606
|
+
this.ranges = [];
|
607
|
+
this.tabstops = [];
|
608
|
+
this.$openTabstops = null;
|
609
|
+
this.selectedTabstop = null;
|
610
|
+
|
611
|
+
this.editor = editor;
|
612
|
+
this.editor.on("change", this.$onChange);
|
613
|
+
this.editor.on("changeSelection", this.$onChangeSelection);
|
614
|
+
this.editor.on("changeSession", this.$onChangeSession);
|
615
|
+
this.editor.commands.on("afterExec", this.$onAfterExec);
|
616
|
+
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
617
|
+
};
|
618
|
+
this.detach = function() {
|
619
|
+
this.tabstops.forEach(this.removeTabstopMarkers, this);
|
620
|
+
this.ranges = null;
|
621
|
+
this.tabstops = null;
|
622
|
+
this.selectedTabstop = null;
|
623
|
+
this.editor.removeListener("change", this.$onChange);
|
624
|
+
this.editor.removeListener("changeSelection", this.$onChangeSelection);
|
625
|
+
this.editor.removeListener("changeSession", this.$onChangeSession);
|
626
|
+
this.editor.commands.removeListener("afterExec", this.$onAfterExec);
|
627
|
+
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
628
|
+
this.editor.tabstopManager = null;
|
629
|
+
this.editor = null;
|
630
|
+
};
|
631
|
+
|
632
|
+
this.onChange = function(delta) {
|
633
|
+
var changeRange = delta;
|
634
|
+
var isRemove = delta.action[0] == "r";
|
635
|
+
var start = delta.start;
|
636
|
+
var end = delta.end;
|
637
|
+
var startRow = start.row;
|
638
|
+
var endRow = end.row;
|
639
|
+
var lineDif = endRow - startRow;
|
640
|
+
var colDiff = end.column - start.column;
|
641
|
+
|
642
|
+
if (isRemove) {
|
643
|
+
lineDif = -lineDif;
|
644
|
+
colDiff = -colDiff;
|
645
|
+
}
|
646
|
+
if (!this.$inChange && isRemove) {
|
647
|
+
var ts = this.selectedTabstop;
|
648
|
+
var changedOutside = ts && !ts.some(function(r) {
|
649
|
+
return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0;
|
650
|
+
});
|
651
|
+
if (changedOutside)
|
652
|
+
return this.detach();
|
653
|
+
}
|
654
|
+
var ranges = this.ranges;
|
655
|
+
for (var i = 0; i < ranges.length; i++) {
|
656
|
+
var r = ranges[i];
|
657
|
+
if (r.end.row < start.row)
|
658
|
+
continue;
|
659
|
+
|
660
|
+
if (isRemove && comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) {
|
661
|
+
this.removeRange(r);
|
662
|
+
i--;
|
663
|
+
continue;
|
664
|
+
}
|
665
|
+
|
666
|
+
if (r.start.row == startRow && r.start.column > start.column)
|
667
|
+
r.start.column += colDiff;
|
668
|
+
if (r.end.row == startRow && r.end.column >= start.column)
|
669
|
+
r.end.column += colDiff;
|
670
|
+
if (r.start.row >= startRow)
|
671
|
+
r.start.row += lineDif;
|
672
|
+
if (r.end.row >= startRow)
|
673
|
+
r.end.row += lineDif;
|
674
|
+
|
675
|
+
if (comparePoints(r.start, r.end) > 0)
|
676
|
+
this.removeRange(r);
|
677
|
+
}
|
678
|
+
if (!ranges.length)
|
679
|
+
this.detach();
|
680
|
+
};
|
681
|
+
this.updateLinkedFields = function() {
|
682
|
+
var ts = this.selectedTabstop;
|
683
|
+
if (!ts || !ts.hasLinkedRanges)
|
684
|
+
return;
|
685
|
+
this.$inChange = true;
|
686
|
+
var session = this.editor.session;
|
687
|
+
var text = session.getTextRange(ts.firstNonLinked);
|
688
|
+
for (var i = ts.length; i--;) {
|
689
|
+
var range = ts[i];
|
690
|
+
if (!range.linked)
|
691
|
+
continue;
|
692
|
+
var fmt = exports.snippetManager.tmStrFormat(text, range.original);
|
693
|
+
session.replace(range, fmt);
|
694
|
+
}
|
695
|
+
this.$inChange = false;
|
696
|
+
};
|
697
|
+
this.onAfterExec = function(e) {
|
698
|
+
if (e.command && !e.command.readOnly)
|
699
|
+
this.updateLinkedFields();
|
700
|
+
};
|
701
|
+
this.onChangeSelection = function() {
|
702
|
+
if (!this.editor)
|
703
|
+
return;
|
704
|
+
var lead = this.editor.selection.lead;
|
705
|
+
var anchor = this.editor.selection.anchor;
|
706
|
+
var isEmpty = this.editor.selection.isEmpty();
|
707
|
+
for (var i = this.ranges.length; i--;) {
|
708
|
+
if (this.ranges[i].linked)
|
709
|
+
continue;
|
710
|
+
var containsLead = this.ranges[i].contains(lead.row, lead.column);
|
711
|
+
var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column);
|
712
|
+
if (containsLead && containsAnchor)
|
713
|
+
return;
|
714
|
+
}
|
715
|
+
this.detach();
|
716
|
+
};
|
717
|
+
this.onChangeSession = function() {
|
718
|
+
this.detach();
|
719
|
+
};
|
720
|
+
this.tabNext = function(dir) {
|
721
|
+
var max = this.tabstops.length;
|
722
|
+
var index = this.index + (dir || 1);
|
723
|
+
index = Math.min(Math.max(index, 1), max);
|
724
|
+
if (index == max)
|
725
|
+
index = 0;
|
726
|
+
this.selectTabstop(index);
|
727
|
+
if (index === 0)
|
728
|
+
this.detach();
|
729
|
+
};
|
730
|
+
this.selectTabstop = function(index) {
|
731
|
+
this.$openTabstops = null;
|
732
|
+
var ts = this.tabstops[this.index];
|
733
|
+
if (ts)
|
734
|
+
this.addTabstopMarkers(ts);
|
735
|
+
this.index = index;
|
736
|
+
ts = this.tabstops[this.index];
|
737
|
+
if (!ts || !ts.length)
|
738
|
+
return;
|
739
|
+
|
740
|
+
this.selectedTabstop = ts;
|
741
|
+
if (!this.editor.inVirtualSelectionMode) {
|
742
|
+
var sel = this.editor.multiSelect;
|
743
|
+
sel.toSingleRange(ts.firstNonLinked.clone());
|
744
|
+
for (var i = ts.length; i--;) {
|
745
|
+
if (ts.hasLinkedRanges && ts[i].linked)
|
746
|
+
continue;
|
747
|
+
sel.addRange(ts[i].clone(), true);
|
748
|
+
}
|
749
|
+
if (sel.ranges[0])
|
750
|
+
sel.addRange(sel.ranges[0].clone());
|
751
|
+
} else {
|
752
|
+
this.editor.selection.setRange(ts.firstNonLinked);
|
753
|
+
}
|
754
|
+
|
755
|
+
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
756
|
+
};
|
757
|
+
this.addTabstops = function(tabstops, start, end) {
|
758
|
+
if (!this.$openTabstops)
|
759
|
+
this.$openTabstops = [];
|
760
|
+
if (!tabstops[0]) {
|
761
|
+
var p = Range.fromPoints(end, end);
|
762
|
+
moveRelative(p.start, start);
|
763
|
+
moveRelative(p.end, start);
|
764
|
+
tabstops[0] = [p];
|
765
|
+
tabstops[0].index = 0;
|
766
|
+
}
|
767
|
+
|
768
|
+
var i = this.index;
|
769
|
+
var arg = [i + 1, 0];
|
770
|
+
var ranges = this.ranges;
|
771
|
+
tabstops.forEach(function(ts, index) {
|
772
|
+
var dest = this.$openTabstops[index] || ts;
|
773
|
+
|
774
|
+
for (var i = ts.length; i--;) {
|
775
|
+
var p = ts[i];
|
776
|
+
var range = Range.fromPoints(p.start, p.end || p.start);
|
777
|
+
movePoint(range.start, start);
|
778
|
+
movePoint(range.end, start);
|
779
|
+
range.original = p;
|
780
|
+
range.tabstop = dest;
|
781
|
+
ranges.push(range);
|
782
|
+
if (dest != ts)
|
783
|
+
dest.unshift(range);
|
784
|
+
else
|
785
|
+
dest[i] = range;
|
786
|
+
if (p.fmtString) {
|
787
|
+
range.linked = true;
|
788
|
+
dest.hasLinkedRanges = true;
|
789
|
+
} else if (!dest.firstNonLinked)
|
790
|
+
dest.firstNonLinked = range;
|
791
|
+
}
|
792
|
+
if (!dest.firstNonLinked)
|
793
|
+
dest.hasLinkedRanges = false;
|
794
|
+
if (dest === ts) {
|
795
|
+
arg.push(dest);
|
796
|
+
this.$openTabstops[index] = dest;
|
797
|
+
}
|
798
|
+
this.addTabstopMarkers(dest);
|
799
|
+
}, this);
|
800
|
+
|
801
|
+
if (arg.length > 2) {
|
802
|
+
if (this.tabstops.length)
|
803
|
+
arg.push(arg.splice(2, 1)[0]);
|
804
|
+
this.tabstops.splice.apply(this.tabstops, arg);
|
805
|
+
}
|
806
|
+
};
|
807
|
+
|
808
|
+
this.addTabstopMarkers = function(ts) {
|
809
|
+
var session = this.editor.session;
|
810
|
+
ts.forEach(function(range) {
|
811
|
+
if (!range.markerId)
|
812
|
+
range.markerId = session.addMarker(range, "ace_snippet-marker", "text");
|
813
|
+
});
|
814
|
+
};
|
815
|
+
this.removeTabstopMarkers = function(ts) {
|
816
|
+
var session = this.editor.session;
|
817
|
+
ts.forEach(function(range) {
|
818
|
+
session.removeMarker(range.markerId);
|
819
|
+
range.markerId = null;
|
820
|
+
});
|
821
|
+
};
|
822
|
+
this.removeRange = function(range) {
|
823
|
+
var i = range.tabstop.indexOf(range);
|
824
|
+
range.tabstop.splice(i, 1);
|
825
|
+
i = this.ranges.indexOf(range);
|
826
|
+
this.ranges.splice(i, 1);
|
827
|
+
this.editor.session.removeMarker(range.markerId);
|
828
|
+
if (!range.tabstop.length) {
|
829
|
+
i = this.tabstops.indexOf(range.tabstop);
|
830
|
+
if (i != -1)
|
831
|
+
this.tabstops.splice(i, 1);
|
832
|
+
if (!this.tabstops.length)
|
833
|
+
this.detach();
|
834
|
+
}
|
835
|
+
};
|
836
|
+
|
837
|
+
this.keyboardHandler = new HashHandler();
|
838
|
+
this.keyboardHandler.bindKeys({
|
839
|
+
"Tab": function(ed) {
|
840
|
+
if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) {
|
841
|
+
return;
|
842
|
+
}
|
843
|
+
|
844
|
+
ed.tabstopManager.tabNext(1);
|
845
|
+
},
|
846
|
+
"Shift-Tab": function(ed) {
|
847
|
+
ed.tabstopManager.tabNext(-1);
|
848
|
+
},
|
849
|
+
"Esc": function(ed) {
|
850
|
+
ed.tabstopManager.detach();
|
851
|
+
},
|
852
|
+
"Return": function(ed) {
|
853
|
+
return false;
|
854
|
+
}
|
855
|
+
});
|
856
|
+
}).call(TabstopManager.prototype);
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
var changeTracker = {};
|
861
|
+
changeTracker.onChange = Anchor.prototype.onChange;
|
862
|
+
changeTracker.setPosition = function(row, column) {
|
863
|
+
this.pos.row = row;
|
864
|
+
this.pos.column = column;
|
865
|
+
};
|
866
|
+
changeTracker.update = function(pos, delta, $insertRight) {
|
867
|
+
this.$insertRight = $insertRight;
|
868
|
+
this.pos = pos;
|
869
|
+
this.onChange(delta);
|
870
|
+
};
|
871
|
+
|
872
|
+
var movePoint = function(point, diff) {
|
873
|
+
if (point.row == 0)
|
874
|
+
point.column += diff.column;
|
875
|
+
point.row += diff.row;
|
876
|
+
};
|
877
|
+
|
878
|
+
var moveRelative = function(point, start) {
|
879
|
+
if (point.row == start.row)
|
880
|
+
point.column -= start.column;
|
881
|
+
point.row -= start.row;
|
882
|
+
};
|
883
|
+
|
884
|
+
|
885
|
+
require("./lib/dom").importCssString("\
|
886
|
+
.ace_snippet-marker {\
|
887
|
+
-moz-box-sizing: border-box;\
|
888
|
+
box-sizing: border-box;\
|
889
|
+
background: rgba(194, 193, 208, 0.09);\
|
890
|
+
border: 1px dotted rgba(211, 208, 235, 0.62);\
|
891
|
+
position: absolute;\
|
892
|
+
}");
|
893
|
+
|
894
|
+
exports.snippetManager = new SnippetManager();
|
895
|
+
|
896
|
+
|
897
|
+
var Editor = require("./editor").Editor;
|
898
|
+
(function() {
|
899
|
+
this.insertSnippet = function(content, options) {
|
900
|
+
return exports.snippetManager.insertSnippet(this, content, options);
|
901
|
+
};
|
902
|
+
this.expandSnippet = function(options) {
|
903
|
+
return exports.snippetManager.expandWithTab(this, options);
|
904
|
+
};
|
905
|
+
}).call(Editor.prototype);
|
906
|
+
|
907
|
+
});
|
908
|
+
|
909
|
+
define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","tabStops","resources","utils","actions","ace/config","ace/config"], function(require, exports, module) {
|
910
|
+
"use strict";
|
911
|
+
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
|
912
|
+
var Editor = require("ace/editor").Editor;
|
913
|
+
var snippetManager = require("ace/snippets").snippetManager;
|
914
|
+
var Range = require("ace/range").Range;
|
915
|
+
var emmet, emmetPath;
|
916
|
+
function AceEmmetEditor() {}
|
917
|
+
|
918
|
+
AceEmmetEditor.prototype = {
|
919
|
+
setupContext: function(editor) {
|
920
|
+
this.ace = editor;
|
921
|
+
this.indentation = editor.session.getTabString();
|
922
|
+
if (!emmet)
|
923
|
+
emmet = window.emmet;
|
924
|
+
var resources = emmet.resources || emmet.require("resources");
|
925
|
+
resources.setVariable("indentation", this.indentation);
|
926
|
+
this.$syntax = null;
|
927
|
+
this.$syntax = this.getSyntax();
|
928
|
+
},
|
929
|
+
getSelectionRange: function() {
|
930
|
+
var range = this.ace.getSelectionRange();
|
931
|
+
var doc = this.ace.session.doc;
|
932
|
+
return {
|
933
|
+
start: doc.positionToIndex(range.start),
|
934
|
+
end: doc.positionToIndex(range.end)
|
935
|
+
};
|
936
|
+
},
|
937
|
+
createSelection: function(start, end) {
|
938
|
+
var doc = this.ace.session.doc;
|
939
|
+
this.ace.selection.setRange({
|
940
|
+
start: doc.indexToPosition(start),
|
941
|
+
end: doc.indexToPosition(end)
|
942
|
+
});
|
943
|
+
},
|
944
|
+
getCurrentLineRange: function() {
|
945
|
+
var ace = this.ace;
|
946
|
+
var row = ace.getCursorPosition().row;
|
947
|
+
var lineLength = ace.session.getLine(row).length;
|
948
|
+
var index = ace.session.doc.positionToIndex({row: row, column: 0});
|
949
|
+
return {
|
950
|
+
start: index,
|
951
|
+
end: index + lineLength
|
952
|
+
};
|
953
|
+
},
|
954
|
+
getCaretPos: function(){
|
955
|
+
var pos = this.ace.getCursorPosition();
|
956
|
+
return this.ace.session.doc.positionToIndex(pos);
|
957
|
+
},
|
958
|
+
setCaretPos: function(index){
|
959
|
+
var pos = this.ace.session.doc.indexToPosition(index);
|
960
|
+
this.ace.selection.moveToPosition(pos);
|
961
|
+
},
|
962
|
+
getCurrentLine: function() {
|
963
|
+
var row = this.ace.getCursorPosition().row;
|
964
|
+
return this.ace.session.getLine(row);
|
965
|
+
},
|
966
|
+
replaceContent: function(value, start, end, noIndent) {
|
967
|
+
if (end == null)
|
968
|
+
end = start == null ? this.getContent().length : start;
|
969
|
+
if (start == null)
|
970
|
+
start = 0;
|
971
|
+
|
972
|
+
var editor = this.ace;
|
973
|
+
var doc = editor.session.doc;
|
974
|
+
var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end));
|
975
|
+
editor.session.remove(range);
|
976
|
+
|
977
|
+
range.end = range.start;
|
978
|
+
value = this.$updateTabstops(value);
|
979
|
+
snippetManager.insertSnippet(editor, value);
|
980
|
+
},
|
981
|
+
getContent: function(){
|
982
|
+
return this.ace.getValue();
|
983
|
+
},
|
984
|
+
getSyntax: function() {
|
985
|
+
if (this.$syntax)
|
986
|
+
return this.$syntax;
|
987
|
+
var syntax = this.ace.session.$modeId.split("/").pop();
|
988
|
+
if (syntax == "html" || syntax == "php") {
|
989
|
+
var cursor = this.ace.getCursorPosition();
|
990
|
+
var state = this.ace.session.getState(cursor.row);
|
991
|
+
if (typeof state != "string")
|
992
|
+
state = state[0];
|
993
|
+
if (state) {
|
994
|
+
state = state.split("-");
|
995
|
+
if (state.length > 1)
|
996
|
+
syntax = state[0];
|
997
|
+
else if (syntax == "php")
|
998
|
+
syntax = "html";
|
999
|
+
}
|
1000
|
+
}
|
1001
|
+
return syntax;
|
1002
|
+
},
|
1003
|
+
getProfileName: function() {
|
1004
|
+
var resources = emmet.resources || emmet.require("resources");
|
1005
|
+
switch (this.getSyntax()) {
|
1006
|
+
case "css": return "css";
|
1007
|
+
case "xml":
|
1008
|
+
case "xsl":
|
1009
|
+
return "xml";
|
1010
|
+
case "html":
|
1011
|
+
var profile = resources.getVariable("profile");
|
1012
|
+
if (!profile)
|
1013
|
+
profile = this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i) != -1 ? "xhtml": "html";
|
1014
|
+
return profile;
|
1015
|
+
default:
|
1016
|
+
var mode = this.ace.session.$mode;
|
1017
|
+
return mode.emmetConfig && mode.emmetConfig.profile || "xhtml";
|
1018
|
+
}
|
1019
|
+
},
|
1020
|
+
prompt: function(title) {
|
1021
|
+
return prompt(title);
|
1022
|
+
},
|
1023
|
+
getSelection: function() {
|
1024
|
+
return this.ace.session.getTextRange();
|
1025
|
+
},
|
1026
|
+
getFilePath: function() {
|
1027
|
+
return "";
|
1028
|
+
},
|
1029
|
+
$updateTabstops: function(value) {
|
1030
|
+
var base = 1000;
|
1031
|
+
var zeroBase = 0;
|
1032
|
+
var lastZero = null;
|
1033
|
+
var ts = emmet.tabStops || emmet.require('tabStops');
|
1034
|
+
var resources = emmet.resources || emmet.require("resources");
|
1035
|
+
var settings = resources.getVocabulary("user");
|
1036
|
+
var tabstopOptions = {
|
1037
|
+
tabstop: function(data) {
|
1038
|
+
var group = parseInt(data.group, 10);
|
1039
|
+
var isZero = group === 0;
|
1040
|
+
if (isZero)
|
1041
|
+
group = ++zeroBase;
|
1042
|
+
else
|
1043
|
+
group += base;
|
1044
|
+
|
1045
|
+
var placeholder = data.placeholder;
|
1046
|
+
if (placeholder) {
|
1047
|
+
placeholder = ts.processText(placeholder, tabstopOptions);
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}';
|
1051
|
+
|
1052
|
+
if (isZero) {
|
1053
|
+
lastZero = [data.start, result];
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
return result;
|
1057
|
+
},
|
1058
|
+
escape: function(ch) {
|
1059
|
+
if (ch == '$') return '\\$';
|
1060
|
+
if (ch == '\\') return '\\\\';
|
1061
|
+
return ch;
|
1062
|
+
}
|
1063
|
+
};
|
1064
|
+
|
1065
|
+
value = ts.processText(value, tabstopOptions);
|
1066
|
+
|
1067
|
+
if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) {
|
1068
|
+
value += '${0}';
|
1069
|
+
} else if (lastZero) {
|
1070
|
+
var common = emmet.utils ? emmet.utils.common : emmet.require('utils');
|
1071
|
+
value = common.replaceSubstring(value, '${0}', lastZero[0], lastZero[1]);
|
1072
|
+
}
|
1073
|
+
|
1074
|
+
return value;
|
1075
|
+
}
|
1076
|
+
};
|
1077
|
+
|
1078
|
+
|
1079
|
+
var keymap = {
|
1080
|
+
expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"},
|
1081
|
+
match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"},
|
1082
|
+
match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"},
|
1083
|
+
matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"},
|
1084
|
+
next_edit_point: "alt+right",
|
1085
|
+
prev_edit_point: "alt+left",
|
1086
|
+
toggle_comment: {"mac": "command+/", "win": "ctrl+/"},
|
1087
|
+
split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"},
|
1088
|
+
remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"},
|
1089
|
+
evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"},
|
1090
|
+
increment_number_by_1: "ctrl+up",
|
1091
|
+
decrement_number_by_1: "ctrl+down",
|
1092
|
+
increment_number_by_01: "alt+up",
|
1093
|
+
decrement_number_by_01: "alt+down",
|
1094
|
+
increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"},
|
1095
|
+
decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"},
|
1096
|
+
select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."},
|
1097
|
+
select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"},
|
1098
|
+
reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"},
|
1099
|
+
|
1100
|
+
encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"},
|
1101
|
+
expand_abbreviation_with_tab: "Tab",
|
1102
|
+
wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"}
|
1103
|
+
};
|
1104
|
+
|
1105
|
+
var editorProxy = new AceEmmetEditor();
|
1106
|
+
exports.commands = new HashHandler();
|
1107
|
+
exports.runEmmetCommand = function runEmmetCommand(editor) {
|
1108
|
+
try {
|
1109
|
+
editorProxy.setupContext(editor);
|
1110
|
+
var actions = emmet.actions || emmet.require("actions");
|
1111
|
+
|
1112
|
+
if (this.action == "expand_abbreviation_with_tab") {
|
1113
|
+
if (!editor.selection.isEmpty())
|
1114
|
+
return false;
|
1115
|
+
var pos = editor.selection.lead;
|
1116
|
+
var token = editor.session.getTokenAt(pos.row, pos.column);
|
1117
|
+
if (token && /\btag\b/.test(token.type))
|
1118
|
+
return false;
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
if (this.action == "wrap_with_abbreviation") {
|
1122
|
+
return setTimeout(function() {
|
1123
|
+
actions.run("wrap_with_abbreviation", editorProxy);
|
1124
|
+
}, 0);
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
var result = actions.run(this.action, editorProxy);
|
1128
|
+
} catch(e) {
|
1129
|
+
if (!emmet) {
|
1130
|
+
exports.load(runEmmetCommand.bind(this, editor));
|
1131
|
+
return true;
|
1132
|
+
}
|
1133
|
+
editor._signal("changeStatus", typeof e == "string" ? e : e.message);
|
1134
|
+
console.log(e);
|
1135
|
+
result = false;
|
1136
|
+
}
|
1137
|
+
return result;
|
1138
|
+
};
|
1139
|
+
|
1140
|
+
for (var command in keymap) {
|
1141
|
+
exports.commands.addCommand({
|
1142
|
+
name: "emmet:" + command,
|
1143
|
+
action: command,
|
1144
|
+
bindKey: keymap[command],
|
1145
|
+
exec: exports.runEmmetCommand,
|
1146
|
+
multiSelectAction: "forEach"
|
1147
|
+
});
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
exports.updateCommands = function(editor, enabled) {
|
1151
|
+
if (enabled) {
|
1152
|
+
editor.keyBinding.addKeyboardHandler(exports.commands);
|
1153
|
+
} else {
|
1154
|
+
editor.keyBinding.removeKeyboardHandler(exports.commands);
|
1155
|
+
}
|
1156
|
+
};
|
1157
|
+
|
1158
|
+
exports.isSupportedMode = function(mode) {
|
1159
|
+
if (!mode) return false;
|
1160
|
+
if (mode.emmetConfig) return true;
|
1161
|
+
var id = mode.$id || mode;
|
1162
|
+
return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id);
|
1163
|
+
};
|
1164
|
+
|
1165
|
+
exports.isAvailable = function(editor, command) {
|
1166
|
+
if (/(evaluate_math_expression|expand_abbreviation)$/.test(command))
|
1167
|
+
return true;
|
1168
|
+
var mode = editor.session.$mode;
|
1169
|
+
var isSupported = exports.isSupportedMode(mode);
|
1170
|
+
if (isSupported && mode.$modes) {
|
1171
|
+
try {
|
1172
|
+
editorProxy.setupContext(editor);
|
1173
|
+
if (/js|php/.test(editorProxy.getSyntax()))
|
1174
|
+
isSupported = false;
|
1175
|
+
} catch(e) {}
|
1176
|
+
}
|
1177
|
+
return isSupported;
|
1178
|
+
};
|
1179
|
+
|
1180
|
+
var onChangeMode = function(e, target) {
|
1181
|
+
var editor = target;
|
1182
|
+
if (!editor)
|
1183
|
+
return;
|
1184
|
+
var enabled = exports.isSupportedMode(editor.session.$mode);
|
1185
|
+
if (e.enableEmmet === false)
|
1186
|
+
enabled = false;
|
1187
|
+
if (enabled)
|
1188
|
+
exports.load();
|
1189
|
+
exports.updateCommands(editor, enabled);
|
1190
|
+
};
|
1191
|
+
|
1192
|
+
exports.load = function(cb) {
|
1193
|
+
if (typeof emmetPath == "string") {
|
1194
|
+
require("ace/config").loadModule(emmetPath, function() {
|
1195
|
+
emmetPath = null;
|
1196
|
+
cb && cb();
|
1197
|
+
});
|
1198
|
+
}
|
1199
|
+
};
|
1200
|
+
|
1201
|
+
exports.AceEmmetEditor = AceEmmetEditor;
|
1202
|
+
require("ace/config").defineOptions(Editor.prototype, "editor", {
|
1203
|
+
enableEmmet: {
|
1204
|
+
set: function(val) {
|
1205
|
+
this[val ? "on" : "removeListener"]("changeMode", onChangeMode);
|
1206
|
+
onChangeMode({enableEmmet: !!val}, this);
|
1207
|
+
},
|
1208
|
+
value: true
|
1209
|
+
}
|
1210
|
+
});
|
1211
|
+
|
1212
|
+
exports.setCore = function(e) {
|
1213
|
+
if (typeof e == "string")
|
1214
|
+
emmetPath = e;
|
1215
|
+
else
|
1216
|
+
emmet = e;
|
1217
|
+
};
|
1218
|
+
});
|
1219
|
+
(function() {
|
1220
|
+
window.require(["ace/ext/emmet"], function(m) {
|
1221
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
1222
|
+
module.exports = m;
|
1223
|
+
}
|
1224
|
+
});
|
1225
|
+
})();
|
1226
|
+
|