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(){var e={},t=function(t){for(var n=e[t],i=n.deps,o=n.defn,a=i.length,s=new Array(a),l=0;l<a;++l)s[l]=r(i[l]);var c=o.apply(null,s);if(void 0===c)throw"module ["+t+"] returned undefined";n.instance=c},n=function(t,n,r){if("string"!=typeof t)throw"module id must be a string";if(void 0===n)throw"no dependencies for "+t;if(void 0===r)throw"no definition function for "+t;e[t]={deps:n,defn:r,instance:void 0}},r=function(n){var r=e[n];if(void 0===r)throw"module ["+n+"] was undefined";return void 0===r.instance&&t(n),r.instance},i=function(e,t){for(var n=e.length,i=new Array(n),o=0;o<n;++o)i.push(r(e[o]));t.apply(null,t)},o={};o.bolt={module:{api:{define:n,require:i,demand:r}}};var a=n,s=function(e,t){a(e,[],function(){return t})};s("1",tinymce.ThemeManager),s("2",tinymce.util.Delay),s("c",tinymce.util.Tools),s("d",tinymce.ui.Factory),s("e",tinymce.DOM),a("j",[],function(){var e=function(e){return function(t){return typeof t===e}},t=function(e){return Array.isArray(e)},n=function(e){return null===e},r=function(e){return function(r){return!n(r)&&!t(r)&&e(r)}};return{isString:e("string"),isNumber:e("number"),isBoolean:e("boolean"),isFunction:e("function"),isObject:r(e("object")),isNull:n,isArray:t}}),a("f",["c","d","j"],function(e,t,n){var r=function(e,t){return function(n,r){for(var i,o=r.parents.length;o--&&(i=r.parents[o].nodeName,"OL"!=i&&"UL"!=i););e.active(n&&i==t)}},i=function(e,t){var n=function(e,t){return{selector:e,handler:t}},i=function(e){t.active(e)},o=function(e){t.disabled(e)};return"bullist"==e?n("ul > li",r(t,"UL")):"numlist"==e?n("ol > li",r(t,"OL")):t.settings.stateSelector?n(t.settings.stateSelector,i):t.settings.disabledStateSelector?n(t.settings.disabledStateSelector,o):null},o=function(e,t,n){return function(){var r=i(t,n);null!==r&&e.selection.selectorChanged(r.selector,r.handler)}},a=function(e){return n.isArray(e)?e:n.isString(e)?e.split(/[ ,]/):[]},s=function(n,r,i){var s,l=[];if(i)return e.each(a(i),function(e){var r;"|"==e?s=null:t.has(e)?(e={type:e},l.push(e),s=null):n.buttons[e]&&(s||(s={type:"buttongroup",items:[]},l.push(s)),r=e,e=n.buttons[r],"function"==typeof e&&(e=e()),e.type=e.type||"button",e=t.create(e),e.on("postRender",o(n,r,e)),s.items.push(e))}),t.create({type:"toolbar",layout:"flow",name:r,items:l})};return{create:s}}),s("o",tinymce.util.Promise),a("p",[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)};return"s"+Date.now().toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),a("u",[],function(){var e=function(e,t){function n(n){var i,o,a;o=t[n?"startContainer":"endContainer"],a=t[n?"startOffset":"endOffset"],1==o.nodeType&&(i=e.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(a=Math.min(a,o.childNodes.length-1),n?o.insertBefore(i,o.childNodes[a]):e.insertAfter(i,o.childNodes[a])):o.appendChild(i),o=i,a=0),r[n?"startContainer":"endContainer"]=o,r[n?"startOffset":"endOffset"]=a}var r={};return n(!0),t.collapsed||n(),r},t=function(e,t){function n(n){function r(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;1==t.nodeType&&"bookmark"==t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}var i,o,a;i=a=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],i&&(1==i.nodeType&&(o=r(i),i=i.parentNode,e.remove(a)),t[n?"startContainer":"endContainer"]=i,t[n?"startOffset":"endOffset"]=o)}n(!0),n();var r=e.createRng();return r.setStart(t.startContainer,t.startOffset),t.endContainer&&r.setEnd(t.endContainer,t.endOffset),r};return{create:e,resolve:t}}),s("v",tinymce.dom.TreeWalker),s("w",tinymce.dom.RangeUtils),a("q",["u","c","v","w"],function(e,t,n,r){var i=function(e,t,r){var i,o,a=[];for(i=new n(t,e),o=t;o&&(1===o.nodeType&&a.push(o),o!==r);o=i.next());return a},o=function(n,r){var i,o,a;o=n.dom,a=n.selection,i=e.create(o,a.getRng()),t.each(r,function(e){n.dom.remove(e,!0)}),a.setRng(e.resolve(o,i))},a=function(e){return"A"===e.nodeName&&e.hasAttribute("href")},s=function(e,t){var n=e.getParent(t,a);return n?n:t},l=function(e){var n,o,l,c,u,d,f;return u=e.selection,d=e.dom,f=u.getRng(),n=s(d,r.getNode(f.startContainer,f.startOffset)),o=r.getNode(f.endContainer,f.endOffset),l=e.getBody(),c=t.grep(i(l,n,o),a)},c=function(e){o(e,l(e))};return{unlinkSelection:c}}),a("m",["p","q"],function(e,t){var n=function(e,t){var n,r,i;for(i='<table data-mce-id="mce" style="width: 100%">',i+="<tbody>",r=0;r<t;r++){for(i+="<tr>",n=0;n<e;n++)i+="<td><br></td>";i+="</tr>"}return i+="</tbody>",i+="</table>"},r=function(e){var t=e.dom.select("*[data-mce-id]");return t[0]},i=function(e,t,i){e.undoManager.transact(function(){var o,a;e.insertContent(n(t,i)),o=r(e),o.removeAttribute("data-mce-id"),a=e.dom.select("td,th",o),e.selection.setCursorLocation(a[0],0)})},o=function(e,t){e.execCommand("FormatBlock",!1,t)},a=function(t,n,r){var i,o;i=t.editorUpload.blobCache,o=i.create(e.uuid("mceu"),r,n),i.add(o),t.insertContent(t.dom.createHTML("img",{src:o.blobUri()}))},s=function(e){e.selection.collapse(!1)},l=function(e){e.focus(),t.unlinkSelection(e),s(e)},c=function(e,t,n){e.focus(),e.dom.setAttrib(t,"href",n),s(e)},u=function(e,t){e.execCommand("mceInsertLink",!1,{href:t}),s(e)},d=function(e,t){var n=e.dom.getParent(e.selection.getStart(),"a[href]");n?c(e,n,t):u(e,t)},f=function(e,t){0===t.trim().length?l(e):d(e,t)};return{insertTable:i,formatBlock:o,insertBlob:a,createLink:f,unlink:l}}),a("r",[],function(){var e=function(e){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(e.trim())},t=function(e){return/^https?:\/\//.test(e.trim())};return{isDomainLike:e,isAbsolute:t}}),a("g",["c","d","o","m","r"],function(e,t,n,r,i){var o=function(e){e.find("textbox").eq(0).each(function(e){e.focus()})},a=function(n,r){var i=t.create(e.extend({type:"form",layout:"flex",direction:"row",padding:5,name:n,spacing:3},r));return i.on("show",function(){o(i)}),i},s=function(e,t){return t?e.show():e.hide()},l=function(e,t){return new n(function(n){e.windowManager.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){var r=e===!0?"http://"+t:t;n(r)})})},c=function(e,t){return!i.isAbsolute(t)&&i.isDomainLike(t)?l(e,t):n.resolve(t)},u=function(e,t){var n=function(){e.focus(),r.unlink(e),t()};return a("quicklink",{items:[{type:"button",name:"unlink",icon:"unlink",onclick:n,tooltip:"Remove link"},{type:"textbox",name:"linkurl",placeholder:"Paste or type a link"},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(){var t,n="";t=e.dom.getParent(e.selection.getStart(),"a[href]"),t&&(n=e.dom.getAttrib(t,"href")),this.fromJSON({linkurl:n}),s(this.find("#unlink"),t)},onsubmit:function(n){c(e,n.data.linkurl).then(function(n){r.createLink(e,n),t()})}})};return{createQuickLinkForm:u}}),s("s",tinymce.geom.Rect),a("t",[],function(){var e=function(e){return{x:e.left,y:e.top,w:e.width,h:e.height}},t=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}};return{fromClientRect:e,toClientRect:t}}),a("h",["e","s","t"],function(e,t,n){var r=function(t){var n=e.getViewPort();return{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}},i=function(e){var t=e.getBoundingClientRect();return r({x:t.left,y:t.top,w:Math.max(e.clientWidth,e.offsetWidth),h:Math.max(e.clientHeight,e.offsetHeight)})},o=function(e,t){return i(t)},a=function(e){return i(e.getElement().ownerDocument.body)},s=function(e){return i(e.getContentAreaContainer()||e.getBody())},l=function(e){var t=e.selection.getBoundingClientRect();return t?r(n.fromClientRect(t)):null};return{getElementRect:o,getPageAreaRect:a,getContentAreaRect:s,getSelectionRect:l}}),a("i",["s","t"],function(e,t){var n=function(e,t){return{rect:e,position:t}},r=function(e,t){return{x:t.x,y:t.y,w:e.w,h:e.h}},i=function(t,i,o,a,s){var l,c,u;return l=e.findBestRelativePosition(s,o,a,t),o=e.clamp(o,a),l?(c=e.relativePosition(s,o,l),u=r(s,c),n(u,l)):(o=e.intersect(a,o),o?(l=e.findBestRelativePosition(s,o,a,i))?(c=e.relativePosition(s,o,l),u=r(s,c),n(u,l)):(u=r(s,o),n(u,l)):null)},o=function(e,t,n){return i(["cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr"],e,t,n)},a=function(e,t,n){return i(["tc-bc","bc-tc","tl-bl","bl-tl","tr-br","br-tr"],["bc-tc","bl-tl","br-tr"],e,t,n)},s=function(e,n,r,i){var o;return"function"==typeof e?(o=e({elementRect:t.toClientRect(n),contentAreaRect:t.toClientRect(r),panelRect:t.toClientRect(i)}),t.fromClientRect(o)):i},l=function(e){return e.panelRect};return{calcInsert:o,calc:a,userConstrain:s,defaultHandler:l}}),a("a",["j"],function(e){var t=function(e,t){if(t(e))return!0;throw new Error("Default value doesn't match requested type.")},n=function(e){return function(n,r,i){var o=n.settings;return t(i,e),r in o&&e(o[r])?o[r]:i}},r=function(e,t){return e.split(t).filter(function(e){return e.length>0})},i=function(t,n){var i=function(e){return"string"==typeof e?r(e,/[ ,]/):e},o=function(e,t){return e===!1?[]:t};return e.isArray(t)?t:e.isString(t)?i(t):e.isBoolean(t)?o(t,n):n},o=function(e){return function(n,r,o){var a=r in n.settings?n.settings[r]:o;return t(o,e),i(a,o)}};return{getStringOr:n(e.isString),getBoolOr:n(e.isBoolean),getNumberOr:n(e.isNumber),getHandlerOr:n(e.isFunction),getToolbarItemsOr:o(e.isArray)}}),a("3",["c","d","e","f","g","h","i","a"],function(e,t,n,r,i,o,a,s){return function(){var l,c,u=["bold","italic","|","quicklink","h2","h3","blockquote"],d=["quickimage","quicktable"],f=function(t,n){return e.map(n,function(e){return r.create(t,e.id,e.items)})},h=function(e){return s.getToolbarItemsOr(e,"selection_toolbar",u)},p=function(e){return s.getToolbarItemsOr(e,"insert_toolbar",d)},m=function(e){return e.items().length>0},g=function(n,o){var a=f(n,o).concat([r.create(n,"text",h(n)),r.create(n,"insert",p(n)),i.createQuickLinkForm(n,_)]);return t.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:e.grep(a,m),oncancel:function(){n.focus()}})},v=function(e){e&&e.show()},y=function(e,t){e.moveTo(t.x,t.y)},b=function(t,n){n=n?n.substr(0,2):"",e.each({t:"down",b:"up",c:"center"},function(e,r){t.classes.toggle("arrow-"+e,r===n.substr(0,1))}),"cr"===n?(t.classes.toggle("arrow-left",!0),t.classes.toggle("arrow-right",!1)):"cl"===n?(t.classes.toggle("arrow-left",!0),t.classes.toggle("arrow-right",!0)):e.each({l:"left",r:"right"},function(e,r){t.classes.toggle("arrow-"+e,r===n.substr(1,1))})},C=function(e,t){var n=e.items().filter("#"+t);return n.length>0&&(n[0].show(),e.reflow(),!0)},x=function(e,t,r,i){var l,u,d,f;return v(e),e.items().hide(),C(e,t)?(f=s.getHandlerOr(r,"inline_toolbar_position_handler",a.defaultHandler),l=o.getContentAreaRect(r),u=n.getRect(e.getEl()),d="insert"===t?a.calcInsert(i,l,u):a.calc(i,l,u),void(d?(u=d.rect,c=i,y(e,a.userConstrain(f,i,l,u)),b(e,d.position)):_(e))):void _(e)},w=function(){return l.items().filter("form:visible").length>0},N=function(e,t){if(l){if(l.items().hide(),!C(l,t))return void _(l);var r,i,u,d;v(l),l.items().hide(),C(l,t),d=s.getHandlerOr(e,"inline_toolbar_position_handler",a.defaultHandler),r=o.getContentAreaRect(e),i=n.getRect(l.getEl()),u=a.calc(c,r,i),u&&(i=u.rect,y(l,a.userConstrain(d,c,r,i)),b(l,u.position))}},E=function(e,t,n,r){l||(l=g(e,r),l.renderTo(document.body).reflow().moveTo(n.x,n.y),e.nodeChanged()),x(l,t,e,n)},_=function(){l&&l.hide()},S=function(){l&&l.find("toolbar:visible").eq(0).each(function(e){e.focus(!0)})},k=function(){l&&(l.remove(),l=null)},T=function(){return l&&l.visible()&&w()};return{show:E,showForm:N,inForm:T,hide:_,focus:S,remove:k}}}),a("k",["o"],function(e){var t=function(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(t)})};return{blobToBase64:t}}),a("l",["o"],function(e){var t=function(){return new e(function(e){var t;t=document.createElement("input"),t.type="file",t.style.position="fixed",t.style.left=0,t.style.top=0,t.style.opacity=.001,document.body.appendChild(t),t.onchange=function(t){e(Array.prototype.slice.call(t.target.files))},t.click(),t.parentNode.removeChild(t)})};return{pickFile:t}}),a("4",["3","k","l","m"],function(e,t,n,r){var i=function(e){for(var t=function(t){return function(){r.formatBlock(e,t)}},n=1;n<6;n++){var i="h"+n;e.addButton(i,{text:i.toUpperCase(),tooltip:"Heading "+n,stateSelector:i,onclick:t(i),onPostRender:function(){var e=this.getEl().firstChild.firstChild;e.style.fontWeight="bold"}})}},o=function(e,o){e.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){o.showForm(e,"quicklink")}}),e.addButton("quickimage",{icon:"image",tooltip:"Insert image",onclick:function(){n.pickFile().then(function(n){var i=n[0];t.blobToBase64(i).then(function(t){r.insertBlob(e,t,i)})})}}),e.addButton("quicktable",{icon:"table",tooltip:"Insert table",onclick:function(){o.hide(),r.insertTable(e,2,2)}}),i(e)};return{addToEditor:o}}),s("n",tinymce.EditorManager),a("5",["n","e"],function(e,t){var n=function(e,t){var n=function(){e.fire("SkinLoaded"),t()};e.initialized?n():e.on("init",n)},r=function(t){var n=e.baseURL+"/skins/";return t?n+t:n+"lightgray"},i=function(e,t){return e.documentBaseURI.toAbsolute(t)},o=function(e,o){var a=e.settings,s=a.skin_url?i(e,a.skin_url):r(a.skin),l=function(){n(e,o)};t.styleSheetLoader.load(s+"/skin.min.css",l),e.contentCSS.push(s+"/content.inline.min.css")};return{load:o}}),a("8",[],function(){var e=function(e,t){return{id:e,rect:t}},t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r(e);if(i)return i}return null};return{match:t,result:e}}),a("6",["8","h"],function(e,t){var n=function(n){return function(r){return r.selection.isCollapsed()?null:e.result(n,t.getSelectionRect(r))}},r=function(n,r){return function(i){var o,a=i.schema.getTextBlockElements();for(o=0;o<n.length;o++)if("TABLE"===n[o].nodeName)return null;for(o=0;o<n.length;o++)if(n[o].nodeName in a)return i.dom.isEmpty(n[o])?e.result(r,t.getSelectionRect(i)):null;return null}};return{textSelection:n,emptyTextBlock:r}}),a("7",["8","h"],function(e,t){var n=function(n,r){return function(i){for(var o=0;o<r.length;o++)if(r[o].predicate(n))return e.result(r[o].id,t.getElementRect(i,n));return null}},r=function(n,r){return function(i){for(var o=0;o<n.length;o++)for(var a=0;a<r.length;a++)if(r[a].predicate(n[o]))return e.result(r[a].id,t.getElementRect(i,n[o]));return null}};return{element:n,parent:r}}),a("9",[],function(){var e=function(t){return t.reduce(function(t,n){return Array.isArray(n)?t.concat(e(n)):t.concat(n)},[])};return{flatten:e}}),a("b",["c"],function(e){var t=function(e,t){return{id:e,predicate:t}},n=function(n){return e.map(n,function(e){return t(e.id,e.predicate)})};return{create:t,fromContextToolbars:n}}),a("0",["1","2","3","4","5","6","7","8","9","a","b"],function(e,t,n,r,i,o,a,s,l,c,u){var d=function(e){var t=e.selection.getNode(),n=e.dom.getParents(t);return n},f=function(e,t,n,r){var i=function(n){return e.dom.is(n,t)};return{predicate:i,id:n,items:r}},h=function(e){var t=e.contextToolbars;return l.flatten([t?t:[],f(e,"img","image","alignleft aligncenter alignright")])},p=function(e,t){var n,r,i;return r=d(e),i=u.fromContextToolbars(t),n=s.match(e,[a.element(r[0],i),o.textSelection("text"),o.emptyTextBlock(r,"insert"),a.parent(r,i)]),n&&n.rect?n:null},m=function(e,t){var n=function(){var n=h(e),r=p(e,n);r?t.show(e,r.id,r.rect,n):t.hide()};return function(){e.removed||n()}},g=function(e,t){return function(){e.inForm()||t()}},v=function(e,n){var r=t.throttle(m(e,n),0),i=t.throttle(g(n,m(e,n)),0);e.on("blur hide ObjectResizeStart",n.hide),e.on("click",r),e.on("nodeChange mouseup",i),e.on("ResizeEditor ResizeWindow keyup",r),e.on("remove",n.remove),e.shortcuts.add("Alt+F10","",n.focus)},y=function(e,t){e.shortcuts.remove("meta+k"),e.shortcuts.add("meta+k","",function(){var n=h(e),r=r=s.match(e,[o.textSelection("quicklink")]);r&&t.show(e,r.id,r.rect,n)})},b=function(e,t){return i.load(e,function(){v(e,t),y(e,t)}),{}},C=function(e){throw new Error(e)};return e.add("inlite",function(e){var t=new n;r.addToEditor(e,t);var i=function(){return e.inline?b(e,t):C("inlite theme only supports inline mode.")};return{renderUI:i}}),function(){}}),r("0")()}();
|
@@ -0,0 +1,934 @@
|
|
1
|
+
/**
|
2
|
+
* theme.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.ThemeManager.add('modern', function(editor) {
|
14
|
+
var self = this, settings = editor.settings, Factory = tinymce.ui.Factory,
|
15
|
+
each = tinymce.each, DOM = tinymce.DOM, Rect = tinymce.geom.Rect, FloatPanel = tinymce.ui.FloatPanel;
|
16
|
+
|
17
|
+
// Default menus
|
18
|
+
var defaultMenus = {
|
19
|
+
file: {title: 'File', items: 'newdocument'},
|
20
|
+
edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
|
21
|
+
insert: {title: 'Insert', items: '|'},
|
22
|
+
view: {title: 'View', items: 'visualaid |'},
|
23
|
+
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
|
24
|
+
table: {title: 'Table'},
|
25
|
+
tools: {title: 'Tools'}
|
26
|
+
};
|
27
|
+
|
28
|
+
var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
|
29
|
+
"bullist numlist outdent indent | link image";
|
30
|
+
|
31
|
+
function createToolbar(items, size) {
|
32
|
+
var toolbarItems = [], buttonGroup;
|
33
|
+
|
34
|
+
if (!items) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
|
38
|
+
each(items.split(/[ ,]/), function(item) {
|
39
|
+
var itemName;
|
40
|
+
|
41
|
+
function bindSelectorChanged() {
|
42
|
+
var selection = editor.selection;
|
43
|
+
|
44
|
+
function setActiveItem(name) {
|
45
|
+
return function(state, args) {
|
46
|
+
var nodeName, i = args.parents.length;
|
47
|
+
|
48
|
+
while (i--) {
|
49
|
+
nodeName = args.parents[i].nodeName;
|
50
|
+
if (nodeName == "OL" || nodeName == "UL") {
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
item.active(state && nodeName == name);
|
56
|
+
};
|
57
|
+
}
|
58
|
+
|
59
|
+
if (itemName == "bullist") {
|
60
|
+
selection.selectorChanged('ul > li', setActiveItem("UL"));
|
61
|
+
}
|
62
|
+
|
63
|
+
if (itemName == "numlist") {
|
64
|
+
selection.selectorChanged('ol > li', setActiveItem("OL"));
|
65
|
+
}
|
66
|
+
|
67
|
+
if (item.settings.stateSelector) {
|
68
|
+
selection.selectorChanged(item.settings.stateSelector, function(state) {
|
69
|
+
item.active(state);
|
70
|
+
}, true);
|
71
|
+
}
|
72
|
+
|
73
|
+
if (item.settings.disabledStateSelector) {
|
74
|
+
selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
|
75
|
+
item.disabled(state);
|
76
|
+
});
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
if (item == "|") {
|
81
|
+
buttonGroup = null;
|
82
|
+
} else {
|
83
|
+
if (Factory.has(item)) {
|
84
|
+
item = {type: item, size: size};
|
85
|
+
toolbarItems.push(item);
|
86
|
+
buttonGroup = null;
|
87
|
+
} else {
|
88
|
+
if (!buttonGroup) {
|
89
|
+
buttonGroup = {type: 'buttongroup', items: []};
|
90
|
+
toolbarItems.push(buttonGroup);
|
91
|
+
}
|
92
|
+
|
93
|
+
if (editor.buttons[item]) {
|
94
|
+
// TODO: Move control creation to some UI class
|
95
|
+
itemName = item;
|
96
|
+
item = editor.buttons[itemName];
|
97
|
+
|
98
|
+
if (typeof item == "function") {
|
99
|
+
item = item();
|
100
|
+
}
|
101
|
+
|
102
|
+
item.type = item.type || 'button';
|
103
|
+
item.size = size;
|
104
|
+
|
105
|
+
item = Factory.create(item);
|
106
|
+
buttonGroup.items.push(item);
|
107
|
+
|
108
|
+
if (editor.initialized) {
|
109
|
+
bindSelectorChanged();
|
110
|
+
} else {
|
111
|
+
editor.on('init', bindSelectorChanged);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
});
|
117
|
+
|
118
|
+
return {
|
119
|
+
type: 'toolbar',
|
120
|
+
layout: 'flow',
|
121
|
+
items: toolbarItems
|
122
|
+
};
|
123
|
+
}
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Creates the toolbars from config and returns a toolbar array.
|
127
|
+
*
|
128
|
+
* @param {String} size Optional toolbar item size.
|
129
|
+
* @return {Array} Array with toolbars.
|
130
|
+
*/
|
131
|
+
function createToolbars(size) {
|
132
|
+
var toolbars = [];
|
133
|
+
|
134
|
+
function addToolbar(items) {
|
135
|
+
if (items) {
|
136
|
+
toolbars.push(createToolbar(items, size));
|
137
|
+
return true;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
// Convert toolbar array to multiple options
|
142
|
+
if (tinymce.isArray(settings.toolbar)) {
|
143
|
+
// Empty toolbar array is the same as a disabled toolbar
|
144
|
+
if (settings.toolbar.length === 0) {
|
145
|
+
return;
|
146
|
+
}
|
147
|
+
|
148
|
+
tinymce.each(settings.toolbar, function(toolbar, i) {
|
149
|
+
settings["toolbar" + (i + 1)] = toolbar;
|
150
|
+
});
|
151
|
+
|
152
|
+
delete settings.toolbar;
|
153
|
+
}
|
154
|
+
|
155
|
+
// Generate toolbar<n>
|
156
|
+
for (var i = 1; i < 10; i++) {
|
157
|
+
if (!addToolbar(settings["toolbar" + i])) {
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
// Generate toolbar or default toolbar unless it's disabled
|
163
|
+
if (!toolbars.length && settings.toolbar !== false) {
|
164
|
+
addToolbar(settings.toolbar || defaultToolbar);
|
165
|
+
}
|
166
|
+
|
167
|
+
if (toolbars.length) {
|
168
|
+
return {
|
169
|
+
type: 'panel',
|
170
|
+
layout: 'stack',
|
171
|
+
classes: "toolbar-grp",
|
172
|
+
ariaRoot: true,
|
173
|
+
ariaRemember: true,
|
174
|
+
items: toolbars
|
175
|
+
};
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Creates the menu buttons based on config.
|
181
|
+
*
|
182
|
+
* @return {Array} Menu buttons array.
|
183
|
+
*/
|
184
|
+
function createMenuButtons() {
|
185
|
+
var name, menuButtons = [];
|
186
|
+
|
187
|
+
function createMenuItem(name) {
|
188
|
+
var menuItem;
|
189
|
+
|
190
|
+
if (name == '|') {
|
191
|
+
return {text: '|'};
|
192
|
+
}
|
193
|
+
|
194
|
+
menuItem = editor.menuItems[name];
|
195
|
+
|
196
|
+
return menuItem;
|
197
|
+
}
|
198
|
+
|
199
|
+
function createMenu(context) {
|
200
|
+
var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
|
201
|
+
|
202
|
+
removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
|
203
|
+
|
204
|
+
// User defined menu
|
205
|
+
if (settings.menu) {
|
206
|
+
menu = settings.menu[context];
|
207
|
+
isUserDefined = true;
|
208
|
+
} else {
|
209
|
+
menu = defaultMenus[context];
|
210
|
+
}
|
211
|
+
|
212
|
+
if (menu) {
|
213
|
+
menuButton = {text: menu.title};
|
214
|
+
menuItems = [];
|
215
|
+
|
216
|
+
// Default/user defined items
|
217
|
+
each((menu.items || '').split(/[ ,]/), function(item) {
|
218
|
+
var menuItem = createMenuItem(item);
|
219
|
+
|
220
|
+
if (menuItem && !removedMenuItems[item]) {
|
221
|
+
menuItems.push(createMenuItem(item));
|
222
|
+
}
|
223
|
+
});
|
224
|
+
|
225
|
+
// Added though context
|
226
|
+
if (!isUserDefined) {
|
227
|
+
each(editor.menuItems, function(menuItem) {
|
228
|
+
if (menuItem.context == context) {
|
229
|
+
if (menuItem.separator == 'before') {
|
230
|
+
menuItems.push({text: '|'});
|
231
|
+
}
|
232
|
+
|
233
|
+
if (menuItem.prependToContext) {
|
234
|
+
menuItems.unshift(menuItem);
|
235
|
+
} else {
|
236
|
+
menuItems.push(menuItem);
|
237
|
+
}
|
238
|
+
|
239
|
+
if (menuItem.separator == 'after') {
|
240
|
+
menuItems.push({text: '|'});
|
241
|
+
}
|
242
|
+
}
|
243
|
+
});
|
244
|
+
}
|
245
|
+
|
246
|
+
for (var i = 0; i < menuItems.length; i++) {
|
247
|
+
if (menuItems[i].text == '|') {
|
248
|
+
if (i === 0 || i == menuItems.length - 1) {
|
249
|
+
menuItems.splice(i, 1);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
menuButton.menu = menuItems;
|
255
|
+
|
256
|
+
if (!menuButton.menu.length) {
|
257
|
+
return null;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
return menuButton;
|
262
|
+
}
|
263
|
+
|
264
|
+
var defaultMenuBar = [];
|
265
|
+
if (settings.menu) {
|
266
|
+
for (name in settings.menu) {
|
267
|
+
defaultMenuBar.push(name);
|
268
|
+
}
|
269
|
+
} else {
|
270
|
+
for (name in defaultMenus) {
|
271
|
+
defaultMenuBar.push(name);
|
272
|
+
}
|
273
|
+
}
|
274
|
+
|
275
|
+
var enabledMenuNames = typeof settings.menubar == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
|
276
|
+
for (var i = 0; i < enabledMenuNames.length; i++) {
|
277
|
+
var menu = enabledMenuNames[i];
|
278
|
+
menu = createMenu(menu);
|
279
|
+
|
280
|
+
if (menu) {
|
281
|
+
menuButtons.push(menu);
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
return menuButtons;
|
286
|
+
}
|
287
|
+
|
288
|
+
/**
|
289
|
+
* Adds accessibility shortcut keys to panel.
|
290
|
+
*
|
291
|
+
* @param {tinymce.ui.Panel} panel Panel to add focus to.
|
292
|
+
*/
|
293
|
+
function addAccessibilityKeys(panel) {
|
294
|
+
function focus(type) {
|
295
|
+
var item = panel.find(type)[0];
|
296
|
+
|
297
|
+
if (item) {
|
298
|
+
item.focus(true);
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
editor.shortcuts.add('Alt+F9', '', function() {
|
303
|
+
focus('menubar');
|
304
|
+
});
|
305
|
+
|
306
|
+
editor.shortcuts.add('Alt+F10', '', function() {
|
307
|
+
focus('toolbar');
|
308
|
+
});
|
309
|
+
|
310
|
+
editor.shortcuts.add('Alt+F11', '', function() {
|
311
|
+
focus('elementpath');
|
312
|
+
});
|
313
|
+
|
314
|
+
panel.on('cancel', function() {
|
315
|
+
editor.focus();
|
316
|
+
});
|
317
|
+
}
|
318
|
+
|
319
|
+
/**
|
320
|
+
* Resizes the editor to the specified width, height.
|
321
|
+
*/
|
322
|
+
function resizeTo(width, height) {
|
323
|
+
var containerElm, iframeElm, containerSize, iframeSize;
|
324
|
+
|
325
|
+
function getSize(elm) {
|
326
|
+
return {
|
327
|
+
width: elm.clientWidth,
|
328
|
+
height: elm.clientHeight
|
329
|
+
};
|
330
|
+
}
|
331
|
+
|
332
|
+
containerElm = editor.getContainer();
|
333
|
+
iframeElm = editor.getContentAreaContainer().firstChild;
|
334
|
+
containerSize = getSize(containerElm);
|
335
|
+
iframeSize = getSize(iframeElm);
|
336
|
+
|
337
|
+
if (width !== null) {
|
338
|
+
width = Math.max(settings.min_width || 100, width);
|
339
|
+
width = Math.min(settings.max_width || 0xFFFF, width);
|
340
|
+
|
341
|
+
DOM.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
|
342
|
+
DOM.setStyle(iframeElm, 'width', width);
|
343
|
+
}
|
344
|
+
|
345
|
+
height = Math.max(settings.min_height || 100, height);
|
346
|
+
height = Math.min(settings.max_height || 0xFFFF, height);
|
347
|
+
DOM.setStyle(iframeElm, 'height', height);
|
348
|
+
|
349
|
+
editor.fire('ResizeEditor');
|
350
|
+
}
|
351
|
+
|
352
|
+
function resizeBy(dw, dh) {
|
353
|
+
var elm = editor.getContentAreaContainer();
|
354
|
+
self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
|
355
|
+
}
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Handles contextual toolbars.
|
359
|
+
*/
|
360
|
+
function addContextualToolbars() {
|
361
|
+
var scrollContainer;
|
362
|
+
|
363
|
+
function getContextToolbars() {
|
364
|
+
return editor.contextToolbars || [];
|
365
|
+
}
|
366
|
+
|
367
|
+
function getElementRect(elm) {
|
368
|
+
var pos, targetRect, root;
|
369
|
+
|
370
|
+
pos = tinymce.DOM.getPos(editor.getContentAreaContainer());
|
371
|
+
targetRect = editor.dom.getRect(elm);
|
372
|
+
root = editor.dom.getRoot();
|
373
|
+
|
374
|
+
// Adjust targetPos for scrolling in the editor
|
375
|
+
if (root.nodeName == 'BODY') {
|
376
|
+
targetRect.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
|
377
|
+
targetRect.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
|
378
|
+
}
|
379
|
+
|
380
|
+
targetRect.x += pos.x;
|
381
|
+
targetRect.y += pos.y;
|
382
|
+
|
383
|
+
return targetRect;
|
384
|
+
}
|
385
|
+
|
386
|
+
function hideAllFloatingPanels() {
|
387
|
+
each(editor.contextToolbars, function(toolbar) {
|
388
|
+
if (toolbar.panel) {
|
389
|
+
toolbar.panel.hide();
|
390
|
+
}
|
391
|
+
});
|
392
|
+
}
|
393
|
+
|
394
|
+
function togglePositionClass(panel, relPos, predicate) {
|
395
|
+
relPos = relPos ? relPos.substr(0, 2) : '';
|
396
|
+
|
397
|
+
each({
|
398
|
+
t: 'down',
|
399
|
+
b: 'up'
|
400
|
+
}, function(cls, pos) {
|
401
|
+
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(0, 1)));
|
402
|
+
});
|
403
|
+
|
404
|
+
each({
|
405
|
+
l: 'left',
|
406
|
+
r: 'right'
|
407
|
+
}, function(cls, pos) {
|
408
|
+
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(1, 1)));
|
409
|
+
});
|
410
|
+
}
|
411
|
+
|
412
|
+
function toClientRect(geomRect) {
|
413
|
+
return {
|
414
|
+
left: geomRect.x,
|
415
|
+
top: geomRect.y,
|
416
|
+
width: geomRect.w,
|
417
|
+
height: geomRect.h,
|
418
|
+
right: geomRect.x + geomRect.w,
|
419
|
+
bottom: geomRect.y + geomRect.h
|
420
|
+
};
|
421
|
+
}
|
422
|
+
|
423
|
+
function userConstrain(x, y, elementRect, contentAreaRect, panelRect) {
|
424
|
+
panelRect = toClientRect({x: x, y: y, w: panelRect.w, h: panelRect.h});
|
425
|
+
|
426
|
+
if (settings.inline_toolbar_position_handler) {
|
427
|
+
panelRect = settings.inline_toolbar_position_handler({
|
428
|
+
elementRect: toClientRect(elementRect),
|
429
|
+
contentAreaRect: toClientRect(contentAreaRect),
|
430
|
+
panelRect: panelRect
|
431
|
+
});
|
432
|
+
}
|
433
|
+
|
434
|
+
return panelRect;
|
435
|
+
}
|
436
|
+
|
437
|
+
function movePanelTo(panel, pos) {
|
438
|
+
panel.moveTo(pos.left, pos.top);
|
439
|
+
}
|
440
|
+
|
441
|
+
function reposition(match) {
|
442
|
+
var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions, smallElementWidthThreshold;
|
443
|
+
|
444
|
+
if (editor.removed) {
|
445
|
+
return;
|
446
|
+
}
|
447
|
+
|
448
|
+
if (!match || !match.toolbar.panel) {
|
449
|
+
hideAllFloatingPanels();
|
450
|
+
return;
|
451
|
+
}
|
452
|
+
|
453
|
+
testPositions = [
|
454
|
+
'bc-tc', 'tc-bc',
|
455
|
+
'tl-bl', 'bl-tl',
|
456
|
+
'tr-br', 'br-tr'
|
457
|
+
];
|
458
|
+
|
459
|
+
panel = match.toolbar.panel;
|
460
|
+
panel.show();
|
461
|
+
|
462
|
+
elementRect = getElementRect(match.element);
|
463
|
+
panelRect = tinymce.DOM.getRect(panel.getEl());
|
464
|
+
contentAreaRect = tinymce.DOM.getRect(editor.getContentAreaContainer() || editor.getBody());
|
465
|
+
smallElementWidthThreshold = 25;
|
466
|
+
|
467
|
+
// We need to use these instead of the rect values since the style
|
468
|
+
// size properites might not be the same as the real size for a table
|
469
|
+
elementRect.w = match.element.clientWidth;
|
470
|
+
elementRect.h = match.element.clientHeight;
|
471
|
+
|
472
|
+
if (!editor.inline) {
|
473
|
+
contentAreaRect.w = editor.getDoc().documentElement.offsetWidth;
|
474
|
+
}
|
475
|
+
|
476
|
+
// Inflate the elementRect so it doesn't get placed above resize handles
|
477
|
+
if (editor.selection.controlSelection.isResizable(match.element) && elementRect.w < smallElementWidthThreshold) {
|
478
|
+
elementRect = Rect.inflate(elementRect, 0, 8);
|
479
|
+
}
|
480
|
+
|
481
|
+
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, testPositions);
|
482
|
+
elementRect = Rect.clamp(elementRect, contentAreaRect);
|
483
|
+
|
484
|
+
if (relPos) {
|
485
|
+
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
486
|
+
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
487
|
+
} else {
|
488
|
+
// Allow overflow below the editor to avoid placing toolbars ontop of tables
|
489
|
+
contentAreaRect.h += panelRect.h;
|
490
|
+
|
491
|
+
elementRect = Rect.intersect(contentAreaRect, elementRect);
|
492
|
+
if (elementRect) {
|
493
|
+
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, [
|
494
|
+
'bc-tc', 'bl-tl', 'br-tr'
|
495
|
+
]);
|
496
|
+
|
497
|
+
if (relPos) {
|
498
|
+
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
499
|
+
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
500
|
+
} else {
|
501
|
+
movePanelTo(panel, userConstrain(elementRect.x, elementRect.y, elementRect, contentAreaRect, panelRect));
|
502
|
+
}
|
503
|
+
} else {
|
504
|
+
panel.hide();
|
505
|
+
}
|
506
|
+
}
|
507
|
+
|
508
|
+
togglePositionClass(panel, relPos, function(pos1, pos2) {
|
509
|
+
return pos1 === pos2;
|
510
|
+
});
|
511
|
+
|
512
|
+
//drawRect(contentAreaRect, 'blue');
|
513
|
+
//drawRect(elementRect, 'red');
|
514
|
+
//drawRect(panelRect, 'green');
|
515
|
+
}
|
516
|
+
|
517
|
+
function repositionHandler() {
|
518
|
+
function execute() {
|
519
|
+
if (editor.selection) {
|
520
|
+
reposition(findFrontMostMatch(editor.selection.getNode()));
|
521
|
+
}
|
522
|
+
}
|
523
|
+
|
524
|
+
tinymce.util.Delay.requestAnimationFrame(execute);
|
525
|
+
}
|
526
|
+
|
527
|
+
function bindScrollEvent() {
|
528
|
+
if (!scrollContainer) {
|
529
|
+
scrollContainer = editor.selection.getScrollContainer() || editor.getWin();
|
530
|
+
tinymce.$(scrollContainer).on('scroll', repositionHandler);
|
531
|
+
|
532
|
+
editor.on('remove', function() {
|
533
|
+
tinymce.$(scrollContainer).off('scroll');
|
534
|
+
});
|
535
|
+
}
|
536
|
+
}
|
537
|
+
|
538
|
+
function showContextToolbar(match) {
|
539
|
+
var panel;
|
540
|
+
|
541
|
+
if (match.toolbar.panel) {
|
542
|
+
match.toolbar.panel.show();
|
543
|
+
reposition(match);
|
544
|
+
return;
|
545
|
+
}
|
546
|
+
|
547
|
+
bindScrollEvent();
|
548
|
+
|
549
|
+
panel = Factory.create({
|
550
|
+
type: 'floatpanel',
|
551
|
+
role: 'dialog',
|
552
|
+
classes: 'tinymce tinymce-inline arrow',
|
553
|
+
ariaLabel: 'Inline toolbar',
|
554
|
+
layout: 'flex',
|
555
|
+
direction: 'column',
|
556
|
+
align: 'stretch',
|
557
|
+
autohide: false,
|
558
|
+
autofix: true,
|
559
|
+
fixed: true,
|
560
|
+
border: 1,
|
561
|
+
items: createToolbar(match.toolbar.items),
|
562
|
+
oncancel: function() {
|
563
|
+
editor.focus();
|
564
|
+
}
|
565
|
+
});
|
566
|
+
|
567
|
+
match.toolbar.panel = panel;
|
568
|
+
panel.renderTo(document.body).reflow();
|
569
|
+
reposition(match);
|
570
|
+
}
|
571
|
+
|
572
|
+
function hideAllContextToolbars() {
|
573
|
+
tinymce.each(getContextToolbars(), function(toolbar) {
|
574
|
+
if (toolbar.panel) {
|
575
|
+
toolbar.panel.hide();
|
576
|
+
}
|
577
|
+
});
|
578
|
+
}
|
579
|
+
|
580
|
+
function findFrontMostMatch(targetElm) {
|
581
|
+
var i, y, parentsAndSelf, toolbars = getContextToolbars();
|
582
|
+
|
583
|
+
parentsAndSelf = editor.$(targetElm).parents().add(targetElm);
|
584
|
+
for (i = parentsAndSelf.length - 1; i >= 0; i--) {
|
585
|
+
for (y = toolbars.length - 1; y >= 0; y--) {
|
586
|
+
if (toolbars[y].predicate(parentsAndSelf[i])) {
|
587
|
+
return {
|
588
|
+
toolbar: toolbars[y],
|
589
|
+
element: parentsAndSelf[i]
|
590
|
+
};
|
591
|
+
}
|
592
|
+
}
|
593
|
+
}
|
594
|
+
|
595
|
+
return null;
|
596
|
+
}
|
597
|
+
|
598
|
+
editor.on('click keyup setContent', function(e) {
|
599
|
+
// Only act on partial inserts
|
600
|
+
if (e.type == 'setcontent' && !e.selection) {
|
601
|
+
return;
|
602
|
+
}
|
603
|
+
|
604
|
+
// Needs to be delayed to avoid Chrome img focus out bug
|
605
|
+
tinymce.util.Delay.setEditorTimeout(editor, function() {
|
606
|
+
var match;
|
607
|
+
|
608
|
+
match = findFrontMostMatch(editor.selection.getNode());
|
609
|
+
if (match) {
|
610
|
+
hideAllContextToolbars();
|
611
|
+
showContextToolbar(match);
|
612
|
+
} else {
|
613
|
+
hideAllContextToolbars();
|
614
|
+
}
|
615
|
+
});
|
616
|
+
});
|
617
|
+
|
618
|
+
editor.on('blur hide', hideAllContextToolbars);
|
619
|
+
|
620
|
+
editor.on('ObjectResizeStart', function() {
|
621
|
+
var match = findFrontMostMatch(editor.selection.getNode());
|
622
|
+
|
623
|
+
if (match && match.toolbar.panel) {
|
624
|
+
match.toolbar.panel.hide();
|
625
|
+
}
|
626
|
+
});
|
627
|
+
|
628
|
+
editor.on('nodeChange ResizeEditor ResizeWindow', repositionHandler);
|
629
|
+
|
630
|
+
editor.on('remove', function() {
|
631
|
+
tinymce.each(getContextToolbars(), function(toolbar) {
|
632
|
+
if (toolbar.panel) {
|
633
|
+
toolbar.panel.remove();
|
634
|
+
}
|
635
|
+
});
|
636
|
+
|
637
|
+
editor.contextToolbars = {};
|
638
|
+
});
|
639
|
+
|
640
|
+
editor.shortcuts.add('ctrl+shift+e > ctrl+shift+p', '', function() {
|
641
|
+
var match = findFrontMostMatch(editor.selection.getNode());
|
642
|
+
if (match && match.toolbar.panel) {
|
643
|
+
match.toolbar.panel.items()[0].focus();
|
644
|
+
}
|
645
|
+
});
|
646
|
+
}
|
647
|
+
|
648
|
+
function fireSkinLoaded(editor) {
|
649
|
+
return function() {
|
650
|
+
if (editor.initialized) {
|
651
|
+
editor.fire('SkinLoaded');
|
652
|
+
} else {
|
653
|
+
editor.on('init', function() {
|
654
|
+
editor.fire('SkinLoaded');
|
655
|
+
});
|
656
|
+
}
|
657
|
+
};
|
658
|
+
}
|
659
|
+
|
660
|
+
/**
|
661
|
+
* Renders the inline editor UI.
|
662
|
+
*
|
663
|
+
* @return {Object} Name/value object with theme data.
|
664
|
+
*/
|
665
|
+
function renderInlineUI(args) {
|
666
|
+
var panel, inlineToolbarContainer;
|
667
|
+
|
668
|
+
if (settings.fixed_toolbar_container) {
|
669
|
+
inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
|
670
|
+
}
|
671
|
+
|
672
|
+
function reposition() {
|
673
|
+
if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
|
674
|
+
// TODO: This is kind of ugly and doesn't handle multiple scrollable elements
|
675
|
+
var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
|
676
|
+
var deltaX = 0, deltaY = 0;
|
677
|
+
|
678
|
+
if (scrollContainer) {
|
679
|
+
var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
|
680
|
+
|
681
|
+
deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
|
682
|
+
deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
|
683
|
+
}
|
684
|
+
|
685
|
+
panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl', 'tr-br']).moveBy(deltaX, deltaY);
|
686
|
+
}
|
687
|
+
}
|
688
|
+
|
689
|
+
function show() {
|
690
|
+
if (panel) {
|
691
|
+
panel.show();
|
692
|
+
reposition();
|
693
|
+
DOM.addClass(editor.getBody(), 'mce-edit-focus');
|
694
|
+
}
|
695
|
+
}
|
696
|
+
|
697
|
+
function hide() {
|
698
|
+
if (panel) {
|
699
|
+
// We require two events as the inline float panel based toolbar does not have autohide=true
|
700
|
+
panel.hide();
|
701
|
+
|
702
|
+
// All other autohidden float panels will be closed below.
|
703
|
+
FloatPanel.hideAll();
|
704
|
+
|
705
|
+
DOM.removeClass(editor.getBody(), 'mce-edit-focus');
|
706
|
+
}
|
707
|
+
}
|
708
|
+
|
709
|
+
function render() {
|
710
|
+
if (panel) {
|
711
|
+
if (!panel.visible()) {
|
712
|
+
show();
|
713
|
+
}
|
714
|
+
|
715
|
+
return;
|
716
|
+
}
|
717
|
+
|
718
|
+
// Render a plain panel inside the inlineToolbarContainer if it's defined
|
719
|
+
panel = self.panel = Factory.create({
|
720
|
+
type: inlineToolbarContainer ? 'panel' : 'floatpanel',
|
721
|
+
role: 'application',
|
722
|
+
classes: 'tinymce tinymce-inline',
|
723
|
+
layout: 'flex',
|
724
|
+
direction: 'column',
|
725
|
+
align: 'stretch',
|
726
|
+
autohide: false,
|
727
|
+
autofix: true,
|
728
|
+
fixed: !!inlineToolbarContainer,
|
729
|
+
border: 1,
|
730
|
+
items: [
|
731
|
+
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
732
|
+
createToolbars(settings.toolbar_items_size)
|
733
|
+
]
|
734
|
+
});
|
735
|
+
|
736
|
+
// Add statusbar
|
737
|
+
/*if (settings.statusbar !== false) {
|
738
|
+
panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
|
739
|
+
{type: 'elementpath'}
|
740
|
+
]});
|
741
|
+
}*/
|
742
|
+
|
743
|
+
editor.fire('BeforeRenderUI');
|
744
|
+
panel.renderTo(inlineToolbarContainer || document.body).reflow();
|
745
|
+
|
746
|
+
addAccessibilityKeys(panel);
|
747
|
+
show();
|
748
|
+
addContextualToolbars();
|
749
|
+
|
750
|
+
editor.on('nodeChange', reposition);
|
751
|
+
editor.on('activate', show);
|
752
|
+
editor.on('deactivate', hide);
|
753
|
+
|
754
|
+
editor.nodeChanged();
|
755
|
+
}
|
756
|
+
|
757
|
+
settings.content_editable = true;
|
758
|
+
|
759
|
+
editor.on('focus', function() {
|
760
|
+
// Render only when the CSS file has been loaded
|
761
|
+
if (args.skinUiCss) {
|
762
|
+
tinymce.DOM.styleSheetLoader.load(args.skinUiCss, render, render);
|
763
|
+
} else {
|
764
|
+
render();
|
765
|
+
}
|
766
|
+
});
|
767
|
+
|
768
|
+
editor.on('blur hide', hide);
|
769
|
+
|
770
|
+
// Remove the panel when the editor is removed
|
771
|
+
editor.on('remove', function() {
|
772
|
+
if (panel) {
|
773
|
+
panel.remove();
|
774
|
+
panel = null;
|
775
|
+
}
|
776
|
+
});
|
777
|
+
|
778
|
+
// Preload skin css
|
779
|
+
if (args.skinUiCss) {
|
780
|
+
tinymce.DOM.styleSheetLoader.load(args.skinUiCss, fireSkinLoaded(editor));
|
781
|
+
}
|
782
|
+
|
783
|
+
return {};
|
784
|
+
}
|
785
|
+
|
786
|
+
/**
|
787
|
+
* Renders the iframe editor UI.
|
788
|
+
*
|
789
|
+
* @param {Object} args Details about target element etc.
|
790
|
+
* @return {Object} Name/value object with theme data.
|
791
|
+
*/
|
792
|
+
function renderIframeUI(args) {
|
793
|
+
var panel, resizeHandleCtrl, startSize;
|
794
|
+
|
795
|
+
function switchMode() {
|
796
|
+
return function(e) {
|
797
|
+
if (e.mode == 'readonly') {
|
798
|
+
panel.find('*').disabled(true);
|
799
|
+
} else {
|
800
|
+
panel.find('*').disabled(false);
|
801
|
+
}
|
802
|
+
};
|
803
|
+
}
|
804
|
+
|
805
|
+
if (args.skinUiCss) {
|
806
|
+
tinymce.DOM.styleSheetLoader.load(args.skinUiCss, fireSkinLoaded(editor));
|
807
|
+
}
|
808
|
+
|
809
|
+
// Basic UI layout
|
810
|
+
panel = self.panel = Factory.create({
|
811
|
+
type: 'panel',
|
812
|
+
role: 'application',
|
813
|
+
classes: 'tinymce',
|
814
|
+
style: 'visibility: hidden',
|
815
|
+
layout: 'stack',
|
816
|
+
border: 1,
|
817
|
+
items: [
|
818
|
+
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
819
|
+
createToolbars(settings.toolbar_items_size),
|
820
|
+
{type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
|
821
|
+
]
|
822
|
+
});
|
823
|
+
|
824
|
+
if (settings.resize !== false) {
|
825
|
+
resizeHandleCtrl = {
|
826
|
+
type: 'resizehandle',
|
827
|
+
direction: settings.resize,
|
828
|
+
|
829
|
+
onResizeStart: function() {
|
830
|
+
var elm = editor.getContentAreaContainer().firstChild;
|
831
|
+
|
832
|
+
startSize = {
|
833
|
+
width: elm.clientWidth,
|
834
|
+
height: elm.clientHeight
|
835
|
+
};
|
836
|
+
},
|
837
|
+
|
838
|
+
onResize: function(e) {
|
839
|
+
if (settings.resize == 'both') {
|
840
|
+
resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
|
841
|
+
} else {
|
842
|
+
resizeTo(null, startSize.height + e.deltaY);
|
843
|
+
}
|
844
|
+
}
|
845
|
+
};
|
846
|
+
}
|
847
|
+
|
848
|
+
// Add statusbar if needed
|
849
|
+
if (settings.statusbar !== false) {
|
850
|
+
panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [
|
851
|
+
{type: 'elementpath', editor: editor},
|
852
|
+
resizeHandleCtrl
|
853
|
+
]});
|
854
|
+
}
|
855
|
+
|
856
|
+
editor.fire('BeforeRenderUI');
|
857
|
+
editor.on('SwitchMode', switchMode());
|
858
|
+
panel.renderBefore(args.targetNode).reflow();
|
859
|
+
|
860
|
+
if (settings.readonly) {
|
861
|
+
editor.setMode('readonly');
|
862
|
+
}
|
863
|
+
|
864
|
+
if (settings.width) {
|
865
|
+
tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
|
866
|
+
}
|
867
|
+
|
868
|
+
// Remove the panel when the editor is removed
|
869
|
+
editor.on('remove', function() {
|
870
|
+
panel.remove();
|
871
|
+
panel = null;
|
872
|
+
});
|
873
|
+
|
874
|
+
// Add accesibility shortcuts
|
875
|
+
addAccessibilityKeys(panel);
|
876
|
+
addContextualToolbars();
|
877
|
+
|
878
|
+
return {
|
879
|
+
iframeContainer: panel.find('#iframe')[0].getEl(),
|
880
|
+
editorContainer: panel.getEl()
|
881
|
+
};
|
882
|
+
}
|
883
|
+
|
884
|
+
/**
|
885
|
+
* Renders the UI for the theme. This gets called by the editor.
|
886
|
+
*
|
887
|
+
* @param {Object} args Details about target element etc.
|
888
|
+
* @return {Object} Theme UI data items.
|
889
|
+
*/
|
890
|
+
self.renderUI = function(args) {
|
891
|
+
var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
|
892
|
+
|
893
|
+
if (skin) {
|
894
|
+
var skinUrl = settings.skin_url;
|
895
|
+
|
896
|
+
if (skinUrl) {
|
897
|
+
skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
|
898
|
+
} else {
|
899
|
+
skinUrl = tinymce.baseURL + '/skins/' + skin;
|
900
|
+
}
|
901
|
+
|
902
|
+
// Load special skin for IE7
|
903
|
+
// TODO: Remove this when we drop IE7 support
|
904
|
+
if (tinymce.Env.documentMode <= 7) {
|
905
|
+
args.skinUiCss = skinUrl + '/skin.ie7.min.css';
|
906
|
+
} else {
|
907
|
+
args.skinUiCss = skinUrl + '/skin.min.css';
|
908
|
+
}
|
909
|
+
|
910
|
+
// Load content.min.css or content.inline.min.css
|
911
|
+
editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
|
912
|
+
}
|
913
|
+
|
914
|
+
// Handle editor setProgressState change
|
915
|
+
editor.on('ProgressState', function(e) {
|
916
|
+
self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
|
917
|
+
|
918
|
+
if (e.state) {
|
919
|
+
self.throbber.show(e.time);
|
920
|
+
} else {
|
921
|
+
self.throbber.hide();
|
922
|
+
}
|
923
|
+
});
|
924
|
+
|
925
|
+
if (settings.inline) {
|
926
|
+
return renderInlineUI(args);
|
927
|
+
}
|
928
|
+
|
929
|
+
return renderIframeUI(args);
|
930
|
+
};
|
931
|
+
|
932
|
+
self.resizeTo = resizeTo;
|
933
|
+
self.resizeBy = resizeBy;
|
934
|
+
});
|