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,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
/* global global: false */
|
3
|
+
|
4
|
+
var modelDef = require("./model.js");
|
5
|
+
|
6
|
+
var wrappedResultModel = function(templateDef) {
|
7
|
+
var defs = templateDef._defs;
|
8
|
+
var templateName = templateDef.templateName;
|
9
|
+
var finalModelContentDef = modelDef.getDef(defs, templateName);
|
10
|
+
|
11
|
+
var finalModelContent = modelDef.generateResultModel(templateDef);
|
12
|
+
|
13
|
+
var wrapper = require("./wrapper.js");
|
14
|
+
var res = wrapper(finalModelContent, finalModelContentDef, defs);
|
15
|
+
|
16
|
+
return res;
|
17
|
+
};
|
18
|
+
|
19
|
+
// requires only when imported
|
20
|
+
var translateTemplate = function() {
|
21
|
+
var tt = require('./parser.js');
|
22
|
+
return tt.apply(tt, arguments);
|
23
|
+
};
|
24
|
+
|
25
|
+
// requires only when imported
|
26
|
+
var generateEditors = function() {
|
27
|
+
var ge = require('./editor.js');
|
28
|
+
return ge.apply(ge, arguments);
|
29
|
+
};
|
30
|
+
|
31
|
+
var checkModel = function() {
|
32
|
+
var cm = require('./checkmodel.js');
|
33
|
+
return cm.apply(cm, arguments);
|
34
|
+
};
|
35
|
+
|
36
|
+
module.exports = {
|
37
|
+
translateTemplate: translateTemplate,
|
38
|
+
wrappedResultModel: wrappedResultModel,
|
39
|
+
generateResultModel: modelDef.generateResultModel,
|
40
|
+
generateEditors: generateEditors,
|
41
|
+
checkModel: checkModel
|
42
|
+
};
|
@@ -0,0 +1,536 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var objExtend = require("./domutils.js").objExtend;
|
4
|
+
var console = require("console");
|
5
|
+
|
6
|
+
var _valueSet = function(defs, model, prop, value) {
|
7
|
+
var dotPos = prop.indexOf('.');
|
8
|
+
if (dotPos == -1) {
|
9
|
+
if (typeof model[prop] == 'undefined') {
|
10
|
+
console.log("Undefined prop " + prop + " while setting value " + value + " in model._valueSet");
|
11
|
+
} else if (model[prop] === null) {
|
12
|
+
if (typeof value == 'object' && value !== null && typeof value.push == 'undefined') console.log("nullpropobjectvalue", prop, value);
|
13
|
+
model[prop] = value;
|
14
|
+
} else if (typeof model[prop] == 'object' && typeof model[prop].push == 'function') {
|
15
|
+
var values;
|
16
|
+
if (typeof value === 'string') {
|
17
|
+
var valuesString = value.match(/^\[(.*)\]$/);
|
18
|
+
if (valuesString !== null) {
|
19
|
+
values = valuesString[1].split(',');
|
20
|
+
} else {
|
21
|
+
throw "Unexpected default value for array property " + prop + ": " + value;
|
22
|
+
}
|
23
|
+
} else if (typeof value === 'object' && typeof value.push !== 'undefined') {
|
24
|
+
values = value;
|
25
|
+
} else {
|
26
|
+
throw "Unexpected default value for array property " + prop + ": " + value + " typeof " + (typeof value);
|
27
|
+
}
|
28
|
+
var res = [];
|
29
|
+
for (var i = 0; i < values.length; i++) {
|
30
|
+
if (values[i].substr(0, 1) == '@') {
|
31
|
+
// TODO remove this legacy support (@), so we can remove "defs" from this function, too.
|
32
|
+
res.push(_generateModel(defs, values[i].substr(1)));
|
33
|
+
} else if (values[i].length > 0) {
|
34
|
+
res.push(values[i]);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
model[prop] = res;
|
38
|
+
} else if (typeof model[prop] == 'string' || typeof model[prop] == 'boolean') {
|
39
|
+
// TODO does this still happen? Debug/test me.
|
40
|
+
model[prop] = value;
|
41
|
+
} else if (typeof model[prop] == 'object' && model[prop] !== null && typeof model[prop]._widget != 'undefined') {
|
42
|
+
if (typeof value == 'object' && value !== null) console.log("objectvalue", prop, model[prop]._widget, value);
|
43
|
+
// _data is defined for primitive types
|
44
|
+
model[prop] = value;
|
45
|
+
} else {
|
46
|
+
console.log("setting", typeof model[prop], model[prop], prop, value);
|
47
|
+
}
|
48
|
+
} else {
|
49
|
+
var propName = prop.substr(0, dotPos);
|
50
|
+
_valueSet(defs, model[propName], prop.substr(dotPos + 1), value);
|
51
|
+
}
|
52
|
+
};
|
53
|
+
|
54
|
+
var _modelCreateOrUpdateBlockDef = function(defs, templateName, properties, namedProperties) {
|
55
|
+
if (typeof defs[templateName] !== 'undefined' && defs[templateName]._initialized && !defs[templateName]._writeable) {
|
56
|
+
console.log("_modelCreateOrUpdateBlockDef", defs, templateName, properties, namedProperties);
|
57
|
+
throw "Trying to alter non writeable model: " + templateName + " / " + properties;
|
58
|
+
}
|
59
|
+
|
60
|
+
if (typeof defs[templateName] == 'undefined') {
|
61
|
+
defs[templateName] = {
|
62
|
+
_writeable: true
|
63
|
+
};
|
64
|
+
// Fallback computation of "category" depending on the property name
|
65
|
+
// TODO remove me: this should be always defined in the template definition, no need to hardcode this stuff.
|
66
|
+
if (typeof namedProperties == 'undefined') namedProperties = {};
|
67
|
+
if (typeof namedProperties.category == 'undefined' && typeof defs[templateName]._category == 'undefined') {
|
68
|
+
if (templateName.match(/(^t|.T)heme$/) || templateName.match(/(^s|.S)tyle$/) || templateName.match(/(^c|.C)olor$/) || templateName.match(/(^r|.R)adius$/)) {
|
69
|
+
namedProperties.category = 'style';
|
70
|
+
} else {
|
71
|
+
namedProperties.category = 'content';
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
if (typeof namedProperties !== 'undefined') {
|
78
|
+
// TODO check if this is needed before the ending namedProperty "loop" or not.
|
79
|
+
if (typeof namedProperties.name != 'undefined') defs[templateName]._name = namedProperties.name;
|
80
|
+
|
81
|
+
if (typeof namedProperties.themeOverride != 'undefined') {
|
82
|
+
defs[templateName]._themeOverride = namedProperties.themeOverride;
|
83
|
+
}
|
84
|
+
if (typeof namedProperties.globalStyle != 'undefined') {
|
85
|
+
defs[templateName]._globalStyle = namedProperties.globalStyle;
|
86
|
+
// TODO remove deprecated $theme
|
87
|
+
var globalStyleSub = namedProperties.globalStyle.replace(/^(\$theme|_theme_)\./, '');
|
88
|
+
var p = globalStyleSub.indexOf('.');
|
89
|
+
var gs = p != -1 ? globalStyleSub.substr(0, p) : globalStyleSub;
|
90
|
+
_modelCreateOrUpdateBlockDef(defs, 'theme', gs);
|
91
|
+
|
92
|
+
if (typeof defs[templateName]._themeOverride === 'undefined' || !!defs[templateName]._themeOverride) {
|
93
|
+
_modelCreateOrUpdateBlockDef(defs, templateName, "customStyle=false");
|
94
|
+
}
|
95
|
+
}
|
96
|
+
if (typeof namedProperties.contextName !== 'undefined') {
|
97
|
+
defs[templateName]._context = namedProperties.contextName;
|
98
|
+
// TODO is it correct to fallback to "bodyTheme" for blocks not declaring a default theme?
|
99
|
+
// Maybe it would be better to simply declare it as mandatory but leave the default configutation
|
100
|
+
// to the template definition.
|
101
|
+
if (namedProperties.contextName == 'block' && typeof defs[templateName]._globalStyle == 'undefined') {
|
102
|
+
defs[templateName]._globalStyle = '_theme_.bodyTheme';
|
103
|
+
_modelCreateOrUpdateBlockDef(defs, 'theme', 'bodyTheme');
|
104
|
+
|
105
|
+
if (typeof defs[templateName]._themeOverride == 'undefined' || defs[templateName]._themeOverride) {
|
106
|
+
_modelCreateOrUpdateBlockDef(defs, templateName, "customStyle=false");
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
if (typeof namedProperties.extend != 'undefined') defs[templateName].type = namedProperties.extend;
|
111
|
+
}
|
112
|
+
|
113
|
+
for (var np in namedProperties) if (namedProperties.hasOwnProperty(np) && typeof namedProperties[np] !== 'undefined' && ['name', 'extend', 'contextName', 'globalStyle','themeOverride'].indexOf(np) == -1) {
|
114
|
+
defs[templateName]['_'+np] = namedProperties[np];
|
115
|
+
}
|
116
|
+
|
117
|
+
if (typeof properties != 'undefined' && properties.length > 0) {
|
118
|
+
defs[templateName]._props = typeof defs[templateName]._props != 'undefined' && defs[templateName]._props.length > 0 ? defs[templateName]._props + " " + properties : properties;
|
119
|
+
}
|
120
|
+
};
|
121
|
+
|
122
|
+
// remove the first "sequence" in a camelcased word (e.g: myCamelCase => camelCase).
|
123
|
+
var _removePrefix = function(str) {
|
124
|
+
var res = str.match(/^[^A-Z]+([A-Z])(.*)$/);
|
125
|
+
return res !== null ? res[1].toLowerCase() + res[2] : null;
|
126
|
+
};
|
127
|
+
|
128
|
+
// TODO defs is needed only because _valueSet needs it.. we should remove it downstream.
|
129
|
+
var _generateModelFromDef = function(modelDef, defs) {
|
130
|
+
var res = {};
|
131
|
+
|
132
|
+
for (var prop in modelDef)
|
133
|
+
if (!prop.match(/^_.*/) && modelDef.hasOwnProperty(prop)) {
|
134
|
+
var value = modelDef[prop];
|
135
|
+
if (typeof value == 'object' && value !== null && typeof value._complex != 'undefined' && value._complex) {
|
136
|
+
res[prop] = _generateModelFromDef(value, defs);
|
137
|
+
} else if (prop == 'type') {
|
138
|
+
res[prop] = value;
|
139
|
+
} else if (typeof value == 'object') {
|
140
|
+
// most times this will be overwritten by _valueSet
|
141
|
+
res[prop] = null;
|
142
|
+
// for customStyle this is set to null.
|
143
|
+
} else {
|
144
|
+
console.error("Unexpected model def", prop, value, modelDef);
|
145
|
+
throw "Unexpected model def [" + prop + "]=" + value;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
if (typeof modelDef._defaultValues != 'undefined') {
|
150
|
+
var defaults = modelDef._defaultValues;
|
151
|
+
for (var prop2 in defaults)
|
152
|
+
if (defaults.hasOwnProperty(prop2)) {
|
153
|
+
_valueSet(defs, res, prop2, defaults[prop2]);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
return res;
|
158
|
+
};
|
159
|
+
|
160
|
+
var _generateModel = function(defs, name) {
|
161
|
+
var modelDef = _getModelDef(defs, name, false, true);
|
162
|
+
return _generateModelFromDef(modelDef, defs);
|
163
|
+
};
|
164
|
+
|
165
|
+
var _getDef = function(defs, name) {
|
166
|
+
return _getModelDef(defs, name, false, true);
|
167
|
+
};
|
168
|
+
|
169
|
+
var _getModelDef = function(defs, name, returnClone, readonly) {
|
170
|
+
// lookup "name" in the template definition
|
171
|
+
if (typeof defs[name] == 'undefined') {
|
172
|
+
// if the name has a space then returns.
|
173
|
+
if (name.indexOf(' ') != -1) return null;
|
174
|
+
// otherwise try looking up using a deprefixed name.
|
175
|
+
var res = _removePrefix(name);
|
176
|
+
if (res !== null) {
|
177
|
+
// TODO the deprefixing is powerful, but maybe not really needed.
|
178
|
+
return _getModelDef(defs, res, returnClone, readonly);
|
179
|
+
}
|
180
|
+
// not a prefixed name
|
181
|
+
// TODO should we raise an error?
|
182
|
+
return null;
|
183
|
+
} else {
|
184
|
+
// when the name is already defined...
|
185
|
+
var defObj = defs[name];
|
186
|
+
if (typeof defObj != 'object') throw "Block definition must be an object: found " + defObj + " for " + name;
|
187
|
+
|
188
|
+
if (typeof defObj._initialized == 'undefined') {
|
189
|
+
// Populate "type" depending on name
|
190
|
+
if (typeof defObj.type == 'undefined') {
|
191
|
+
if (name.indexOf(' ') == -1) {
|
192
|
+
defObj.type = name;
|
193
|
+
} else {
|
194
|
+
defObj.type = name.substr(name.indexOf(' ') + 1);
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
// If it is not a "data" type then let's deal with inheritance
|
199
|
+
if (defObj.type != name && typeof defObj._widget == 'undefined') {
|
200
|
+
var typeDef = _getModelDef(defs, defObj.type, true);
|
201
|
+
var extended = objExtend(typeDef, defObj);
|
202
|
+
defObj = extended;
|
203
|
+
defs[name] = defObj;
|
204
|
+
} else if (typeof defObj._widget == 'undefined' && typeof defObj._props == 'undefined' && typeof defObj._complex == 'undefined') {
|
205
|
+
// TODO here I tried to deal with inheritance for every object without a "type" by using a simple deprefix.
|
206
|
+
// but this break on theme containing "pageTheme" that would inherit from is parent. (creating a loop)
|
207
|
+
/*
|
208
|
+
var superType = _removePrefix(defObj.type);
|
209
|
+
if (superType !== null) {
|
210
|
+
console.log("Extending", typeDef, name, superType, defObj.type);
|
211
|
+
var typeDef = _getModelDef(defs, superType, true);
|
212
|
+
|
213
|
+
var extended = jQuery.extend(true, typeDef, defObj);
|
214
|
+
defObj = extended;
|
215
|
+
defs[name] = defObj;
|
216
|
+
}
|
217
|
+
*/
|
218
|
+
}
|
219
|
+
defObj._writeable = true;
|
220
|
+
defObj._initialized = true;
|
221
|
+
}
|
222
|
+
|
223
|
+
if (typeof defObj._props != 'undefined') {
|
224
|
+
var def = defObj._props;
|
225
|
+
def = def.split(" ");
|
226
|
+
|
227
|
+
if (def.length > 0 && typeof defObj._writeable == 'undefined') {
|
228
|
+
console.error("Altering a non writable object ", name, def, defObj);
|
229
|
+
throw "Altering a non writable object: " + name + " def: " + def;
|
230
|
+
}
|
231
|
+
|
232
|
+
if (typeof defObj._processedDefs == 'undefined') {
|
233
|
+
defObj._processedDefs = {};
|
234
|
+
}
|
235
|
+
|
236
|
+
if (typeof defObj._globalStyles == 'undefined') {
|
237
|
+
defObj._globalStyles = {};
|
238
|
+
}
|
239
|
+
|
240
|
+
if (typeof defObj._defaultValues == 'undefined') {
|
241
|
+
defObj._defaultValues = {};
|
242
|
+
}
|
243
|
+
|
244
|
+
for (var i = 0; i < def.length; i++) {
|
245
|
+
var prop = def[i];
|
246
|
+
if (prop.length === 0) continue;
|
247
|
+
var origProp = prop;
|
248
|
+
var defValue = null;
|
249
|
+
// parses "prop" "prop=value" and "prop[]" declarations
|
250
|
+
var propDef = prop.match(/^([^=\[\]]+)(\[\])?(=?)(.*)$/);
|
251
|
+
if (propDef !== null) {
|
252
|
+
prop = propDef[1];
|
253
|
+
// TODO array definition should be done differently
|
254
|
+
if (propDef[2] == '[]') {
|
255
|
+
// TODO type should not be defined in this function
|
256
|
+
if (typeof defObj[prop] == 'undefined') defObj[prop] = [];
|
257
|
+
defValue = [];
|
258
|
+
}
|
259
|
+
if (propDef[3] == '=') {
|
260
|
+
// TODO remove hardcoded "visible" matching (this should be defined in the template definition)
|
261
|
+
if (prop.match(/(^v|V)isible$/)) defValue = String(propDef[4]).toLowerCase() == 'true';
|
262
|
+
else if (prop.match(/^customStyle$/)) {
|
263
|
+
defValue = String(propDef[4]).toLowerCase() == 'true';
|
264
|
+
} else defValue = propDef[4];
|
265
|
+
}
|
266
|
+
}
|
267
|
+
// default values found in "properties" are not being processed by "modelEnsureValue" and by consequence do not call "themeUpdater".
|
268
|
+
// TODO document why this is needed, or remove.
|
269
|
+
if (defValue !== null) {
|
270
|
+
if (typeof defObj._defaultValues[prop] == 'undefined') {
|
271
|
+
// if (prop.match(/^_/)) console.log("defValue for", prop, "in", name);
|
272
|
+
defObj._defaultValues[prop] = defValue;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
if (typeof defObj[prop] == 'undefined') {
|
277
|
+
var val = _getModelDef(defs, name + ' ' + prop, true);
|
278
|
+
if (val === null) {
|
279
|
+
val = _getModelDef(defs, prop, true);
|
280
|
+
}
|
281
|
+
defObj[prop] = val;
|
282
|
+
}
|
283
|
+
|
284
|
+
defObj._processedDefs[prop] = origProp;
|
285
|
+
defObj._complex = true;
|
286
|
+
}
|
287
|
+
|
288
|
+
delete defObj._props;
|
289
|
+
}
|
290
|
+
|
291
|
+
if (returnClone) {
|
292
|
+
defObj._writeable = false;
|
293
|
+
var cloned = objExtend({}, defObj);
|
294
|
+
return cloned;
|
295
|
+
} else if (readonly) {
|
296
|
+
defObj._writeable = false;
|
297
|
+
return defObj;
|
298
|
+
} else {
|
299
|
+
if (typeof defObj._writeable == 'undefined' || defObj._writeable === false) throw "Retrieving non writeable object definition: " + name;
|
300
|
+
return defObj;
|
301
|
+
}
|
302
|
+
}
|
303
|
+
};
|
304
|
+
|
305
|
+
var _increaseUseCount = function(readonly, model) {
|
306
|
+
if (!readonly) {
|
307
|
+
if (typeof model._usecount == 'undefined') model._usecount = 0;
|
308
|
+
model._usecount++;
|
309
|
+
} else if (typeof model._usecount == 'undefined') {
|
310
|
+
console.error("ERROR trying to bind an unused property while readonly", model);
|
311
|
+
throw "ERROR trying to bind an unused property";
|
312
|
+
}
|
313
|
+
};
|
314
|
+
|
315
|
+
var ensureGlobalStyle = function(defs, readonly, gsBindingProvider, modelName, path, gsFullPath, defaultValue, overrideDefault) {
|
316
|
+
|
317
|
+
var globalStyleBindingBindValue = gsBindingProvider(gsFullPath, defaultValue, overrideDefault);
|
318
|
+
|
319
|
+
if (typeof defs[modelName]._globalStyles[path] == 'undefined') {
|
320
|
+
if (readonly) throw "Cannot find _globalStyle for " + path + " in " + modelName + "!";
|
321
|
+
if (path.indexOf('.') != -1 || (typeof defs[modelName][path] == 'object' && typeof defs[modelName][path]._widget !== 'undefined')) {
|
322
|
+
defs[modelName]._globalStyles[path] = globalStyleBindingBindValue;
|
323
|
+
}
|
324
|
+
} else if (defs[modelName]._globalStyles[path] != globalStyleBindingBindValue) throw "Unexpected conflicting globalStyle [2] for " + modelName + "/" + path + ": old=" + defs[modelName]._globalStyles[path] + " new=" + globalStyleBindingBindValue;
|
325
|
+
};
|
326
|
+
|
327
|
+
// themeUpdater, defaultValue, overrideDefault, setcategory are only used in !readonly mode
|
328
|
+
var modelEnsurePathAndGetBindValue = function(readonly, defs, themeUpdater, rootModelName, templateName, within, fullPath, defaultValue, overrideDefault, setcategory) {
|
329
|
+
var modelName;
|
330
|
+
var res;
|
331
|
+
var path;
|
332
|
+
// TODO remove '$' and '#' handing
|
333
|
+
if (fullPath.substr(0, 1) == '$') {
|
334
|
+
console.warn("DEPRECATED $ in bindingProvider: ", fullPath, templateName);
|
335
|
+
var p = fullPath.indexOf('.');
|
336
|
+
if (p == -1) {
|
337
|
+
throw "Unexpected fullPath: " + fullPath + "/" + within + "/" + templateName + "/" + defaultValue + "/" + overrideDefault;
|
338
|
+
} else {
|
339
|
+
modelName = fullPath.substr(1, p - 1);
|
340
|
+
path = fullPath.substr(p + 1);
|
341
|
+
// TODO refactor me please
|
342
|
+
if (modelName == 'theme') {
|
343
|
+
var p2 = path.indexOf('.');
|
344
|
+
modelName = path.substr(0, p2);
|
345
|
+
path = path.substr(p2 + 1);
|
346
|
+
} else {
|
347
|
+
throw "Unexpected $ sequence: " + modelName + " in " + fullPath;
|
348
|
+
}
|
349
|
+
res = "$root.content().theme()." + modelName + "()." + path.replace(new RegExp('\\.', 'g'), '().');
|
350
|
+
}
|
351
|
+
} else if (fullPath.substr(0, 1) == '#') {
|
352
|
+
console.warn("DEPRECATED # in bindingProvider: ", fullPath, templateName);
|
353
|
+
modelName = rootModelName;
|
354
|
+
path = fullPath.substr(1);
|
355
|
+
res = "$root.content()." + path.replace(new RegExp('\\.', 'g'), '().');
|
356
|
+
} else if (fullPath.substr(0, 8) == '_theme_.') {
|
357
|
+
var p3 = fullPath.indexOf('.', 8);
|
358
|
+
modelName = fullPath.substr(8, p3 - 8);
|
359
|
+
path = fullPath.substr(p3 + 1);
|
360
|
+
res = "$root.content().theme()." + modelName + "()." + path.replace(new RegExp('\\.', 'g'), '().');
|
361
|
+
} else if (fullPath.substr(0, 7) == '_root_.') {
|
362
|
+
modelName = rootModelName;
|
363
|
+
path = fullPath.substr(7);
|
364
|
+
res = "$root.content()." + path.replace(new RegExp('\\.', 'g'), '().');
|
365
|
+
} else {
|
366
|
+
modelName = templateName;
|
367
|
+
path = within + fullPath;
|
368
|
+
res = fullPath.replace(new RegExp('\\.', 'g'), '().');
|
369
|
+
}
|
370
|
+
|
371
|
+
if (typeof defs[modelName] === 'undefined') throw "Cannot find model def for [" + modelName + "]";
|
372
|
+
|
373
|
+
var propPos = path.indexOf('.');
|
374
|
+
var propName = propPos == -1 ? path : path.substr(0, propPos);
|
375
|
+
|
376
|
+
if (modelName.indexOf('-') != -1) {
|
377
|
+
console.error("ERROR cannot use - for block names", modelName);
|
378
|
+
throw "ERROR unexpected char in block name: " + modelName;
|
379
|
+
}
|
380
|
+
if (propName.indexOf('-') != -1) {
|
381
|
+
console.error("ERROR cannot use - for property names", propName);
|
382
|
+
throw "ERROR unexpected char in property name: " + modelName;
|
383
|
+
}
|
384
|
+
|
385
|
+
// Fastpath
|
386
|
+
if (readonly) {
|
387
|
+
if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] !== 'undefined' && defs[modelName][propName]._category == 'style') {
|
388
|
+
res += '._defaultComputed';
|
389
|
+
}
|
390
|
+
return res;
|
391
|
+
}
|
392
|
+
|
393
|
+
// gets the writable model when "!readonly" or the readonly model otherwise
|
394
|
+
var model;
|
395
|
+
if (readonly) {
|
396
|
+
if (typeof defaultValue !== 'undefined') throw "Cannot use defaultValue in readonly mode!";
|
397
|
+
if (overrideDefault) throw "Cannot use overrideDefault in readonly mode for " + modelName + "/" + path + "/" + overrideDefault + "!";
|
398
|
+
if (typeof setcategory !== 'undefined') throw "Cannot set category for " + modelName + "/" + path + "/" + setcategory + " in readonly mode!";
|
399
|
+
model = _getModelDef(defs, modelName, false, true);
|
400
|
+
} else {
|
401
|
+
if (defs[modelName]._writeable === false) console.log("TODO debug use cases for this condition", modelName, path);
|
402
|
+
model = _getModelDef(defs, modelName, defs[modelName]._writeable === false);
|
403
|
+
}
|
404
|
+
|
405
|
+
if (model === null) throw "Unexpected model for [" + modelName + "]";
|
406
|
+
|
407
|
+
// if the property does not exists we have to create it.
|
408
|
+
if (typeof model[propName] == 'undefined') {
|
409
|
+
// when in readonly mode this cannot be done!
|
410
|
+
if (readonly) throw "Cannot find path " + propName + " for " + modelName + "!";
|
411
|
+
_modelCreateOrUpdateBlockDef(defs, modelName, propName);
|
412
|
+
model = _getModelDef(defs, modelName, false);
|
413
|
+
}
|
414
|
+
|
415
|
+
// Needs to do this again, because "_modelCreateOrUpdateBlockDef" could have been just created the property (e.g: backgroundColor buttonBlock not getting defaultComputed in template-lm)
|
416
|
+
if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] !== 'undefined' && defs[modelName][propName] !== null && defs[modelName][propName]._category == 'style') {
|
417
|
+
res += '._defaultComputed';
|
418
|
+
}
|
419
|
+
|
420
|
+
var childModel = model;
|
421
|
+
try {
|
422
|
+
_increaseUseCount(readonly, childModel);
|
423
|
+
if (propPos != -1) {
|
424
|
+
var mypath = path;
|
425
|
+
do {
|
426
|
+
var prop = mypath.substr(0, propPos);
|
427
|
+
if (typeof childModel[prop] == 'undefined') {
|
428
|
+
throw "Found an unexpected prop " + prop + " for model " + modelName + " for " + path;
|
429
|
+
}
|
430
|
+
|
431
|
+
childModel = childModel[prop];
|
432
|
+
_increaseUseCount(readonly, childModel);
|
433
|
+
mypath = mypath.substr(propPos + 1);
|
434
|
+
propPos = mypath.indexOf('.');
|
435
|
+
} while (propPos != -1);
|
436
|
+
|
437
|
+
if (typeof childModel[mypath] == 'undefined' || childModel[mypath] === null) {
|
438
|
+
throw "Found an unexpected path termination " + mypath + " for model " + modelName + " for " + path;
|
439
|
+
}
|
440
|
+
childModel = childModel[mypath];
|
441
|
+
} else {
|
442
|
+
childModel = childModel[path];
|
443
|
+
}
|
444
|
+
|
445
|
+
if (typeof childModel === 'undefined' || childModel === null) throw "Unexpected null model for " + modelName + "/" + within + "/" + fullPath;
|
446
|
+
|
447
|
+
if (typeof setcategory !== 'undefined') {
|
448
|
+
childModel._category = setcategory;
|
449
|
+
}
|
450
|
+
|
451
|
+
_increaseUseCount(readonly, childModel);
|
452
|
+
} catch (e) {
|
453
|
+
console.error("TODO ERROR Property lookup exception", e, modelName, path, templateName, fullPath, defs);
|
454
|
+
throw e;
|
455
|
+
}
|
456
|
+
|
457
|
+
if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] == 'object' && defs[modelName][propName] !== null && typeof defs[modelName][propName]._category != 'undefined' && defs[modelName][propName]._category == 'style') {
|
458
|
+
// TODO can I restrict this code to !readonly mode?
|
459
|
+
var gsBindingProvider = modelEnsurePathAndGetBindValue.bind(undefined, readonly, defs, themeUpdater, rootModelName, templateName, '');
|
460
|
+
|
461
|
+
var subPath = path.indexOf('.') != -1 ? path.substr(path.indexOf('.')) : '';
|
462
|
+
|
463
|
+
// The next code supports only properties with one dot (object.property).
|
464
|
+
if (subPath.indexOf('.', 1) != -1) throw "TODO unsupported object nesting! " + path;
|
465
|
+
|
466
|
+
var gsPath = defs[modelName]._globalStyle + '.' + propName;
|
467
|
+
if (typeof defs[modelName][propName] == 'object' && defs[modelName][propName] !== null && typeof defs[modelName][propName]._globalStyle != 'undefined') {
|
468
|
+
gsPath = defs[modelName][propName]._globalStyle;
|
469
|
+
}
|
470
|
+
|
471
|
+
ensureGlobalStyle(defs, readonly, gsBindingProvider, modelName, propName, gsPath, undefined, false);
|
472
|
+
|
473
|
+
var gsFullPath = gsPath + subPath;
|
474
|
+
|
475
|
+
if (typeof defaultValue == 'undefined' && defs[modelName]._defaultValues[path] !== null) defaultValue = defs[modelName]._defaultValues[path];
|
476
|
+
|
477
|
+
ensureGlobalStyle(defs, readonly, gsBindingProvider, modelName, path, gsFullPath, defaultValue, overrideDefault);
|
478
|
+
|
479
|
+
if (typeof defaultValue !== 'undefined') {
|
480
|
+
if (readonly) {
|
481
|
+
console.error("Cannot set a new theme default value", gsFullPath.substr(7), defaultValue, "while in readonly mode");
|
482
|
+
throw "Cannot set a new theme default value (" + defaultValue + ") for " + gsFullPath.substr(7) + " while in readonly mode!";
|
483
|
+
}
|
484
|
+
themeUpdater('default', gsFullPath.substr(7), defaultValue);
|
485
|
+
}
|
486
|
+
|
487
|
+
// TODO complex stuff. If the theme uses inheritance we enforce it using with the same value, but this is a limit.
|
488
|
+
defaultValue = null;
|
489
|
+
|
490
|
+
}
|
491
|
+
|
492
|
+
if (typeof defaultValue != 'undefined') {
|
493
|
+
if (typeof defs[modelName]._defaultValues[path] == 'undefined' || (typeof overrideDefault != 'undefined' && overrideDefault)) {
|
494
|
+
if (readonly) throw "Cannot set new _defaultValues [1] for " + path + " in " + modelName + "!";
|
495
|
+
defs[modelName]._defaultValues[path] = defaultValue;
|
496
|
+
} else {
|
497
|
+
if (defaultValue === null) {
|
498
|
+
if (readonly && defs[modelName]._defaultValues[path] !== null) {
|
499
|
+
throw "Cannot set new _defaultValues [2] for " + path + " in " + modelName + "!";
|
500
|
+
}
|
501
|
+
// This remove default value. Ugly. (Needs this for defaults in template-lm socialLinksIcon)
|
502
|
+
defs[modelName]._defaultValues[path] = null;
|
503
|
+
} else if (defs[modelName]._defaultValues[path] != defaultValue) {
|
504
|
+
console.error("TODO error!!! Trying to set a new default value for " + modelName + " " + path + " while it already exists (current: " + defs[modelName]._defaultValues[path] + ", new: " + defaultValue + ")");
|
505
|
+
throw "Trying to set a new default value for " + modelName + " " + path + " while it already exists (current: " + defs[modelName].defaultValues[path] + ", new: " + defaultValue + ")";
|
506
|
+
}
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
return res;
|
511
|
+
};
|
512
|
+
|
513
|
+
var generateResultModel = function(templateDef) {
|
514
|
+
var defs = templateDef._defs;
|
515
|
+
var templateName = templateDef.templateName;
|
516
|
+
|
517
|
+
var finalModelContent = _generateModel(defs, templateName);
|
518
|
+
|
519
|
+
// TODO ugly to add this manually
|
520
|
+
if (typeof defs['theme'] !== 'undefined') {
|
521
|
+
finalModelContent.theme = _generateModel(defs, 'theme');
|
522
|
+
}
|
523
|
+
|
524
|
+
return finalModelContent;
|
525
|
+
};
|
526
|
+
|
527
|
+
module.exports = {
|
528
|
+
// used to compile the template
|
529
|
+
ensurePathAndGetBindValue: modelEnsurePathAndGetBindValue.bind(undefined, false),
|
530
|
+
// used in runtime the template
|
531
|
+
getBindValue: modelEnsurePathAndGetBindValue.bind(undefined, true),
|
532
|
+
generateModel: _generateModel,
|
533
|
+
generateResultModel: generateResultModel,
|
534
|
+
getDef: _getDef,
|
535
|
+
createOrUpdateBlockDef: _modelCreateOrUpdateBlockDef
|
536
|
+
};
|