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,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
// script template is the one provided by KO and deals with tempaltes defined as <script type=text/html.
|
4
|
+
// string template defines them in memory and avoids polluting the HTML: seems to work better in Mosaico.
|
5
|
+
|
6
|
+
module.exports = require('./string-template.js');
|
7
|
+
// module.exports = require('./script-template.js');
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false */
|
3
|
+
|
4
|
+
require("evol-colorpicker");
|
5
|
+
|
6
|
+
var $ = require("jquery");
|
7
|
+
var ko = require("knockout");
|
8
|
+
var kojqui = require("knockout-jqueryui");
|
9
|
+
|
10
|
+
|
11
|
+
var ColorPicker = function() {
|
12
|
+
kojqui.BindingHandler.call(this, 'colorpicker');
|
13
|
+
};
|
14
|
+
ColorPicker.prototype = kojqui.utils.createObject(kojqui.BindingHandler.prototype);
|
15
|
+
ColorPicker.prototype.constructor = ColorPicker;
|
16
|
+
|
17
|
+
ColorPicker.prototype.init = function(element, valueAccessor, allBindings) {
|
18
|
+
var va = valueAccessor();
|
19
|
+
var value = va.color;
|
20
|
+
|
21
|
+
// In order to have a correct dependency tracking in "ifSubs" we have to ensure we use a single computer for each editable
|
22
|
+
// property. Given this binding needs 2 of them, we create a computed so to "proxy" the dependencies.
|
23
|
+
var newDO = ko.computed({
|
24
|
+
read: value,
|
25
|
+
write: value,
|
26
|
+
disposeWhenNodeIsRemoved: element
|
27
|
+
});
|
28
|
+
var newVA = function() {
|
29
|
+
return newDO;
|
30
|
+
};
|
31
|
+
|
32
|
+
ko.bindingHandlers.value.init(element, newVA, allBindings);
|
33
|
+
|
34
|
+
var changePropagator = function(event, color) {
|
35
|
+
if (typeof color !== 'undefined') newDO(color);
|
36
|
+
};
|
37
|
+
$(element).on('change.color', changePropagator);
|
38
|
+
|
39
|
+
ko.computed({
|
40
|
+
read: function() {
|
41
|
+
var opt = {
|
42
|
+
color: ko.utils.unwrapObservable(newDO),
|
43
|
+
showOn: 'button'
|
44
|
+
};
|
45
|
+
for (var prop in va)
|
46
|
+
if (prop !== 'color' && va.hasOwnProperty(prop)) opt[prop] = ko.utils.unwrapObservable(va[prop]);
|
47
|
+
$(element).colorpicker(opt);
|
48
|
+
},
|
49
|
+
disposeWhenNodeIsRemoved: element
|
50
|
+
});
|
51
|
+
|
52
|
+
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
53
|
+
$(element).off('change.color', changePropagator);
|
54
|
+
$(element).colorpicker('destroy');
|
55
|
+
});
|
56
|
+
|
57
|
+
};
|
58
|
+
kojqui.utils.register(ColorPicker);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var ko = require("knockout");
|
4
|
+
|
5
|
+
/* https://github.com/knockout/knockout/issues/1171 */
|
6
|
+
ko.bindingHandlers.cssText = {
|
7
|
+
'update': function(node, valueAccessor, allBindings) {
|
8
|
+
var text = ko.utils.unwrapObservable(valueAccessor());
|
9
|
+
try {
|
10
|
+
node.innerText = text;
|
11
|
+
} catch (e) {
|
12
|
+
if (!node.styleSheet) node.innerHTML = "a{}";
|
13
|
+
node.styleSheet.cssText = text;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -0,0 +1,87 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var $ = require("jquery");
|
4
|
+
var ko = require("knockout");
|
5
|
+
|
6
|
+
/* knockout droppable, with simplified UMD */
|
7
|
+
;(function(factory) {
|
8
|
+
factory(ko, $);
|
9
|
+
})(function(ko, $) {
|
10
|
+
var ITEMKEY = "ko_sortItem",
|
11
|
+
INDEXKEY = "ko_sourceIndex",
|
12
|
+
LISTKEY = "ko_sortList",
|
13
|
+
PARENTKEY = "ko_parentList",
|
14
|
+
DRAGKEY = "ko_dragItem",
|
15
|
+
unwrap = ko.utils.unwrapObservable,
|
16
|
+
dataGet = ko.utils.domData.get,
|
17
|
+
dataSet = ko.utils.domData.set;
|
18
|
+
|
19
|
+
ko.bindingHandlers.droppable = {
|
20
|
+
init: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
21
|
+
var $element = $(element),
|
22
|
+
value = ko.utils.unwrapObservable(valueAccessor()) || {},
|
23
|
+
droppable = {},
|
24
|
+
dropActual;
|
25
|
+
|
26
|
+
$.extend(true, droppable, ko.bindingHandlers.droppable);
|
27
|
+
if (value.data) {
|
28
|
+
if (value.options && droppable.options) {
|
29
|
+
ko.utils.extend(droppable.options, value.options);
|
30
|
+
delete value.options;
|
31
|
+
}
|
32
|
+
ko.utils.extend(droppable, value);
|
33
|
+
} else {
|
34
|
+
droppable.data = value;
|
35
|
+
}
|
36
|
+
|
37
|
+
dropActual = droppable.options.drop;
|
38
|
+
|
39
|
+
$element.droppable(ko.utils.extend(droppable.options, {
|
40
|
+
drop: function(event, ui) {
|
41
|
+
|
42
|
+
var el = ui.draggable[0],
|
43
|
+
item = dataGet(el, ITEMKEY) || dataGet(el, DRAGKEY);
|
44
|
+
|
45
|
+
if (item) {
|
46
|
+
|
47
|
+
if (item.clone) {
|
48
|
+
item = item.clone();
|
49
|
+
}
|
50
|
+
|
51
|
+
if (droppable.dragged) {
|
52
|
+
item = droppable.dragged.call(this, item, event, ui) || item;
|
53
|
+
}
|
54
|
+
|
55
|
+
if (droppable.data) {
|
56
|
+
droppable.data(item);
|
57
|
+
}
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
if (dropActual) {
|
62
|
+
dropActual.apply(this, arguments);
|
63
|
+
}
|
64
|
+
|
65
|
+
}
|
66
|
+
}));
|
67
|
+
|
68
|
+
//handle enabling/disabling
|
69
|
+
if (droppable.isEnabled !== undefined) {
|
70
|
+
ko.computed({
|
71
|
+
read: function() {
|
72
|
+
$element.droppable(ko.utils.unwrapObservable(droppable.isEnabled) ? "enable" : "disable");
|
73
|
+
},
|
74
|
+
disposeWhenNodeIsRemoved: element
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
},
|
79
|
+
update: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
80
|
+
|
81
|
+
},
|
82
|
+
targetIndex: null,
|
83
|
+
afterMove: null,
|
84
|
+
beforeMove: null,
|
85
|
+
options: {}
|
86
|
+
};
|
87
|
+
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var ko = require("knockout");
|
4
|
+
var $ = require("jquery");
|
5
|
+
var console = require("console");
|
6
|
+
|
7
|
+
/* utility for togetherjs */
|
8
|
+
ko.bindingHandlers.focusable = {
|
9
|
+
'focus': function() {},
|
10
|
+
'blur': function() {},
|
11
|
+
'init': function(element) {
|
12
|
+
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
13
|
+
$(element).off("focusin", ko.bindingHandlers.focusable.focus);
|
14
|
+
$(element).off("focusout", ko.bindingHandlers.focusable.blur);
|
15
|
+
});
|
16
|
+
|
17
|
+
$(element).on("focusin", ko.bindingHandlers.focusable.focus);
|
18
|
+
$(element).on("focusout", ko.bindingHandlers.focusable.blur);
|
19
|
+
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
ko.bindingHandlers.scrollable = {
|
24
|
+
'scroll': function() {},
|
25
|
+
'init': function(element) {
|
26
|
+
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
27
|
+
$(element).off("scroll", ko.bindingHandlers.scrollable.scroll);
|
28
|
+
});
|
29
|
+
|
30
|
+
$(element).on("scroll", ko.bindingHandlers.scrollable.scroll);
|
31
|
+
|
32
|
+
}
|
33
|
+
};
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var ko = require("knockout");
|
4
|
+
|
5
|
+
ko.extenders.paging = function(target, pageSize) {
|
6
|
+
var _pageSize = ko.observable(pageSize || 10),
|
7
|
+
// default pageSize to 10
|
8
|
+
_currentPage = ko.observable(1); // default current page to 1
|
9
|
+
target.pageSize = ko.computed({
|
10
|
+
read: _pageSize,
|
11
|
+
write: function(newValue) {
|
12
|
+
if (newValue > 0) {
|
13
|
+
_pageSize(newValue);
|
14
|
+
} else {
|
15
|
+
_pageSize(10);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
target.currentPage = ko.computed({
|
21
|
+
read: _currentPage,
|
22
|
+
write: function(newValue) {
|
23
|
+
if (newValue > target.pageCount()) {
|
24
|
+
_currentPage(target.pageCount());
|
25
|
+
} else if (newValue <= 0) {
|
26
|
+
_currentPage(1);
|
27
|
+
} else {
|
28
|
+
_currentPage(newValue);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
32
|
+
|
33
|
+
target.pageCount = ko.computed(function() {
|
34
|
+
return Math.ceil(target().length / target.pageSize()) || 1;
|
35
|
+
});
|
36
|
+
|
37
|
+
target.currentPageData = ko.computed(function() {
|
38
|
+
var pageSize = _pageSize(),
|
39
|
+
pageIndex = _currentPage(),
|
40
|
+
startIndex = pageSize * (pageIndex - 1),
|
41
|
+
endIndex = pageSize * pageIndex;
|
42
|
+
|
43
|
+
return target().slice(startIndex, endIndex);
|
44
|
+
});
|
45
|
+
|
46
|
+
target.moveFirst = function() {
|
47
|
+
target.currentPage(1);
|
48
|
+
};
|
49
|
+
target.movePrevious = function() {
|
50
|
+
target.currentPage(target.currentPage() - 1);
|
51
|
+
};
|
52
|
+
target.moveNext = function() {
|
53
|
+
target.currentPage(target.currentPage() + 1);
|
54
|
+
};
|
55
|
+
target.moveLast = function() {
|
56
|
+
target.currentPage(target.pageCount());
|
57
|
+
};
|
58
|
+
|
59
|
+
return target;
|
60
|
+
};
|
@@ -0,0 +1,103 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* globals global: true */
|
3
|
+
|
4
|
+
var $ = require("jquery");
|
5
|
+
var ko = require("knockout");
|
6
|
+
var sortable = require("jquery-ui/sortable");
|
7
|
+
var draggable = require("jquery-ui/draggable");
|
8
|
+
var console = require("console");
|
9
|
+
require("knockout-sortable");
|
10
|
+
|
11
|
+
if (typeof sortable == 'undefined') throw "Cannot find jquery-ui sortable widget dependency!";
|
12
|
+
if (typeof draggable == 'undefined') throw "Cannot find jquery-ui sortable widget dependency!";
|
13
|
+
|
14
|
+
var isDraggingHelper = function(writable, e) {
|
15
|
+
if (writable()) {
|
16
|
+
if (e.type == writable() + 'stop') writable(false);
|
17
|
+
} else {
|
18
|
+
if (e.type == 'dragstart' || e.type == 'sortstart') writable(e.type.substring(0, 4));
|
19
|
+
}
|
20
|
+
};
|
21
|
+
|
22
|
+
var makeExtendedValueAccessor = function(valueAccessor) {
|
23
|
+
return function() {
|
24
|
+
var modelValue = valueAccessor(),
|
25
|
+
unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here
|
26
|
+
|
27
|
+
ko.utils.unwrapObservable(modelValue);
|
28
|
+
|
29
|
+
if (modelValue.options == 'undefined') {
|
30
|
+
modelValue.options = {};
|
31
|
+
}
|
32
|
+
|
33
|
+
var origStart = modelValue.options.start;
|
34
|
+
modelValue.options.start = function(e, ui) {
|
35
|
+
if (typeof modelValue.dragging != 'undefined' && ko.isWritableObservable(modelValue.dragging)) isDraggingHelper(modelValue.dragging, e);
|
36
|
+
if (typeof modelValue.dropContainer != 'undefined') {
|
37
|
+
modelValue.scrollInterval = global.setInterval(function() {
|
38
|
+
var foo = $(modelValue.dropContainer).scrollTop();
|
39
|
+
$(modelValue.dropContainer).scrollTop(foo + modelValue.adding);
|
40
|
+
}, 20);
|
41
|
+
}
|
42
|
+
if (typeof origStart != 'undefined') return origStart(e, ui);
|
43
|
+
};
|
44
|
+
var origStop = modelValue.options.stop;
|
45
|
+
modelValue.options.stop = function(e, ui) {
|
46
|
+
if (typeof modelValue.dragging != 'undefined' && ko.isWritableObservable(modelValue.dragging)) isDraggingHelper(modelValue.dragging, e);
|
47
|
+
if (typeof modelValue.dropContainer != 'undefined') {
|
48
|
+
global.clearInterval(modelValue.scrollInterval);
|
49
|
+
}
|
50
|
+
if (typeof origStop != 'undefined') return origStop(e, ui);
|
51
|
+
};
|
52
|
+
var origDrag = modelValue.options.drag;
|
53
|
+
modelValue.options.drag = function(e, ui) {
|
54
|
+
if (typeof modelValue.dropContainer != 'undefined') {
|
55
|
+
var top = e.pageY - $(modelValue.dropContainer).offset().top;
|
56
|
+
var bottom = top - $(modelValue.dropContainer).height();
|
57
|
+
// Handle scrolling speed depending on distance from border.
|
58
|
+
if (top < -20) {
|
59
|
+
modelValue.adding = -20;
|
60
|
+
// console.log("<<<");
|
61
|
+
} else if (top < 0) {
|
62
|
+
modelValue.adding = -10;
|
63
|
+
// console.log("<<");
|
64
|
+
} else if (top < 10) {
|
65
|
+
modelValue.adding = -5;
|
66
|
+
// console.log("<");
|
67
|
+
} else if (bottom > 20) {
|
68
|
+
modelValue.adding = 20;
|
69
|
+
// console.log(">>>");
|
70
|
+
} else if (bottom > 0) {
|
71
|
+
modelValue.adding = 10;
|
72
|
+
// console.log(">>");
|
73
|
+
} else if (bottom > -10) {
|
74
|
+
modelValue.adding = 5;
|
75
|
+
// console.log(">");
|
76
|
+
} else {
|
77
|
+
modelValue.adding = 0;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
if (typeof origDrag != 'undefined') return origDrag(e, ui);
|
81
|
+
};
|
82
|
+
|
83
|
+
return modelValue;
|
84
|
+
};
|
85
|
+
};
|
86
|
+
|
87
|
+
ko.bindingHandlers.extsortable = {
|
88
|
+
init: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
89
|
+
return ko.bindingHandlers.sortable.init(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);
|
90
|
+
},
|
91
|
+
update: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
92
|
+
return ko.bindingHandlers.sortable.update(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
ko.bindingHandlers.extdraggable = {
|
97
|
+
init: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
98
|
+
return ko.bindingHandlers.draggable.init(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);
|
99
|
+
},
|
100
|
+
update: function(element, valueAccessor, allBindingsAccessor, data, context) {
|
101
|
+
return ko.bindingHandlers.draggable.update(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);
|
102
|
+
}
|
103
|
+
};
|
@@ -0,0 +1,373 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false, Image: false */
|
3
|
+
|
4
|
+
// This module depends on those files, but it doesn't have a direct dependency, so we don't require them here.
|
5
|
+
|
6
|
+
//require("blueimp-canvas-to-blob");
|
7
|
+
//require("jquery-file-upload/js/jquery.iframe-transport.js");
|
8
|
+
//require("jquery-file-upload/js/jquery.fileupload.js");
|
9
|
+
//require("jquery-file-upload/js/jquery.fileupload-process.js");
|
10
|
+
//require("jquery-file-upload/js/jquery.fileupload-image.js");
|
11
|
+
//require("jquery-file-upload/js/jquery.fileupload-validate.js");
|
12
|
+
|
13
|
+
var $ = require("jquery");
|
14
|
+
var ko = require("knockout");
|
15
|
+
var console = require("console");
|
16
|
+
|
17
|
+
// experimental image preloading.
|
18
|
+
ko.bindingHandlers['preloader'] = {
|
19
|
+
init: function(element, valueAccessor) {
|
20
|
+
var value = valueAccessor();
|
21
|
+
if (typeof value.preloaded == 'undefined') {
|
22
|
+
value.preloaded = ko.observable("");
|
23
|
+
|
24
|
+
var preloader = function(newValue) {
|
25
|
+
if (newValue != value.preloaded()) {
|
26
|
+
if (newValue !== '') {
|
27
|
+
var img = new Image();
|
28
|
+
img.onload = function() {
|
29
|
+
value.preloaded(newValue);
|
30
|
+
};
|
31
|
+
img.onerror = function() {
|
32
|
+
value.preloaded(newValue);
|
33
|
+
};
|
34
|
+
img.src = newValue;
|
35
|
+
} else {
|
36
|
+
value.preloaded(newValue);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
value.subscribe(preloader);
|
42
|
+
preloader(value());
|
43
|
+
}
|
44
|
+
}
|
45
|
+
};
|
46
|
+
|
47
|
+
// TODO we don't use advattr and advstyle, maybe we should simply remove this code.
|
48
|
+
ko.bindingHandlers['advattr'] = {
|
49
|
+
'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {
|
50
|
+
var value = ko.utils.unwrapObservable(valueAccessor() || {});
|
51
|
+
ko.utils.objectForEach(value, function(attrName, attrValueAccessor) {
|
52
|
+
var attrValue = element.getAttribute(attrName);
|
53
|
+
|
54
|
+
if (ko.isWriteableObservable(attrValueAccessor)) {
|
55
|
+
var oldValue = attrValueAccessor();
|
56
|
+
if (oldValue != attrValue) {
|
57
|
+
attrValueAccessor(attrValue);
|
58
|
+
if (oldValue !== null) {
|
59
|
+
console.log("AdvAttr found a value different from the default", attrName, oldValue, attrValue);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
});
|
64
|
+
},
|
65
|
+
'update': function(element, valueAccessor, allBindings) {
|
66
|
+
var value = ko.utils.unwrapObservable(valueAccessor()) || {};
|
67
|
+
ko.utils.objectForEach(value, function(attrName, attrValue) {
|
68
|
+
attrValue = ko.utils.unwrapObservable(attrValue);
|
69
|
+
// To cover cases like "attr: { checked:someProp }", we want to remove the attribute entirely
|
70
|
+
// when someProp is a "no value"-like value (strictly null, false, or undefined)
|
71
|
+
// (because the absence of the "checked" attr is how to mark an element as not checked, etc.)
|
72
|
+
var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined);
|
73
|
+
if (toRemove) element.removeAttribute(attrName);
|
74
|
+
else element.setAttribute(attrName, attrValue.toString());
|
75
|
+
});
|
76
|
+
}
|
77
|
+
};
|
78
|
+
ko.bindingHandlers['advstyle'] = {
|
79
|
+
'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {
|
80
|
+
var value = ko.utils.unwrapObservable(valueAccessor() || {});
|
81
|
+
ko.utils.objectForEach(value, function(styleName, styleValueAccessor) {
|
82
|
+
var styleValue;
|
83
|
+
if (styleName.match(/Px$/)) {
|
84
|
+
styleName = styleName.substr(0, styleName.length - 2);
|
85
|
+
styleValue = element.style[styleName];
|
86
|
+
if (styleValue.match(/px$/)) {
|
87
|
+
styleValue = styleValue.replace(/px$/, '');
|
88
|
+
} else {
|
89
|
+
console.log("AdvStyle binding found an unexpected default value", styleName, styleValue, element);
|
90
|
+
}
|
91
|
+
} else {
|
92
|
+
styleValue = element.style[styleName];
|
93
|
+
}
|
94
|
+
|
95
|
+
if (ko.isWriteableObservable(styleValueAccessor)) {
|
96
|
+
var oldValue = styleValueAccessor();
|
97
|
+
if (oldValue != styleValue) {
|
98
|
+
styleValueAccessor(styleValue);
|
99
|
+
if (oldValue !== null) {
|
100
|
+
console.log("AdvStyle found a value different from the default", styleName, oldValue, styleValue);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
});
|
105
|
+
},
|
106
|
+
'update': function(element, valueAccessor) {
|
107
|
+
var value = ko.utils.unwrapObservable(valueAccessor() || {});
|
108
|
+
ko.utils.objectForEach(value, function(styleName, styleValue) {
|
109
|
+
styleValue = ko.utils.unwrapObservable(styleValue);
|
110
|
+
|
111
|
+
if (styleValue === null || typeof styleValue === 'undefined' || styleValue === false) {
|
112
|
+
styleValue = "";
|
113
|
+
}
|
114
|
+
|
115
|
+
if (styleName.match(/Px$/)) {
|
116
|
+
styleName = styleName.substr(0, styleName.length - 2);
|
117
|
+
styleValue = styleValue + "px";
|
118
|
+
}
|
119
|
+
|
120
|
+
element.style[styleName] = styleValue;
|
121
|
+
});
|
122
|
+
}
|
123
|
+
};
|
124
|
+
|
125
|
+
// Utility to log inizialization and disposal of DOM elements.
|
126
|
+
ko.bindingHandlers['domlog'] = {
|
127
|
+
init: function(element, valueAccessor) {
|
128
|
+
console.log("initialized", element);
|
129
|
+
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
130
|
+
console.log("disposed", element);
|
131
|
+
});
|
132
|
+
}
|
133
|
+
};
|
134
|
+
|
135
|
+
ko.bindingHandlers['fudroppable'] = {
|
136
|
+
init: function(element, valueAccessor) {
|
137
|
+
var opt = valueAccessor() || {};
|
138
|
+
var timeoutsObj = {};
|
139
|
+
|
140
|
+
var over = function(timeouts, dropZoneTimeout, element, className, observable, event) {
|
141
|
+
|
142
|
+
if (!timeouts[dropZoneTimeout]) {
|
143
|
+
if (typeof className !== 'undefined') {
|
144
|
+
element.classList.add(className);
|
145
|
+
}
|
146
|
+
if (ko.isWriteableObservable(observable) && !observable()) {
|
147
|
+
observable(true);
|
148
|
+
}
|
149
|
+
} else {
|
150
|
+
global.clearTimeout(timeouts[dropZoneTimeout]);
|
151
|
+
}
|
152
|
+
|
153
|
+
var stop = function() {
|
154
|
+
timeouts[dropZoneTimeout] = null;
|
155
|
+
if (typeof className !== 'undefined') {
|
156
|
+
element.classList.remove(className);
|
157
|
+
}
|
158
|
+
if (ko.isWriteableObservable(observable) && observable()) {
|
159
|
+
observable(false);
|
160
|
+
}
|
161
|
+
};
|
162
|
+
|
163
|
+
if (event.type == 'dragleave') stop();
|
164
|
+
else {
|
165
|
+
// Using 100 it doens't work fine on Linux (chome/firefox), using 200 still shows issues on slow Linux boxes
|
166
|
+
timeouts[dropZoneTimeout] = global.setTimeout(stop, 500);
|
167
|
+
}
|
168
|
+
|
169
|
+
};
|
170
|
+
|
171
|
+
if (opt.active || opt.activeClass) {
|
172
|
+
ko.utils.registerEventHandler(global, 'dragover', over.bind(undefined, timeoutsObj, 'activeTimeout', element, opt.activeClass, opt.active));
|
173
|
+
}
|
174
|
+
if (opt.hoverClass) {
|
175
|
+
// dragenter and dragleave are not required but they speedup feedback when used.
|
176
|
+
ko.utils.registerEventHandler(element, 'dragover dragenter dragleave', over.bind(undefined, timeoutsObj, 'hoverTimeout', element, opt.hoverClass, undefined));
|
177
|
+
}
|
178
|
+
}
|
179
|
+
};
|
180
|
+
|
181
|
+
ko.bindingHandlers['fileupload'] = {
|
182
|
+
extendOptions: {},
|
183
|
+
remoteFilePreprocessor: function(url) { return url; },
|
184
|
+
init: function(element, valueAccessor) {
|
185
|
+
// TODO domnodedisposal doesn't work when the upload is done by "clicking"
|
186
|
+
// Probably jquery-fileupload moves the DOM somewhere else so that KO doesn't
|
187
|
+
// detect the removal anymore.
|
188
|
+
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
|
189
|
+
$(element).fileupload('destroy');
|
190
|
+
});
|
191
|
+
|
192
|
+
// if we leave the title the native control will show us a tooltip we don't want.
|
193
|
+
// In WebKit the right way to remove it is leaving a "whitespace".
|
194
|
+
// In Gecko we have to set it empty.
|
195
|
+
if (global.webkitURL)
|
196
|
+
$(element).attr('title', ' ');
|
197
|
+
else
|
198
|
+
$(element).attr('title', '');
|
199
|
+
},
|
200
|
+
|
201
|
+
update: function(element, valueAccessor) {
|
202
|
+
var options = valueAccessor() || {};
|
203
|
+
|
204
|
+
var $fu = $(element);
|
205
|
+
var $parent = $fu.parents('.uploadzone');
|
206
|
+
|
207
|
+
var dataValue = options.data;
|
208
|
+
options.data = undefined;
|
209
|
+
|
210
|
+
var canvasPreview = options.canvasPreview;
|
211
|
+
|
212
|
+
// TODO remove hardcoded url
|
213
|
+
ko.utils.extend(options, {
|
214
|
+
url: '/upload/',
|
215
|
+
dataType: 'json',
|
216
|
+
dropZone: $parent.find('.mo-uploadzone')[0],
|
217
|
+
autoUpload: true,
|
218
|
+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
219
|
+
maxFileSize: 1024 * 1024,
|
220
|
+
// Enable image resizing, except for Android and Opera,
|
221
|
+
// which actually support image resizing, but fail to
|
222
|
+
// send Blob objects via XHR requests:
|
223
|
+
disableImageResize: /Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),
|
224
|
+
previewMaxWidth: 200,
|
225
|
+
previewMaxHeight: 200,
|
226
|
+
previewCrop: false,
|
227
|
+
replaceFileInput: false, // replaceFileInput true breaks after uploading using "input" (using mouse clic instead of dropping)
|
228
|
+
|
229
|
+
messages: {
|
230
|
+
// client side
|
231
|
+
unknownError: 'Unknown error',
|
232
|
+
uploadedBytes: 'Uploaded bytes exceed file size',
|
233
|
+
maxNumberOfFiles: 'Maximum number of files exceeded',
|
234
|
+
acceptFileTypes: 'File type not allowed',
|
235
|
+
maxFileSize: 'File is too large',
|
236
|
+
minFileSize: 'File is too small',
|
237
|
+
// server side
|
238
|
+
post_max_size: 'The uploaded file exceeds the post_max_size directive in php.ini',
|
239
|
+
max_file_size: 'File is too big',
|
240
|
+
min_file_size: 'File is too small',
|
241
|
+
accept_file_types: 'Filetype not allowed',
|
242
|
+
max_number_of_files: 'Maximum number of files exceeded',
|
243
|
+
max_width: 'Image exceeds maximum width',
|
244
|
+
min_width: 'Image requires a minimum width',
|
245
|
+
max_height: 'Image exceeds maximum height',
|
246
|
+
min_height: 'Image requires a minimum height',
|
247
|
+
abort: 'File upload aborted',
|
248
|
+
image_resize: 'Failed to resize image',
|
249
|
+
generic: 'Unexpected upload error'
|
250
|
+
}
|
251
|
+
});
|
252
|
+
|
253
|
+
ko.utils.extend(options, ko.bindingHandlers['fileupload'].extendOptions);
|
254
|
+
|
255
|
+
var working = 0;
|
256
|
+
var firstWorked = '';
|
257
|
+
|
258
|
+
var cleanup = function() {
|
259
|
+
if (--working === 0) {
|
260
|
+
if (dataValue) {
|
261
|
+
dataValue(firstWorked);
|
262
|
+
}
|
263
|
+
firstWorked = '';
|
264
|
+
if (canvasPreview) {
|
265
|
+
$parent.find('img').show();
|
266
|
+
$parent.find('canvas').remove();
|
267
|
+
}
|
268
|
+
$parent.removeClass("uploading");
|
269
|
+
$parent.find('.progress-bar').css('width', 0);
|
270
|
+
}
|
271
|
+
};
|
272
|
+
|
273
|
+
var translatedMessage = function(text) {
|
274
|
+
if (typeof options.messages == 'object' && options.messages !== null) {
|
275
|
+
var match = text.match(/^([^ ]+)(.*)$/);
|
276
|
+
if (match) {
|
277
|
+
if (typeof options.messages[match[1]] !== 'undefined') {
|
278
|
+
return options.messages[match[1]] + match[2];
|
279
|
+
}
|
280
|
+
}
|
281
|
+
}
|
282
|
+
return text;
|
283
|
+
};
|
284
|
+
|
285
|
+
$fu.fileupload(options);
|
286
|
+
|
287
|
+
var events = ['fileuploadadd', 'fileuploadprocessalways', 'fileuploadprogressall', 'fileuploaddone', 'fileuploadfail'];
|
288
|
+
var eventHandler = function(e, data) {
|
289
|
+
if (e.type == 'fileuploadadd') {
|
290
|
+
working++;
|
291
|
+
}
|
292
|
+
if (e.type == 'fileuploadfail') {
|
293
|
+
console.log("fileuploadfail", e, data);
|
294
|
+
if (options.onerror) {
|
295
|
+
if (data.errorThrown === '' && data.textStatus == 'error') {
|
296
|
+
options.onerror(translatedMessage('generic'));
|
297
|
+
} else {
|
298
|
+
options.onerror(translatedMessage('generic (' + data.errorThrown + ')'));
|
299
|
+
}
|
300
|
+
}
|
301
|
+
cleanup();
|
302
|
+
}
|
303
|
+
if (e.type == 'fileuploaddone') {
|
304
|
+
if (typeof data.result.files[0].url !== 'undefined') {
|
305
|
+
if (options.onfile) {
|
306
|
+
for (var i = 0; i < data.result.files.length; i++) {
|
307
|
+
data.result.files[i] = ko.bindingHandlers['fileupload'].remoteFilePreprocessor(data.result.files[i]);
|
308
|
+
options.onfile(data.result.files[i]);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
if (firstWorked === '') firstWorked = data.result.files[0].url;
|
313
|
+
|
314
|
+
if (canvasPreview) {
|
315
|
+
var img = new Image();
|
316
|
+
img.onload = cleanup;
|
317
|
+
img.onerror = cleanup;
|
318
|
+
img.src = data.result.files[0].url;
|
319
|
+
} else {
|
320
|
+
cleanup();
|
321
|
+
}
|
322
|
+
} else if (typeof data.result.files[0].error !== 'undefined') {
|
323
|
+
console.log("remote error", e, data);
|
324
|
+
if (options.onerror) {
|
325
|
+
options.onerror(translatedMessage(data.result.files[0].error));
|
326
|
+
}
|
327
|
+
cleanup();
|
328
|
+
} else {
|
329
|
+
console.log("unexpected error", e, data);
|
330
|
+
if (options.onerror) {
|
331
|
+
options.onerror(translatedMessage('generic (Unexpected Error retrieving uploaded file)'));
|
332
|
+
}
|
333
|
+
cleanup();
|
334
|
+
}
|
335
|
+
}
|
336
|
+
if (e.type == 'fileuploadprocessalways') {
|
337
|
+
var index = data.index,
|
338
|
+
file = data.files[index];
|
339
|
+
if (file.preview && index === 0) {
|
340
|
+
// if we have a canvas we had multiple uploaded files
|
341
|
+
if ($parent.find('canvas').length === 0) {
|
342
|
+
if (canvasPreview) {
|
343
|
+
var el = $(file.preview).css('width', '100%'); // .css('position', 'absolute').css('left', '0');
|
344
|
+
$parent.find('img').hide();
|
345
|
+
$parent.prepend(el);
|
346
|
+
}
|
347
|
+
$parent.addClass("uploading");
|
348
|
+
$parent.find('.progress-bar').css('width', 0);
|
349
|
+
}
|
350
|
+
}
|
351
|
+
if (file.error) {
|
352
|
+
// File type not allowed
|
353
|
+
// File is too large
|
354
|
+
if (options.onerror) {
|
355
|
+
options.onerror(translatedMessage(file.error));
|
356
|
+
}
|
357
|
+
cleanup();
|
358
|
+
}
|
359
|
+
}
|
360
|
+
if (e.type == 'fileuploadprogressall') {
|
361
|
+
var progress = parseInt(data.loaded / data.total * 100, 10);
|
362
|
+
$parent.find('.progress-bar').css('width', progress + '%');
|
363
|
+
}
|
364
|
+
};
|
365
|
+
for (var i = events.length - 1; i >= 0; i--) {
|
366
|
+
var eventName = events[i];
|
367
|
+
$fu.on(eventName, eventHandler);
|
368
|
+
}
|
369
|
+
if (!$.support.fileInput) {
|
370
|
+
$fu.prop('disabled', true).parent().addClass('disabled');
|
371
|
+
}
|
372
|
+
}
|
373
|
+
};
|