mosaico 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +7 -0
- data/LICENSE +680 -0
- data/README.md +179 -0
- data/Rakefile +5 -0
- data/app/assets/images/mosaico/logo_transparent.png +0 -0
- data/app/assets/javascripts/mosaico/application.js.erb +51 -0
- data/app/assets/javascripts/mosaico/plugins/debug.js.erb +10 -0
- data/app/assets/javascripts/mosaico/plugins/logo.js.erb +10 -0
- data/app/assets/javascripts/mosaico/plugins/preview.js +85 -0
- data/app/assets/javascripts/mosaico/plugins/save.js.erb +72 -0
- data/app/assets/javascripts/mosaico/plugins/template_path.js.erb +22 -0
- data/app/assets/javascripts/mosaico/plugins/translations.js +10 -0
- data/app/assets/javascripts/mosaico/utilities.js +25 -0
- data/app/assets/stylesheets/mosaico/application.css +6 -0
- data/app/controllers/mosaico/application_controller.rb +17 -0
- data/app/controllers/mosaico/images_controller.rb +142 -0
- data/app/controllers/mosaico/projects_controller.rb +31 -0
- data/app/controllers/mosaico/templates_controller.rb +8 -0
- data/app/helpers/mosaico/application_helper.rb +7 -0
- data/app/models/mosaico/image.rb +9 -0
- data/app/models/mosaico/placeholder_image.rb +9 -0
- data/app/models/mosaico/project.rb +13 -0
- data/app/models/mosaico/uploaded_image.rb +26 -0
- data/app/views/layouts/mosaico/application.html.erb +13 -0
- data/app/views/mosaico/projects/new.html.erb +1 -0
- data/app/views/mosaico/projects/show.html.erb +1 -0
- data/app/views/mosaico/shared/_metadata.html.erb +12 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20170817202255_add_images.rb +14 -0
- data/db/migrate/20170824233755_add_projects.rb +11 -0
- data/lib/mosaico.rb +100 -0
- data/lib/mosaico/engine.rb +72 -0
- data/lib/mosaico/local_backend.rb +23 -0
- data/lib/mosaico/local_image_backend.rb +7 -0
- data/lib/mosaico/local_placeholder_backend.rb +7 -0
- data/lib/mosaico/placeholder.png +0 -0
- data/lib/mosaico/template.rb +89 -0
- data/lib/mosaico/versafix_template.rb +43 -0
- data/lib/mosaico/version.rb +4 -0
- data/lib/tasks/makeThumbs.js.erb +57 -0
- data/lib/tasks/thumbs.rake +35 -0
- data/mosaico.gemspec +22 -0
- data/screenshot.png +0 -0
- data/vendor/assets/fonts/LiberationSans-Regular.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.jsbeautifyrc +6 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.jshintrc +8 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.travis.yml +6 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/CONTRIBUTING.md +37 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/Dockerfile +21 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/Gruntfile.js +241 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/LICENSE +680 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/NOTICE.txt +87 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/README.md +73 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/backend/README.txt +23 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/backend/main.js +162 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/bower.json +76 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico-material.css +7425 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.css +7133 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.debug.js +1517 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.js +12828 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/templates.js +15 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.svg +685 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/byvoxmail.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-badge.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-v.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico32.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaicologo.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot-orig.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/README.md +26 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-de.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-en.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-es.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-fr.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-it.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-nl.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-sv.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js +1517 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js.map +147 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/canvas-to-blob.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.css +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.js +13 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-image.js +324 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-process.js +175 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-validate.js +122 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload.js +1482 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.iframe-transport.js +217 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.js +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.ui.touch-punch.min.js +11 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout-jqueryui.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/load-image.all.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/stylesheet.css +9 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.js +55 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.js +204 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.js +162 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.js +165 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.js +462 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.js +60 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/css/prism.css +138 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.js +1319 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.js +112 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.js +100 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.js +64 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.js +65 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.js +490 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.js +154 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.js +30 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.js +630 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.js +2944 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.js +273 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.js +121 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.js +225 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.js +208 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.js +403 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.js +965 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/moxieplayer.swf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.js +879 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.js +53 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.js +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.js +1844 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.js +32 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.js +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.js +609 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.js +1031 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.js +120 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.js +4400 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.js +276 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.js +297 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.js +268 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/css/visualblocks.css +135 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.js +86 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.js +69 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/Variables.less +196 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/readme.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.json +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.svg +129 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.js +1828 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.js +934 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/tinymce.min.js +14 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/editor.html +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/favicon.ico +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/index.html +368 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/package.json +92 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/byvoxmail.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-badge.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-v.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico32.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaicologo.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot-orig.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/README.md +26 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-de.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-en.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-es.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-fr.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-it.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-nl.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-sv.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/Variables.less +196 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/readme.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.json +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/server-config.js +12 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/converter-spec.js +115 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/data/template-versafix-1.model.json +137 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/declarations-spec.js +282 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/mensch-spec.js +114 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/model-spec.js +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/stylesheet-spec.js +177 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone.less +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone_material.less +350 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/safarihack.css +17 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements.less +497 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_jquery.less +344 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_mixins.less +406 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_moxie.less +130 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico.less +529 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_content.less +391 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_tools.less +1043 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_reset.less +45 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_variables.less +156 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/app.js +167 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/bind-iframe.js +64 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/blocks.js +118 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/choose-template.js +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/colorpicker.js +58 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/csstext.js +16 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/droppable.js +87 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/eventable.js +33 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extender-pagination.js +60 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extsortables.js +103 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/fileupload.js +373 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/if-subs.js +110 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-spinner.js +31 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-tabs.js +17 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/script-template.js +30 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollfix.js +48 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollintoview.js +83 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/string-template.js +76 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/tooltips.js +36 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/validated-value.js +40 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/virtuals.js +102 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/wysiwygs.js +304 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/checkmodel.js +114 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/declarations.js +279 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/domutils.js +93 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/editor.js +411 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/main.js +42 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/model.js +536 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/parser.js +485 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/stylesheet.js +205 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/utils.js +156 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/wrapper.js +308 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/color.js +53 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/inliner.js +35 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/localstorage.js +100 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ko-bindings.js +22 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/template-loader.js +446 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/timed-call.js +31 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undomain.js +49 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undoserializer.js +120 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/viewmodel.js +595 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/array.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-show.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-wysiwyg.tmpl.html +18 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-show.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-wysiwyg.tmpl.html +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/customstyle.tmpl.html +3 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/empty.tmpl.html +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/error.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/gallery-images.tmpl.html +16 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/img-wysiwyg.tmpl.html +43 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/main.tmpl.html +102 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/toolbox.tmpl.html +111 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/combineKOTemplates.js +24 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/lib/phantom-thumbnailer-editor.js +168 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/makeThumbs.js +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/README.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/footerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/headerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/heroBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/socialBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/threetwoBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/twoColumnBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/template-tedc15.html +567 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/HeaderAndText.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/fixedlist.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.md +335 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.pdf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_384.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_385.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_386.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_387.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_407.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_408.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/template-tutorial.html +68 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/buttonBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleImageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/hrBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/imageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/logoBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/sideArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/singleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/socialBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/spacerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/textBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/titleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleImageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/sponsor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/template-versafix-1.html +1531 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/uploads/README.md +1 -0
- metadata +536 -0
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):"function"==typeof n?n(t):t(n)}}function n(e,t,n){function r(e,n){return n=n||[],tinymce.each(e,function(e){var i={text:e.text||e.title};e.menu?i.menu=r(e.menu):(i.value=e.value,t&&t(i)),n.push(i)}),n}return r(e,n||[])}function r(t){function r(e){var t=d.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),d.find("#href").value(e.control.value())}function i(t){var n=[];if(tinymce.each(e.dom.select("a:not([href])"),function(e){var r=e.name||e.id;r&&n.push({text:r,value:"#"+r,selected:t.indexOf("#"+r)!=-1})}),n.length)return n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:r}}function o(){!u&&0===C.text.length&&f&&this.parent().parent().find("#text")[0].value(this.value())}function a(t){var n=t.meta||{};p&&p.value(e.convertURL(this.value(),"href")),tinymce.each(t.meta,function(e,t){d.find("#"+t).value(e)}),n.text||o.call(this)}function s(e){var t=x.getContent();if(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||t.indexOf("href=")==-1))return!1;if(e){var n,r=e.childNodes;if(0===r.length)return!1;for(n=r.length-1;n>=0;n--)if(3!=r[n].nodeType)return!1}return!0}var l,c,u,d,f,h,p,m,g,v,y,b,C={},x=e.selection,w=e.dom;l=x.getNode(),c=w.getParent(l,"a[href]"),f=s(),C.text=u=c?c.innerText||c.textContent:x.getContent({format:"text"}),C.href=c?w.getAttrib(c,"href"):"",c?C.target=w.getAttrib(c,"target"):e.settings.default_link_target&&(C.target=e.settings.default_link_target),(b=w.getAttrib(c,"rel"))&&(C.rel=b),(b=w.getAttrib(c,"class"))&&(C.class=b),(b=w.getAttrib(c,"title"))&&(C.title=b),f&&(h={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){C.text=this.value()}}),t&&(p={type:"listbox",label:"Link list",values:n(t,function(t){t.value=e.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:r,value:e.convertURL(C.href,"href"),onPostRender:function(){p=this}}),e.settings.target_list!==!1&&(e.settings.target_list||(e.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),g={name:"target",type:"listbox",label:"Target",values:n(e.settings.target_list)}),e.settings.rel_list&&(m={name:"rel",type:"listbox",label:"Rel",values:n(e.settings.rel_list)}),e.settings.link_class_list&&(v={name:"class",type:"listbox",label:"Class",values:n(e.settings.link_class_list,function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"a",classes:[t.value]})})})}),e.settings.link_title!==!1&&(y={name:"title",type:"textbox",label:"Title",value:C.title}),d=e.windowManager.open({title:"Insert link",data:C,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:a,onkeyup:o},h,y,i(C.href),p,m,g,v],onSubmit:function(t){function n(t,n){var r=e.selection.getRng();tinymce.util.Delay.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(r),n(t)})})}function r(){var t={href:i,target:C.target?C.target:null,rel:C.rel?C.rel:null,class:C.class?C.class:null,title:C.title?C.title:null};c?(e.focus(),f&&C.text!=u&&("innerText"in c?c.innerText=C.text:c.textContent=C.text),w.setAttribs(c,t),x.select(c),e.undoManager.add()):f?e.insertContent(w.createHTML("a",t,w.encode(C.text))):e.execCommand("mceInsertLink",!1,t)}var i;return C=tinymce.extend(C,t.data),(i=C.href)?i.indexOf("@")>0&&i.indexOf("//")==-1&&i.indexOf("mailto:")==-1?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(i="mailto:"+i),r()}):e.settings.link_assume_external_targets&&!/^\w+:/i.test(i)||!e.settings.link_assume_external_targets&&/^\s*www[\.|\d\.]/i.test(i)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(i="http://"+i),r()}):void r():void e.execCommand("unlink")}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:t(r),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Meta+K","",t(r)),e.addCommand("mceLink",t(r)),this.showDialog=r,e.addMenuItem("link",{icon:"link",text:"Insert/edit link",shortcut:"Meta+K",onclick:t(r),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
|
@@ -0,0 +1,965 @@
|
|
1
|
+
/**
|
2
|
+
* plugin.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/*global tinymce:true */
|
12
|
+
/*eslint consistent-this:0 */
|
13
|
+
|
14
|
+
tinymce.PluginManager.add('lists', function(editor) {
|
15
|
+
var self = this;
|
16
|
+
|
17
|
+
function isChildOfBody(elm) {
|
18
|
+
return editor.$.contains(editor.getBody(), elm);
|
19
|
+
}
|
20
|
+
|
21
|
+
function isBr(node) {
|
22
|
+
return node && node.nodeName == 'BR';
|
23
|
+
}
|
24
|
+
|
25
|
+
function isListNode(node) {
|
26
|
+
return node && (/^(OL|UL|DL)$/).test(node.nodeName) && isChildOfBody(node);
|
27
|
+
}
|
28
|
+
|
29
|
+
function isListItemNode(node) {
|
30
|
+
return node && /^(LI|DT|DD)$/.test(node.nodeName);
|
31
|
+
}
|
32
|
+
|
33
|
+
function isFirstChild(node) {
|
34
|
+
return node.parentNode.firstChild == node;
|
35
|
+
}
|
36
|
+
|
37
|
+
function isLastChild(node) {
|
38
|
+
return node.parentNode.lastChild == node;
|
39
|
+
}
|
40
|
+
|
41
|
+
function isTextBlock(node) {
|
42
|
+
return node && !!editor.schema.getTextBlockElements()[node.nodeName];
|
43
|
+
}
|
44
|
+
|
45
|
+
function isEditorBody(elm) {
|
46
|
+
return elm === editor.getBody();
|
47
|
+
}
|
48
|
+
|
49
|
+
function isTextNode(node) {
|
50
|
+
return node && node.nodeType === 3;
|
51
|
+
}
|
52
|
+
|
53
|
+
function getNormalizedEndPoint(container, offset) {
|
54
|
+
var node = tinymce.dom.RangeUtils.getNode(container, offset);
|
55
|
+
|
56
|
+
if (isListItemNode(container) && isTextNode(node)) {
|
57
|
+
var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0;
|
58
|
+
return {container: node, offset: textNodeOffset};
|
59
|
+
}
|
60
|
+
|
61
|
+
return {container: container, offset: offset};
|
62
|
+
}
|
63
|
+
|
64
|
+
function normalizeRange(rng) {
|
65
|
+
var outRng = rng.cloneRange();
|
66
|
+
|
67
|
+
var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset);
|
68
|
+
outRng.setStart(rangeStart.container, rangeStart.offset);
|
69
|
+
|
70
|
+
var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset);
|
71
|
+
outRng.setEnd(rangeEnd.container, rangeEnd.offset);
|
72
|
+
|
73
|
+
return outRng;
|
74
|
+
}
|
75
|
+
|
76
|
+
editor.on('init', function() {
|
77
|
+
var dom = editor.dom, selection = editor.selection;
|
78
|
+
|
79
|
+
function isEmpty(elm, keepBookmarks) {
|
80
|
+
var empty = dom.isEmpty(elm);
|
81
|
+
|
82
|
+
if (keepBookmarks && dom.select('span[data-mce-type=bookmark]').length > 0) {
|
83
|
+
return false;
|
84
|
+
}
|
85
|
+
|
86
|
+
return empty;
|
87
|
+
}
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
|
91
|
+
* index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
|
92
|
+
* added to them since they can be restored after a dom operation.
|
93
|
+
*
|
94
|
+
* So this: <p><b>|</b><b>|</b></p>
|
95
|
+
* becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
|
96
|
+
*
|
97
|
+
* @param {DOMRange} rng DOM Range to get bookmark on.
|
98
|
+
* @return {Object} Bookmark object.
|
99
|
+
*/
|
100
|
+
function createBookmark(rng) {
|
101
|
+
var bookmark = {};
|
102
|
+
|
103
|
+
function setupEndPoint(start) {
|
104
|
+
var offsetNode, container, offset;
|
105
|
+
|
106
|
+
container = rng[start ? 'startContainer' : 'endContainer'];
|
107
|
+
offset = rng[start ? 'startOffset' : 'endOffset'];
|
108
|
+
|
109
|
+
if (container.nodeType == 1) {
|
110
|
+
offsetNode = dom.create('span', {'data-mce-type': 'bookmark'});
|
111
|
+
|
112
|
+
if (container.hasChildNodes()) {
|
113
|
+
offset = Math.min(offset, container.childNodes.length - 1);
|
114
|
+
|
115
|
+
if (start) {
|
116
|
+
container.insertBefore(offsetNode, container.childNodes[offset]);
|
117
|
+
} else {
|
118
|
+
dom.insertAfter(offsetNode, container.childNodes[offset]);
|
119
|
+
}
|
120
|
+
} else {
|
121
|
+
container.appendChild(offsetNode);
|
122
|
+
}
|
123
|
+
|
124
|
+
container = offsetNode;
|
125
|
+
offset = 0;
|
126
|
+
}
|
127
|
+
|
128
|
+
bookmark[start ? 'startContainer' : 'endContainer'] = container;
|
129
|
+
bookmark[start ? 'startOffset' : 'endOffset'] = offset;
|
130
|
+
}
|
131
|
+
|
132
|
+
setupEndPoint(true);
|
133
|
+
|
134
|
+
if (!rng.collapsed) {
|
135
|
+
setupEndPoint();
|
136
|
+
}
|
137
|
+
|
138
|
+
return bookmark;
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Moves the selection to the current bookmark and removes any selection container wrappers.
|
143
|
+
*
|
144
|
+
* @param {Object} bookmark Bookmark object to move selection to.
|
145
|
+
*/
|
146
|
+
function moveToBookmark(bookmark) {
|
147
|
+
function restoreEndPoint(start) {
|
148
|
+
var container, offset, node;
|
149
|
+
|
150
|
+
function nodeIndex(container) {
|
151
|
+
var node = container.parentNode.firstChild, idx = 0;
|
152
|
+
|
153
|
+
while (node) {
|
154
|
+
if (node == container) {
|
155
|
+
return idx;
|
156
|
+
}
|
157
|
+
|
158
|
+
// Skip data-mce-type=bookmark nodes
|
159
|
+
if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') {
|
160
|
+
idx++;
|
161
|
+
}
|
162
|
+
|
163
|
+
node = node.nextSibling;
|
164
|
+
}
|
165
|
+
|
166
|
+
return -1;
|
167
|
+
}
|
168
|
+
|
169
|
+
container = node = bookmark[start ? 'startContainer' : 'endContainer'];
|
170
|
+
offset = bookmark[start ? 'startOffset' : 'endOffset'];
|
171
|
+
|
172
|
+
if (!container) {
|
173
|
+
return;
|
174
|
+
}
|
175
|
+
|
176
|
+
if (container.nodeType == 1) {
|
177
|
+
offset = nodeIndex(container);
|
178
|
+
container = container.parentNode;
|
179
|
+
dom.remove(node);
|
180
|
+
}
|
181
|
+
|
182
|
+
bookmark[start ? 'startContainer' : 'endContainer'] = container;
|
183
|
+
bookmark[start ? 'startOffset' : 'endOffset'] = offset;
|
184
|
+
}
|
185
|
+
|
186
|
+
restoreEndPoint(true);
|
187
|
+
restoreEndPoint();
|
188
|
+
|
189
|
+
var rng = dom.createRng();
|
190
|
+
|
191
|
+
rng.setStart(bookmark.startContainer, bookmark.startOffset);
|
192
|
+
|
193
|
+
if (bookmark.endContainer) {
|
194
|
+
rng.setEnd(bookmark.endContainer, bookmark.endOffset);
|
195
|
+
}
|
196
|
+
|
197
|
+
selection.setRng(normalizeRange(rng));
|
198
|
+
}
|
199
|
+
|
200
|
+
function createNewTextBlock(contentNode, blockName) {
|
201
|
+
var node, textBlock, fragment = dom.createFragment(), hasContentNode;
|
202
|
+
var blockElements = editor.schema.getBlockElements();
|
203
|
+
|
204
|
+
if (editor.settings.forced_root_block) {
|
205
|
+
blockName = blockName || editor.settings.forced_root_block;
|
206
|
+
}
|
207
|
+
|
208
|
+
if (blockName) {
|
209
|
+
textBlock = dom.create(blockName);
|
210
|
+
|
211
|
+
if (textBlock.tagName === editor.settings.forced_root_block) {
|
212
|
+
dom.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
|
213
|
+
}
|
214
|
+
|
215
|
+
fragment.appendChild(textBlock);
|
216
|
+
}
|
217
|
+
|
218
|
+
if (contentNode) {
|
219
|
+
while ((node = contentNode.firstChild)) {
|
220
|
+
var nodeName = node.nodeName;
|
221
|
+
|
222
|
+
if (!hasContentNode && (nodeName != 'SPAN' || node.getAttribute('data-mce-type') != 'bookmark')) {
|
223
|
+
hasContentNode = true;
|
224
|
+
}
|
225
|
+
|
226
|
+
if (blockElements[nodeName]) {
|
227
|
+
fragment.appendChild(node);
|
228
|
+
textBlock = null;
|
229
|
+
} else {
|
230
|
+
if (blockName) {
|
231
|
+
if (!textBlock) {
|
232
|
+
textBlock = dom.create(blockName);
|
233
|
+
fragment.appendChild(textBlock);
|
234
|
+
}
|
235
|
+
|
236
|
+
textBlock.appendChild(node);
|
237
|
+
} else {
|
238
|
+
fragment.appendChild(node);
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
|
244
|
+
if (!editor.settings.forced_root_block) {
|
245
|
+
fragment.appendChild(dom.create('br'));
|
246
|
+
} else {
|
247
|
+
// BR is needed in empty blocks on non IE browsers
|
248
|
+
if (!hasContentNode && (!tinymce.Env.ie || tinymce.Env.ie > 10)) {
|
249
|
+
textBlock.appendChild(dom.create('br', {'data-mce-bogus': '1'}));
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
return fragment;
|
254
|
+
}
|
255
|
+
|
256
|
+
function getSelectedListItems() {
|
257
|
+
return tinymce.grep(selection.getSelectedBlocks(), function(block) {
|
258
|
+
return isListItemNode(block);
|
259
|
+
});
|
260
|
+
}
|
261
|
+
|
262
|
+
function splitList(ul, li, newBlock) {
|
263
|
+
var tmpRng, fragment, bookmarks, node;
|
264
|
+
|
265
|
+
function removeAndKeepBookmarks(targetNode) {
|
266
|
+
tinymce.each(bookmarks, function(node) {
|
267
|
+
targetNode.parentNode.insertBefore(node, li.parentNode);
|
268
|
+
});
|
269
|
+
|
270
|
+
dom.remove(targetNode);
|
271
|
+
}
|
272
|
+
|
273
|
+
bookmarks = dom.select('span[data-mce-type="bookmark"]', ul);
|
274
|
+
newBlock = newBlock || createNewTextBlock(li);
|
275
|
+
tmpRng = dom.createRng();
|
276
|
+
tmpRng.setStartAfter(li);
|
277
|
+
tmpRng.setEndAfter(ul);
|
278
|
+
fragment = tmpRng.extractContents();
|
279
|
+
|
280
|
+
for (node = fragment.firstChild; node; node = node.firstChild) {
|
281
|
+
if (node.nodeName == 'LI' && dom.isEmpty(node)) {
|
282
|
+
dom.remove(node);
|
283
|
+
break;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
if (!dom.isEmpty(fragment)) {
|
288
|
+
dom.insertAfter(fragment, ul);
|
289
|
+
}
|
290
|
+
|
291
|
+
dom.insertAfter(newBlock, ul);
|
292
|
+
|
293
|
+
if (isEmpty(li.parentNode)) {
|
294
|
+
removeAndKeepBookmarks(li.parentNode);
|
295
|
+
}
|
296
|
+
|
297
|
+
dom.remove(li);
|
298
|
+
|
299
|
+
if (isEmpty(ul)) {
|
300
|
+
dom.remove(ul);
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
var shouldMerge = function (listBlock, sibling) {
|
305
|
+
var targetStyle = editor.dom.getStyle(listBlock, 'list-style-type', true);
|
306
|
+
var style = editor.dom.getStyle(sibling, 'list-style-type', true);
|
307
|
+
return targetStyle === style;
|
308
|
+
};
|
309
|
+
|
310
|
+
function mergeWithAdjacentLists(listBlock) {
|
311
|
+
var sibling, node;
|
312
|
+
|
313
|
+
sibling = listBlock.nextSibling;
|
314
|
+
if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName && shouldMerge(listBlock, sibling)) {
|
315
|
+
while ((node = sibling.firstChild)) {
|
316
|
+
listBlock.appendChild(node);
|
317
|
+
}
|
318
|
+
|
319
|
+
dom.remove(sibling);
|
320
|
+
}
|
321
|
+
|
322
|
+
sibling = listBlock.previousSibling;
|
323
|
+
if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName && shouldMerge(listBlock, sibling)) {
|
324
|
+
while ((node = sibling.firstChild)) {
|
325
|
+
listBlock.insertBefore(node, listBlock.firstChild);
|
326
|
+
}
|
327
|
+
|
328
|
+
dom.remove(sibling);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
function normalizeLists(element) {
|
333
|
+
tinymce.each(tinymce.grep(dom.select('ol,ul', element)), normalizeList);
|
334
|
+
}
|
335
|
+
|
336
|
+
function normalizeList(ul) {
|
337
|
+
var sibling, parentNode = ul.parentNode;
|
338
|
+
|
339
|
+
// Move UL/OL to previous LI if it's the only child of a LI
|
340
|
+
if (parentNode.nodeName == 'LI' && parentNode.firstChild == ul) {
|
341
|
+
sibling = parentNode.previousSibling;
|
342
|
+
if (sibling && sibling.nodeName == 'LI') {
|
343
|
+
sibling.appendChild(ul);
|
344
|
+
|
345
|
+
if (isEmpty(parentNode)) {
|
346
|
+
dom.remove(parentNode);
|
347
|
+
}
|
348
|
+
} else {
|
349
|
+
dom.setStyle(parentNode, 'listStyleType', 'none');
|
350
|
+
}
|
351
|
+
}
|
352
|
+
|
353
|
+
// Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4
|
354
|
+
if (isListNode(parentNode)) {
|
355
|
+
sibling = parentNode.previousSibling;
|
356
|
+
if (sibling && sibling.nodeName == 'LI') {
|
357
|
+
sibling.appendChild(ul);
|
358
|
+
}
|
359
|
+
}
|
360
|
+
}
|
361
|
+
|
362
|
+
function outdent(li) {
|
363
|
+
var ul = li.parentNode, ulParent = ul.parentNode, newBlock;
|
364
|
+
|
365
|
+
function removeEmptyLi(li) {
|
366
|
+
if (isEmpty(li)) {
|
367
|
+
dom.remove(li);
|
368
|
+
}
|
369
|
+
}
|
370
|
+
|
371
|
+
if (isEditorBody(ul)) {
|
372
|
+
return true;
|
373
|
+
}
|
374
|
+
|
375
|
+
if (li.nodeName == 'DD') {
|
376
|
+
dom.rename(li, 'DT');
|
377
|
+
return true;
|
378
|
+
}
|
379
|
+
|
380
|
+
if (isFirstChild(li) && isLastChild(li)) {
|
381
|
+
if (ulParent.nodeName == "LI") {
|
382
|
+
dom.insertAfter(li, ulParent);
|
383
|
+
removeEmptyLi(ulParent);
|
384
|
+
dom.remove(ul);
|
385
|
+
} else if (isListNode(ulParent)) {
|
386
|
+
dom.remove(ul, true);
|
387
|
+
} else {
|
388
|
+
ulParent.insertBefore(createNewTextBlock(li), ul);
|
389
|
+
dom.remove(ul);
|
390
|
+
}
|
391
|
+
|
392
|
+
return true;
|
393
|
+
} else if (isFirstChild(li)) {
|
394
|
+
if (ulParent.nodeName == "LI") {
|
395
|
+
dom.insertAfter(li, ulParent);
|
396
|
+
li.appendChild(ul);
|
397
|
+
removeEmptyLi(ulParent);
|
398
|
+
} else if (isListNode(ulParent)) {
|
399
|
+
ulParent.insertBefore(li, ul);
|
400
|
+
} else {
|
401
|
+
ulParent.insertBefore(createNewTextBlock(li), ul);
|
402
|
+
dom.remove(li);
|
403
|
+
}
|
404
|
+
|
405
|
+
return true;
|
406
|
+
} else if (isLastChild(li)) {
|
407
|
+
if (ulParent.nodeName == "LI") {
|
408
|
+
dom.insertAfter(li, ulParent);
|
409
|
+
} else if (isListNode(ulParent)) {
|
410
|
+
dom.insertAfter(li, ul);
|
411
|
+
} else {
|
412
|
+
dom.insertAfter(createNewTextBlock(li), ul);
|
413
|
+
dom.remove(li);
|
414
|
+
}
|
415
|
+
|
416
|
+
return true;
|
417
|
+
}
|
418
|
+
|
419
|
+
if (ulParent.nodeName == 'LI') {
|
420
|
+
ul = ulParent;
|
421
|
+
newBlock = createNewTextBlock(li, 'LI');
|
422
|
+
} else if (isListNode(ulParent)) {
|
423
|
+
newBlock = createNewTextBlock(li, 'LI');
|
424
|
+
} else {
|
425
|
+
newBlock = createNewTextBlock(li);
|
426
|
+
}
|
427
|
+
|
428
|
+
splitList(ul, li, newBlock);
|
429
|
+
normalizeLists(ul.parentNode);
|
430
|
+
|
431
|
+
return true;
|
432
|
+
}
|
433
|
+
|
434
|
+
function indent(li) {
|
435
|
+
var sibling, newList, listStyle;
|
436
|
+
|
437
|
+
function mergeLists(from, to) {
|
438
|
+
var node;
|
439
|
+
|
440
|
+
if (isListNode(from)) {
|
441
|
+
while ((node = li.lastChild.firstChild)) {
|
442
|
+
to.appendChild(node);
|
443
|
+
}
|
444
|
+
|
445
|
+
dom.remove(from);
|
446
|
+
}
|
447
|
+
}
|
448
|
+
|
449
|
+
if (li.nodeName == 'DT') {
|
450
|
+
dom.rename(li, 'DD');
|
451
|
+
return true;
|
452
|
+
}
|
453
|
+
|
454
|
+
sibling = li.previousSibling;
|
455
|
+
|
456
|
+
if (sibling && isListNode(sibling)) {
|
457
|
+
sibling.appendChild(li);
|
458
|
+
return true;
|
459
|
+
}
|
460
|
+
|
461
|
+
if (sibling && sibling.nodeName == 'LI' && isListNode(sibling.lastChild)) {
|
462
|
+
sibling.lastChild.appendChild(li);
|
463
|
+
mergeLists(li.lastChild, sibling.lastChild);
|
464
|
+
return true;
|
465
|
+
}
|
466
|
+
|
467
|
+
sibling = li.nextSibling;
|
468
|
+
|
469
|
+
if (sibling && isListNode(sibling)) {
|
470
|
+
sibling.insertBefore(li, sibling.firstChild);
|
471
|
+
return true;
|
472
|
+
}
|
473
|
+
|
474
|
+
/*if (sibling && sibling.nodeName == 'LI' && isListNode(li.lastChild)) {
|
475
|
+
return false;
|
476
|
+
}*/
|
477
|
+
|
478
|
+
sibling = li.previousSibling;
|
479
|
+
if (sibling && sibling.nodeName == 'LI') {
|
480
|
+
newList = dom.create(li.parentNode.nodeName);
|
481
|
+
listStyle = dom.getStyle(li.parentNode, 'listStyleType');
|
482
|
+
if (listStyle) {
|
483
|
+
dom.setStyle(newList, 'listStyleType', listStyle);
|
484
|
+
}
|
485
|
+
sibling.appendChild(newList);
|
486
|
+
newList.appendChild(li);
|
487
|
+
mergeLists(li.lastChild, newList);
|
488
|
+
return true;
|
489
|
+
}
|
490
|
+
|
491
|
+
return false;
|
492
|
+
}
|
493
|
+
|
494
|
+
function indentSelection() {
|
495
|
+
var listElements = getSelectedListItems();
|
496
|
+
|
497
|
+
if (listElements.length) {
|
498
|
+
var bookmark = createBookmark(selection.getRng(true));
|
499
|
+
|
500
|
+
for (var i = 0; i < listElements.length; i++) {
|
501
|
+
if (!indent(listElements[i]) && i === 0) {
|
502
|
+
break;
|
503
|
+
}
|
504
|
+
}
|
505
|
+
|
506
|
+
moveToBookmark(bookmark);
|
507
|
+
editor.nodeChanged();
|
508
|
+
|
509
|
+
return true;
|
510
|
+
}
|
511
|
+
}
|
512
|
+
|
513
|
+
function outdentSelection() {
|
514
|
+
var listElements = getSelectedListItems();
|
515
|
+
|
516
|
+
if (listElements.length) {
|
517
|
+
var bookmark = createBookmark(selection.getRng(true));
|
518
|
+
var i, y, root = editor.getBody();
|
519
|
+
|
520
|
+
i = listElements.length;
|
521
|
+
while (i--) {
|
522
|
+
var node = listElements[i].parentNode;
|
523
|
+
|
524
|
+
while (node && node != root) {
|
525
|
+
y = listElements.length;
|
526
|
+
while (y--) {
|
527
|
+
if (listElements[y] === node) {
|
528
|
+
listElements.splice(i, 1);
|
529
|
+
break;
|
530
|
+
}
|
531
|
+
}
|
532
|
+
|
533
|
+
node = node.parentNode;
|
534
|
+
}
|
535
|
+
}
|
536
|
+
|
537
|
+
for (i = 0; i < listElements.length; i++) {
|
538
|
+
if (!outdent(listElements[i]) && i === 0) {
|
539
|
+
break;
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
moveToBookmark(bookmark);
|
544
|
+
editor.nodeChanged();
|
545
|
+
|
546
|
+
return true;
|
547
|
+
}
|
548
|
+
}
|
549
|
+
|
550
|
+
function applyList(listName, detail) {
|
551
|
+
var rng = selection.getRng(true), bookmark, listItemName = 'LI';
|
552
|
+
|
553
|
+
if (dom.getContentEditable(selection.getNode()) === "false") {
|
554
|
+
return;
|
555
|
+
}
|
556
|
+
|
557
|
+
listName = listName.toUpperCase();
|
558
|
+
|
559
|
+
if (listName == 'DL') {
|
560
|
+
listItemName = 'DT';
|
561
|
+
}
|
562
|
+
|
563
|
+
function getSelectedTextBlocks() {
|
564
|
+
var textBlocks = [], root = editor.getBody();
|
565
|
+
|
566
|
+
function getEndPointNode(start) {
|
567
|
+
var container, offset;
|
568
|
+
|
569
|
+
container = rng[start ? 'startContainer' : 'endContainer'];
|
570
|
+
offset = rng[start ? 'startOffset' : 'endOffset'];
|
571
|
+
|
572
|
+
// Resolve node index
|
573
|
+
if (container.nodeType == 1) {
|
574
|
+
container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
|
575
|
+
}
|
576
|
+
|
577
|
+
while (container.parentNode != root) {
|
578
|
+
if (isTextBlock(container)) {
|
579
|
+
return container;
|
580
|
+
}
|
581
|
+
|
582
|
+
if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
|
583
|
+
return container;
|
584
|
+
}
|
585
|
+
|
586
|
+
container = container.parentNode;
|
587
|
+
}
|
588
|
+
|
589
|
+
return container;
|
590
|
+
}
|
591
|
+
|
592
|
+
var startNode = getEndPointNode(true);
|
593
|
+
var endNode = getEndPointNode();
|
594
|
+
var block, siblings = [];
|
595
|
+
|
596
|
+
for (var node = startNode; node; node = node.nextSibling) {
|
597
|
+
siblings.push(node);
|
598
|
+
|
599
|
+
if (node == endNode) {
|
600
|
+
break;
|
601
|
+
}
|
602
|
+
}
|
603
|
+
|
604
|
+
tinymce.each(siblings, function(node) {
|
605
|
+
if (isTextBlock(node)) {
|
606
|
+
textBlocks.push(node);
|
607
|
+
block = null;
|
608
|
+
return;
|
609
|
+
}
|
610
|
+
|
611
|
+
if (dom.isBlock(node) || isBr(node)) {
|
612
|
+
if (isBr(node)) {
|
613
|
+
dom.remove(node);
|
614
|
+
}
|
615
|
+
|
616
|
+
block = null;
|
617
|
+
return;
|
618
|
+
}
|
619
|
+
|
620
|
+
var nextSibling = node.nextSibling;
|
621
|
+
if (tinymce.dom.BookmarkManager.isBookmarkNode(node)) {
|
622
|
+
if (isTextBlock(nextSibling) || (!nextSibling && node.parentNode == root)) {
|
623
|
+
block = null;
|
624
|
+
return;
|
625
|
+
}
|
626
|
+
}
|
627
|
+
|
628
|
+
if (!block) {
|
629
|
+
block = dom.create('p');
|
630
|
+
node.parentNode.insertBefore(block, node);
|
631
|
+
textBlocks.push(block);
|
632
|
+
}
|
633
|
+
|
634
|
+
block.appendChild(node);
|
635
|
+
});
|
636
|
+
|
637
|
+
return textBlocks;
|
638
|
+
}
|
639
|
+
|
640
|
+
bookmark = createBookmark(rng);
|
641
|
+
|
642
|
+
tinymce.each(getSelectedTextBlocks(), function(block) {
|
643
|
+
var listBlock, sibling;
|
644
|
+
|
645
|
+
var hasCompatibleStyle = function (sib) {
|
646
|
+
var sibStyle = dom.getStyle(sib, 'list-style-type');
|
647
|
+
var detailStyle = detail ? detail['list-style-type'] : '';
|
648
|
+
|
649
|
+
detailStyle = detailStyle === null ? '' : detailStyle;
|
650
|
+
|
651
|
+
return sibStyle === detailStyle;
|
652
|
+
};
|
653
|
+
|
654
|
+
sibling = block.previousSibling;
|
655
|
+
if (sibling && isListNode(sibling) && sibling.nodeName == listName && hasCompatibleStyle(sibling)) {
|
656
|
+
listBlock = sibling;
|
657
|
+
block = dom.rename(block, listItemName);
|
658
|
+
sibling.appendChild(block);
|
659
|
+
} else {
|
660
|
+
listBlock = dom.create(listName);
|
661
|
+
block.parentNode.insertBefore(listBlock, block);
|
662
|
+
listBlock.appendChild(block);
|
663
|
+
block = dom.rename(block, listItemName);
|
664
|
+
}
|
665
|
+
|
666
|
+
updateListStyle(listBlock, detail);
|
667
|
+
mergeWithAdjacentLists(listBlock);
|
668
|
+
});
|
669
|
+
|
670
|
+
moveToBookmark(bookmark);
|
671
|
+
}
|
672
|
+
|
673
|
+
var updateListStyle = function (el, detail) {
|
674
|
+
dom.setStyle(el, 'list-style-type', detail ? detail['list-style-type'] : null);
|
675
|
+
};
|
676
|
+
|
677
|
+
function removeList() {
|
678
|
+
var bookmark = createBookmark(selection.getRng(true)), root = editor.getBody();
|
679
|
+
|
680
|
+
tinymce.each(getSelectedListItems(), function(li) {
|
681
|
+
var node, rootList;
|
682
|
+
|
683
|
+
if (isEditorBody(li.parentNode)) {
|
684
|
+
return;
|
685
|
+
}
|
686
|
+
|
687
|
+
if (isEmpty(li)) {
|
688
|
+
outdent(li);
|
689
|
+
return;
|
690
|
+
}
|
691
|
+
|
692
|
+
for (node = li; node && node != root; node = node.parentNode) {
|
693
|
+
if (isListNode(node)) {
|
694
|
+
rootList = node;
|
695
|
+
}
|
696
|
+
}
|
697
|
+
|
698
|
+
splitList(rootList, li);
|
699
|
+
normalizeLists(rootList.parentNode);
|
700
|
+
});
|
701
|
+
|
702
|
+
moveToBookmark(bookmark);
|
703
|
+
}
|
704
|
+
|
705
|
+
function toggleList(listName, detail) {
|
706
|
+
var parentList = dom.getParent(selection.getStart(), 'OL,UL,DL');
|
707
|
+
|
708
|
+
if (isEditorBody(parentList)) {
|
709
|
+
return;
|
710
|
+
}
|
711
|
+
|
712
|
+
if (parentList) {
|
713
|
+
if (parentList.nodeName == listName) {
|
714
|
+
removeList(listName);
|
715
|
+
} else {
|
716
|
+
var bookmark = createBookmark(selection.getRng(true));
|
717
|
+
updateListStyle(parentList, detail);
|
718
|
+
mergeWithAdjacentLists(dom.rename(parentList, listName));
|
719
|
+
|
720
|
+
moveToBookmark(bookmark);
|
721
|
+
}
|
722
|
+
} else {
|
723
|
+
applyList(listName, detail);
|
724
|
+
}
|
725
|
+
}
|
726
|
+
|
727
|
+
function queryListCommandState(listName) {
|
728
|
+
return function() {
|
729
|
+
var parentList = dom.getParent(editor.selection.getStart(), 'UL,OL,DL');
|
730
|
+
|
731
|
+
return parentList && parentList.nodeName == listName;
|
732
|
+
};
|
733
|
+
}
|
734
|
+
|
735
|
+
function isBogusBr(node) {
|
736
|
+
if (!isBr(node)) {
|
737
|
+
return false;
|
738
|
+
}
|
739
|
+
|
740
|
+
if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) {
|
741
|
+
return true;
|
742
|
+
}
|
743
|
+
|
744
|
+
return false;
|
745
|
+
}
|
746
|
+
|
747
|
+
function findNextCaretContainer(rng, isForward) {
|
748
|
+
var node = rng.startContainer, offset = rng.startOffset;
|
749
|
+
var nonEmptyBlocks, walker;
|
750
|
+
|
751
|
+
if (node.nodeType == 3 && (isForward ? offset < node.data.length : offset > 0)) {
|
752
|
+
return node;
|
753
|
+
}
|
754
|
+
|
755
|
+
nonEmptyBlocks = editor.schema.getNonEmptyElements();
|
756
|
+
if (node.nodeType == 1) {
|
757
|
+
node = tinymce.dom.RangeUtils.getNode(node, offset);
|
758
|
+
}
|
759
|
+
|
760
|
+
walker = new tinymce.dom.TreeWalker(node, editor.getBody());
|
761
|
+
|
762
|
+
// Delete at <li>|<br></li> then jump over the bogus br
|
763
|
+
if (isForward) {
|
764
|
+
if (isBogusBr(node)) {
|
765
|
+
walker.next();
|
766
|
+
}
|
767
|
+
}
|
768
|
+
|
769
|
+
while ((node = walker[isForward ? 'next' : 'prev2']())) {
|
770
|
+
if (node.nodeName == 'LI' && !node.hasChildNodes()) {
|
771
|
+
return node;
|
772
|
+
}
|
773
|
+
|
774
|
+
if (nonEmptyBlocks[node.nodeName]) {
|
775
|
+
return node;
|
776
|
+
}
|
777
|
+
|
778
|
+
if (node.nodeType == 3 && node.data.length > 0) {
|
779
|
+
return node;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
}
|
783
|
+
|
784
|
+
function mergeLiElements(fromElm, toElm) {
|
785
|
+
var node, listNode, ul = fromElm.parentNode;
|
786
|
+
|
787
|
+
if (!isChildOfBody(fromElm) || !isChildOfBody(toElm)) {
|
788
|
+
return;
|
789
|
+
}
|
790
|
+
|
791
|
+
if (isListNode(toElm.lastChild)) {
|
792
|
+
listNode = toElm.lastChild;
|
793
|
+
}
|
794
|
+
|
795
|
+
if (ul == toElm.lastChild) {
|
796
|
+
if (isBr(ul.previousSibling)) {
|
797
|
+
dom.remove(ul.previousSibling);
|
798
|
+
}
|
799
|
+
}
|
800
|
+
|
801
|
+
node = toElm.lastChild;
|
802
|
+
if (node && isBr(node) && fromElm.hasChildNodes()) {
|
803
|
+
dom.remove(node);
|
804
|
+
}
|
805
|
+
|
806
|
+
if (isEmpty(toElm, true)) {
|
807
|
+
dom.$(toElm).empty();
|
808
|
+
}
|
809
|
+
|
810
|
+
if (!isEmpty(fromElm, true)) {
|
811
|
+
while ((node = fromElm.firstChild)) {
|
812
|
+
toElm.appendChild(node);
|
813
|
+
}
|
814
|
+
}
|
815
|
+
|
816
|
+
if (listNode) {
|
817
|
+
toElm.appendChild(listNode);
|
818
|
+
}
|
819
|
+
|
820
|
+
dom.remove(fromElm);
|
821
|
+
|
822
|
+
if (isEmpty(ul) && !isEditorBody(ul)) {
|
823
|
+
dom.remove(ul);
|
824
|
+
}
|
825
|
+
}
|
826
|
+
|
827
|
+
function backspaceDeleteCaret(isForward) {
|
828
|
+
var li = dom.getParent(selection.getStart(), 'LI'), ul, rng, otherLi;
|
829
|
+
|
830
|
+
if (li) {
|
831
|
+
ul = li.parentNode;
|
832
|
+
if (isEditorBody(ul) && dom.isEmpty(ul)) {
|
833
|
+
return true;
|
834
|
+
}
|
835
|
+
|
836
|
+
rng = normalizeRange(selection.getRng(true));
|
837
|
+
otherLi = dom.getParent(findNextCaretContainer(rng, isForward), 'LI');
|
838
|
+
|
839
|
+
if (otherLi && otherLi != li) {
|
840
|
+
var bookmark = createBookmark(rng);
|
841
|
+
|
842
|
+
if (isForward) {
|
843
|
+
mergeLiElements(otherLi, li);
|
844
|
+
} else {
|
845
|
+
mergeLiElements(li, otherLi);
|
846
|
+
}
|
847
|
+
|
848
|
+
moveToBookmark(bookmark);
|
849
|
+
|
850
|
+
return true;
|
851
|
+
} else if (!otherLi) {
|
852
|
+
if (!isForward && removeList(ul.nodeName)) {
|
853
|
+
return true;
|
854
|
+
}
|
855
|
+
}
|
856
|
+
}
|
857
|
+
}
|
858
|
+
|
859
|
+
function backspaceDeleteRange() {
|
860
|
+
var startListParent = editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD');
|
861
|
+
|
862
|
+
if (startListParent || getSelectedListItems().length > 0) {
|
863
|
+
editor.undoManager.transact(function() {
|
864
|
+
editor.execCommand('Delete');
|
865
|
+
normalizeLists(editor.getBody());
|
866
|
+
});
|
867
|
+
|
868
|
+
return true;
|
869
|
+
}
|
870
|
+
|
871
|
+
return false;
|
872
|
+
}
|
873
|
+
|
874
|
+
self.backspaceDelete = function(isForward) {
|
875
|
+
return selection.isCollapsed() ? backspaceDeleteCaret(isForward) : backspaceDeleteRange();
|
876
|
+
};
|
877
|
+
|
878
|
+
editor.on('BeforeExecCommand', function(e) {
|
879
|
+
var cmd = e.command.toLowerCase(), isHandled;
|
880
|
+
|
881
|
+
if (cmd == "indent") {
|
882
|
+
if (indentSelection()) {
|
883
|
+
isHandled = true;
|
884
|
+
}
|
885
|
+
} else if (cmd == "outdent") {
|
886
|
+
if (outdentSelection()) {
|
887
|
+
isHandled = true;
|
888
|
+
}
|
889
|
+
}
|
890
|
+
|
891
|
+
if (isHandled) {
|
892
|
+
editor.fire('ExecCommand', {command: e.command});
|
893
|
+
e.preventDefault();
|
894
|
+
return true;
|
895
|
+
}
|
896
|
+
});
|
897
|
+
|
898
|
+
editor.addCommand('InsertUnorderedList', function(ui, detail) {
|
899
|
+
toggleList('UL', detail);
|
900
|
+
});
|
901
|
+
|
902
|
+
editor.addCommand('InsertOrderedList', function(ui, detail) {
|
903
|
+
toggleList('OL', detail);
|
904
|
+
});
|
905
|
+
|
906
|
+
editor.addCommand('InsertDefinitionList', function(ui, detail) {
|
907
|
+
toggleList('DL', detail);
|
908
|
+
});
|
909
|
+
|
910
|
+
editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState('UL'));
|
911
|
+
editor.addQueryStateHandler('InsertOrderedList', queryListCommandState('OL'));
|
912
|
+
editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState('DL'));
|
913
|
+
|
914
|
+
editor.on('keydown', function(e) {
|
915
|
+
// Check for tab but not ctrl/cmd+tab since it switches browser tabs
|
916
|
+
if (e.keyCode != 9 || tinymce.util.VK.metaKeyPressed(e)) {
|
917
|
+
return;
|
918
|
+
}
|
919
|
+
|
920
|
+
if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
|
921
|
+
e.preventDefault();
|
922
|
+
|
923
|
+
if (e.shiftKey) {
|
924
|
+
outdentSelection();
|
925
|
+
} else {
|
926
|
+
indentSelection();
|
927
|
+
}
|
928
|
+
}
|
929
|
+
});
|
930
|
+
});
|
931
|
+
|
932
|
+
editor.addButton('indent', {
|
933
|
+
icon: 'indent',
|
934
|
+
title: 'Increase indent',
|
935
|
+
cmd: 'Indent',
|
936
|
+
onPostRender: function() {
|
937
|
+
var ctrl = this;
|
938
|
+
|
939
|
+
editor.on('nodechange', function() {
|
940
|
+
var blocks = editor.selection.getSelectedBlocks();
|
941
|
+
var disable = false;
|
942
|
+
|
943
|
+
for (var i = 0, l = blocks.length; !disable && i < l; i++) {
|
944
|
+
var tag = blocks[i].nodeName;
|
945
|
+
|
946
|
+
disable = (tag == 'LI' && isFirstChild(blocks[i]) || tag == 'UL' || tag == 'OL' || tag == 'DD');
|
947
|
+
}
|
948
|
+
|
949
|
+
ctrl.disabled(disable);
|
950
|
+
});
|
951
|
+
}
|
952
|
+
});
|
953
|
+
|
954
|
+
editor.on('keydown', function(e) {
|
955
|
+
if (e.keyCode == tinymce.util.VK.BACKSPACE) {
|
956
|
+
if (self.backspaceDelete()) {
|
957
|
+
e.preventDefault();
|
958
|
+
}
|
959
|
+
} else if (e.keyCode == tinymce.util.VK.DELETE) {
|
960
|
+
if (self.backspaceDelete(true)) {
|
961
|
+
e.preventDefault();
|
962
|
+
}
|
963
|
+
}
|
964
|
+
});
|
965
|
+
});
|