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
|
+
!function(e,t){"use strict";function n(e,t){for(var n,r=[],o=0;o<e.length;++o){if(n=a[e[o]]||i(e[o]),!n)throw"module definition dependecy not found: "+e[o];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){a[e]=i.apply(null,arguments)})}function i(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function o(n){var r,i,o,s,l;for(r=0;r<n.length;r++){i=e,o=n[r],s=o.split(/[.\/]/);for(var c=0;c<s.length-1;++c)i[s[c]]===t&&(i[s[c]]={}),i=i[s[c]];i[s[s.length-1]]=a[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in a)l[o]=a[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var a={};r("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(e,t,n){function r(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function i(i){function o(e){var t=e.name,n=e;if("br"===t)return void(l+="\n");if(c[t]&&(l+=" "),u[t])return void(l+=" ");if(3==e.type&&(l+=e.value),!e.shortEnded&&(e=e.firstChild))do o(e);while(e=e.next);d[t]&&n.next&&(l+="\n","p"==t&&(l+="\n"))}var a=new n,s=new t({},a),l="",c=a.getShortEndedElements(),u=e.makeMap("script noscript style textarea video audio iframe object"," "),d=a.getBlockElements();return i=r(i,[/<!\[[^\]]+\]>/g]),o(s.parse(i)),l}function o(e){function t(e,t,n){return t||n?"\xa0":" "}return e=r(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,t],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function a(e){var t=0;return function(){return e+t++}}return{filter:r,innerText:i,trimHtml:o,createIdGenerator:a}}),r("tinymce/pasteplugin/SmartPaste",["tinymce/util/Tools"],function(e){var t=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},n=function(e){return t(e)&&/.(gif|jpe?g|png)$/.test(e)},r=function(e,t,n){return e.undoManager.extra(function(){n(e,t)},function(){e.insertContent('<img src="'+t+'">')}),!0},i=function(e,t,n){return e.undoManager.extra(function(){n(e,t)},function(){e.execCommand("mceInsertLink",!1,t)}),!0},o=function(e,n,r){return!(e.selection.isCollapsed()!==!1||!t(n))&&i(e,n,r)},a=function(e,t,i){return!!n(t)&&r(e,t,i)},s=function(e,t){return e.insertContent(t,{merge:e.settings.paste_merge_formats!==!1,paste:!0}),!0},l=function(t,n){e.each([o,a,s],function(e){return e(t,n,s)!==!0})},c=function(e,t){e.settings.smart_paste===!1?s(e,t):l(e,t)};return{isImageUrl:n,isAbsoluteUrl:t,insertContent:c}}),r("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils","tinymce/pasteplugin/SmartPaste","tinymce/util/Delay"],function(e,t,n,r,i,o){return function(a){function s(e){var t,n=a.dom;if(t=a.fire("BeforePastePreProcess",{content:e}),t=a.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(a.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var r=n.add(a.getBody(),"div",{style:"display:none"},e);t=a.fire("PastePostProcess",{node:r}),n.remove(r),e=t.node.innerHTML}t.isDefaultPrevented()||i.insertContent(a,e)}}function l(e){e=a.dom.encode(e).replace(/\r\n/g,"\n");var t,n=a.dom.getParent(a.selection.getStart(),a.dom.isBlock),i=a.settings.forced_root_block;i&&(t=a.dom.createHTML(i,a.settings.forced_root_block_attrs),t=t.substr(0,t.length-3)+">"),n&&/^(PRE|DIV)$/.test(n.nodeName)||!i?e=r.filter(e,[[/\n/g,"<br>"]]):(e=r.filter(e,[[/\n\n/g,"</p>"+t],[/^(.*<\/p>)(<p>)$/,t+"$1"],[/\n/g,"<br />"]]),e.indexOf("<p>")!=-1&&(e=t+e)),s(e)}function c(){function t(e){var t,n,i,o=e.startContainer;if(t=e.getClientRects(),t.length)return t[0];if(e.collapsed&&1==o.nodeType){for(i=o.childNodes[_.startOffset];i&&3==i.nodeType&&!i.data.length;)i=i.nextSibling;if(i)return"BR"==i.tagName&&(n=r.doc.createTextNode("\ufeff"),i.parentNode.insertBefore(n,i),e=r.createRng(),e.setStartBefore(n),e.setEndAfter(n),t=e.getClientRects(),r.remove(n)),t.length?t[0]:void 0}}var n,r=a.dom,i=a.getBody(),o=a.dom.getViewPort(a.getWin()),s=o.y,l=20;if(_=a.selection.getRng(),a.inline&&(n=a.selection.getScrollContainer(),n&&n.scrollTop>0&&(s=n.scrollTop)),_.getClientRects){var c=t(_);if(c)l=s+(c.top-r.getPos(i).y);else{l=s;var u=_.startContainer;u&&(3==u.nodeType&&u.parentNode!=i&&(u=u.parentNode),1==u.nodeType&&(l=r.getPos(u,n||i).y))}}E=r.add(a.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+l+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},A),(e.ie||e.gecko)&&r.setStyle(E,"left","rtl"==r.getStyle(i,"direction",!0)?65535:-65535),r.bind(E,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),E.focus(),a.selection.select(E,!0)}function u(){if(E){for(var e;e=a.dom.get("mcepastebin");)a.dom.remove(e),a.dom.unbind(e);_&&a.selection.setRng(_)}E=_=null}function d(){var e,t,n,r,i="";for(e=a.dom.select("div[id=mcepastebin]"),t=0;t<e.length;t++)n=e[t],n.firstChild&&"mcepastebin"==n.firstChild.id&&(n=n.firstChild),r=n.innerHTML,i!=A&&(i+=r);return i}function f(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&n.length>0&&n.indexOf(B)==-1&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var i=e.types[r];t[i]=e.getData(i)}}return t}function h(e){return f(e.clipboardData||a.getDoc().dataTransfer)}function p(e){return x(e,"text/html")||x(e,"text/plain")}function m(e){var t;return t=e.indexOf(","),t!==-1?e.substr(t+1):null}function g(e,t){return!e.images_dataimg_filter||e.images_dataimg_filter(t)}function v(e,t,n){e&&(a.selection.setRng(e),e=null);var r=t.result,i=m(r),o=new Image;if(o.src=r,g(a.settings,o)){var l,c,u=a.editorUpload.blobCache;c=u.findFirst(function(e){return e.base64()===i}),c?l=c:(l=u.create(D(),n,i),u.add(l)),s('<img src="'+l.blobUri()+'">')}else s('<img src="'+r+'">')}function y(e,t){function n(n){var r,i,o,a=!1;if(n)for(r=0;r<n.length;r++)if(i=n[r],/^image\/(jpeg|png|gif|bmp)$/.test(i.type)){var s=i.getAsFile?i.getAsFile():i;o=new FileReader,o.onload=v.bind(null,t,o,s),o.readAsDataURL(s),e.preventDefault(),a=!0}return a}var r=e.clipboardData||e.dataTransfer;if(a.settings.paste_data_images&&r)return n(r.items)||n(r.files)}function b(e){var t=e.clipboardData;return navigator.userAgent.indexOf("Android")!=-1&&t&&t.items&&0===t.items.length}function C(e){return t.getCaretRangeFromPoint(e.clientX,e.clientY,a.getDoc())}function x(e,t){return t in e&&e[t].length>0}function w(e){return n.metaKeyPressed(e)&&86==e.keyCode||e.shiftKey&&45==e.keyCode}function N(){function t(e,t,n){var i;return x(e,"text/html")?i=e["text/html"]:(i=d(),i==A&&(n=!0)),i=r.trimHtml(i),E&&E.firstChild&&"mcepastebin"===E.firstChild.id&&(n=!0),u(),i.length||(n=!0),n&&(i=x(e,"text/plain")&&i.indexOf("</p>")==-1?e["text/plain"]:r.innerText(i)),i==A?void(t||a.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(n?l(i):s(i))}function n(e){return 0===e["text/plain"].indexOf("file://")}a.on("keydown",function(t){function n(e){w(e)&&!e.isDefaultPrevented()&&u()}if(w(t)&&!t.isDefaultPrevented()){if(S=t.shiftKey&&86==t.keyCode,S&&e.webkit&&navigator.userAgent.indexOf("Version/")!=-1)return;if(t.stopImmediatePropagation(),T=(new Date).getTime(),e.ie&&S)return t.preventDefault(),void a.fire("paste",{ieFake:!0});u(),c(),a.once("keyup",n),a.once("paste",function(){a.off("keyup",n)})}});var i=function(){return _||a.selection.getRng()};a.on("paste",function(n){var r=(new Date).getTime(),s=h(n),l=(new Date).getTime()-r,f=(new Date).getTime()-T-l<1e3,m="text"==k.pasteFormat||S;return S=!1,n.isDefaultPrevented()||b(n)?void u():!p(s)&&y(n,i())?void u():(f||n.preventDefault(),!e.ie||f&&!n.ieFake||(c(),a.dom.bind(E,"paste",function(e){e.stopPropagation()}),a.getDoc().execCommand("Paste",!1,null),s["text/html"]=d()),void(x(s,"text/html")?(n.preventDefault(),t(s,f,m)):o.setEditorTimeout(a,function(){t(s,f,m)},0)))}),a.on("dragstart dragend",function(e){R="dragstart"==e.type}),a.on("drop",function(e){var t,i;if(i=C(e),!e.isDefaultPrevented()&&!R&&(t=f(e.dataTransfer),(p(t)&&!n(t)||!y(e,i))&&i&&a.settings.paste_filter_drop!==!1)){var c=t["mce-internal"]||t["text/html"]||t["text/plain"];c&&(e.preventDefault(),o.setEditorTimeout(a,function(){a.undoManager.transact(function(){t["mce-internal"]&&a.execCommand("Delete"),a.selection.setRng(i),c=r.trimHtml(c),t["text/html"]?s(c):l(c)})}))}}),a.on("dragover dragend",function(e){a.settings.paste_data_images&&e.preventDefault()})}var E,_,S,k=this,T=0,R=!1,A="%MCEPASTEBIN%",B="data:text/mce-internal,",D=r.createIdGenerator("mceclip");k.pasteHtml=s,k.pasteText=l,k.pasteImageData=y,a.on("preInit",function(){N(),a.parser.addNodeFilter("img",function(t,n,r){function i(e){return e.data&&e.data.paste===!0}function o(t){t.attr("data-mce-object")||u===e.transparentSrc||t.remove()}function s(e){return 0===e.indexOf("webkit-fake-url")}function l(e){return 0===e.indexOf("data:")}if(!a.settings.paste_data_images&&i(r))for(var c=t.length;c--;){var u=t[c].attributes.map.src;u&&(s(u)?o(t[c]):!a.settings.allow_html_data_urls&&l(u)&&o(t[c]))}})})}}),r("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(e,t,n,r,i,o){function a(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}function s(t){var n,r;return r=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],t=t.replace(/^[\u00a0 ]+/,""),e.each(r,function(e){if(e.test(t))return n=!0,!1}),n}function l(e){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(e)}function c(c){var u=c.settings;c.on("BeforePastePreProcess",function(d){function f(e){function t(e){var n="";if(3===e.type)return e.value;if(e=e.firstChild)do n+=t(e);while(e=e.next);return n}function n(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do if(!n(e,t))return!1;while(e=e.next);return!0}function r(e){if(e._listIgnore)return void e.remove();if(e=e.firstChild)do r(e);while(e=e.next)}function o(e,t,o){var s=e._listLevel||u;s!=u&&(s<u?a&&(a=a.parent.parent):(c=a,a=null)),a&&a.name==t?a.append(e):(c=c||a,a=new i(t,1),o>1&&a.attr("start",""+o),e.wrap(a)),e.name="li",s>u&&c&&c.lastChild.append(a),u=s,r(e),n(e,/^\u00a0+/),n(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),n(e,/^\u00a0+/)}for(var a,c,u=1,d=[],f=e.firstChild;"undefined"!=typeof f&&null!==f;)if(d.push(f),f=f.walk(),null!==f)for(;"undefined"!=typeof f&&f.parent!==e;)f=f.walk();for(var h=0;h<d.length;h++)if(e=d[h],"p"==e.name&&e.firstChild){var p=t(e);if(l(p)){o(e,"ul");continue}if(s(p)){var m=/([0-9]+)\./.exec(p),g=1;m&&(g=parseInt(m[1],10)),o(e,"ol",g);continue}if(e._listLevel){o(e,"ul",1);continue}a=null}else c=a,a=null}function h(t,n){var r,o={},a=c.dom.parseStyle(n);return e.each(a,function(e,i){switch(i){case"mso-list":r=/\w+ \w+([0-9]+)/i.exec(n),r&&(t._listLevel=parseInt(r[1],10)),/Ignore/i.test(e)&&t.firstChild&&(t._listIgnore=!0,t.firstChild._listIgnore=!0);break;case"horiz-align":i="text-align";break;case"vert-align":i="vertical-align";break;case"font-color":case"mso-foreground":i="color";break;case"mso-background":case"mso-highlight":i="background";break;case"font-weight":case"font-style":return void("normal"!=e&&(o[i]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void t.remove()}return 0===i.indexOf("mso-comment")?void t.remove():void(0!==i.indexOf("mso-")&&("all"==p||m&&m[i])&&(o[i]=e))}),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],t.wrap(new i("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],t.wrap(new i("i",1))),o=c.dom.serializeStyle(o,t.name),o?o:null}var p,m,g=d.content;if(g=g.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),g=g.replace(/<br class="?Apple-interchange-newline"?>/gi,""),p=u.paste_retain_style_properties,p&&(m=e.makeMap(p.split(/[, ]/))),u.paste_enable_default_filters!==!1&&a(d.content)){d.wordContent=!0,g=o.filter(g,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var v=u.paste_word_valid_elements;v||(v="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var y=new n({valid_elements:v,valid_children:"-li[p]"});e.each(y.elements,function(e){e.attributes.class||(e.attributes.class={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var b=new t({},y);b.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)t=e[n],t.attr("style",h(t,t.attr("style"))),"span"==t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),b.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)t=e[r],n=t.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),b.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),b.addNodeFilter("a",function(e){for(var t,n,r,i=e.length;i--;)if(t=e[i],n=t.attr("href"),r=t.attr("name"),n&&n.indexOf("#_msocom_")!=-1)t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1],n&&(n="#"+n)),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var C=b.parse(g);u.paste_convert_word_fake_lists!==!1&&f(C),d.content=new r({validate:u.validate},y).serialize(C)}})}return c.isWordContent=a,c}),r("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(e,t,n,r){return function(i){function o(e){i.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+o.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function s(e){if(n.isWordContent(e))return e;var t=i.settings.paste_webkit_styles;if(i.settings.paste_remove_styles_if_webkit===!1||"all"==t)return e;if(t&&(t=t.split(/[, ]/)),t){var r=i.dom,o=i.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,n,i,a){var s=r.parseStyle(i,"span"),l={};if("none"===t)return n+a;for(var c=0;c<t.length;c++){var u=s[t[c]],d=r.getStyle(o,t[c],!0);/color/.test(t[c])&&(u=r.toHex(u),d=r.toHex(d)),d!=u&&(l[t[c]]=u)}return l=r.serializeStyle(l,"span"),l?n+' style="'+l+'"'+a:n+a})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}e.webkit&&o(s),e.ie&&o(a)}}),r("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(e,t,n,r){var i;e.add("paste",function(o){function a(){return i||o.settings.paste_plaintext_inform===!1}function s(){if("text"==l.pasteFormat)this.active(!1),l.pasteFormat="html",o.fire("PastePlainTextToggle",{state:!1});else if(l.pasteFormat="text",this.active(!0),!a()){var e=o.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");o.notificationManager.open({text:e,type:"info"}),i=!0,o.fire("PastePlainTextToggle",{state:!0})}o.focus()}var l,c=this,u=o.settings;return/(^|[ ,])powerpaste([, ]|$)/.test(u.plugins)&&e.get("powerpaste")?void("undefined"!=typeof console&&console.log&&console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option.")):(c.clipboard=l=new t(o),c.quirks=new r(o),c.wordFilter=new n(o),o.settings.paste_as_text&&(c.clipboard.pasteFormat="text"),u.paste_preprocess&&o.on("PastePreProcess",function(e){u.paste_preprocess.call(c,c,e)}),u.paste_postprocess&&o.on("PastePostProcess",function(e){u.paste_postprocess.call(c,c,e)}),o.addCommand("mceInsertClipboardContent",function(e,t){t.content&&c.clipboard.pasteHtml(t.content),t.text&&c.clipboard.pasteText(t.text)}),o.settings.paste_block_drop&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),o.settings.paste_data_images||o.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),o.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:s,active:"text"==c.clipboard.pasteFormat}),void o.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:l.pasteFormat,onclick:s}))})}),o(["tinymce/pasteplugin/Utils"])}(this);
|
@@ -0,0 +1,101 @@
|
|
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
|
+
|
13
|
+
tinymce.PluginManager.add('preview', function(editor) {
|
14
|
+
var settings = editor.settings, sandbox = !tinymce.Env.ie;
|
15
|
+
|
16
|
+
editor.addCommand('mcePreview', function() {
|
17
|
+
editor.windowManager.open({
|
18
|
+
title: 'Preview',
|
19
|
+
width: parseInt(editor.getParam("plugin_preview_width", "650"), 10),
|
20
|
+
height: parseInt(editor.getParam("plugin_preview_height", "500"), 10),
|
21
|
+
html: '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>',
|
22
|
+
buttons: {
|
23
|
+
text: 'Close',
|
24
|
+
onclick: function() {
|
25
|
+
this.parent().parent().close();
|
26
|
+
}
|
27
|
+
},
|
28
|
+
onPostRender: function() {
|
29
|
+
var previewHtml, headHtml = '';
|
30
|
+
|
31
|
+
headHtml += '<base href="' + editor.documentBaseURI.getURI() + '">';
|
32
|
+
|
33
|
+
tinymce.each(editor.contentCSS, function(url) {
|
34
|
+
headHtml += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
|
35
|
+
});
|
36
|
+
|
37
|
+
var bodyId = settings.body_id || 'tinymce';
|
38
|
+
if (bodyId.indexOf('=') != -1) {
|
39
|
+
bodyId = editor.getParam('body_id', '', 'hash');
|
40
|
+
bodyId = bodyId[editor.id] || bodyId;
|
41
|
+
}
|
42
|
+
|
43
|
+
var bodyClass = settings.body_class || '';
|
44
|
+
if (bodyClass.indexOf('=') != -1) {
|
45
|
+
bodyClass = editor.getParam('body_class', '', 'hash');
|
46
|
+
bodyClass = bodyClass[editor.id] || '';
|
47
|
+
}
|
48
|
+
|
49
|
+
var preventClicksOnLinksScript = (
|
50
|
+
'<script>' +
|
51
|
+
'document.addEventListener && document.addEventListener("click", function(e) {' +
|
52
|
+
'for (var elm = e.target; elm; elm = elm.parentNode) {' +
|
53
|
+
'if (elm.nodeName === "A") {' +
|
54
|
+
'e.preventDefault();' +
|
55
|
+
'}' +
|
56
|
+
'}' +
|
57
|
+
'}, false);' +
|
58
|
+
'</script> '
|
59
|
+
);
|
60
|
+
|
61
|
+
var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : '';
|
62
|
+
|
63
|
+
previewHtml = (
|
64
|
+
'<!DOCTYPE html>' +
|
65
|
+
'<html>' +
|
66
|
+
'<head>' +
|
67
|
+
headHtml +
|
68
|
+
'</head>' +
|
69
|
+
'<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '"' + dirAttr + '>' +
|
70
|
+
editor.getContent() +
|
71
|
+
preventClicksOnLinksScript +
|
72
|
+
'</body>' +
|
73
|
+
'</html>'
|
74
|
+
);
|
75
|
+
|
76
|
+
if (!sandbox) {
|
77
|
+
// IE 6-11 doesn't support data uris on iframes
|
78
|
+
// so I guess they will have to be less secure since we can't sandbox on those
|
79
|
+
// TODO: Use sandbox if future versions of IE supports iframes with data: uris.
|
80
|
+
var doc = this.getEl('body').firstChild.contentWindow.document;
|
81
|
+
doc.open();
|
82
|
+
doc.write(previewHtml);
|
83
|
+
doc.close();
|
84
|
+
} else {
|
85
|
+
this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
});
|
89
|
+
});
|
90
|
+
|
91
|
+
editor.addButton('preview', {
|
92
|
+
title: 'Preview',
|
93
|
+
cmd: 'mcePreview'
|
94
|
+
});
|
95
|
+
|
96
|
+
editor.addMenuItem('preview', {
|
97
|
+
text: 'Preview',
|
98
|
+
cmd: 'mcePreview',
|
99
|
+
context: 'view'
|
100
|
+
});
|
101
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("preview",function(e){var t=e.settings,n=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(n?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var r,i="";i+='<base href="'+e.documentBaseURI.getURI()+'">',tinymce.each(e.contentCSS,function(t){i+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});var o=t.body_id||"tinymce";o.indexOf("=")!=-1&&(o=e.getParam("body_id","","hash"),o=o[e.id]||o);var a=t.body_class||"";a.indexOf("=")!=-1&&(a=e.getParam("body_class","","hash"),a=a[e.id]||"");var s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);</script> ',l=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(r="<!DOCTYPE html><html><head>"+i+'</head><body id="'+o+'" class="mce-content-body '+a+'"'+l+">"+e.getContent()+s+"</body></html>",n)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(r);else{var c=this.getEl("body").firstChild.contentWindow.document;c.open(),c.write(r),c.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
|
@@ -0,0 +1,32 @@
|
|
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
|
+
|
13
|
+
tinymce.PluginManager.add('print', function(editor) {
|
14
|
+
editor.addCommand('mcePrint', function() {
|
15
|
+
editor.getWin().print();
|
16
|
+
});
|
17
|
+
|
18
|
+
editor.addButton('print', {
|
19
|
+
title: 'Print',
|
20
|
+
cmd: 'mcePrint'
|
21
|
+
});
|
22
|
+
|
23
|
+
editor.addShortcut('Meta+P', '', 'mcePrint');
|
24
|
+
|
25
|
+
editor.addMenuItem('print', {
|
26
|
+
text: 'Print',
|
27
|
+
cmd: 'mcePrint',
|
28
|
+
icon: 'print',
|
29
|
+
shortcut: 'Meta+P',
|
30
|
+
context: 'file'
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){e.getWin().print()}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addShortcut("Meta+P","","mcePrint"),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})});
|
@@ -0,0 +1,98 @@
|
|
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
|
+
|
13
|
+
tinymce.PluginManager.add('save', function(editor) {
|
14
|
+
function save() {
|
15
|
+
var formObj;
|
16
|
+
|
17
|
+
formObj = tinymce.DOM.getParent(editor.id, 'form');
|
18
|
+
|
19
|
+
if (editor.getParam("save_enablewhendirty", true) && !editor.isDirty()) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
|
23
|
+
tinymce.triggerSave();
|
24
|
+
|
25
|
+
// Use callback instead
|
26
|
+
if (editor.getParam("save_onsavecallback")) {
|
27
|
+
editor.execCallback('save_onsavecallback', editor);
|
28
|
+
editor.nodeChanged();
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
|
32
|
+
if (formObj) {
|
33
|
+
editor.setDirty(false);
|
34
|
+
|
35
|
+
if (!formObj.onsubmit || formObj.onsubmit()) {
|
36
|
+
if (typeof formObj.submit == "function") {
|
37
|
+
formObj.submit();
|
38
|
+
} else {
|
39
|
+
displayErrorMessage(editor.translate("Error: Form submit field collision."));
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
editor.nodeChanged();
|
44
|
+
} else {
|
45
|
+
displayErrorMessage(editor.translate("Error: No form element found."));
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
function displayErrorMessage(message) {
|
50
|
+
editor.notificationManager.open({
|
51
|
+
text: message,
|
52
|
+
type: 'error'
|
53
|
+
});
|
54
|
+
}
|
55
|
+
|
56
|
+
function cancel() {
|
57
|
+
var h = tinymce.trim(editor.startContent);
|
58
|
+
|
59
|
+
// Use callback instead
|
60
|
+
if (editor.getParam("save_oncancelcallback")) {
|
61
|
+
editor.execCallback('save_oncancelcallback', editor);
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
editor.setContent(h);
|
66
|
+
editor.undoManager.clear();
|
67
|
+
editor.nodeChanged();
|
68
|
+
}
|
69
|
+
|
70
|
+
function stateToggle() {
|
71
|
+
var self = this;
|
72
|
+
|
73
|
+
editor.on('nodeChange dirty', function() {
|
74
|
+
self.disabled(editor.getParam("save_enablewhendirty", true) && !editor.isDirty());
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
editor.addCommand('mceSave', save);
|
79
|
+
editor.addCommand('mceCancel', cancel);
|
80
|
+
|
81
|
+
editor.addButton('save', {
|
82
|
+
icon: 'save',
|
83
|
+
text: 'Save',
|
84
|
+
cmd: 'mceSave',
|
85
|
+
disabled: true,
|
86
|
+
onPostRender: stateToggle
|
87
|
+
});
|
88
|
+
|
89
|
+
editor.addButton('cancel', {
|
90
|
+
text: 'Cancel',
|
91
|
+
icon: false,
|
92
|
+
cmd: 'mceCancel',
|
93
|
+
disabled: true,
|
94
|
+
onPostRender: stateToggle
|
95
|
+
});
|
96
|
+
|
97
|
+
editor.addShortcut('Meta+S', '', 'mceSave');
|
98
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("save",function(e){function t(){var t;if(t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty())return tinymce.triggerSave(),e.getParam("save_onsavecallback")?(e.execCallback("save_onsavecallback",e),void e.nodeChanged()):void(t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():n(e.translate("Error: Form submit field collision."))),e.nodeChanged()):n(e.translate("Error: No form element found.")))}function n(t){e.notificationManager.open({text:t,type:"error"})}function r(){var t=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(t),e.undoManager.clear(),void e.nodeChanged())}function i(){var t=this;e.on("nodeChange dirty",function(){t.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",r),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:i}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:i}),e.addShortcut("Meta+S","","mceSave")});
|
@@ -0,0 +1,609 @@
|
|
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
|
+
/*jshint smarttabs:true, undef:true, unused:true, latedef:true, curly:true, bitwise:true */
|
12
|
+
/*eslint no-labels:0, no-constant-condition: 0 */
|
13
|
+
/*global tinymce:true */
|
14
|
+
|
15
|
+
(function() {
|
16
|
+
function isContentEditableFalse(node) {
|
17
|
+
return node && node.nodeType == 1 && node.contentEditable === "false";
|
18
|
+
}
|
19
|
+
|
20
|
+
// Based on work developed by: James Padolsey http://james.padolsey.com
|
21
|
+
// released under UNLICENSE that is compatible with LGPL
|
22
|
+
// TODO: Handle contentEditable edgecase:
|
23
|
+
// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
|
24
|
+
function findAndReplaceDOMText(regex, node, replacementNode, captureGroup, schema) {
|
25
|
+
var m, matches = [], text, count = 0, doc;
|
26
|
+
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
|
27
|
+
|
28
|
+
doc = node.ownerDocument;
|
29
|
+
blockElementsMap = schema.getBlockElements(); // H1-H6, P, TD etc
|
30
|
+
hiddenTextElementsMap = schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
|
31
|
+
shortEndedElementsMap = schema.getShortEndedElements(); // BR, IMG, INPUT
|
32
|
+
|
33
|
+
function getMatchIndexes(m, captureGroup) {
|
34
|
+
captureGroup = captureGroup || 0;
|
35
|
+
|
36
|
+
if (!m[0]) {
|
37
|
+
throw 'findAndReplaceDOMText cannot handle zero-length matches';
|
38
|
+
}
|
39
|
+
|
40
|
+
var index = m.index;
|
41
|
+
|
42
|
+
if (captureGroup > 0) {
|
43
|
+
var cg = m[captureGroup];
|
44
|
+
|
45
|
+
if (!cg) {
|
46
|
+
throw 'Invalid capture group';
|
47
|
+
}
|
48
|
+
|
49
|
+
index += m[0].indexOf(cg);
|
50
|
+
m[0] = cg;
|
51
|
+
}
|
52
|
+
|
53
|
+
return [index, index + m[0].length, [m[0]]];
|
54
|
+
}
|
55
|
+
|
56
|
+
function getText(node) {
|
57
|
+
var txt;
|
58
|
+
|
59
|
+
if (node.nodeType === 3) {
|
60
|
+
return node.data;
|
61
|
+
}
|
62
|
+
|
63
|
+
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
|
64
|
+
return '';
|
65
|
+
}
|
66
|
+
|
67
|
+
txt = '';
|
68
|
+
|
69
|
+
if (isContentEditableFalse(node)) {
|
70
|
+
return '\n';
|
71
|
+
}
|
72
|
+
|
73
|
+
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
|
74
|
+
txt += '\n';
|
75
|
+
}
|
76
|
+
|
77
|
+
if ((node = node.firstChild)) {
|
78
|
+
do {
|
79
|
+
txt += getText(node);
|
80
|
+
} while ((node = node.nextSibling));
|
81
|
+
}
|
82
|
+
|
83
|
+
return txt;
|
84
|
+
}
|
85
|
+
|
86
|
+
function stepThroughMatches(node, matches, replaceFn) {
|
87
|
+
var startNode, endNode, startNodeIndex,
|
88
|
+
endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
|
89
|
+
matchLocation = matches.shift(), matchIndex = 0;
|
90
|
+
|
91
|
+
out: while (true) {
|
92
|
+
if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) {
|
93
|
+
atIndex++;
|
94
|
+
}
|
95
|
+
|
96
|
+
if (curNode.nodeType === 3) {
|
97
|
+
if (!endNode && curNode.length + atIndex >= matchLocation[1]) {
|
98
|
+
// We've found the ending
|
99
|
+
endNode = curNode;
|
100
|
+
endNodeIndex = matchLocation[1] - atIndex;
|
101
|
+
} else if (startNode) {
|
102
|
+
// Intersecting node
|
103
|
+
innerNodes.push(curNode);
|
104
|
+
}
|
105
|
+
|
106
|
+
if (!startNode && curNode.length + atIndex > matchLocation[0]) {
|
107
|
+
// We've found the match start
|
108
|
+
startNode = curNode;
|
109
|
+
startNodeIndex = matchLocation[0] - atIndex;
|
110
|
+
}
|
111
|
+
|
112
|
+
atIndex += curNode.length;
|
113
|
+
}
|
114
|
+
|
115
|
+
if (startNode && endNode) {
|
116
|
+
curNode = replaceFn({
|
117
|
+
startNode: startNode,
|
118
|
+
startNodeIndex: startNodeIndex,
|
119
|
+
endNode: endNode,
|
120
|
+
endNodeIndex: endNodeIndex,
|
121
|
+
innerNodes: innerNodes,
|
122
|
+
match: matchLocation[2],
|
123
|
+
matchIndex: matchIndex
|
124
|
+
});
|
125
|
+
|
126
|
+
// replaceFn has to return the node that replaced the endNode
|
127
|
+
// and then we step back so we can continue from the end of the
|
128
|
+
// match:
|
129
|
+
atIndex -= (endNode.length - endNodeIndex);
|
130
|
+
startNode = null;
|
131
|
+
endNode = null;
|
132
|
+
innerNodes = [];
|
133
|
+
matchLocation = matches.shift();
|
134
|
+
matchIndex++;
|
135
|
+
|
136
|
+
if (!matchLocation) {
|
137
|
+
break; // no more matches
|
138
|
+
}
|
139
|
+
} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
|
140
|
+
if (!isContentEditableFalse(curNode)) {
|
141
|
+
// Move down
|
142
|
+
curNode = curNode.firstChild;
|
143
|
+
continue;
|
144
|
+
}
|
145
|
+
} else if (curNode.nextSibling) {
|
146
|
+
// Move forward:
|
147
|
+
curNode = curNode.nextSibling;
|
148
|
+
continue;
|
149
|
+
}
|
150
|
+
|
151
|
+
// Move forward or up:
|
152
|
+
while (true) {
|
153
|
+
if (curNode.nextSibling) {
|
154
|
+
curNode = curNode.nextSibling;
|
155
|
+
break;
|
156
|
+
} else if (curNode.parentNode !== node) {
|
157
|
+
curNode = curNode.parentNode;
|
158
|
+
} else {
|
159
|
+
break out;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Generates the actual replaceFn which splits up text nodes
|
167
|
+
* and inserts the replacement element.
|
168
|
+
*/
|
169
|
+
function genReplacer(nodeName) {
|
170
|
+
var makeReplacementNode;
|
171
|
+
|
172
|
+
if (typeof nodeName != 'function') {
|
173
|
+
var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
|
174
|
+
|
175
|
+
makeReplacementNode = function(fill, matchIndex) {
|
176
|
+
var clone = stencilNode.cloneNode(false);
|
177
|
+
|
178
|
+
clone.setAttribute('data-mce-index', matchIndex);
|
179
|
+
|
180
|
+
if (fill) {
|
181
|
+
clone.appendChild(doc.createTextNode(fill));
|
182
|
+
}
|
183
|
+
|
184
|
+
return clone;
|
185
|
+
};
|
186
|
+
} else {
|
187
|
+
makeReplacementNode = nodeName;
|
188
|
+
}
|
189
|
+
|
190
|
+
return function(range) {
|
191
|
+
var before, after, parentNode, startNode = range.startNode,
|
192
|
+
endNode = range.endNode, matchIndex = range.matchIndex;
|
193
|
+
|
194
|
+
if (startNode === endNode) {
|
195
|
+
var node = startNode;
|
196
|
+
|
197
|
+
parentNode = node.parentNode;
|
198
|
+
if (range.startNodeIndex > 0) {
|
199
|
+
// Add `before` text node (before the match)
|
200
|
+
before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
|
201
|
+
parentNode.insertBefore(before, node);
|
202
|
+
}
|
203
|
+
|
204
|
+
// Create the replacement node:
|
205
|
+
var el = makeReplacementNode(range.match[0], matchIndex);
|
206
|
+
parentNode.insertBefore(el, node);
|
207
|
+
if (range.endNodeIndex < node.length) {
|
208
|
+
// Add `after` text node (after the match)
|
209
|
+
after = doc.createTextNode(node.data.substring(range.endNodeIndex));
|
210
|
+
parentNode.insertBefore(after, node);
|
211
|
+
}
|
212
|
+
|
213
|
+
node.parentNode.removeChild(node);
|
214
|
+
|
215
|
+
return el;
|
216
|
+
}
|
217
|
+
|
218
|
+
// Replace startNode -> [innerNodes...] -> endNode (in that order)
|
219
|
+
before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
|
220
|
+
after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
|
221
|
+
var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
|
222
|
+
var innerEls = [];
|
223
|
+
|
224
|
+
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
|
225
|
+
var innerNode = range.innerNodes[i];
|
226
|
+
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
|
227
|
+
innerNode.parentNode.replaceChild(innerEl, innerNode);
|
228
|
+
innerEls.push(innerEl);
|
229
|
+
}
|
230
|
+
|
231
|
+
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
|
232
|
+
|
233
|
+
parentNode = startNode.parentNode;
|
234
|
+
parentNode.insertBefore(before, startNode);
|
235
|
+
parentNode.insertBefore(elA, startNode);
|
236
|
+
parentNode.removeChild(startNode);
|
237
|
+
|
238
|
+
parentNode = endNode.parentNode;
|
239
|
+
parentNode.insertBefore(elB, endNode);
|
240
|
+
parentNode.insertBefore(after, endNode);
|
241
|
+
parentNode.removeChild(endNode);
|
242
|
+
|
243
|
+
return elB;
|
244
|
+
};
|
245
|
+
}
|
246
|
+
|
247
|
+
text = getText(node);
|
248
|
+
if (!text) {
|
249
|
+
return;
|
250
|
+
}
|
251
|
+
|
252
|
+
if (regex.global) {
|
253
|
+
while ((m = regex.exec(text))) {
|
254
|
+
matches.push(getMatchIndexes(m, captureGroup));
|
255
|
+
}
|
256
|
+
} else {
|
257
|
+
m = text.match(regex);
|
258
|
+
matches.push(getMatchIndexes(m, captureGroup));
|
259
|
+
}
|
260
|
+
|
261
|
+
if (matches.length) {
|
262
|
+
count = matches.length;
|
263
|
+
stepThroughMatches(node, matches, genReplacer(replacementNode));
|
264
|
+
}
|
265
|
+
|
266
|
+
return count;
|
267
|
+
}
|
268
|
+
|
269
|
+
function Plugin(editor) {
|
270
|
+
var self = this, currentIndex = -1;
|
271
|
+
|
272
|
+
function showDialog() {
|
273
|
+
var last = {}, selectedText;
|
274
|
+
|
275
|
+
selectedText = tinymce.trim(editor.selection.getContent({format: 'text'}));
|
276
|
+
|
277
|
+
function updateButtonStates() {
|
278
|
+
win.statusbar.find('#next').disabled(!findSpansByIndex(currentIndex + 1).length);
|
279
|
+
win.statusbar.find('#prev').disabled(!findSpansByIndex(currentIndex - 1).length);
|
280
|
+
}
|
281
|
+
|
282
|
+
function notFoundAlert() {
|
283
|
+
editor.windowManager.alert('Could not find the specified string.', function() {
|
284
|
+
win.find('#find')[0].focus();
|
285
|
+
});
|
286
|
+
}
|
287
|
+
|
288
|
+
var win = editor.windowManager.open({
|
289
|
+
layout: "flex",
|
290
|
+
pack: "center",
|
291
|
+
align: "center",
|
292
|
+
onClose: function() {
|
293
|
+
editor.focus();
|
294
|
+
self.done();
|
295
|
+
},
|
296
|
+
onSubmit: function(e) {
|
297
|
+
var count, caseState, text, wholeWord;
|
298
|
+
|
299
|
+
e.preventDefault();
|
300
|
+
|
301
|
+
caseState = win.find('#case').checked();
|
302
|
+
wholeWord = win.find('#words').checked();
|
303
|
+
|
304
|
+
text = win.find('#find').value();
|
305
|
+
if (!text.length) {
|
306
|
+
self.done(false);
|
307
|
+
win.statusbar.items().slice(1).disabled(true);
|
308
|
+
return;
|
309
|
+
}
|
310
|
+
|
311
|
+
if (last.text == text && last.caseState == caseState && last.wholeWord == wholeWord) {
|
312
|
+
if (findSpansByIndex(currentIndex + 1).length === 0) {
|
313
|
+
notFoundAlert();
|
314
|
+
return;
|
315
|
+
}
|
316
|
+
|
317
|
+
self.next();
|
318
|
+
updateButtonStates();
|
319
|
+
return;
|
320
|
+
}
|
321
|
+
|
322
|
+
count = self.find(text, caseState, wholeWord);
|
323
|
+
if (!count) {
|
324
|
+
notFoundAlert();
|
325
|
+
}
|
326
|
+
|
327
|
+
win.statusbar.items().slice(1).disabled(count === 0);
|
328
|
+
updateButtonStates();
|
329
|
+
|
330
|
+
last = {
|
331
|
+
text: text,
|
332
|
+
caseState: caseState,
|
333
|
+
wholeWord: wholeWord
|
334
|
+
};
|
335
|
+
},
|
336
|
+
buttons: [
|
337
|
+
{text: "Find", subtype: 'primary', onclick: function() {
|
338
|
+
win.submit();
|
339
|
+
}},
|
340
|
+
{text: "Replace", disabled: true, onclick: function() {
|
341
|
+
if (!self.replace(win.find('#replace').value())) {
|
342
|
+
win.statusbar.items().slice(1).disabled(true);
|
343
|
+
currentIndex = -1;
|
344
|
+
last = {};
|
345
|
+
}
|
346
|
+
}},
|
347
|
+
{text: "Replace all", disabled: true, onclick: function() {
|
348
|
+
self.replace(win.find('#replace').value(), true, true);
|
349
|
+
win.statusbar.items().slice(1).disabled(true);
|
350
|
+
last = {};
|
351
|
+
}},
|
352
|
+
{type: "spacer", flex: 1},
|
353
|
+
{text: "Prev", name: 'prev', disabled: true, onclick: function() {
|
354
|
+
self.prev();
|
355
|
+
updateButtonStates();
|
356
|
+
}},
|
357
|
+
{text: "Next", name: 'next', disabled: true, onclick: function() {
|
358
|
+
self.next();
|
359
|
+
updateButtonStates();
|
360
|
+
}}
|
361
|
+
],
|
362
|
+
title: "Find and replace",
|
363
|
+
items: {
|
364
|
+
type: "form",
|
365
|
+
padding: 20,
|
366
|
+
labelGap: 30,
|
367
|
+
spacing: 10,
|
368
|
+
items: [
|
369
|
+
{type: 'textbox', name: 'find', size: 40, label: 'Find', value: selectedText},
|
370
|
+
{type: 'textbox', name: 'replace', size: 40, label: 'Replace with'},
|
371
|
+
{type: 'checkbox', name: 'case', text: 'Match case', label: ' '},
|
372
|
+
{type: 'checkbox', name: 'words', text: 'Whole words', label: ' '}
|
373
|
+
]
|
374
|
+
}
|
375
|
+
});
|
376
|
+
}
|
377
|
+
|
378
|
+
self.init = function(ed) {
|
379
|
+
ed.addMenuItem('searchreplace', {
|
380
|
+
text: 'Find and replace',
|
381
|
+
shortcut: 'Meta+F',
|
382
|
+
onclick: showDialog,
|
383
|
+
separator: 'before',
|
384
|
+
context: 'edit'
|
385
|
+
});
|
386
|
+
|
387
|
+
ed.addButton('searchreplace', {
|
388
|
+
tooltip: 'Find and replace',
|
389
|
+
shortcut: 'Meta+F',
|
390
|
+
onclick: showDialog
|
391
|
+
});
|
392
|
+
|
393
|
+
ed.addCommand("SearchReplace", showDialog);
|
394
|
+
ed.shortcuts.add('Meta+F', '', showDialog);
|
395
|
+
};
|
396
|
+
|
397
|
+
function getElmIndex(elm) {
|
398
|
+
var value = elm.getAttribute('data-mce-index');
|
399
|
+
|
400
|
+
if (typeof value == "number") {
|
401
|
+
return "" + value;
|
402
|
+
}
|
403
|
+
|
404
|
+
return value;
|
405
|
+
}
|
406
|
+
|
407
|
+
function markAllMatches(regex) {
|
408
|
+
var node, marker;
|
409
|
+
|
410
|
+
marker = editor.dom.create('span', {
|
411
|
+
"data-mce-bogus": 1
|
412
|
+
});
|
413
|
+
|
414
|
+
marker.className = 'mce-match-marker'; // IE 7 adds class="mce-match-marker" and class=mce-match-marker
|
415
|
+
node = editor.getBody();
|
416
|
+
|
417
|
+
self.done(false);
|
418
|
+
|
419
|
+
return findAndReplaceDOMText(regex, node, marker, false, editor.schema);
|
420
|
+
}
|
421
|
+
|
422
|
+
function unwrap(node) {
|
423
|
+
var parentNode = node.parentNode;
|
424
|
+
|
425
|
+
if (node.firstChild) {
|
426
|
+
parentNode.insertBefore(node.firstChild, node);
|
427
|
+
}
|
428
|
+
|
429
|
+
node.parentNode.removeChild(node);
|
430
|
+
}
|
431
|
+
|
432
|
+
function findSpansByIndex(index) {
|
433
|
+
var nodes, spans = [];
|
434
|
+
|
435
|
+
nodes = tinymce.toArray(editor.getBody().getElementsByTagName('span'));
|
436
|
+
if (nodes.length) {
|
437
|
+
for (var i = 0; i < nodes.length; i++) {
|
438
|
+
var nodeIndex = getElmIndex(nodes[i]);
|
439
|
+
|
440
|
+
if (nodeIndex === null || !nodeIndex.length) {
|
441
|
+
continue;
|
442
|
+
}
|
443
|
+
|
444
|
+
if (nodeIndex === index.toString()) {
|
445
|
+
spans.push(nodes[i]);
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
|
450
|
+
return spans;
|
451
|
+
}
|
452
|
+
|
453
|
+
function moveSelection(forward) {
|
454
|
+
var testIndex = currentIndex, dom = editor.dom;
|
455
|
+
|
456
|
+
forward = forward !== false;
|
457
|
+
|
458
|
+
if (forward) {
|
459
|
+
testIndex++;
|
460
|
+
} else {
|
461
|
+
testIndex--;
|
462
|
+
}
|
463
|
+
|
464
|
+
dom.removeClass(findSpansByIndex(currentIndex), 'mce-match-marker-selected');
|
465
|
+
|
466
|
+
var spans = findSpansByIndex(testIndex);
|
467
|
+
if (spans.length) {
|
468
|
+
dom.addClass(findSpansByIndex(testIndex), 'mce-match-marker-selected');
|
469
|
+
editor.selection.scrollIntoView(spans[0]);
|
470
|
+
return testIndex;
|
471
|
+
}
|
472
|
+
|
473
|
+
return -1;
|
474
|
+
}
|
475
|
+
|
476
|
+
function removeNode(node) {
|
477
|
+
var dom = editor.dom, parent = node.parentNode;
|
478
|
+
|
479
|
+
dom.remove(node);
|
480
|
+
|
481
|
+
if (dom.isEmpty(parent)) {
|
482
|
+
dom.remove(parent);
|
483
|
+
}
|
484
|
+
}
|
485
|
+
|
486
|
+
self.find = function(text, matchCase, wholeWord) {
|
487
|
+
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
488
|
+
text = wholeWord ? '\\b' + text + '\\b' : text;
|
489
|
+
|
490
|
+
var count = markAllMatches(new RegExp(text, matchCase ? 'g' : 'gi'));
|
491
|
+
|
492
|
+
if (count) {
|
493
|
+
currentIndex = -1;
|
494
|
+
currentIndex = moveSelection(true);
|
495
|
+
}
|
496
|
+
|
497
|
+
return count;
|
498
|
+
};
|
499
|
+
|
500
|
+
self.next = function() {
|
501
|
+
var index = moveSelection(true);
|
502
|
+
|
503
|
+
if (index !== -1) {
|
504
|
+
currentIndex = index;
|
505
|
+
}
|
506
|
+
};
|
507
|
+
|
508
|
+
self.prev = function() {
|
509
|
+
var index = moveSelection(false);
|
510
|
+
|
511
|
+
if (index !== -1) {
|
512
|
+
currentIndex = index;
|
513
|
+
}
|
514
|
+
};
|
515
|
+
|
516
|
+
function isMatchSpan(node) {
|
517
|
+
var matchIndex = getElmIndex(node);
|
518
|
+
|
519
|
+
return matchIndex !== null && matchIndex.length > 0;
|
520
|
+
}
|
521
|
+
|
522
|
+
self.replace = function(text, forward, all) {
|
523
|
+
var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex, hasMore;
|
524
|
+
|
525
|
+
forward = forward !== false;
|
526
|
+
|
527
|
+
node = editor.getBody();
|
528
|
+
nodes = tinymce.grep(tinymce.toArray(node.getElementsByTagName('span')), isMatchSpan);
|
529
|
+
for (i = 0; i < nodes.length; i++) {
|
530
|
+
var nodeIndex = getElmIndex(nodes[i]);
|
531
|
+
|
532
|
+
matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
|
533
|
+
if (all || matchIndex === currentIndex) {
|
534
|
+
if (text.length) {
|
535
|
+
nodes[i].firstChild.nodeValue = text;
|
536
|
+
unwrap(nodes[i]);
|
537
|
+
} else {
|
538
|
+
removeNode(nodes[i]);
|
539
|
+
}
|
540
|
+
|
541
|
+
while (nodes[++i]) {
|
542
|
+
matchIndex = parseInt(getElmIndex(nodes[i]), 10);
|
543
|
+
|
544
|
+
if (matchIndex === currentMatchIndex) {
|
545
|
+
removeNode(nodes[i]);
|
546
|
+
} else {
|
547
|
+
i--;
|
548
|
+
break;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
|
552
|
+
if (forward) {
|
553
|
+
nextIndex--;
|
554
|
+
}
|
555
|
+
} else if (currentMatchIndex > currentIndex) {
|
556
|
+
nodes[i].setAttribute('data-mce-index', currentMatchIndex - 1);
|
557
|
+
}
|
558
|
+
}
|
559
|
+
|
560
|
+
editor.undoManager.add();
|
561
|
+
currentIndex = nextIndex;
|
562
|
+
|
563
|
+
if (forward) {
|
564
|
+
hasMore = findSpansByIndex(nextIndex + 1).length > 0;
|
565
|
+
self.next();
|
566
|
+
} else {
|
567
|
+
hasMore = findSpansByIndex(nextIndex - 1).length > 0;
|
568
|
+
self.prev();
|
569
|
+
}
|
570
|
+
|
571
|
+
return !all && hasMore;
|
572
|
+
};
|
573
|
+
|
574
|
+
self.done = function(keepEditorSelection) {
|
575
|
+
var i, nodes, startContainer, endContainer;
|
576
|
+
|
577
|
+
nodes = tinymce.toArray(editor.getBody().getElementsByTagName('span'));
|
578
|
+
for (i = 0; i < nodes.length; i++) {
|
579
|
+
var nodeIndex = getElmIndex(nodes[i]);
|
580
|
+
|
581
|
+
if (nodeIndex !== null && nodeIndex.length) {
|
582
|
+
if (nodeIndex === currentIndex.toString()) {
|
583
|
+
if (!startContainer) {
|
584
|
+
startContainer = nodes[i].firstChild;
|
585
|
+
}
|
586
|
+
|
587
|
+
endContainer = nodes[i].firstChild;
|
588
|
+
}
|
589
|
+
|
590
|
+
unwrap(nodes[i]);
|
591
|
+
}
|
592
|
+
}
|
593
|
+
|
594
|
+
if (startContainer && endContainer) {
|
595
|
+
var rng = editor.dom.createRng();
|
596
|
+
rng.setStart(startContainer, 0);
|
597
|
+
rng.setEnd(endContainer, endContainer.data.length);
|
598
|
+
|
599
|
+
if (keepEditorSelection !== false) {
|
600
|
+
editor.selection.setRng(rng);
|
601
|
+
}
|
602
|
+
|
603
|
+
return rng;
|
604
|
+
}
|
605
|
+
};
|
606
|
+
}
|
607
|
+
|
608
|
+
tinymce.PluginManager.add('searchreplace', Plugin);
|
609
|
+
})();
|