mosaico 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +680 -0
  5. data/README.md +179 -0
  6. data/Rakefile +5 -0
  7. data/app/assets/images/mosaico/logo_transparent.png +0 -0
  8. data/app/assets/javascripts/mosaico/application.js.erb +51 -0
  9. data/app/assets/javascripts/mosaico/plugins/debug.js.erb +10 -0
  10. data/app/assets/javascripts/mosaico/plugins/logo.js.erb +10 -0
  11. data/app/assets/javascripts/mosaico/plugins/preview.js +85 -0
  12. data/app/assets/javascripts/mosaico/plugins/save.js.erb +72 -0
  13. data/app/assets/javascripts/mosaico/plugins/template_path.js.erb +22 -0
  14. data/app/assets/javascripts/mosaico/plugins/translations.js +10 -0
  15. data/app/assets/javascripts/mosaico/utilities.js +25 -0
  16. data/app/assets/stylesheets/mosaico/application.css +6 -0
  17. data/app/controllers/mosaico/application_controller.rb +17 -0
  18. data/app/controllers/mosaico/images_controller.rb +142 -0
  19. data/app/controllers/mosaico/projects_controller.rb +31 -0
  20. data/app/controllers/mosaico/templates_controller.rb +8 -0
  21. data/app/helpers/mosaico/application_helper.rb +7 -0
  22. data/app/models/mosaico/image.rb +9 -0
  23. data/app/models/mosaico/placeholder_image.rb +9 -0
  24. data/app/models/mosaico/project.rb +13 -0
  25. data/app/models/mosaico/uploaded_image.rb +26 -0
  26. data/app/views/layouts/mosaico/application.html.erb +13 -0
  27. data/app/views/mosaico/projects/new.html.erb +1 -0
  28. data/app/views/mosaico/projects/show.html.erb +1 -0
  29. data/app/views/mosaico/shared/_metadata.html.erb +12 -0
  30. data/config/routes.rb +12 -0
  31. data/db/migrate/20170817202255_add_images.rb +14 -0
  32. data/db/migrate/20170824233755_add_projects.rb +11 -0
  33. data/lib/mosaico.rb +100 -0
  34. data/lib/mosaico/engine.rb +72 -0
  35. data/lib/mosaico/local_backend.rb +23 -0
  36. data/lib/mosaico/local_image_backend.rb +7 -0
  37. data/lib/mosaico/local_placeholder_backend.rb +7 -0
  38. data/lib/mosaico/placeholder.png +0 -0
  39. data/lib/mosaico/template.rb +89 -0
  40. data/lib/mosaico/versafix_template.rb +43 -0
  41. data/lib/mosaico/version.rb +4 -0
  42. data/lib/tasks/makeThumbs.js.erb +57 -0
  43. data/lib/tasks/thumbs.rake +35 -0
  44. data/mosaico.gemspec +22 -0
  45. data/screenshot.png +0 -0
  46. data/vendor/assets/fonts/LiberationSans-Regular.ttf +0 -0
  47. data/vendor/assets/mosaico-0.16.0/mosaico/.jsbeautifyrc +6 -0
  48. data/vendor/assets/mosaico-0.16.0/mosaico/.jshintrc +8 -0
  49. data/vendor/assets/mosaico-0.16.0/mosaico/.travis.yml +6 -0
  50. data/vendor/assets/mosaico-0.16.0/mosaico/CONTRIBUTING.md +37 -0
  51. data/vendor/assets/mosaico-0.16.0/mosaico/Dockerfile +21 -0
  52. data/vendor/assets/mosaico-0.16.0/mosaico/Gruntfile.js +241 -0
  53. data/vendor/assets/mosaico-0.16.0/mosaico/LICENSE +680 -0
  54. data/vendor/assets/mosaico-0.16.0/mosaico/NOTICE.txt +87 -0
  55. data/vendor/assets/mosaico-0.16.0/mosaico/README.md +73 -0
  56. data/vendor/assets/mosaico-0.16.0/mosaico/backend/README.txt +23 -0
  57. data/vendor/assets/mosaico-0.16.0/mosaico/backend/main.js +162 -0
  58. data/vendor/assets/mosaico-0.16.0/mosaico/bower.json +76 -0
  59. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico-material.css +7425 -0
  60. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.css +7133 -0
  61. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.debug.js +1517 -0
  62. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.js +12828 -0
  63. data/vendor/assets/mosaico-0.16.0/mosaico/build/templates.js +15 -0
  64. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.eot +0 -0
  65. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.svg +685 -0
  66. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.ttf +0 -0
  67. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff +0 -0
  68. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff2 +0 -0
  69. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/byvoxmail.png +0 -0
  70. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-badge.gif +0 -0
  71. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-v.gif +0 -0
  72. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico32.png +0 -0
  73. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaicologo.png +0 -0
  74. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot-orig.png +0 -0
  75. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot.png +0 -0
  76. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/README.md +26 -0
  77. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-de.json +88 -0
  78. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-en.json +88 -0
  79. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-es.json +88 -0
  80. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-fr.json +88 -0
  81. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-it.json +88 -0
  82. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-nl.json +88 -0
  83. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-sv.json +88 -0
  84. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css +5 -0
  85. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css.map +1 -0
  86. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css +5 -0
  87. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css.map +1 -0
  88. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js +1517 -0
  89. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js.map +147 -0
  90. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/canvas-to-blob.min.js +2 -0
  91. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.css +7 -0
  92. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.js +13 -0
  93. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-image.js +324 -0
  94. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-process.js +175 -0
  95. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-validate.js +122 -0
  96. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload.js +1482 -0
  97. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.iframe-transport.js +217 -0
  98. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.js +5 -0
  99. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.map +1 -0
  100. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.ui.touch-punch.min.js +11 -0
  101. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout-jqueryui.min.js +1 -0
  102. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout.js +123 -0
  103. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/load-image.all.min.js +2 -0
  104. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.eot +0 -0
  105. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.ttf +0 -0
  106. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.woff +0 -0
  107. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/stylesheet.css +9 -0
  108. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.js +101 -0
  109. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.min.js +1 -0
  110. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.js +55 -0
  111. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.min.js +1 -0
  112. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.js +204 -0
  113. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.min.js +1 -0
  114. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.js +162 -0
  115. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.min.js +1 -0
  116. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.js +165 -0
  117. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.min.js +1 -0
  118. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.js +123 -0
  119. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.min.js +1 -0
  120. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.js +462 -0
  121. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.min.js +1 -0
  122. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.js +60 -0
  123. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.min.js +1 -0
  124. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/css/prism.css +138 -0
  125. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.js +1319 -0
  126. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.min.js +1 -0
  127. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.js +112 -0
  128. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.min.js +1 -0
  129. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.js +100 -0
  130. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.min.js +1 -0
  131. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.js +64 -0
  132. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.min.js +1 -0
  133. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cool.gif +0 -0
  134. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cry.gif +0 -0
  135. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  136. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  137. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-frown.gif +0 -0
  138. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-innocent.gif +0 -0
  139. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-kiss.gif +0 -0
  140. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-laughing.gif +0 -0
  141. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  142. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-sealed.gif +0 -0
  143. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-smile.gif +0 -0
  144. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-surprised.gif +0 -0
  145. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  146. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-undecided.gif +0 -0
  147. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-wink.gif +0 -0
  148. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-yell.gif +0 -0
  149. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.js +65 -0
  150. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.min.js +1 -0
  151. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.js +490 -0
  152. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.min.js +1 -0
  153. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.js +154 -0
  154. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.min.js +1 -0
  155. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.js +30 -0
  156. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.min.js +1 -0
  157. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.js +630 -0
  158. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.min.js +1 -0
  159. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.js +2944 -0
  160. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.min.js +1 -0
  161. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.js +273 -0
  162. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.min.js +1 -0
  163. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.js +121 -0
  164. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.min.js +1 -0
  165. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.js +225 -0
  166. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.min.js +1 -0
  167. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.js +208 -0
  168. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.min.js +1 -0
  169. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.js +403 -0
  170. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.min.js +1 -0
  171. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.js +965 -0
  172. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.min.js +1 -0
  173. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/moxieplayer.swf +0 -0
  174. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.js +879 -0
  175. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.min.js +1 -0
  176. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.js +53 -0
  177. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.min.js +1 -0
  178. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.js +101 -0
  179. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.min.js +1 -0
  180. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.js +88 -0
  181. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.min.js +1 -0
  182. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.js +1844 -0
  183. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.min.js +1 -0
  184. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.js +101 -0
  185. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.min.js +1 -0
  186. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.js +32 -0
  187. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.min.js +1 -0
  188. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.js +98 -0
  189. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.min.js +1 -0
  190. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.js +609 -0
  191. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.min.js +1 -0
  192. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.js +1031 -0
  193. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.min.js +1 -0
  194. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.js +120 -0
  195. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.min.js +1 -0
  196. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.js +4400 -0
  197. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.min.js +2 -0
  198. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.js +276 -0
  199. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.min.js +1 -0
  200. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.js +297 -0
  201. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.min.js +1 -0
  202. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.js +268 -0
  203. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.min.js +1 -0
  204. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/css/visualblocks.css +135 -0
  205. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.js +86 -0
  206. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.min.js +1 -0
  207. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.js +123 -0
  208. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.min.js +1 -0
  209. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.js +69 -0
  210. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js +1 -0
  211. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/Variables.less +196 -0
  212. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.inline.min.css +1 -0
  213. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.min.css +1 -0
  214. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/readme.md +1 -0
  215. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
  216. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
  217. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
  218. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
  219. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
  220. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
  221. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
  222. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
  223. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
  224. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
  225. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/anchor.gif +0 -0
  226. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/loader.gif +0 -0
  227. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/object.gif +0 -0
  228. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/trans.gif +0 -0
  229. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
  230. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.json +79 -0
  231. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.min.css +1 -0
  232. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.inline.min.css +1 -0
  233. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.min.css +1 -0
  234. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.eot +0 -0
  235. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.svg +63 -0
  236. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  237. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.woff +0 -0
  238. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.eot +0 -0
  239. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.svg +129 -0
  240. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.ttf +0 -0
  241. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.woff +0 -0
  242. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/anchor.gif +0 -0
  243. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/loader.gif +0 -0
  244. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/object.gif +0 -0
  245. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/trans.gif +0 -0
  246. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.ie7.min.css +1 -0
  247. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.min.css +1 -0
  248. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.js +1828 -0
  249. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.min.js +1 -0
  250. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.js +934 -0
  251. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.min.js +1 -0
  252. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/tinymce.min.js +14 -0
  253. data/vendor/assets/mosaico-0.16.0/mosaico/editor.html +63 -0
  254. data/vendor/assets/mosaico-0.16.0/mosaico/favicon.ico +0 -0
  255. data/vendor/assets/mosaico-0.16.0/mosaico/index.html +368 -0
  256. data/vendor/assets/mosaico-0.16.0/mosaico/package.json +92 -0
  257. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/byvoxmail.png +0 -0
  258. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-badge.gif +0 -0
  259. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-v.gif +0 -0
  260. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico32.png +0 -0
  261. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaicologo.png +0 -0
  262. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot-orig.png +0 -0
  263. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot.png +0 -0
  264. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/README.md +26 -0
  265. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-de.json +88 -0
  266. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-en.json +88 -0
  267. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-es.json +88 -0
  268. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-fr.json +88 -0
  269. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-it.json +88 -0
  270. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-nl.json +88 -0
  271. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-sv.json +88 -0
  272. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/Variables.less +196 -0
  273. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.inline.min.css +1 -0
  274. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.min.css +1 -0
  275. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/readme.md +1 -0
  276. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
  277. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
  278. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
  279. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
  280. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
  281. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
  282. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
  283. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
  284. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
  285. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
  286. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/anchor.gif +0 -0
  287. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/loader.gif +0 -0
  288. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/object.gif +0 -0
  289. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/trans.gif +0 -0
  290. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
  291. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.json +79 -0
  292. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.min.css +1 -0
  293. data/vendor/assets/mosaico-0.16.0/mosaico/server-config.js +12 -0
  294. data/vendor/assets/mosaico-0.16.0/mosaico/spec/converter-spec.js +115 -0
  295. data/vendor/assets/mosaico-0.16.0/mosaico/spec/data/template-versafix-1.model.json +137 -0
  296. data/vendor/assets/mosaico-0.16.0/mosaico/spec/declarations-spec.js +282 -0
  297. data/vendor/assets/mosaico-0.16.0/mosaico/spec/mensch-spec.js +114 -0
  298. data/vendor/assets/mosaico-0.16.0/mosaico/spec/model-spec.js +88 -0
  299. data/vendor/assets/mosaico-0.16.0/mosaico/spec/stylesheet-spec.js +177 -0
  300. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone.less +7 -0
  301. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone_material.less +350 -0
  302. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/safarihack.css +17 -0
  303. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements.less +497 -0
  304. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_jquery.less +344 -0
  305. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_mixins.less +406 -0
  306. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_moxie.less +130 -0
  307. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico.less +529 -0
  308. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_content.less +391 -0
  309. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_tools.less +1043 -0
  310. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_reset.less +45 -0
  311. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_variables.less +156 -0
  312. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/app.js +167 -0
  313. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/bind-iframe.js +64 -0
  314. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/blocks.js +118 -0
  315. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/choose-template.js +7 -0
  316. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/colorpicker.js +58 -0
  317. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/csstext.js +16 -0
  318. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/droppable.js +87 -0
  319. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/eventable.js +33 -0
  320. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extender-pagination.js +60 -0
  321. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extsortables.js +103 -0
  322. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/fileupload.js +373 -0
  323. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/if-subs.js +110 -0
  324. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-spinner.js +31 -0
  325. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-tabs.js +17 -0
  326. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/script-template.js +30 -0
  327. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollfix.js +48 -0
  328. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollintoview.js +83 -0
  329. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/string-template.js +76 -0
  330. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/tooltips.js +36 -0
  331. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/validated-value.js +40 -0
  332. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/virtuals.js +102 -0
  333. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/wysiwygs.js +304 -0
  334. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/checkmodel.js +114 -0
  335. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/declarations.js +279 -0
  336. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/domutils.js +93 -0
  337. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/editor.js +411 -0
  338. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/main.js +42 -0
  339. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/model.js +536 -0
  340. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/parser.js +485 -0
  341. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/stylesheet.js +205 -0
  342. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/utils.js +156 -0
  343. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/wrapper.js +308 -0
  344. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/color.js +53 -0
  345. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/inliner.js +35 -0
  346. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/localstorage.js +100 -0
  347. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ko-bindings.js +22 -0
  348. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/template-loader.js +446 -0
  349. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/timed-call.js +31 -0
  350. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undomain.js +49 -0
  351. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undoserializer.js +120 -0
  352. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/viewmodel.js +595 -0
  353. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/array.tmpl.html +1 -0
  354. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-show.tmpl.html +1 -0
  355. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-wysiwyg.tmpl.html +18 -0
  356. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-show.tmpl.html +1 -0
  357. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-wysiwyg.tmpl.html +2 -0
  358. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/customstyle.tmpl.html +3 -0
  359. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/empty.tmpl.html +0 -0
  360. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/error.tmpl.html +1 -0
  361. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/gallery-images.tmpl.html +16 -0
  362. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/img-wysiwyg.tmpl.html +43 -0
  363. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/main.tmpl.html +102 -0
  364. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/toolbox.tmpl.html +111 -0
  365. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/combineKOTemplates.js +24 -0
  366. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/lib/phantom-thumbnailer-editor.js +168 -0
  367. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/makeThumbs.js +79 -0
  368. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/README.md +1 -0
  369. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/_full.png +0 -0
  370. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/footerBlock.png +0 -0
  371. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/headerBlock.png +0 -0
  372. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/heroBlock.png +0 -0
  373. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/socialBlock.png +0 -0
  374. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/threetwoBlock.png +0 -0
  375. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/twoColumnBlock.png +0 -0
  376. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/template-tedc15.html +567 -0
  377. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/HeaderAndText.png +0 -0
  378. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/_full.png +0 -0
  379. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/fixedlist.png +0 -0
  380. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.md +335 -0
  381. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.pdf +0 -0
  382. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_384.jpg +0 -0
  383. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_385.jpg +0 -0
  384. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_386.jpg +0 -0
  385. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_387.jpg +0 -0
  386. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_407.jpg +0 -0
  387. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_408.jpg +0 -0
  388. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/template-tutorial.html +68 -0
  389. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/_full.png +0 -0
  390. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/buttonBlock.png +0 -0
  391. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleArticleBlock.png +0 -0
  392. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleImageBlock.png +0 -0
  393. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/hrBlock.png +0 -0
  394. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/imageBlock.png +0 -0
  395. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/logoBlock.png +0 -0
  396. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/sideArticleBlock.png +0 -0
  397. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/singleArticleBlock.png +0 -0
  398. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/socialBlock.png +0 -0
  399. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/spacerBlock.png +0 -0
  400. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/textBlock.png +0 -0
  401. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/titleBlock.png +0 -0
  402. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleArticleBlock.png +0 -0
  403. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleImageBlock.png +0 -0
  404. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_bw_ok.png +0 -0
  405. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_ok.png +0 -0
  406. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_bw_ok.png +0 -0
  407. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_ok.png +0 -0
  408. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_bw_ok.png +0 -0
  409. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_ok.png +0 -0
  410. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_bw_ok.png +0 -0
  411. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_ok.png +0 -0
  412. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_bw_ok.png +0 -0
  413. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_ok.png +0 -0
  414. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_bw_ok.png +0 -0
  415. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_ok.png +0 -0
  416. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_bw_ok.png +0 -0
  417. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_ok.png +0 -0
  418. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_bw_ok.png +0 -0
  419. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_ok.png +0 -0
  420. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_bw_ok.png +0 -0
  421. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_ok.png +0 -0
  422. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/sponsor.gif +0 -0
  423. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/template-versafix-1.html +1531 -0
  424. data/vendor/assets/mosaico-0.16.0/mosaico/uploads/README.md +1 -0
  425. metadata +536 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var console = require("console");
4
+
5
+ var _call = function(whatToCall) {
6
+ return whatToCall();
7
+ };
8
+
9
+ var logs = [];
10
+
11
+ var _timedCall = function(name, whatToCall) {
12
+ var res;
13
+ var start = new Date().getTime();
14
+ if (typeof console == 'object' && console.time) console.time(name);
15
+ res = _call(whatToCall);
16
+ if (typeof console == 'object' && console.time) console.timeEnd(name);
17
+ var diff = new Date().getTime() - start;
18
+ if (typeof console == 'object' && !console.time) console.log(name, "took", diff, "ms");
19
+ logs.push({
20
+ name: name,
21
+ time: diff
22
+ });
23
+ // max logs
24
+ if (logs.length > 100) logs.unshift();
25
+ return res;
26
+ };
27
+
28
+ module.exports = {
29
+ timedCall: _timedCall,
30
+ logs: logs
31
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var ko = require("knockout");
4
+ var undoManager = require('knockout-undomanager');
5
+ var undoserializer = require("./undoserializer.js");
6
+
7
+ var addUndoStackExtensionMaker = function(performanceAwareCaller) {
8
+ return function(viewModel) {
9
+
10
+ viewModel.contentListeners(viewModel.contentListeners() + 2);
11
+
12
+ // TODO the labels should be computed observables (needs changes in undomanager projects)
13
+ var undoRedoStack = undoManager(viewModel.content, {
14
+ levels: 100,
15
+ undoLabel: ko.computed(function() { return viewModel.t("Undo (#COUNT#)"); }),
16
+ redoLabel: ko.computed(function() { return viewModel.t("Redo"); })
17
+ });
18
+ viewModel.undo = undoRedoStack.undoCommand;
19
+ viewModel.undo.execute = performanceAwareCaller.bind(viewModel, 'undo', viewModel.undo.execute);
20
+ viewModel.redo = undoRedoStack.redoCommand;
21
+ viewModel.redo.execute = performanceAwareCaller.bind(viewModel, 'redo', viewModel.redo.execute);
22
+ viewModel.undoReset = performanceAwareCaller.bind(viewModel, 'undoReset', undoRedoStack.reset);
23
+ viewModel.setUndoModeMerge = undoRedoStack.setModeMerge;
24
+ viewModel.setUndoModeOnce = undoRedoStack.setModeOnce;
25
+ undoRedoStack.setModeIgnore();
26
+ undoRedoStack.setUndoActionMaker(undoserializer.makeUndoAction.bind(undefined, viewModel.content));
27
+ undoserializer.watchEnabled(true);
28
+
29
+ return {
30
+ pause: function() {
31
+ undoRedoStack.setModeIgnore();
32
+ },
33
+ run: function() {
34
+ undoRedoStack.setModeOnce();
35
+ },
36
+ init: function() {
37
+ undoRedoStack.setModeOnce();
38
+ },
39
+ dispose: function() {
40
+ viewModel.contentListeners(viewModel.contentListeners() - 2);
41
+ undoserializer.watchEnabled(false);
42
+ undoRedoStack.dispose();
43
+ }
44
+ };
45
+
46
+ };
47
+ };
48
+
49
+ module.exports = addUndoStackExtensionMaker;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var ko = require("knockout");
3
+ var console = require("console");
4
+ // This module deals with serialization/deserialization of a "tree-path" representing the path to reach the given leaf.
5
+ // In order to be correctly serialized we have to move from "reference" to "string" and viceversa.
6
+
7
+ var _reference = function(model, path) {
8
+ var p = 0;
9
+ var p1, p2;
10
+ var m = model;
11
+ while (p < path.length) {
12
+ switch (path.charAt(p)) {
13
+ case '(':
14
+ if (path.charAt(p + 1) == ')') {
15
+ m = m();
16
+ } else {
17
+ // TODO error
18
+ }
19
+ p += 2;
20
+ break;
21
+ case '[':
22
+ p2 = path.indexOf(']', p);
23
+ m = m[path.substring(p + 1, p2)];
24
+ p = p2 + 1;
25
+ break;
26
+ case '.':
27
+ p1 = path.indexOf('(', p);
28
+ if (p1 == -1) p1 = path.length;
29
+ p2 = path.indexOf('[', p);
30
+ if (p2 == -1) p2 = path.length;
31
+ p2 = Math.min(p1, p2);
32
+ m = m[path.substring(p + 1, p2)];
33
+ p = p2;
34
+ break;
35
+ default:
36
+ // TODO error
37
+ }
38
+ }
39
+ return m;
40
+ };
41
+
42
+ var _getPath = function(parents, child) {
43
+ var path = "";
44
+ var p;
45
+ for (var k = 0; k <= parents.length; k++) {
46
+ p = k < parents.length ? parents[k] : child;
47
+ if (ko.isObservable(p)) path += '()';
48
+ if (typeof p._fieldName !== 'undefined') {
49
+ path += "." + p._fieldName;
50
+ } else if (k > 0 && typeof parents[k - 1].pop == 'function') {
51
+ var parentArray = ko.isObservable(parents[k - 1]) ? ko.utils.peekObservable(parents[k - 1]) : parents[k - 1];
52
+ var pos = ko.utils.arrayIndexOf(parentArray, p);
53
+ if (pos != -1) {
54
+ path += "[" + pos + "]";
55
+ } else {
56
+ // NOTE this happen, sometimes when TinyMCE sends updates for objects already removed.
57
+ console.error("Unexpected object not found in parent array", parentArray, p, k, parents.length, ko.toJS(parentArray), ko.utils.unwrapObservable(p));
58
+ throw "Unexpected object not found in parent array";
59
+ }
60
+ } else {
61
+ console.error("Unexpected parent with no _fieldName and no parent array", k, parents);
62
+ throw "Unexpected parent with no _fieldName and no parent array";
63
+ }
64
+ }
65
+ return path;
66
+ };
67
+
68
+ var makeDereferencedUndoAction = function(undoFunc, model, path, value, item) {
69
+ var child = _reference(model, path);
70
+ undoFunc(child, value, item);
71
+ };
72
+
73
+ var listener;
74
+
75
+ var _setListener = function(listenfunc) {
76
+ listener = listenfunc;
77
+ };
78
+
79
+ /* dereferencing path and changing value with "toJS" */
80
+ var makeUndoActionDereferenced = function(model, undoFunc, parents, child, oldVal, item) {
81
+ try {
82
+ var path = _getPath(parents, child);
83
+
84
+ // Transform actions in simple JS objects.
85
+ if (typeof oldVal === 'object' || typeof oldVal === 'function') oldVal = ko.toJS(oldVal);
86
+ if (typeof item !== 'undefined' && (typeof item.value === 'object' || typeof item.value === 'function')) {
87
+ var newItem = ko.toJS(item);
88
+ item = newItem;
89
+ }
90
+
91
+ if (typeof listener !== 'undefined') {
92
+ try {
93
+ listener(path, child, oldVal, item);
94
+ } catch (e) {
95
+ console.log("Undoserializer ignoring exception in listener callback");
96
+ }
97
+ }
98
+
99
+ return makeDereferencedUndoAction.bind(undefined, undoFunc, model, path, oldVal, item);
100
+ } catch (e) {
101
+ // NOTE this happens, from time to time, when TinyMCE sends updates for deleted content.
102
+ console.error("Exception processing undo", e, parents, child, item);
103
+ }
104
+ };
105
+
106
+ var watchEnabled;
107
+ var _watchEnabled = function(newVal) {
108
+ if (typeof newVal !== 'undefined')
109
+ watchEnabled = newVal;
110
+ else
111
+ return watchEnabled;
112
+ };
113
+
114
+ module.exports = {
115
+ dereference: _getPath,
116
+ reference: _reference,
117
+ makeUndoAction: makeUndoActionDereferenced,
118
+ setListener: _setListener,
119
+ watchEnabled: _watchEnabled
120
+ };
@@ -0,0 +1,595 @@
1
+ "use strict";
2
+ /* global global: false */
3
+
4
+ var $ = require("jquery");
5
+ var ko = require("knockout");
6
+ var console = require("console");
7
+ var performanceAwareCaller = require("./timed-call.js").timedCall;
8
+
9
+ var toastr = require("toastr");
10
+ toastr.options = {
11
+ "closeButton": false,
12
+ "debug": false,
13
+ "positionClass": "toast-bottom-full-width",
14
+ "target": "#mo-body",
15
+ "onclick": null,
16
+ "showDuration": "300",
17
+ "hideDuration": "1000",
18
+ "timeOut": "5000",
19
+ "extendedTimeOut": "1000",
20
+ "showEasing": "swing",
21
+ "hideEasing": "linear",
22
+ "showMethod": "fadeIn",
23
+ "hideMethod": "fadeOut"
24
+ };
25
+
26
+ /* NOTE: translations moved to "plugin"
27
+ var strings = {
28
+ 'show preview and send test': 'Visualizza una anteprima e fai un invio di test',
29
+ // Strings for app.js
30
+ 'Download': 'Download',
31
+ 'Test': 'Test',
32
+ 'Save': 'Salva',
33
+ 'Downloading...': "Download in corso...",
34
+ 'Invalid email address': "Indirizzo email invalido",
35
+ "Test email sent...": "Email di test inviata...",
36
+ 'Unexpected error talking to server: contact us!': 'Errore di comunicazione con il server: contattaci!',
37
+ 'Insert here the recipient email address': 'Inserisci qui l\'indirizzo email a cui spedire',
38
+ "Test email address": "Indirizzo email di test",
39
+ // viewModel
40
+ 'Block removed: use undo button to restore it...': 'Blocco eliminato: usa il pulsante annulla per recuperarlo...',
41
+ 'New block added after the selected one (__pos__)': 'Nuovo blocco aggiunto sotto a quello selezionato (__pos__)',
42
+ 'New block added at the model bottom (__pos__)': 'Nuovo blocco aggiunto in fondo al modello (__pos__)',
43
+ // undomain.js
44
+ 'Undo (#COUNT#)': 'Annulla (#COUNT#)',
45
+ 'Redo': 'Ripristina',
46
+ // editor.js
47
+ 'Selected element has no editable properties': 'L\'elemento selezionato non fornisce proprietà editabili',
48
+ 'This style is specific for this block: click here to remove the custom style and revert to the theme value': 'Questo stile è specifico di questo blocco: clicca qui per annullare lo stile personalizzato',
49
+ 'Switch between global and block level styles editing': 'Permette di specificare se si vuole modificare lo stile generale o solamente quello specifico del blocco selezionato',
50
+ // main.tpl.html
51
+ 'Undo last operation': 'Annulla ultima operazione',
52
+ 'Redo last operation': 'Ripeti operazione annullata',
53
+ 'Show image gallery': 'Visualizza galleria immagini',
54
+ 'Gallery': 'Galleria',
55
+ 'Preview': 'Anteprima',
56
+ 'Show live preview': 'Mostra anteprima live',
57
+ 'Large screen': 'Schermo grande',
58
+ 'Tablet': 'Tablet',
59
+ 'Smartphone': 'Smartphone',
60
+ 'Show preview and send test': 'Visualizza una anteprima e fai un invio di test',
61
+ 'Download template': 'Scarica il template',
62
+ 'Save template': 'Salva il template',
63
+ 'Saved model is obsolete': 'Modello salvato obsoleto',
64
+ '<p>The saved model has been created with a previous, non completely compatible version, of the template</p><p>Some content or style in the model <b>COULD BE LOST</b> if you will <b>save</b></p><p>Contact us for more informations!</p>': '<p>Il modello salvato è stato creato con una versione precedente del template non del tutto compatibile</p><p>Alcuni contenuti o stili del modello <b>POTREBBERO ESSERE PERSI</b> se procederai e deciderai di <b>salvare</b></p><p>Contattaci se hai dei dubbi!</p>',
65
+
66
+ // TODO this cannot be done in knockout as with uncompatible browsers we don't initialize
67
+ // 'Usupported browser': 'Browser non compatibile',
68
+ // '<p>Your browser is not supported.</p><p>Use a different browser or try updaring your browser.</p><p>Supported browsers: <ul><li>Internet Explorer &gt;= 10</li><li>Google Chrome &gt;= 30</li><li>Apple Safari &gt;= 5</li><li>Mozilla Firefix &gt;= 20</li></ul></p>': '<p>Il tuo browser non è supportato.</p><p>Accedi con un browser differente o prova ad aggiornare il tuo browser.</p><p>Browser supportati: <ul><li>Internet Explorer &gt;= 10</li><li>Google Chrome &gt;= 30</li><li>Apple Safari &gt;= 5</li><li>Mozilla Firefix &gt;= 20</li></ul></p>',
69
+
70
+ // toolbox
71
+ 'Blocks': 'Blocchi',
72
+ 'Blocks ready to be added to the template': 'Elenco contenuti aggiungibili al messaggio',
73
+ 'Content': 'Contenuto',
74
+ 'Edit content options': 'Modifica opzioni contenuti',
75
+ 'Style': 'Stile',
76
+ 'Edit style options': 'Modifica opzioni grafiche',
77
+ 'Block __name__': 'Blocco __name__',
78
+ 'Click or drag to add this block to the template': 'Clicca o trascina per aggiungere al messaggio',
79
+ 'Add': 'Aggiungi',
80
+ 'By clicking on message parts you will select a block and content options, if any, will show here': 'Cliccando su alcune parti del messaggio selezionerai un blocco e le opzioni contenutistiche, se disponibili, compariranno qui',
81
+ 'By clicking on message parts you will select a block and style options, if available, will show here': 'Cliccando su alcune parti del messaggio selezionerai un blocco e le opzioni di stile, se disponibili, compariranno qui',
82
+ 'Click or drag files here': 'Clicca o trascina i file qui!',
83
+ 'No images uploaded, yet': 'Non hai ancora caricato immagini',
84
+ 'Show images from the gallery': 'Visualizza le immagini caricate nella tua area',
85
+ 'Loading...': 'Caricamento...',
86
+ 'Load gallery': 'Carica galleria',
87
+ 'Loading gallery...': 'Caricamento in corso...',
88
+ 'The gallery is empty': 'Nessuna immagine nella galleria',
89
+ // img-wysiwyg.tmlp
90
+ 'Remove image': 'Rimuovi immagine',
91
+ 'Open the image editing tool': 'Avvia strumento modifica immagine',
92
+ 'Upload a new image': 'Carica una nuova immagine',
93
+ 'Drop an image here': 'Trascina una immagine qui',
94
+ 'Drop an image here or click the upload button': 'Trascina una immagine qui o clicca sul pulsante di caricamento',
95
+ // gallery
96
+ 'Drag this image and drop it on any template image placeholder': 'Trascina questa immagine sulla posizione in cui vuoi inserirla',
97
+ 'Gallery:': 'Galleria:',
98
+ 'Session images': 'Immagini di sessione',
99
+ 'Recents': 'Recenti',
100
+ 'Remote gallery': 'Galleria remota',
101
+
102
+ // customstyle
103
+ 'Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class="customStyled"><span>"small cube" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul>': 'Blocco personalizzato.<ul><li>In questa modalità se cambi una proprietà verrà modificata solamente per questo specifico blocco (invece che per tutti i blocchi della stessa sezione).</li><li>Per segnalare la personalizzazione apparirà l\'icona <span class="customStyled"><span> del "cubetto"</span></span> a fianco delle proprietà. Cliccando questa icona tornerai al valore comune.</li></ul>',
104
+ // blocks-wysiwyg
105
+ 'Drop here blocks from the "Blocks" tab': 'Trascina qui i blocchi dalla scheda \'Blocchi\'',
106
+ // block-wysiwyg
107
+ 'Drag this handle to move the block': 'Trascina per spostare il blocco altrove',
108
+ 'Move this block upside': 'Sposta il blocco in su',
109
+ 'Move this block downside': 'Sposta il blocco in giu',
110
+ 'Delete block': 'Elimina blocco',
111
+ 'Duplicate block': 'Duplica blocco',
112
+ 'Switch block variant': 'Cambia variante blocco',
113
+ // colorpicker
114
+ 'Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.': 'Colori Tema,Colori Standard,Colori Web,Colori Tema,Torna alla tavolozza,Storico,storico colori vuoto',
115
+
116
+ 'Drop here': 'Rilascia qui',
117
+
118
+ };
119
+ */
120
+
121
+ function initializeEditor(content, blockDefs, thumbPathConverter, galleryUrl) {
122
+
123
+ var viewModel = {
124
+ galleryRecent: ko.observableArray([]).extend({
125
+ paging: 16
126
+ }),
127
+ galleryRemote: ko.observableArray([]).extend({
128
+ paging: 16
129
+ }),
130
+ selectedBlock: ko.observable(null),
131
+ selectedItem: ko.observable(null),
132
+ selectedTool: ko.observable(0),
133
+ selectedImageTab: ko.observable(0),
134
+ dragging: ko.observable(false),
135
+ draggingImage: ko.observable(false),
136
+ galleryLoaded: ko.observable(false),
137
+ showPreviewFrame: ko.observable(false),
138
+ previewMode: ko.observable('mobile'),
139
+ showToolbox: ko.observable(true),
140
+ showTheme: ko.observable(false),
141
+ showGallery: ko.observable(false),
142
+ debug: ko.observable(false),
143
+ contentListeners: ko.observable(0),
144
+
145
+ logoPath: 'dist/img/mosaico32.png',
146
+ logoUrl: '.',
147
+ logoAlt: 'mosaico'
148
+ };
149
+
150
+ // viewModel.content = content._instrument(ko, content, undefined, true);
151
+ viewModel.content = content;
152
+ viewModel.blockDefs = blockDefs;
153
+
154
+ viewModel.notifier = toastr;
155
+
156
+ // Does token substitution in i18next style
157
+ viewModel.tt = function(key, paramObj) {
158
+ if (typeof paramObj !== 'undefined')
159
+ for (var prop in paramObj)
160
+ if (paramObj.hasOwnProperty(prop)) {
161
+ key = key.replace(new RegExp('__' + prop + '__', 'g'), paramObj[prop]);
162
+ }
163
+ return key;
164
+ };
165
+
166
+ // Simply maps to tt: language plugins can override this method to define their own language
167
+ // handling.
168
+ // If this method invokes an observable (e.g: viewModel.lang()) then the UI language will automatically
169
+ // update when the "lang" observable changes.
170
+ viewModel.t = viewModel.tt;
171
+
172
+ // currently called by editor.html to translate template-defined keys (label, help, descriptions)
173
+ // the editor always uses the "template" category for that strings.
174
+ // you can override this method as you like in order to provide translation or change the strings in any way.
175
+ viewModel.ut = function(category, key) {
176
+ return key;
177
+ };
178
+
179
+ viewModel.templatePath = thumbPathConverter;
180
+
181
+ viewModel.remoteUrlProcessor = function(url) {
182
+ return url;
183
+ };
184
+
185
+ viewModel.remoteFileProcessor = function(fileObj) {
186
+ if (typeof fileObj.url !== 'undefined') fileObj.url = viewModel.remoteUrlProcessor(fileObj.url);
187
+ if (typeof fileObj.thumbnailUrl !== 'undefined') fileObj.thumbnailUrl = viewModel.remoteUrlProcessor(fileObj.thumbnailUrl);
188
+ // deleteUrl?
189
+ return fileObj;
190
+ };
191
+
192
+ // toolbox.tmpl.html
193
+ viewModel.loadGallery = function() {
194
+ viewModel.galleryLoaded('loading');
195
+ var url = galleryUrl ? galleryUrl : '/upload/';
196
+ // retrieve the full list of remote files
197
+ $.getJSON(url, function(data) {
198
+ for (var i = 0; i < data.files.length; i++) data.files[i] = viewModel.remoteFileProcessor(data.files[i]);
199
+ viewModel.galleryLoaded(data.files.length);
200
+ // TODO do I want this call to return relative paths? Or just absolute paths?
201
+ viewModel.galleryRemote(data.files.reverse());
202
+ }).fail(function() {
203
+ viewModel.galleryLoaded(false);
204
+ viewModel.notifier.error(viewModel.t('Unexpected error listing files'));
205
+ });
206
+ };
207
+
208
+ // img-wysiwyg.tmpl.html
209
+ viewModel.fileToImage = function(obj, event, ui) {
210
+ // console.log("fileToImage", obj);
211
+ return obj.url;
212
+ };
213
+
214
+ // block-wysiwyg.tmpl.html
215
+ viewModel.removeBlock = function(data, parent) {
216
+ // let's unselect the block
217
+ if (ko.utils.unwrapObservable(viewModel.selectedBlock) == ko.utils.unwrapObservable(data)) {
218
+ viewModel.selectBlock(null, true);
219
+ }
220
+ var res = parent.blocks.remove(data);
221
+ // TODO This message should be different depending on undo plugin presence.
222
+ viewModel.notifier.info(viewModel.t('Block removed: use undo button to restore it...'));
223
+ return res;
224
+ };
225
+
226
+ // block-wysiwyg.tmpl.html
227
+ viewModel.duplicateBlock = function(index, parent) {
228
+ var idx = ko.utils.unwrapObservable(index);
229
+ // Deinstrument/deobserve the object
230
+ var unwrapped = ko.toJS(ko.utils.unwrapObservable(parent.blocks)[idx]);
231
+ // We need to remove the id so that a new one will be assigned to the clone
232
+ if (typeof unwrapped.id !== 'undefined') unwrapped.id = '';
233
+ // insert the cloned block
234
+ parent.blocks.splice(idx + 1, 0, unwrapped);
235
+ };
236
+
237
+ // block-wysiwyg.tmpl.html
238
+ viewModel.moveBlock = function(index, parent, up) {
239
+ var idx = ko.utils.unwrapObservable(index);
240
+ var parentBlocks = ko.utils.unwrapObservable(parent.blocks);
241
+ if ((up && idx > 0) || (!up && idx < parentBlocks.length - 1)) {
242
+ var destIndex = idx + (up ? -1 : 1);
243
+ var destBlock = parentBlocks[destIndex];
244
+ viewModel.startMultiple();
245
+ parent.blocks.splice(destIndex, 1);
246
+ parent.blocks.splice(idx, 0, destBlock);
247
+ viewModel.stopMultiple();
248
+ }
249
+ };
250
+
251
+ // test method, command line use only
252
+ viewModel.loadDefaultBlocks = function() {
253
+ // cloning the whole "mainBlocks" object so that undomanager will
254
+ // see it as a single operation (maybe I could use "startMultiple"/"stopMultiple".
255
+ var res = ko.toJS(viewModel.content().mainBlocks);
256
+ res.blocks = [];
257
+ var input = ko.utils.unwrapObservable(viewModel.blockDefs);
258
+ for (var i = 0; i < input.length; i++) {
259
+ var obj = ko.toJS(input[i]);
260
+ // generating ids for blocks, maybe this would work also leaving it empty.
261
+ obj.id = 'block_' + i;
262
+ res.blocks.push(obj);
263
+ }
264
+ performanceAwareCaller('setMainBlocks', viewModel.content().mainBlocks._wrap.bind(viewModel.content().mainBlocks, res));
265
+ };
266
+
267
+ // gallery-images.tmpl.html
268
+ viewModel.addImage = function(img) {
269
+ var selectedImg = $('#main-wysiwyg-area .selectable-img.selecteditem');
270
+ if (selectedImg.length == 1 && typeof img == 'object' && typeof img.url !== 'undefined') {
271
+ ko.contextFor(selectedImg[0])._src(img.url);
272
+ return true;
273
+ } else {
274
+ return false;
275
+ }
276
+ };
277
+
278
+ // toolbox.tmpl.html
279
+ viewModel.addBlock = function(obj, event) {
280
+ // if there is a selected block we try to add the block just after the selected one.
281
+ var selected = viewModel.selectedBlock();
282
+ // search the selected block position.
283
+ var found;
284
+ if (selected !== null) {
285
+ // TODO "mainBlocks" is an hardcoded thing.
286
+ for (var i = viewModel.content().mainBlocks().blocks().length - 1; i >= 0; i--) {
287
+ if (viewModel.content().mainBlocks().blocks()[i]() == selected) {
288
+ found = i;
289
+ break;
290
+ }
291
+ }
292
+ }
293
+ var pos;
294
+ if (typeof found !== 'undefined') {
295
+ pos = found + 1;
296
+ viewModel.content().mainBlocks().blocks.splice(pos, 0, obj);
297
+ viewModel.notifier.info(viewModel.t('New block added after the selected one (__pos__)', {
298
+ pos: pos
299
+ }));
300
+ } else {
301
+ viewModel.content().mainBlocks().blocks.push(obj);
302
+ pos = viewModel.content().mainBlocks().blocks().length - 1;
303
+ viewModel.notifier.info(viewModel.t('New block added at the model bottom (__pos__)', {
304
+ pos: pos
305
+ }));
306
+ }
307
+ // find the newly added block and select it!
308
+ var added = viewModel.content().mainBlocks().blocks()[pos]();
309
+ viewModel.selectBlock(added, true);
310
+ // prevent click propagation (losing url hash - see #43)
311
+ return false;
312
+ };
313
+
314
+ // Used by stylesheet.js to create multiple styles
315
+ viewModel.findObjectsOfType = function(data, type) {
316
+ var res = [];
317
+ var obj = ko.utils.unwrapObservable(data);
318
+ for (var prop in obj)
319
+ if (obj.hasOwnProperty(prop)) {
320
+ var val = ko.utils.unwrapObservable(obj[prop]);
321
+ // TODO this is not the right way to deal with "block list" objects.
322
+ if (prop.match(/Blocks$/)) {
323
+ var contents = ko.utils.unwrapObservable(val.blocks);
324
+ for (var i = 0; i < contents.length; i++) {
325
+ var c = ko.utils.unwrapObservable(contents[i]);
326
+ if (type === null || ko.utils.unwrapObservable(c.type) == type) res.push(c);
327
+ }
328
+ // TODO investigate which condition provide a null value.
329
+ } else if (typeof val == 'object' && val !== null) {
330
+ if (type === null || ko.utils.unwrapObservable(val.type) == type) res.push(val);
331
+ }
332
+ }
333
+ return res;
334
+ };
335
+
336
+ /*
337
+ viewModel.placeholderHelper = 'sortable-placeholder';
338
+ if (false) {
339
+ viewModel.placeholderHelper = {
340
+ element: function(currentItem) {
341
+ return $('<div />').removeClass('ui-draggable').addClass('sortable-placeholder').css('position', 'relative').css('width', '100%').css('height', currentItem.css('height')).css('opacity', '.8')[0];
342
+ },
343
+ update: function(container, p) {
344
+ return;
345
+ }
346
+ };
347
+ }
348
+ */
349
+
350
+ // Attempt to insert the block in the destination layout during dragging
351
+ viewModel.placeholderHelper = {
352
+ element: function(currentItem) {
353
+ return $(currentItem[0].outerHTML).removeClass('ui-draggable').addClass('sortable-placeholder').css('display', 'block').css('position', 'relative').css('width', '100%').css('height', 'auto').css('opacity', '.8')[0];
354
+ },
355
+ update: function(container, p) {
356
+ return;
357
+ }
358
+ };
359
+
360
+ // TODO the undumanager should be pluggable.
361
+ // Used by "moveBlock" and blocks-wysiwyg.tmpl.html to "merge" drag/drop operations into a single undo/redo op.
362
+ viewModel.startMultiple = function() {
363
+ if (typeof viewModel.setUndoModeMerge !== 'undefined') viewModel.setUndoModeMerge();
364
+ };
365
+ viewModel.stopMultiple = function() {
366
+ if (typeof viewModel.setUndoModeOnce !== 'undefined') viewModel.setUndoModeOnce();
367
+ };
368
+
369
+ // Used by code generated by editor.js
370
+ viewModel.localGlobalSwitch = function(prop, globalProp) {
371
+ var current = prop();
372
+ if (current === null) prop(globalProp());
373
+ else prop(null);
374
+ return false;
375
+ };
376
+
377
+ // Used by editor and main "converter" to support item selection
378
+ viewModel.selectItem = function(valueAccessor, item, block) {
379
+ var val = ko.utils.peekObservable(valueAccessor);
380
+ if (typeof block !== 'undefined') viewModel.selectBlock(block, false, true);
381
+ if (val != item) {
382
+ valueAccessor(item);
383
+ // On selectItem if we were on "Blocks" toolbox tab we move to "Content" toolbox tab.
384
+ if (item !== null && viewModel.selectedTool() === 0) viewModel.selectedTool(1);
385
+ }
386
+ return false;
387
+ }.bind(viewModel, viewModel.selectedItem);
388
+
389
+ viewModel.isSelectedItem = function(item) {
390
+ return viewModel.selectedItem() == item;
391
+ };
392
+
393
+ viewModel.selectBlock = function(valueAccessor, item, doNotSelect, doNotUnselectItem) {
394
+ var val = ko.utils.peekObservable(valueAccessor);
395
+ if (!doNotUnselectItem) viewModel.selectItem(null);
396
+ if (val != item) {
397
+ valueAccessor(item);
398
+ // hide gallery on block selection
399
+ viewModel.showGallery(false);
400
+ if (item !== null && !doNotSelect && viewModel.selectedTool() === 0) viewModel.selectedTool(1);
401
+ }
402
+ }.bind(viewModel, viewModel.selectedBlock);
403
+
404
+ // DEBUG
405
+ viewModel.countSubscriptions = function(model, debug) {
406
+ var res = 0;
407
+ for (var prop in model)
408
+ if (model.hasOwnProperty(prop)) {
409
+ var p = model[prop];
410
+ if (ko.isObservable(p)) {
411
+ if (typeof p._defaultComputed != 'undefined') {
412
+ if (typeof debug != 'undefined') console.log(debug + "/" + prop + "/_", p._defaultComputed.getSubscriptionsCount());
413
+ res += p._defaultComputed.getSubscriptionsCount();
414
+ }
415
+ if (typeof debug != 'undefined') console.log(debug + "/" + prop + "/-", p.getSubscriptionsCount());
416
+ res += p.getSubscriptionsCount();
417
+ p = ko.utils.unwrapObservable(p);
418
+ }
419
+ if (typeof p == 'object' && p !== null) {
420
+ var tot = viewModel.countSubscriptions(p, typeof debug != 'undefined' ? debug + '/' + prop + "@" : undefined);
421
+ if (typeof debug != 'undefined') console.log(debug + "/" + prop + "@", tot);
422
+ res += tot;
423
+ }
424
+ }
425
+ return res;
426
+ };
427
+
428
+ // DEBUG
429
+ viewModel.loopSubscriptionsCount = function() {
430
+ var count = viewModel.countSubscriptions(viewModel.content());
431
+ global.document.getElementById('subscriptionsCount').innerHTML = count;
432
+ global.setTimeout(viewModel.loopSubscriptionsCount, 1000);
433
+ };
434
+
435
+ viewModel.export = function() {
436
+ var content = performanceAwareCaller("exportHTML", viewModel.exportHTML);
437
+ return content;
438
+ };
439
+
440
+ function conditional_restore(html) {
441
+ return html.replace(/<replacedcc[^>]* condition="([^"]*)"[^>]*>([\s\S]*?)<\/replacedcc>/g, function(match, condition, body) {
442
+ var dd = '<!--[if '+condition.replace(/&amp;/, '&')+']>';
443
+ dd += body.replace(/<!-- cc:bc:([A-Za-z:]*) -->(<\/cc>)?<!-- cc:ac:\1 -->/g, '</$1>') // restore closing tags (including lost tags)
444
+ .replace(/><\/cc><!-- cc:sc -->/g, '/>') // restore selfclosing tags
445
+ .replace(/<!-- cc:bo:([A-Za-z:]*) --><cc/g, '<$1') // restore open tags
446
+ .replace(/^.*<!-- cc:start -->/,'') // remove content before start
447
+ .replace(/<!-- cc:end -->.*$/,''); // remove content after end
448
+ dd += '<![endif]-->';
449
+ return dd;
450
+ });
451
+ }
452
+
453
+ viewModel.exportHTML = function() {
454
+ var id = 'exportframe';
455
+ $('body').append('<iframe id="' + id + '" data-bind="bindIframe: $data"></iframe>');
456
+ var frameEl = global.document.getElementById(id);
457
+ ko.applyBindings(viewModel, frameEl);
458
+
459
+ ko.cleanNode(frameEl);
460
+
461
+ if (viewModel.inline) viewModel.inline(frameEl.contentWindow.document);
462
+
463
+ // Obsolete method didn't work on IE11 when using "HTML5 doctype":
464
+ // var docType = new XMLSerializer().serializeToString(global.document.doctype);
465
+ var node = frameEl.contentWindow.document.doctype;
466
+ var docType = "<!DOCTYPE " + node.name +
467
+ (node.publicId ? ' PUBLIC "' + node.publicId + '"' : '') +
468
+ (!node.publicId && node.systemId ? ' SYSTEM' : '') +
469
+ (node.systemId ? ' "' + node.systemId + '"' : '') + '>';
470
+ var content = docType + "\n" + frameEl.contentWindow.document.documentElement.outerHTML;
471
+ ko.removeNode(frameEl);
472
+
473
+ content = content.replace(/<script ([^>]* )?type="text\/html"[^>]*>[\s\S]*?<\/script>/gm, '');
474
+ // content = content.replace(/<!-- ko .*? -->/g, ''); // sometimes we have expressions like (<!-- ko var > 2 -->)
475
+ content = content.replace(/<!-- ko ((?!--).)*? -->/g, ''); // this replaces the above with a more formal (but slower) solution
476
+ content = content.replace(/<!-- \/ko -->/g, '');
477
+ // Remove data-bind/data-block attributes
478
+ content = content.replace(/ data-bind="[^"]*"/gm, '');
479
+ // Remove trash leftover by TinyMCE
480
+ content = content.replace(/ data-mce-(href|src|style)="[^"]*"/gm, '');
481
+
482
+ // Replace "replacedstyle" to "style" attributes (chrome puts replacedstyle after style)
483
+ content = content.replace(/ style="[^"]*"([^>]*) replaced(style="[^"]*")/gm, '$1 $2');
484
+ // Replace "replacedstyle" to "style" attributes (ie/ff have reverse order)
485
+ content = content.replace(/ replaced(style="[^"]*")([^>]*) style="[^"]*"/gm, ' $1$2');
486
+ content = content.replace(/ replaced(style="[^"]*")/gm, ' $1');
487
+
488
+ // same as style, but for http-equiv (some browser break it if we don't replace, but then we find it duplicated)
489
+ content = content.replace(/ http-equiv="[^"]*"([^>]*) replaced(http-equiv="[^"]*")/gm, '$1 $2');
490
+ content = content.replace(/ replaced(http-equiv="[^"]*")([^>]*) http-equiv="[^"]*"/gm, ' $1$2');
491
+ content = content.replace(/ replaced(http-equiv="[^"]*")/gm, ' $1');
492
+
493
+ // We already replace style and http-equiv and we don't need this.
494
+ // content = content.replace(/ replaced([^= ]*=)/gm, ' $1');
495
+ // Restore conditional comments
496
+ content = conditional_restore(content);
497
+ var trash = content.match(/ data-[^ =]+(="[^"]+")? /) || content.match(/ replaced([^= ]*=)/);
498
+ if (trash) {
499
+ console.warn("Output HTML contains unexpected data- attributes or replaced attributes", trash);
500
+ }
501
+
502
+ return content;
503
+ };
504
+
505
+ viewModel.exportHTMLtoTextarea = function(textareaid) {
506
+ $(textareaid).val(viewModel.exportHTML());
507
+ };
508
+
509
+ viewModel.exportJSONtoTextarea = function(textareaid) {
510
+ $(textareaid).val(viewModel.exportJSON());
511
+ };
512
+
513
+ viewModel.importJSONfromTextarea = function(textareaid) {
514
+ viewModel.importJSON($(textareaid).val());
515
+ };
516
+
517
+ viewModel.exportMetadata = function() {
518
+ var json = ko.toJSON(viewModel.metadata);
519
+ return json;
520
+ };
521
+
522
+ viewModel.exportJSON = function() {
523
+ var json = ko.toJSON(viewModel.content);
524
+ return json;
525
+ };
526
+
527
+ viewModel.exportJS = function() {
528
+ return ko.toJS(viewModel.content);
529
+ };
530
+
531
+ viewModel.importJSON = function(json) {
532
+ var unwrapped = ko.utils.parseJson(json);
533
+ viewModel.content._wrap(unwrapped);
534
+ };
535
+
536
+ viewModel.exportTheme = function() {
537
+ var flat = {};
538
+ var mod = viewModel.content().theme();
539
+
540
+ var _export = function(prefix, flat, mod) {
541
+ for (var prop in mod)
542
+ if (mod.hasOwnProperty(prop)) {
543
+ var a = ko.utils.unwrapObservable(mod[prop]);
544
+ if (a !== null && typeof a == 'object') {
545
+ _export(prop + '.', flat, a);
546
+ } else {
547
+ flat[prefix + prop] = a;
548
+ }
549
+ }
550
+ };
551
+
552
+ _export('', flat, mod);
553
+
554
+ var output = '';
555
+ for (var prop in flat)
556
+ if (flat.hasOwnProperty(prop) && prop != 'type') {
557
+ output += prop + ": " + flat[prop] + ";" + "\n";
558
+ }
559
+
560
+ return output;
561
+ };
562
+
563
+ // moxiemanager (or file browser/imageeditor) extension points.
564
+ // Just implement editImage or linkDialog methods
565
+ // viewModel.editImage = function(src, done) {} : implement this method to enable image editing (src is a wirtableObservable).
566
+ // viewModel.linkDialog = function() {}: implement this method using "this" to find the input element $(this).val is a writableObservable.
567
+
568
+ viewModel.loadImage = function(img) {
569
+ // push image at top of "recent" gallery
570
+ viewModel.galleryRecent.unshift(img);
571
+ // select recent gallery tab
572
+ viewModel.selectedImageTab(0);
573
+ };
574
+
575
+ viewModel.dialog = function(selector, options) {
576
+ $(selector).dialog(options);
577
+ };
578
+
579
+ // Dummy log method overridden by extensions
580
+ viewModel.log = function(category, msg) {
581
+ // console.log("viewModel.log", category, msg);
582
+ };
583
+
584
+ // automatically load the gallery when the gallery tab is selected
585
+ viewModel.selectedImageTab.subscribe(function(newValue) {
586
+ if (newValue == 1 && viewModel.galleryLoaded() === false) {
587
+ viewModel.loadGallery();
588
+ }
589
+ }, viewModel, 'change');
590
+
591
+ return viewModel;
592
+
593
+ }
594
+
595
+ module.exports = initializeEditor;