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,282 @@
|
|
1
|
+
'use strict';
|
2
|
+
/* globals describe: false, it: false, expect: false */
|
3
|
+
/* globals process: false, console: false */
|
4
|
+
|
5
|
+
var mockery = require('mockery');
|
6
|
+
mockery.enable();
|
7
|
+
mockery.registerAllowables(['../src/js/converter/declarations.js', 'console', './utils.js', './domutils.js', 'console', '../bower_components/mensch']);
|
8
|
+
var currentDocument;
|
9
|
+
mockery.registerMock('jquery', function() {
|
10
|
+
return currentDocument.apply(currentDocument, arguments);
|
11
|
+
});
|
12
|
+
mockery.registerMock('jsep', require('../bower_components/jsep/src/jsep.js'));
|
13
|
+
mockery.registerMock('mensch/lib/parser.js', function() {
|
14
|
+
var parse = require('../bower_components/mensch').parse;
|
15
|
+
return parse.apply(parse, arguments);
|
16
|
+
});
|
17
|
+
var elaborateDeclarations = require('../src/js/converter/declarations.js');
|
18
|
+
var templateUrlConverter = function(url) { return '.'+url; };
|
19
|
+
|
20
|
+
var mockedBindingProvider = function(a, b) {
|
21
|
+
// console.log("binding provider for", a, b);
|
22
|
+
return "$" + a + "[" + b + "]";
|
23
|
+
};
|
24
|
+
|
25
|
+
describe('Style declaration processor', function() {
|
26
|
+
|
27
|
+
it('should not loose simple properties after a -ko-property', function() {
|
28
|
+
var styleSheet, declarations, previewBindings;
|
29
|
+
styleSheet = require('mensch/lib/parser.js')("#{\n" + 'color: red; -ko-color: @color; background-color: white' + "}", {
|
30
|
+
comments: true,
|
31
|
+
position: true
|
32
|
+
});
|
33
|
+
declarations = styleSheet.stylesheet.rules[0].declarations;
|
34
|
+
previewBindings = elaborateDeclarations(undefined, declarations, templateUrlConverter, mockedBindingProvider);
|
35
|
+
expect(previewBindings).toEqual("virtualAttrStyle: 'color: '+($color[undefined]())+'; '+'background-color: white;'+''");
|
36
|
+
|
37
|
+
styleSheet = require('mensch/lib/parser.js')("#{\n" + 'color: red; background-color: white; -ko-color: @color' + "}", {
|
38
|
+
comments: true,
|
39
|
+
position: true
|
40
|
+
});
|
41
|
+
declarations = styleSheet.stylesheet.rules[0].declarations;
|
42
|
+
previewBindings = elaborateDeclarations(undefined, declarations, templateUrlConverter, mockedBindingProvider);
|
43
|
+
expect(previewBindings).toEqual("virtualAttrStyle: 'color: '+($color[undefined]())+'; '+'background-color: white;'+''");
|
44
|
+
|
45
|
+
});
|
46
|
+
|
47
|
+
it('should not mix virtualStyle and virtualAttrStyle bindings', function() {
|
48
|
+
var styleSheet, declarations, previewBindings;
|
49
|
+
styleSheet = require('mensch/lib/parser.js')("#{\n" + '-ko-bind-text: @[\'Pulsante\']; -ko-font-family: @face; -ko-color: @color; -ko-font-size: @[size]px; -ko-background-color: @buttonColor; padding-left: 5px; -ko-border-radius: @[radius]px; padding: 5px;' + "}", {
|
50
|
+
comments: true,
|
51
|
+
position: true
|
52
|
+
});
|
53
|
+
declarations = styleSheet.stylesheet.rules[0].declarations;
|
54
|
+
previewBindings = elaborateDeclarations(undefined, declarations, templateUrlConverter, mockedBindingProvider);
|
55
|
+
expect(previewBindings).toEqual("virtualAttrStyle: 'padding-left: 5px; '+'padding: 5px;'+'', text: 'Pulsante', virtualStyle: { fontFamily: $face[undefined](), color: $color[undefined](), fontSize: $size[undefined]()+'px', backgroundColor: $buttonColor[undefined](), borderRadius: $radius[undefined]()+'px' }");
|
56
|
+
});
|
57
|
+
|
58
|
+
it('should mantain spaces and ; when removing/replacing declarations', function() {
|
59
|
+
var result;
|
60
|
+
result = elaborateDeclarations('color: red; -ko-color: @color; background-color: white', undefined, templateUrlConverter, mockedBindingProvider);
|
61
|
+
expect(result).toEqual("color: red; color: <!-- ko text: $color[red]() -->red<!-- /ko -->; background-color: white");
|
62
|
+
|
63
|
+
result = elaborateDeclarations('color: red;-ko-color: @color;background-color: white', undefined, templateUrlConverter, mockedBindingProvider);
|
64
|
+
expect(result).toEqual("color: red;color: <!-- ko text: $color[red]() -->red<!-- /ko -->;background-color: white");
|
65
|
+
});
|
66
|
+
|
67
|
+
|
68
|
+
it('should correctly parse multiline declarations', function() {
|
69
|
+
var result;
|
70
|
+
|
71
|
+
result = elaborateDeclarations('\tcolor: red;\n\t-ko-color: @color;\n\tbackground-color: white\n', undefined, templateUrlConverter, mockedBindingProvider);
|
72
|
+
expect(result).toEqual("\tcolor: red;\n\tcolor: <!-- ko text: $color[red]() -->red<!-- /ko -->;\n\tbackground-color: white\n");
|
73
|
+
});
|
74
|
+
|
75
|
+
it('should support modifiers', function() {
|
76
|
+
var result;
|
77
|
+
result = elaborateDeclarations('width: 10%; -ko-width: @[mywidth]%', undefined, templateUrlConverter, mockedBindingProvider);
|
78
|
+
expect(result).toEqual("width: 10%; width: <!-- ko text: $mywidth[10]()+'%' -->10%<!-- /ko -->");
|
79
|
+
|
80
|
+
result = elaborateDeclarations('width: 10px; -ko-width: @[mywidth]px', undefined, templateUrlConverter, mockedBindingProvider);
|
81
|
+
expect(result).toEqual("width: 10px; width: <!-- ko text: $mywidth[10]()+'px' -->10px<!-- /ko -->");
|
82
|
+
|
83
|
+
result = elaborateDeclarations('src: url(\'path\'); -ko-src: url(\'@myurl\')', undefined, templateUrlConverter, mockedBindingProvider);
|
84
|
+
expect(result).toEqual("src: url(\'.path\'); src: <!-- ko text: 'url(\\''+$myurl[.path]()+'\\')' -->url(\'.path\')<!-- /ko -->");
|
85
|
+
|
86
|
+
result = elaborateDeclarations('src: url("path"); -ko-src: url("@myurl")', undefined, templateUrlConverter, mockedBindingProvider);
|
87
|
+
expect(result).toEqual("src: url(\".path\"); src: <!-- ko text: 'url(\"'+$myurl[.path]()+'\")' -->url(\".path\")<!-- /ko -->");
|
88
|
+
|
89
|
+
result = elaborateDeclarations('src: url(path); -ko-src: url(@myurl)', undefined, templateUrlConverter, mockedBindingProvider);
|
90
|
+
expect(result).toEqual("src: url(.path); src: <!-- ko text: 'url('+$myurl[.path]()+')' -->url(.path)<!-- /ko -->");
|
91
|
+
|
92
|
+
});
|
93
|
+
|
94
|
+
it('should be able to remove display: none', function() {
|
95
|
+
var result;
|
96
|
+
result = elaborateDeclarations('a: 1; display: none; b: 2', undefined, templateUrlConverter, mockedBindingProvider, undefined, undefined, true);
|
97
|
+
expect(result).toEqual("a: 1; ; b: 2");
|
98
|
+
});
|
99
|
+
|
100
|
+
it('should support composed properties and hardcoded values', function() {
|
101
|
+
var result;
|
102
|
+
result = elaborateDeclarations('border: 1px 2px 3px 4px; -ko-border: @border1 @border2 3px @border4', undefined, templateUrlConverter, mockedBindingProvider);
|
103
|
+
expect(result).toEqual("border: 1px 2px 3px 4px; border: <!-- ko text: $border1[1px]()+' '+$border2[2px]()+' 3px '+$border4[4px]() -->1px 2px 3px 4px<!-- /ko -->");
|
104
|
+
});
|
105
|
+
|
106
|
+
it('should support conditional properties', function() {
|
107
|
+
var result, styleSheet, declarations;
|
108
|
+
styleSheet = require('mensch/lib/parser.js')("#{\n" + 'color: red; -ko-color: @mycolor; -ko-color-if: mycondition' + "}", {
|
109
|
+
comments: true,
|
110
|
+
position: true
|
111
|
+
});
|
112
|
+
declarations = styleSheet.stylesheet.rules[0].declarations;
|
113
|
+
result = elaborateDeclarations(undefined, declarations, templateUrlConverter, mockedBindingProvider);
|
114
|
+
expect(result).toEqual("virtualAttrStyle: 'color: '+(($mycondition[undefined]()) ? $mycolor[undefined]() : null)+';'+''");
|
115
|
+
|
116
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-if: mycondition', undefined, templateUrlConverter, mockedBindingProvider);
|
117
|
+
expect(result).toEqual("color: red; color: <!-- ko text: ($mycondition[undefined]()) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
118
|
+
});
|
119
|
+
|
120
|
+
it('should support simple expressions in conditional properties', function() {
|
121
|
+
var result, styleSheet, declarations;
|
122
|
+
styleSheet = require('mensch/lib/parser.js')("#{\n" + 'color: red; -ko-color: @mycolor; -ko-color-if: mycondition gt 1 and mycondition lt 3' + "}", {
|
123
|
+
comments: true,
|
124
|
+
position: true
|
125
|
+
});
|
126
|
+
declarations = styleSheet.stylesheet.rules[0].declarations;
|
127
|
+
result = elaborateDeclarations(undefined, declarations, templateUrlConverter, mockedBindingProvider);
|
128
|
+
expect(result).toEqual("virtualAttrStyle: 'color: '+(((($mycondition[undefined]() > 1) && ($mycondition[undefined]() < 3))) ? $mycolor[undefined]() : null)+';'+''");
|
129
|
+
|
130
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-if: mycondition gt 1 and mycondition lt 3', undefined, templateUrlConverter, mockedBindingProvider);
|
131
|
+
expect(result).toEqual("color: red; color: <!-- ko text: ((($mycondition[undefined]() > 1) && ($mycondition[undefined]() < 3))) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
132
|
+
|
133
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-ifnot: mycondition gt 1 and mycondition lt 3', undefined, templateUrlConverter, mockedBindingProvider);
|
134
|
+
expect(result).toEqual("color: red; color: <!-- ko text: !((($mycondition[undefined]() > 1) && ($mycondition[undefined]() < 3))) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
135
|
+
|
136
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-ifnot: mycondition eq "ciao ciao"', undefined, templateUrlConverter, mockedBindingProvider);
|
137
|
+
expect(result).toEqual("color: red; color: <!-- ko text: !(($mycondition[undefined]() == \"ciao ciao\")) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
138
|
+
|
139
|
+
});
|
140
|
+
|
141
|
+
it('should support complex expressions in conditional properties', function() {
|
142
|
+
var result;
|
143
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-ifnot: mycondition eq "ciao ciao" and mycondition neq "miao" or mycondition lte 1 or Color.lighter(mycondition, "#00000") gte "#CCCCCC"', undefined, templateUrlConverter, mockedBindingProvider);
|
144
|
+
expect(result).toEqual("color: red; color: <!-- ko text: !((((($mycondition[undefined]() == \"ciao ciao\") && ($mycondition[undefined]() != \"miao\")) || ($mycondition[undefined]() <= 1)) || (Color.lighter($mycondition[undefined](), \"#00000\") >= \"#CCCCCC\"))) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
145
|
+
|
146
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-ifnot: !mycondition || true ? myobj.color : "red"', undefined, templateUrlConverter, mockedBindingProvider);
|
147
|
+
expect(result).toEqual("color: red; color: <!-- ko text: !(((!$mycondition[undefined]() || true) ? $myobj.color[undefined]() : \"red\")) ? $mycolor[red]() : null -->red<!-- /ko -->; ");
|
148
|
+
});
|
149
|
+
|
150
|
+
it('should expect defaults', function() {
|
151
|
+
var result, exception;
|
152
|
+
try {
|
153
|
+
result = elaborateDeclarations('-ko-color: red', undefined, templateUrlConverter, mockedBindingProvider);
|
154
|
+
} catch (e) {
|
155
|
+
exception = e;
|
156
|
+
}
|
157
|
+
expect(result).toEqual(undefined);
|
158
|
+
expect(exception).toMatch(/^Cannot find default/);
|
159
|
+
|
160
|
+
try {
|
161
|
+
result = elaborateDeclarations('color: red blue; -ko-color: @a @b @c @d', undefined, templateUrlConverter, mockedBindingProvider);
|
162
|
+
} catch (e) {
|
163
|
+
exception = e;
|
164
|
+
}
|
165
|
+
expect(result).toEqual(undefined);
|
166
|
+
expect(exception).toMatch(/^Cannot find default/);
|
167
|
+
});
|
168
|
+
|
169
|
+
// TODO the first now works (we support "or") while the seconds raise a different exception.
|
170
|
+
it('should raise an exception on unknown tokens in condition expressions', function() {
|
171
|
+
var result, exception;
|
172
|
+
try {
|
173
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-if: mycondition gt 1 xor mycondition lt 3', undefined, templateUrlConverter, mockedBindingProvider);
|
174
|
+
} catch (e) {
|
175
|
+
exception = e;
|
176
|
+
}
|
177
|
+
expect(result).toEqual(undefined);
|
178
|
+
expect(exception).toMatch(/^Syntax error/);
|
179
|
+
|
180
|
+
try {
|
181
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-if: mycondition gtn 1', undefined, templateUrlConverter, mockedBindingProvider);
|
182
|
+
} catch (e) {
|
183
|
+
exception = e;
|
184
|
+
}
|
185
|
+
expect(result).toEqual(undefined);
|
186
|
+
expect(exception).toMatch(/^Syntax error/);
|
187
|
+
|
188
|
+
});
|
189
|
+
|
190
|
+
it('should raise an exception on element styles applied with no element', function() {
|
191
|
+
var result, exception;
|
192
|
+
try {
|
193
|
+
result = elaborateDeclarations('-ko-attr-href: @myhref', undefined, templateUrlConverter, mockedBindingProvider);
|
194
|
+
} catch (e) {
|
195
|
+
exception = e;
|
196
|
+
}
|
197
|
+
expect(result).toEqual(undefined);
|
198
|
+
expect(exception).toMatch(/^Attributes and bind declarations/);
|
199
|
+
|
200
|
+
try {
|
201
|
+
result = elaborateDeclarations('-ko-bind-text: @mytext', undefined, templateUrlConverter, mockedBindingProvider);
|
202
|
+
} catch (e) {
|
203
|
+
exception = e;
|
204
|
+
}
|
205
|
+
expect(result).toEqual(undefined);
|
206
|
+
expect(exception).toMatch(/^Attributes and bind declarations/);
|
207
|
+
|
208
|
+
});
|
209
|
+
|
210
|
+
// TODO switching to JSEP raises an "'Found an unsupported expression type: Compound'"" exception, instead.
|
211
|
+
it('should raise an exception on unbalanced string values', function() {
|
212
|
+
var result, exception;
|
213
|
+
try {
|
214
|
+
result = elaborateDeclarations('color: red; -ko-color: @mycolor; -ko-color-if: mycondition eq "ciao ciao"a', undefined, templateUrlConverter, mockedBindingProvider);
|
215
|
+
} catch (e) {
|
216
|
+
exception = e;
|
217
|
+
}
|
218
|
+
expect(result).toEqual(undefined);
|
219
|
+
expect(exception).toMatch(/^Syntax error/);
|
220
|
+
});
|
221
|
+
|
222
|
+
it('should raise an exception when -if and -ifnot are used on the same property', function() {
|
223
|
+
var result, exception;
|
224
|
+
try {
|
225
|
+
result = elaborateDeclarations('color: red; -ko-color-ifnot: mycondition; -ko-color: @mycolor; -ko-color-if: mycondition eq "ciao ciao"', undefined, templateUrlConverter, mockedBindingProvider);
|
226
|
+
} catch (e) {
|
227
|
+
exception = e;
|
228
|
+
}
|
229
|
+
expect(result).toEqual(undefined);
|
230
|
+
expect(exception).toMatch(/^Unexpected error/);
|
231
|
+
});
|
232
|
+
|
233
|
+
|
234
|
+
// TODO maybe this doesn't apply anymore??
|
235
|
+
it('should raise errors on bad modifiers', function() {
|
236
|
+
var result, exception;
|
237
|
+
try {
|
238
|
+
result = elaborateDeclarations('src: url(\'path\'); -ko-src: @[myurl!mymod]', undefined, templateUrlConverter, mockedBindingProvider);
|
239
|
+
} catch (e) {
|
240
|
+
exception = e;
|
241
|
+
}
|
242
|
+
expect(result).toEqual(undefined);
|
243
|
+
expect(exception).toMatch(/Syntax error /);
|
244
|
+
});
|
245
|
+
|
246
|
+
it('should raise errors on missing default value', function() {
|
247
|
+
var result, exception;
|
248
|
+
try {
|
249
|
+
result = elaborateDeclarations('-ko-color: @mycolor', undefined, templateUrlConverter, mockedBindingProvider);
|
250
|
+
} catch (e) {
|
251
|
+
exception = e;
|
252
|
+
}
|
253
|
+
expect(result).toEqual(undefined);
|
254
|
+
expect(exception).toMatch(/^Cannot find default/);
|
255
|
+
});
|
256
|
+
|
257
|
+
it('should not alter the result when no -ko declarations are used', function() {
|
258
|
+
var result;
|
259
|
+
result = elaborateDeclarations('width: 10%; width: 20%', undefined, templateUrlConverter, mockedBindingProvider);
|
260
|
+
expect(result).toBe(null);
|
261
|
+
});
|
262
|
+
|
263
|
+
it('should raise errors on unexpected default values when using modifiers', function() {
|
264
|
+
var result, exception;
|
265
|
+
try {
|
266
|
+
result = elaborateDeclarations('width: 10%; -ko-width: @[mywidth]px', undefined, templateUrlConverter, mockedBindingProvider);
|
267
|
+
} catch (e) {
|
268
|
+
exception = e;
|
269
|
+
}
|
270
|
+
expect(result).toEqual(undefined);
|
271
|
+
expect(exception).toMatch(/^Cannot find default/);
|
272
|
+
|
273
|
+
try {
|
274
|
+
result = elaborateDeclarations('width: 10px; -ko-width: @[mywidth]%', undefined, templateUrlConverter, mockedBindingProvider);
|
275
|
+
} catch (e) {
|
276
|
+
exception = e;
|
277
|
+
}
|
278
|
+
expect(result).toEqual(undefined);
|
279
|
+
expect(exception).toMatch(/^Cannot find default/);
|
280
|
+
});
|
281
|
+
|
282
|
+
});
|
@@ -0,0 +1,114 @@
|
|
1
|
+
'use strict';
|
2
|
+
/* globals describe: false, it: false, expect: false */
|
3
|
+
|
4
|
+
var mockery = require('mockery');
|
5
|
+
mockery.enable();
|
6
|
+
mockery.registerAllowables(['../src/js/converter/declarations.js', 'console', './utils.js', './domutils.js', 'console', '../bower_components/mensch']);
|
7
|
+
var currentDocument;
|
8
|
+
mockery.registerMock('jquery', function() {
|
9
|
+
return currentDocument.apply(currentDocument, arguments);
|
10
|
+
});
|
11
|
+
mockery.registerMock('mensch/lib/parser.js', function() {
|
12
|
+
var parse = require('../bower_components/mensch').parse;
|
13
|
+
return parse.apply(parse, arguments);
|
14
|
+
});
|
15
|
+
|
16
|
+
var utils = require('../src/js/converter/utils.js');
|
17
|
+
|
18
|
+
|
19
|
+
describe('Mensch parser', function() {
|
20
|
+
|
21
|
+
it('should return expected positions', function() {
|
22
|
+
var styleText = " \nselector \n{\n color: red\n;\t}\n selector2{a:b}";
|
23
|
+
var styleSheet = require('mensch/lib/parser.js')(styleText, {
|
24
|
+
comments: true,
|
25
|
+
position: true
|
26
|
+
});
|
27
|
+
var declarations = styleSheet.stylesheet.rules[0].declarations;
|
28
|
+
|
29
|
+
expect(styleSheet.stylesheet.rules[0].position).toEqual({
|
30
|
+
start: {
|
31
|
+
line: 2,
|
32
|
+
col: 1
|
33
|
+
},
|
34
|
+
end: {
|
35
|
+
line: 3,
|
36
|
+
col: 1
|
37
|
+
}
|
38
|
+
});
|
39
|
+
expect(declarations[0].position).toEqual({
|
40
|
+
start: {
|
41
|
+
line: 4,
|
42
|
+
col: 2
|
43
|
+
},
|
44
|
+
end: {
|
45
|
+
line: 5,
|
46
|
+
col: 1
|
47
|
+
}
|
48
|
+
});
|
49
|
+
expect(styleSheet.stylesheet.rules[1].position).toEqual({
|
50
|
+
start: {
|
51
|
+
line: 6,
|
52
|
+
col: 2
|
53
|
+
},
|
54
|
+
end: {
|
55
|
+
line: 6,
|
56
|
+
col: 11
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
|
61
|
+
var replacedText = styleText;
|
62
|
+
replacedText = utils.removeStyle(replacedText, styleSheet.stylesheet.rules[1].position.start, styleSheet.stylesheet.rules[1].position.end, 0, 0, 0, 'CCC');
|
63
|
+
replacedText = utils.removeStyle(replacedText, declarations[0].position.start, declarations[0].position.end, 0, 0, 0, 'BBB');
|
64
|
+
replacedText = utils.removeStyle(replacedText, styleSheet.stylesheet.rules[0].position.start, styleSheet.stylesheet.rules[0].position.end, 0, 0, 0, 'AAA');
|
65
|
+
expect(replacedText).toEqual(" \nAAA{\n BBB;\t}\n CCC{a:b}");
|
66
|
+
});
|
67
|
+
|
68
|
+
it('should return expected positions 2', function() {
|
69
|
+
var styleText = "a { b: c; d: e }\na { b: c; d: e }";
|
70
|
+
var styleSheet = require('mensch/lib/parser.js')(styleText, {
|
71
|
+
comments: true,
|
72
|
+
position: true
|
73
|
+
});
|
74
|
+
var declarations = styleSheet.stylesheet.rules[0].declarations;
|
75
|
+
|
76
|
+
expect(styleSheet.stylesheet.rules[0].position).toEqual({
|
77
|
+
start: {
|
78
|
+
line: 1,
|
79
|
+
col: 1
|
80
|
+
},
|
81
|
+
end: {
|
82
|
+
line: 1,
|
83
|
+
col: 3
|
84
|
+
}
|
85
|
+
});
|
86
|
+
expect(declarations[0].position).toEqual({
|
87
|
+
start: {
|
88
|
+
line: 1,
|
89
|
+
col: 5
|
90
|
+
},
|
91
|
+
end: {
|
92
|
+
line: 1,
|
93
|
+
col: 9
|
94
|
+
}
|
95
|
+
});
|
96
|
+
expect(styleSheet.stylesheet.rules[1].position).toEqual({
|
97
|
+
start: {
|
98
|
+
line: 2,
|
99
|
+
col: 1
|
100
|
+
},
|
101
|
+
end: {
|
102
|
+
line: 2,
|
103
|
+
col: 3
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
107
|
+
var replacedText = styleText;
|
108
|
+
replacedText = utils.removeStyle(replacedText, declarations[1].position.start, declarations[1].position.end, 0, 0, 0, 'D:E');
|
109
|
+
replacedText = utils.removeStyle(replacedText, declarations[0].position.start, declarations[0].position.end, 0, 0, 0, 'B:C');
|
110
|
+
replacedText = utils.removeStyle(replacedText, styleSheet.stylesheet.rules[0].position.start, styleSheet.stylesheet.rules[0].position.end, 0, 0, 0, 'A');
|
111
|
+
expect(replacedText).toEqual("A{ B:C; D:E}\na { b: c; d: e }");
|
112
|
+
});
|
113
|
+
|
114
|
+
});
|
@@ -0,0 +1,88 @@
|
|
1
|
+
'use strict';
|
2
|
+
/* globals it:false, describe:false, expect:false */
|
3
|
+
|
4
|
+
var mockery = require('mockery');
|
5
|
+
mockery.enable();
|
6
|
+
mockery.registerAllowables(['console', './domutils.js']);
|
7
|
+
var currentDocument;
|
8
|
+
mockery.registerMock('jquery', function() {
|
9
|
+
return currentDocument.apply(currentDocument, arguments);
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Model generator', function() {
|
13
|
+
|
14
|
+
/*
|
15
|
+
ensurePathAndGetBindValue: modelEnsurePathAndGetBindValue.bind(undefined, false),
|
16
|
+
getBindValue: modelEnsurePathAndGetBindValue.bind(undefined, true),
|
17
|
+
generateModel: _generateModel,
|
18
|
+
getDef: _getDef,
|
19
|
+
createOrUpdateBlockDef: _modelCreateOrUpdateBlockDef,
|
20
|
+
checkModel: checkModel
|
21
|
+
*/
|
22
|
+
describe('ensurePathAndGetBindValue', function() {
|
23
|
+
|
24
|
+
/*
|
25
|
+
main.js.processBlock: var bindingProvider = modelDef.ensurePathAndGetBindValue.bind(undefined, defs, themeUpdater, rootModelName, templateName, '');
|
26
|
+
main.js.processBlock: var localWithBindingProvider = modelDef.ensurePathAndGetBindValue.bind(undefined, defs, themeUpdater, rootModelName);
|
27
|
+
main.js.processBlock: var modelBindValue = modelDef.ensurePathAndGetBindValue (defs, themeUpdater, rootModelName, templateName, '', blockName);
|
28
|
+
main.js.translateTemplate: modelDef.ensurePathAndGetBindValue (defs, themeUpdater, templateName, templateName, '', containerName+".blocks", "[]");
|
29
|
+
|
30
|
+
main.js.createBlockEditor: var withBindingProvider = modelDef.getBindValue.bind(undefined, defs, themeUpdater, rootModelName, templateName);
|
31
|
+
|
32
|
+
stylesheet.js.processStylesheetRules: bindingProvider = localWithBindingProvider.bind(this, 'theme', '');
|
33
|
+
stylesheet.js.processStylesheetRules: bindingProvider = localWithBindingProvider.bind(this, localBlockName, '');
|
34
|
+
*/
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
it('should return expected positions', function() {
|
39
|
+
var styleText = " \nselector \n{\n color: red\n;\t}\n selector2{a:b}";
|
40
|
+
var styleSheet = require('mensch/lib/parser.js')(styleText, {
|
41
|
+
comments: true,
|
42
|
+
position: true
|
43
|
+
});
|
44
|
+
var declarations = styleSheet.stylesheet.rules[0].declarations;
|
45
|
+
|
46
|
+
expect(styleSheet.stylesheet.rules[0].position).toEqual({
|
47
|
+
start: {
|
48
|
+
line: 2,
|
49
|
+
col: 1
|
50
|
+
},
|
51
|
+
end: {
|
52
|
+
line: 3,
|
53
|
+
col: 1
|
54
|
+
}
|
55
|
+
});
|
56
|
+
expect(declarations[0].position).toEqual({
|
57
|
+
start: {
|
58
|
+
line: 4,
|
59
|
+
col: 2
|
60
|
+
},
|
61
|
+
end: {
|
62
|
+
line: 5,
|
63
|
+
col: 1
|
64
|
+
}
|
65
|
+
});
|
66
|
+
expect(styleSheet.stylesheet.rules[1].position).toEqual({
|
67
|
+
start: {
|
68
|
+
line: 6,
|
69
|
+
col: 2
|
70
|
+
},
|
71
|
+
end: {
|
72
|
+
line: 6,
|
73
|
+
col: 11
|
74
|
+
}
|
75
|
+
});
|
76
|
+
|
77
|
+
var utils = require('../src/js/converter/utils.js');
|
78
|
+
|
79
|
+
var replacedText = styleText;
|
80
|
+
replacedText = utils.removeStyle(replacedText, styleSheet.stylesheet.rules[1].position.start, styleSheet.stylesheet.rules[1].position.end, 0, 0, 0, 'CCC');
|
81
|
+
replacedText = utils.removeStyle(replacedText, declarations[0].position.start, declarations[0].position.end, 0, 0, 0, 'BBB');
|
82
|
+
replacedText = utils.removeStyle(replacedText, styleSheet.stylesheet.rules[0].position.start, styleSheet.stylesheet.rules[0].position.end, 0, 0, 0, 'AAA');
|
83
|
+
expect(replacedText).toEqual(" \nAAA{\n BBB;\t}\n CCC{a:b}");
|
84
|
+
});
|
85
|
+
|
86
|
+
});
|
87
|
+
|
88
|
+
});
|