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,53 @@
|
|
1
|
+
var tinycolor = require('tinycolor');
|
2
|
+
|
3
|
+
function Color(tinycolor) {
|
4
|
+
this.getBrightness = function(color) {
|
5
|
+
return tinycolor(color).getBrightness();
|
6
|
+
};
|
7
|
+
this.isLight = function(color) {
|
8
|
+
return tinycolor(color).isLight();
|
9
|
+
};
|
10
|
+
this.isDark = function(color) {
|
11
|
+
return tinycolor(color).isDark();
|
12
|
+
};
|
13
|
+
this.getLuminance = function(color) {
|
14
|
+
return tinycolor(color).getLuminance();
|
15
|
+
};
|
16
|
+
|
17
|
+
|
18
|
+
this.lighten = function(color, amount) {
|
19
|
+
return tinycolor(color).lighten(amount).toHexString();
|
20
|
+
};
|
21
|
+
this.brighten = function(color, amount) {
|
22
|
+
return tinycolor(color).brighten(amount).toHexString();
|
23
|
+
};
|
24
|
+
this.darken = function(color, amount) {
|
25
|
+
return tinycolor(color).darken(amount).toHexString();
|
26
|
+
};
|
27
|
+
this.desaturate = function(color, amount) {
|
28
|
+
return tinycolor(color).desaturate(amount).toHexString();
|
29
|
+
};
|
30
|
+
this.saturate = function(color, amount) {
|
31
|
+
return tinycolor(color).saturate(amount).toHexString();
|
32
|
+
};
|
33
|
+
this.greyscale = function(color) {
|
34
|
+
return tinycolor(color).greyscale().toHexString();
|
35
|
+
};
|
36
|
+
this.spin = function(color, amount) {
|
37
|
+
return tinycolor(color).spin(amount).toHexString();
|
38
|
+
};
|
39
|
+
this.complement = function(color) {
|
40
|
+
return tinycolor(color).complement().toHexString();
|
41
|
+
};
|
42
|
+
|
43
|
+
this.mix = tinycolor.mix;
|
44
|
+
this.readability = tinycolor.readability;
|
45
|
+
this.isReadable = tinycolor.isReadable;
|
46
|
+
this.mostReadable = tinycolor.mostReadable;
|
47
|
+
}
|
48
|
+
|
49
|
+
var colorPlugin = function(vm) {
|
50
|
+
global.Color = new Color(tinycolor);
|
51
|
+
};
|
52
|
+
|
53
|
+
module.exports = colorPlugin;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false */
|
3
|
+
var console = require("console");
|
4
|
+
var $ = require("jquery");
|
5
|
+
var inlineDocument = require("juice/lib/inline")({}).inlineDocument;
|
6
|
+
|
7
|
+
var inlinerPlugin = function(vm) {
|
8
|
+
vm.inline = function(doc) {
|
9
|
+
// tinymce may have added style attributes to elements that will also have global styles to be inlined
|
10
|
+
$('[style]:not([replacedstyle])', doc).each(function(index, el) {
|
11
|
+
var $el = $(el);
|
12
|
+
$el.attr('replacedstyle', $el.attr('style'));
|
13
|
+
});
|
14
|
+
|
15
|
+
var style = [];
|
16
|
+
$('style[data-inline="true"]', doc).each(function(index, element) {
|
17
|
+
var content = $(element).html();
|
18
|
+
content = content.replace(/<!-- ko ((?!--).)*? -->/g, ''); // this replaces the above with a more formal (but slower) solution
|
19
|
+
content = content.replace(/<!-- \/ko -->/g, '');
|
20
|
+
style.push(content);
|
21
|
+
$(element).removeAttr('data-inline');
|
22
|
+
});
|
23
|
+
var styleText = style.join("\n");
|
24
|
+
var $context = function(selector, context) {
|
25
|
+
if (typeof context == 'undefined') context = doc;
|
26
|
+
return $(selector, context);
|
27
|
+
};
|
28
|
+
$context.root = function() {
|
29
|
+
return $(':root', doc);
|
30
|
+
};
|
31
|
+
inlineDocument($context, styleText, { styleAttributeName: 'replacedstyle' });
|
32
|
+
};
|
33
|
+
};
|
34
|
+
|
35
|
+
module.exports = inlinerPlugin;
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false */
|
3
|
+
var console = require("console");
|
4
|
+
var ko = require("knockout");
|
5
|
+
var $ = require("jquery");
|
6
|
+
|
7
|
+
var lsLoader = function(hash_key, emailProcessorBackend) {
|
8
|
+
var mdStr = global.localStorage.getItem("metadata-" + hash_key);
|
9
|
+
if (mdStr !== null) {
|
10
|
+
var model;
|
11
|
+
var td = global.localStorage.getItem("template-" + hash_key);
|
12
|
+
if (td !== null) model = JSON.parse(td);
|
13
|
+
var md = JSON.parse(mdStr);
|
14
|
+
return {
|
15
|
+
metadata: md,
|
16
|
+
model: model,
|
17
|
+
extension: lsCommandPluginFactory(md, emailProcessorBackend)
|
18
|
+
};
|
19
|
+
} else {
|
20
|
+
throw "Cannot find stored data for "+hash_key;
|
21
|
+
}
|
22
|
+
};
|
23
|
+
|
24
|
+
var lsCommandPluginFactory = function(md, emailProcessorBackend) {
|
25
|
+
var commandsPlugin = function(mdkey, mdname, viewModel) {
|
26
|
+
|
27
|
+
// console.log("loading from metadata", md, model);
|
28
|
+
var saveCmd = {
|
29
|
+
name: 'Save', // l10n happens in the template
|
30
|
+
enabled: ko.observable(true)
|
31
|
+
};
|
32
|
+
saveCmd.execute = function() {
|
33
|
+
saveCmd.enabled(false);
|
34
|
+
viewModel.metadata.changed = Date.now();
|
35
|
+
if (typeof viewModel.metadata.key == 'undefined') {
|
36
|
+
console.warn("Unable to find ket in metadata object...", viewModel.metadata);
|
37
|
+
viewModel.metadata.key = mdkey;
|
38
|
+
}
|
39
|
+
global.localStorage.setItem("metadata-" + mdkey, viewModel.exportMetadata());
|
40
|
+
global.localStorage.setItem("template-" + mdkey, viewModel.exportJSON());
|
41
|
+
saveCmd.enabled(true);
|
42
|
+
};
|
43
|
+
var testCmd = {
|
44
|
+
name: 'Test', // l10n happens in the template
|
45
|
+
enabled: ko.observable(true)
|
46
|
+
};
|
47
|
+
var downloadCmd = {
|
48
|
+
name: 'Download', // l10n happens in the template
|
49
|
+
enabled: ko.observable(true)
|
50
|
+
};
|
51
|
+
testCmd.execute = function() {
|
52
|
+
testCmd.enabled(false);
|
53
|
+
var email = global.localStorage.getItem("testemail");
|
54
|
+
if (email === null || email == 'null') email = viewModel.t('Insert here the recipient email address');
|
55
|
+
email = global.prompt(viewModel.t("Test email address"), email);
|
56
|
+
if (email.match(/@/)) {
|
57
|
+
global.localStorage.setItem("testemail", email);
|
58
|
+
console.log("TODO testing...", email);
|
59
|
+
var postUrl = emailProcessorBackend ? emailProcessorBackend : '/dl/';
|
60
|
+
var post = $.post(postUrl, {
|
61
|
+
action: 'email',
|
62
|
+
rcpt: email,
|
63
|
+
subject: "[test] " + mdkey + " - " + mdname,
|
64
|
+
html: viewModel.exportHTML()
|
65
|
+
}, null, 'html');
|
66
|
+
post.fail(function() {
|
67
|
+
console.log("fail", arguments);
|
68
|
+
viewModel.notifier.error(viewModel.t('Unexpected error talking to server: contact us!'));
|
69
|
+
});
|
70
|
+
post.success(function() {
|
71
|
+
console.log("success", arguments);
|
72
|
+
viewModel.notifier.success(viewModel.t("Test email sent..."));
|
73
|
+
});
|
74
|
+
post.always(function() {
|
75
|
+
testCmd.enabled(true);
|
76
|
+
});
|
77
|
+
} else {
|
78
|
+
global.alert(viewModel.t('Invalid email address'));
|
79
|
+
testCmd.enabled(true);
|
80
|
+
}
|
81
|
+
};
|
82
|
+
downloadCmd.execute = function() {
|
83
|
+
downloadCmd.enabled(false);
|
84
|
+
viewModel.notifier.info(viewModel.t("Downloading..."));
|
85
|
+
viewModel.exportHTMLtoTextarea('#downloadHtmlTextarea');
|
86
|
+
var postUrl = emailProcessorBackend ? emailProcessorBackend : '/dl/';
|
87
|
+
global.document.getElementById('downloadForm').setAttribute("action", postUrl);
|
88
|
+
global.document.getElementById('downloadForm').submit();
|
89
|
+
downloadCmd.enabled(true);
|
90
|
+
};
|
91
|
+
|
92
|
+
viewModel.save = saveCmd;
|
93
|
+
viewModel.test = testCmd;
|
94
|
+
viewModel.download = downloadCmd;
|
95
|
+
}.bind(undefined, md.key, md.name);
|
96
|
+
|
97
|
+
return commandsPlugin;
|
98
|
+
};
|
99
|
+
|
100
|
+
module.exports = lsLoader;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
require("knockout-sortable");
|
4
|
+
|
5
|
+
require("./bindings/jqueryui-spinner.js");
|
6
|
+
require("./bindings/jqueryui-tabs.js");
|
7
|
+
require("./bindings/colorpicker.js");
|
8
|
+
require("./bindings/blocks.js");
|
9
|
+
require("./bindings/csstext.js");
|
10
|
+
require("./bindings/bind-iframe.js");
|
11
|
+
require("./bindings/droppable.js");
|
12
|
+
require("./bindings/fileupload.js");
|
13
|
+
require("./bindings/virtuals.js");
|
14
|
+
require("./bindings/wysiwygs.js");
|
15
|
+
require("./bindings/scrollfix.js");
|
16
|
+
require("./bindings/if-subs.js");
|
17
|
+
require("./bindings/extsortables.js");
|
18
|
+
require("./bindings/eventable.js");
|
19
|
+
require("./bindings/tooltips.js");
|
20
|
+
require("./bindings/extender-pagination.js");
|
21
|
+
require("./bindings/validated-value.js");
|
22
|
+
require("./bindings/scrollintoview.js");
|
@@ -0,0 +1,446 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false */
|
3
|
+
|
4
|
+
var $ = require("jquery");
|
5
|
+
var ko = require("knockout");
|
6
|
+
var kojqui = require("knockout-jqueryui"); // just for the widget plugins
|
7
|
+
var templateConverter = require("./converter/main.js");
|
8
|
+
var console = require("console");
|
9
|
+
var initializeViewmodel = require("./viewmodel.js");
|
10
|
+
var templateSystem = require('./bindings/choose-template.js');
|
11
|
+
|
12
|
+
// call a given method on every plugin implementing it.
|
13
|
+
// supports a "reverse" parameter to call the methods from the last one to the first one.
|
14
|
+
var pluginsCall = function(plugins, methodName, args, reverse) {
|
15
|
+
var start, end, diff, res, results;
|
16
|
+
results = [];
|
17
|
+
if (typeof reverse !== 'undefined' && reverse) {
|
18
|
+
start = plugins.length - 1;
|
19
|
+
end = 0;
|
20
|
+
diff = -1;
|
21
|
+
} else {
|
22
|
+
start = 0;
|
23
|
+
end = plugins.length - 1;
|
24
|
+
diff = 1;
|
25
|
+
}
|
26
|
+
for (var i = start; i != end + diff; i += diff) {
|
27
|
+
if (typeof plugins[i][methodName] !== 'undefined') {
|
28
|
+
res = plugins[i][methodName].apply(plugins[i], args);
|
29
|
+
if (typeof res !== 'undefined') results.push(res);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
return results;
|
33
|
+
};
|
34
|
+
|
35
|
+
// workaround for knockout-jqueryui's buttonset/button disposal:
|
36
|
+
// https://github.com/gvas/knockout-jqueryui/issues/25
|
37
|
+
var origDisposeCallback = ko.utils.domNodeDisposal.addDisposeCallback;
|
38
|
+
ko.utils.domNodeDisposal.addDisposeCallback = function(node, callback) {
|
39
|
+
var newCallback = function(node) {
|
40
|
+
try {
|
41
|
+
callback(node);
|
42
|
+
} catch (e) {
|
43
|
+
console.warn("Caught unexpected dispose callback exception", e);
|
44
|
+
}
|
45
|
+
};
|
46
|
+
origDisposeCallback(node, newCallback);
|
47
|
+
};
|
48
|
+
|
49
|
+
var bindingPluginMaker = function(performanceAwareCaller) {
|
50
|
+
return {
|
51
|
+
viewModel: function(viewModel) {
|
52
|
+
try {
|
53
|
+
performanceAwareCaller('applyBindings', ko.applyBindings.bind(undefined, viewModel));
|
54
|
+
} catch (err) {
|
55
|
+
console.warn(err, err.stack);
|
56
|
+
throw err;
|
57
|
+
}
|
58
|
+
},
|
59
|
+
dispose: function() {
|
60
|
+
try {
|
61
|
+
performanceAwareCaller('unapplyBindings', ko.cleanNode.bind(this, global.document.body));
|
62
|
+
} catch (err) {
|
63
|
+
console.warn(err, err.stack);
|
64
|
+
throw err;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
};
|
68
|
+
};
|
69
|
+
|
70
|
+
var templateCreator = function(templatePlugin, htmlOrElement, optionalName, templateMode) {
|
71
|
+
var tmpName = optionalName;
|
72
|
+
if (typeof optionalName != 'undefined' && typeof templateMode != 'undefined') {
|
73
|
+
if (typeof htmlOrElement != 'object' || htmlOrElement.tagName.toLowerCase() != 'replacedhtml') tmpName += '-' + templateMode;
|
74
|
+
}
|
75
|
+
|
76
|
+
while (typeof tmpName == 'undefined' || tmpName === null || templatePlugin.exists(tmpName)) {
|
77
|
+
tmpName = 'anonymous-' + Math.floor((Math.random() * 100000) + 1);
|
78
|
+
}
|
79
|
+
|
80
|
+
if (typeof htmlOrElement == 'object' && htmlOrElement.tagName.toLowerCase() == 'replacedhtml') {
|
81
|
+
var $el = $(htmlOrElement);
|
82
|
+
var $head = $('replacedhead', $el);
|
83
|
+
var $body = $('replacedbody', $el);
|
84
|
+
templatePlugin.adder(tmpName + '-head', $head.html() || '');
|
85
|
+
templatePlugin.adder(tmpName + '-show', $body.html() || '');
|
86
|
+
templatePlugin.adder(tmpName + '-preview', $el.html());
|
87
|
+
templatePlugin.adder(tmpName + '-wysiwyg', $el.html());
|
88
|
+
|
89
|
+
// $head.attr('data-bind', 'block: content');
|
90
|
+
$head.children().detach();
|
91
|
+
$head.html("<!-- ko block: content --><!-- /ko -->");
|
92
|
+
$head.before('<!-- ko withProperties: { templateMode: \'head\' } -->');
|
93
|
+
$head.after('<!-- /ko -->');
|
94
|
+
$body.html("<!-- ko block: content --><!-- /ko -->");
|
95
|
+
|
96
|
+
templatePlugin.adder(tmpName + '-iframe', $el[0].outerHTML);
|
97
|
+
|
98
|
+
} else if (typeof htmlOrElement == 'object') {
|
99
|
+
templatePlugin.adder(tmpName, htmlOrElement.outerHTML);
|
100
|
+
} else {
|
101
|
+
templatePlugin.adder(tmpName, htmlOrElement);
|
102
|
+
}
|
103
|
+
|
104
|
+
return tmpName;
|
105
|
+
};
|
106
|
+
|
107
|
+
// Adapter to transform "viewModel plugins" into more generic plugins.
|
108
|
+
function _viewModelPluginInstance(pluginFunction) {
|
109
|
+
var instance;
|
110
|
+
return {
|
111
|
+
viewModel: function(viewModel) {
|
112
|
+
instance = pluginFunction(viewModel);
|
113
|
+
},
|
114
|
+
init: function() {
|
115
|
+
if (typeof instance !== 'undefined' && typeof instance.init !== 'undefined') instance.init();
|
116
|
+
},
|
117
|
+
dispose: function() {
|
118
|
+
if (typeof instance !== 'undefined' && typeof instance.dispose !== 'undefined') instance.dispose();
|
119
|
+
}
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
var _templateUrlConverter = function(basePath, url) {
|
124
|
+
if (!url.match(/^[^\/]*:/) && !url.match(/^\//) && !url.match(/^\[/) && !url.match(/^#?$/)) {
|
125
|
+
// TODO this could be smarter joining the urls...
|
126
|
+
return basePath + url;
|
127
|
+
} else {
|
128
|
+
return null;
|
129
|
+
}
|
130
|
+
};
|
131
|
+
|
132
|
+
var templateLoader = function(performanceAwareCaller, templateFileName, templateMetadata, jsorjson, extensions, galleryUrl) {
|
133
|
+
var templateFile = typeof templateFileName == 'string' ? templateFileName : templateMetadata.template;
|
134
|
+
var templatePath = "./";
|
135
|
+
var p = templateFile.lastIndexOf('/');
|
136
|
+
if (p != -1) {
|
137
|
+
templatePath = templateFile.substr(0, p + 1);
|
138
|
+
}
|
139
|
+
|
140
|
+
var templateUrlConverter = _templateUrlConverter.bind(undefined, templatePath);
|
141
|
+
|
142
|
+
var metadata;
|
143
|
+
if (typeof templateMetadata == 'undefined') {
|
144
|
+
metadata = {
|
145
|
+
template: templateFile,
|
146
|
+
// TODO l10n?
|
147
|
+
name: 'No name',
|
148
|
+
created: Date.now()
|
149
|
+
};
|
150
|
+
} else {
|
151
|
+
metadata = templateMetadata;
|
152
|
+
}
|
153
|
+
|
154
|
+
$.get(templateFile, function(templatecode) {
|
155
|
+
var res = templateCompiler(performanceAwareCaller, templateUrlConverter, "template", templatecode, jsorjson, metadata, extensions, galleryUrl);
|
156
|
+
res.init();
|
157
|
+
});
|
158
|
+
};
|
159
|
+
|
160
|
+
var templateCompiler = function(performanceAwareCaller, templateUrlConverter, templateName, templatecode, jsorjson, metadata, extensions, galleryUrl) {
|
161
|
+
// we strip content before <html> tag and after </html> because jquery doesn't parse it.
|
162
|
+
// we'll keep it "raw" and use it in the preview/output methods.
|
163
|
+
var res = templatecode.match(/^([\S\s]*)([<]html[^>]*>[\S\s]*<\/html>)([\S\s]*)$/i);
|
164
|
+
if (res === null) throw "Unable to find <html> opening and closing tags in the template";
|
165
|
+
var prefix = res[1];
|
166
|
+
// we parse the html content after replacing the tag name for html/head/body so to avoid jquery issues in parsing.
|
167
|
+
var basicStructure = { '<html': 0, '<head': 0, '<body': 0, '</html': 0, '</body': 0, '</head': 0 };
|
168
|
+
var html = res[2].replace(/(<\/?)(html|head|body)([^>]*>)/gi, function(match, p1, p2, p3) {
|
169
|
+
basicStructure[(p1+p2).toLowerCase()] += 1;
|
170
|
+
return p1 + 'replaced' + p2 + p3;
|
171
|
+
});
|
172
|
+
for (var ele in basicStructure) if (basicStructure.hasOwnProperty(ele)) if (basicStructure[ele] != 1) {
|
173
|
+
if (basicStructure[ele] === 0) throw "ERROR: missing mandatory element "+ele+">";
|
174
|
+
if (basicStructure[ele] > 1) throw "ERROR: multiple element "+ele+"> occourences are not supported (found "+basicStructure[ele]+" occourences)";
|
175
|
+
}
|
176
|
+
var postfix = res[3];
|
177
|
+
var blockDefs = [];
|
178
|
+
var enableUndo = true;
|
179
|
+
var enableRecorder = true;
|
180
|
+
var baseThreshold = '+$root.contentListeners()';
|
181
|
+
|
182
|
+
var plugins = [];
|
183
|
+
|
184
|
+
if (typeof extensions !== 'undefined') {
|
185
|
+
for (var i = 0; i < extensions.length; i++) {
|
186
|
+
if (typeof extensions[i] == 'function') {
|
187
|
+
plugins.push(_viewModelPluginInstance(extensions[i]));
|
188
|
+
} else {
|
189
|
+
plugins.push(extensions[i]);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
var createdTemplates = [];
|
195
|
+
var templatesPlugin = {
|
196
|
+
adder: function(id, html) {
|
197
|
+
if (typeof html !== 'string') throw "Template system: cannot create new template " + id;
|
198
|
+
var trash = html.match(/(data)?-ko-[^ =:]*/g);
|
199
|
+
if (trash) {
|
200
|
+
console.error("ERROR: found unexpected -ko- attribute in compiled template", id, ", you probably mispelled it:", trash);
|
201
|
+
}
|
202
|
+
templateSystem.addTemplate(id, html);
|
203
|
+
createdTemplates.push(id);
|
204
|
+
},
|
205
|
+
exists: function(id) {
|
206
|
+
var el = templateSystem.getTemplateContent(id);
|
207
|
+
if (typeof el !== 'undefined') return true;
|
208
|
+
else return false;
|
209
|
+
},
|
210
|
+
dispose: function() {
|
211
|
+
for (var i = createdTemplates.length - 1; i >= 0; i--) {
|
212
|
+
templateSystem.removeTemplate(createdTemplates[i]);
|
213
|
+
}
|
214
|
+
}
|
215
|
+
};
|
216
|
+
|
217
|
+
ko.bindingHandlers['block'].templateExists = templatesPlugin.exists;
|
218
|
+
|
219
|
+
// templatecreator tracks created template (via templateAdder) so to be able to dispose them later
|
220
|
+
var myTemplateCreator = templateCreator.bind(undefined, templatesPlugin);
|
221
|
+
|
222
|
+
// first pass: we "compile" the template into a termplateDef object
|
223
|
+
var templateDef = performanceAwareCaller('translateTemplate', templateConverter.translateTemplate.bind(undefined, templateName, html, templateUrlConverter, myTemplateCreator));
|
224
|
+
|
225
|
+
// second pass: given the templateDef we create a base content model object for this template.
|
226
|
+
var content = performanceAwareCaller('generateModel', templateConverter.wrappedResultModel.bind(undefined, templateDef));
|
227
|
+
|
228
|
+
// third pass: we create "style/content editors" for every block
|
229
|
+
var widgets = {};
|
230
|
+
var widgetPlugins = pluginsCall(plugins, 'widget', [$, ko, kojqui]);
|
231
|
+
for (var wi = 0; wi < widgetPlugins.length; wi++) {
|
232
|
+
widgets[widgetPlugins[wi].widget] = widgetPlugins[wi];
|
233
|
+
}
|
234
|
+
blockDefs.push.apply(blockDefs, performanceAwareCaller('generateEditors', templateConverter.generateEditors.bind(undefined, templateDef, widgets, templateUrlConverter, myTemplateCreator, baseThreshold)));
|
235
|
+
|
236
|
+
var incompatibleTemplate = false;
|
237
|
+
if (typeof jsorjson !== 'undefined' && jsorjson !== null) {
|
238
|
+
var unwrapped;
|
239
|
+
if (typeof jsorjson == 'string') {
|
240
|
+
unwrapped = ko.utils.parseJson(jsorjson);
|
241
|
+
} else {
|
242
|
+
unwrapped = jsorjson;
|
243
|
+
}
|
244
|
+
|
245
|
+
// we run a basic compatibility check between the content-model we expect and the initialization model
|
246
|
+
var checkModelRes = performanceAwareCaller('checkModel', templateConverter.checkModel.bind(undefined, content._unwrap(), blockDefs, unwrapped));
|
247
|
+
// if checkModelRes is 1 then the model is not fully compatible but we fixed it
|
248
|
+
if (checkModelRes == 2) {
|
249
|
+
console.error("Trying to compile an incompatible template version!", content._unwrap(), blockDefs, unwrapped);
|
250
|
+
incompatibleTemplate = true;
|
251
|
+
}
|
252
|
+
|
253
|
+
try {
|
254
|
+
content._wrap(unwrapped);
|
255
|
+
} catch (ex) {
|
256
|
+
console.error("Unable to inject model content!", ex);
|
257
|
+
incompatibleTemplate = true;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
// This build the template for the preview/output, but concatenating prefix, template and content and stripping the "replaced" prefix added to "problematic" tag (html/head/body)
|
262
|
+
var iframeTpl = prefix + templateSystem.getTemplateContent(templateName + '-iframe').replace(/(<\/?)replaced(html|head|body)([^>]*>)/gi, function(match, p1, p2, p3) {
|
263
|
+
return p1 + p2 + p3;
|
264
|
+
}) + postfix;
|
265
|
+
|
266
|
+
// store this so to restore it on disposale
|
267
|
+
var origiFrameTpl = ko.bindingHandlers.bindIframe.tpl;
|
268
|
+
ko.bindingHandlers.bindIframe.tpl = iframeTpl;
|
269
|
+
var iFramePlugin = {
|
270
|
+
dispose: function() {
|
271
|
+
ko.bindingHandlers.bindIframe.tpl = origiFrameTpl;
|
272
|
+
}
|
273
|
+
};
|
274
|
+
|
275
|
+
plugins.push(iFramePlugin);
|
276
|
+
plugins.push(templatesPlugin);
|
277
|
+
|
278
|
+
// initialize the viewModel object based on the content model.
|
279
|
+
var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockDefs, templateUrlConverter, galleryUrl));
|
280
|
+
|
281
|
+
viewModel.metadata = metadata;
|
282
|
+
// let's run some version check on template and editor used to build the model being loaded.
|
283
|
+
var editver = '0.16.0';
|
284
|
+
if (typeof viewModel.metadata.editorversion !== 'undefined' && viewModel.metadata.editorversion !== editver) {
|
285
|
+
console.warn("The model being loaded has been created with an older editor version", viewModel.metadata.editorversion, "vs", editver);
|
286
|
+
}
|
287
|
+
viewModel.metadata.editorversion = editver;
|
288
|
+
|
289
|
+
if (typeof templateDef.version !== 'undefined') {
|
290
|
+
if (typeof viewModel.metadata.templateversion !== 'undefined' && viewModel.metadata.templateversion !== templateDef.version) {
|
291
|
+
console.error("The model being loaded has been created with a different template version", templateDef.version, "vs", viewModel.metadata.templateversion);
|
292
|
+
}
|
293
|
+
viewModel.metadata.templateversion = templateDef.version;
|
294
|
+
}
|
295
|
+
|
296
|
+
templateSystem.init();
|
297
|
+
|
298
|
+
// everything's ready, start knockout bindings.
|
299
|
+
plugins.push(bindingPluginMaker(performanceAwareCaller));
|
300
|
+
|
301
|
+
pluginsCall(plugins, 'viewModel', [viewModel]);
|
302
|
+
|
303
|
+
if (incompatibleTemplate) {
|
304
|
+
$('#incompatible-template').dialog({
|
305
|
+
modal: true,
|
306
|
+
appendTo: '#mo-body',
|
307
|
+
buttons: {
|
308
|
+
Ok: function() {
|
309
|
+
$(this).dialog("close");
|
310
|
+
}
|
311
|
+
}
|
312
|
+
});
|
313
|
+
}
|
314
|
+
|
315
|
+
return {
|
316
|
+
model: viewModel,
|
317
|
+
init: function() {
|
318
|
+
pluginsCall(plugins, 'init', undefined, true);
|
319
|
+
},
|
320
|
+
dispose: function() {
|
321
|
+
pluginsCall(plugins, 'dispose', undefined, true);
|
322
|
+
}
|
323
|
+
};
|
324
|
+
|
325
|
+
};
|
326
|
+
|
327
|
+
|
328
|
+
var checkFeature = function(feature, func) {
|
329
|
+
if (!func()) {
|
330
|
+
console.warn("Missing feature", feature);
|
331
|
+
throw "Missing feature " + feature;
|
332
|
+
}
|
333
|
+
};
|
334
|
+
|
335
|
+
var isCompatible = function() {
|
336
|
+
try {
|
337
|
+
// window.msMatchMedia would match also IE9
|
338
|
+
// IE9 wouldn't be so hard to support, but it doesn't worth it. (preview iframe and automatic scroll are 2 things not working in IE9)
|
339
|
+
checkFeature('matchMedia', function() {
|
340
|
+
return typeof global.matchMedia != 'undefined';
|
341
|
+
});
|
342
|
+
checkFeature('XMLHttpRequest 2', function() {
|
343
|
+
return 'XMLHttpRequest' in global && 'withCredentials' in new global.XMLHttpRequest();
|
344
|
+
});
|
345
|
+
checkFeature('ES5 strict', function() {
|
346
|
+
return function() { /* "use strict";*/
|
347
|
+
return typeof this == 'undefined';
|
348
|
+
}();
|
349
|
+
});
|
350
|
+
checkFeature('CSS borderRadius', function() {
|
351
|
+
return typeof global.document.body.style['borderRadius'] != 'undefined';
|
352
|
+
});
|
353
|
+
checkFeature('CSS boxShadow', function() {
|
354
|
+
return typeof global.document.body.style['boxShadow'] != 'undefined';
|
355
|
+
});
|
356
|
+
checkFeature('CSS boxSizing', function() {
|
357
|
+
return typeof global.document.body.style['boxSizing'] != 'undefined';
|
358
|
+
});
|
359
|
+
checkFeature('CSS backgroundSize', function() {
|
360
|
+
return typeof global.document.body.style['backgroundSize'] != 'undefined';
|
361
|
+
});
|
362
|
+
checkFeature('CSS backgroundOrigin', function() {
|
363
|
+
return typeof global.document.body.style['backgroundOrigin'] != 'undefined';
|
364
|
+
});
|
365
|
+
checkBadBrowserExtensions();
|
366
|
+
return true;
|
367
|
+
} catch (exception) {
|
368
|
+
return false;
|
369
|
+
}
|
370
|
+
};
|
371
|
+
|
372
|
+
var checkBadBrowserExtensions = function() {
|
373
|
+
var id = 'checkbadbrowsersframe';
|
374
|
+
var origTpl = ko.bindingHandlers.bindIframe.tpl;
|
375
|
+
ko.bindingHandlers.bindIframe.tpl = "<!DOCTYPE html>\r\n<html>\r\n<head><title>A</title>\r\n</head>\r\n<body><p style=\"color: blue\" align=\"right\" data-bind=\"style: { color: 'red' }\">B</p><div data-bind=\"text: content\"></div></body>\r\n</html>\r\n";
|
376
|
+
$('body').append('<iframe id="' + id + '" data-bind="bindIframe: $data"></iframe>');
|
377
|
+
var frameEl = global.document.getElementById(id);
|
378
|
+
ko.applyBindings({ content: "dummy content" }, frameEl);
|
379
|
+
// Obsolete method didn't work on IE11 when using "HTML5 doctype":
|
380
|
+
// var docType = new XMLSerializer().serializeToString(global.document.doctype);
|
381
|
+
var node = frameEl.contentWindow.document.doctype;
|
382
|
+
var docType = "<!DOCTYPE " + node.name +
|
383
|
+
(node.publicId ? ' PUBLIC "' + node.publicId + '"' : '') +
|
384
|
+
(!node.publicId && node.systemId ? ' SYSTEM' : '') +
|
385
|
+
(node.systemId ? ' "' + node.systemId + '"' : '') + '>';
|
386
|
+
var content = docType + "\n" + frameEl.contentWindow.document.documentElement.outerHTML;
|
387
|
+
ko.cleanNode(frameEl);
|
388
|
+
ko.removeNode(frameEl);
|
389
|
+
ko.bindingHandlers.bindIframe.tpl = origTpl;
|
390
|
+
|
391
|
+
var expected = "<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p align=\"right\" style=\"color: red;\" data-bind=\"style: { color: 'red' }\">B</p><div data-bind=\"text: content\">dummy content</div>\n\n</body></html>";
|
392
|
+
var expected2 = "<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style=\"color: red;\" data-bind=\"style: { color: 'red' }\" align=\"right\">B</p><div data-bind=\"text: content\">dummy content</div>\n\n</body></html>";
|
393
|
+
var expected3 = "<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style=\"color: red;\" align=\"right\" data-bind=\"style: { color: 'red' }\">B</p><div data-bind=\"text: content\">dummy content</div>\n\n</body></html>";
|
394
|
+
if (expected !== content && expected2 !== content && expected3 !== content) {
|
395
|
+
console.info("BadBrowser.FrameContentCheck", content.length, expected.length, expected2.length, expected3.length, content == expected, content == expected2, content == expected3);
|
396
|
+
console.info(content);
|
397
|
+
throw "Unexpected frame content. Misbehaving browser: "+content.length+"/"+expected.length+"/"+expected2.length+"/"+expected3.length;
|
398
|
+
}
|
399
|
+
};
|
400
|
+
|
401
|
+
var fixPageEvents = function() {
|
402
|
+
// This is global code to prevent dragging/dropping in the page where we don't deal with it.
|
403
|
+
// IE8 doesn't have window.addEventListener, but doesn't support drag&drop too.
|
404
|
+
if (global.addEventListener) {
|
405
|
+
// prevent generic file droppping in the page
|
406
|
+
global.addEventListener("drag", function(e) {
|
407
|
+
// console.log("browser is using drag listener on window");
|
408
|
+
e = e || global.event;
|
409
|
+
e.preventDefault();
|
410
|
+
}, false);
|
411
|
+
global.addEventListener("dragstart", function(e) {
|
412
|
+
// console.log("browser is using dragstart listener on window");
|
413
|
+
e = e || global.event;
|
414
|
+
e.preventDefault();
|
415
|
+
}, false);
|
416
|
+
global.addEventListener("dragover", function(e) {
|
417
|
+
// this is called on mouse move on every supported browser.
|
418
|
+
// console.log("browser is using dragover listener on window");
|
419
|
+
e = e || global.event;
|
420
|
+
e.preventDefault();
|
421
|
+
}, false);
|
422
|
+
global.addEventListener("drop", function(e) {
|
423
|
+
// console.log("browser is using drop listener on window");
|
424
|
+
e = e || global.event;
|
425
|
+
e.preventDefault();
|
426
|
+
}, false);
|
427
|
+
global.document.body.addEventListener('drop', function(e) {
|
428
|
+
// I browser supportati entrato tutti qui quando si droppa qualcosa sul body
|
429
|
+
// console.log("browser is using drop listener on body tag");
|
430
|
+
e.preventDefault();
|
431
|
+
}, false);
|
432
|
+
}
|
433
|
+
if (global.document.ondragstart) {
|
434
|
+
global.document.ondragstart = function() {
|
435
|
+
// console.log("browser called ondragstart. return false!");
|
436
|
+
return false;
|
437
|
+
};
|
438
|
+
}
|
439
|
+
};
|
440
|
+
|
441
|
+
module.exports = {
|
442
|
+
compile: templateCompiler,
|
443
|
+
load: templateLoader,
|
444
|
+
isCompatible: isCompatible,
|
445
|
+
fixPageEvents: fixPageEvents
|
446
|
+
};
|