comfortable_mexican_sofa 1.11.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -2
  3. data/CONTRIBUTING.md +29 -0
  4. data/README.md +24 -15
  5. data/Rakefile +12 -4
  6. data/app/assets/javascripts/comfortable_mexican_sofa/application.js.coffee +11 -10
  7. data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff.js.coffee +9 -0
  8. data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff/diff_match_patch.min.js +49 -0
  9. data/app/assets/javascripts/comfortable_mexican_sofa/lib/diff/pretty_text_diff.min.js +5 -0
  10. data/app/assets/stylesheets/comfortable_mexican_sofa/application.css.sass +7 -9
  11. data/app/assets/stylesheets/comfortable_mexican_sofa/base.css.sass +45 -15
  12. data/app/assets/stylesheets/comfortable_mexican_sofa/bootstrap_overrides.css.sass +21 -41
  13. data/app/controllers/{admin → comfy/admin}/cms/base_controller.rb +9 -8
  14. data/app/controllers/{admin → comfy/admin}/cms/categories_controller.rb +1 -1
  15. data/app/controllers/{admin → comfy/admin}/cms/files_controller.rb +11 -11
  16. data/app/controllers/{admin → comfy/admin}/cms/layouts_controller.rb +10 -10
  17. data/app/controllers/{admin → comfy/admin}/cms/pages_controller.rb +16 -12
  18. data/app/controllers/{admin → comfy/admin}/cms/revisions_controller.rb +12 -12
  19. data/app/controllers/{admin → comfy/admin}/cms/sites_controller.rb +13 -13
  20. data/app/controllers/{admin → comfy/admin}/cms/snippets_controller.rb +9 -9
  21. data/app/controllers/{cms → comfy/cms}/assets_controller.rb +1 -1
  22. data/app/controllers/{cms → comfy/cms}/base_controller.rb +4 -4
  23. data/app/controllers/{cms → comfy/cms}/content_controller.rb +9 -6
  24. data/app/models/{cms → comfy/cms}/block.rb +13 -10
  25. data/app/models/{cms → comfy/cms}/categorization.rb +2 -2
  26. data/app/models/{cms → comfy/cms}/category.rb +2 -2
  27. data/app/models/{cms → comfy/cms}/file.rb +12 -11
  28. data/app/models/{cms → comfy/cms}/layout.rb +10 -8
  29. data/app/models/{cms → comfy/cms}/page.rb +6 -82
  30. data/app/models/{cms → comfy/cms}/revision.rb +2 -2
  31. data/app/models/{cms → comfy/cms}/site.rb +6 -6
  32. data/app/models/{cms → comfy/cms}/snippet.rb +7 -7
  33. data/app/views/{admin → comfy/admin}/cms/categories/_categories.html.haml +0 -0
  34. data/app/views/comfy/admin/cms/categories/_edit.html.haml +6 -0
  35. data/app/views/{admin → comfy/admin}/cms/categories/_form.html.haml +2 -2
  36. data/app/views/comfy/admin/cms/categories/_index.html.haml +25 -0
  37. data/app/views/{admin → comfy/admin}/cms/categories/_show.html.haml +3 -3
  38. data/app/views/{admin → comfy/admin}/cms/categories/create.js.erb +0 -0
  39. data/app/views/{admin → comfy/admin}/cms/categories/destroy.js.erb +0 -0
  40. data/app/views/{admin → comfy/admin}/cms/categories/edit.js.erb +0 -0
  41. data/app/views/{admin → comfy/admin}/cms/categories/update.js.erb +0 -0
  42. data/app/views/{admin → comfy/admin}/cms/files/_file.html.haml +2 -2
  43. data/app/views/comfy/admin/cms/files/_form.html.haml +19 -0
  44. data/app/views/comfy/admin/cms/files/_index.html.haml +11 -0
  45. data/app/views/{admin → comfy/admin}/cms/files/_page_form.html.haml +2 -2
  46. data/app/views/{admin → comfy/admin}/cms/files/destroy.js.coffee +0 -0
  47. data/app/views/{admin → comfy/admin}/cms/files/edit.html.haml +0 -0
  48. data/app/views/comfy/admin/cms/files/index.html.haml +31 -0
  49. data/app/views/{admin → comfy/admin}/cms/files/new.html.haml +0 -0
  50. data/app/views/{admin → comfy/admin}/cms/layouts/_form.html.haml +6 -6
  51. data/app/views/comfy/admin/cms/layouts/_index_branch.html.haml +23 -0
  52. data/app/views/comfy/admin/cms/layouts/edit.html.haml +9 -0
  53. data/app/views/comfy/admin/cms/layouts/index.html.haml +13 -0
  54. data/app/views/{admin → comfy/admin}/cms/layouts/new.html.haml +0 -0
  55. data/app/views/comfy/admin/cms/pages/_form.html.haml +40 -0
  56. data/app/views/{admin → comfy/admin}/cms/pages/_form_blocks.html.haml +4 -3
  57. data/app/views/{admin → comfy/admin}/cms/pages/_index_branch.html.haml +7 -7
  58. data/app/views/comfy/admin/cms/pages/edit.html.haml +9 -0
  59. data/app/views/{admin → comfy/admin}/cms/pages/form_blocks.js.erb +0 -0
  60. data/app/views/comfy/admin/cms/pages/index.html.haml +15 -0
  61. data/app/views/{admin → comfy/admin}/cms/pages/new.html.haml +0 -0
  62. data/app/views/{admin → comfy/admin}/cms/pages/toggle_branch.js.erb +1 -1
  63. data/app/views/{admin → comfy/admin}/cms/partials/_body_before.html.haml +0 -0
  64. data/app/views/{admin → comfy/admin}/cms/partials/_file_form_after.html.haml +0 -0
  65. data/app/views/{admin → comfy/admin}/cms/partials/_file_form_before.html.haml +0 -0
  66. data/app/views/{admin → comfy/admin}/cms/partials/_files_after.html.haml +0 -0
  67. data/app/views/{admin → comfy/admin}/cms/partials/_files_before.html.haml +0 -0
  68. data/app/views/{admin → comfy/admin}/cms/partials/_html_footer.html.haml +0 -0
  69. data/app/views/{admin → comfy/admin}/cms/partials/_html_head.html.haml +0 -0
  70. data/app/views/{admin → comfy/admin}/cms/partials/_layout_form_after.html.haml +0 -0
  71. data/app/views/{admin → comfy/admin}/cms/partials/_layout_form_before.html.haml +0 -0
  72. data/app/views/{admin → comfy/admin}/cms/partials/_layouts_after.html.haml +0 -0
  73. data/app/views/{admin → comfy/admin}/cms/partials/_layouts_before.html.haml +0 -0
  74. data/app/views/{admin → comfy/admin}/cms/partials/_navigation_after.html.haml +0 -0
  75. data/app/views/{admin → comfy/admin}/cms/partials/_navigation_before.html.haml +0 -0
  76. data/app/views/{admin → comfy/admin}/cms/partials/_navigation_inner.html.haml +0 -0
  77. data/app/views/{admin → comfy/admin}/cms/partials/_page_form_after.html.haml +0 -0
  78. data/app/views/{admin → comfy/admin}/cms/partials/_page_form_before.html.haml +0 -0
  79. data/app/views/{admin → comfy/admin}/cms/partials/_page_form_inner.html.haml +0 -0
  80. data/app/views/{admin → comfy/admin}/cms/partials/_pages_after.html.haml +0 -0
  81. data/app/views/{admin → comfy/admin}/cms/partials/_pages_before.html.haml +0 -0
  82. data/app/views/{admin → comfy/admin}/cms/partials/_right_column_after.html.haml +0 -0
  83. data/app/views/{admin → comfy/admin}/cms/partials/_right_column_before.html.haml +0 -0
  84. data/app/views/{admin → comfy/admin}/cms/partials/_site_form_after.html.haml +0 -0
  85. data/app/views/{admin → comfy/admin}/cms/partials/_site_form_before.html.haml +0 -0
  86. data/app/views/{admin → comfy/admin}/cms/partials/_sites_after.html.haml +0 -0
  87. data/app/views/{admin → comfy/admin}/cms/partials/_sites_before.html.haml +0 -0
  88. data/app/views/{admin → comfy/admin}/cms/partials/_snippet_form_after.html.haml +0 -0
  89. data/app/views/{admin → comfy/admin}/cms/partials/_snippet_form_before.html.haml +0 -0
  90. data/app/views/{admin → comfy/admin}/cms/partials/_snippets_after.html.haml +0 -0
  91. data/app/views/{admin → comfy/admin}/cms/partials/_snippets_before.html.haml +0 -0
  92. data/app/views/comfy/admin/cms/revisions/show.html.haml +35 -0
  93. data/app/views/comfy/admin/cms/sites/_form.html.haml +14 -0
  94. data/app/views/comfy/admin/cms/sites/_mirrors.html.haml +18 -0
  95. data/app/views/{admin → comfy/admin}/cms/sites/edit.html.haml +0 -0
  96. data/app/views/comfy/admin/cms/sites/index.html.haml +28 -0
  97. data/app/views/{admin → comfy/admin}/cms/sites/new.html.haml +0 -0
  98. data/app/views/comfy/admin/cms/snippets/_form.html.haml +15 -0
  99. data/app/views/{admin → comfy/admin}/cms/snippets/edit.html.haml +2 -2
  100. data/app/views/comfy/admin/cms/snippets/index.html.haml +32 -0
  101. data/app/views/{admin → comfy/admin}/cms/snippets/new.html.haml +0 -0
  102. data/app/views/{cms → comfy/cms}/content/render_sitemap.xml.builder +0 -0
  103. data/app/views/kaminari/{_first_page.html.haml → comfy/_first_page.html.haml} +0 -0
  104. data/app/views/kaminari/{_gap.html.haml → comfy/_gap.html.haml} +0 -0
  105. data/app/views/kaminari/{_last_page.html.haml → comfy/_last_page.html.haml} +0 -0
  106. data/app/views/kaminari/{_next_page.html.haml → comfy/_next_page.html.haml} +0 -0
  107. data/app/views/kaminari/{_page.html.haml → comfy/_page.html.haml} +0 -0
  108. data/app/views/kaminari/{_paginator.html.haml → comfy/_paginator.html.haml} +0 -0
  109. data/app/views/kaminari/{_prev_page.html.haml → comfy/_prev_page.html.haml} +0 -0
  110. data/app/views/layouts/comfy/admin/cms.html.haml +4 -0
  111. data/app/views/layouts/comfy/admin/cms/_body.html.haml +17 -0
  112. data/app/views/layouts/{admin → comfy/admin}/cms/_center.html.haml +0 -0
  113. data/app/views/layouts/{admin → comfy/admin}/cms/_footer.html.haml +0 -0
  114. data/app/views/layouts/{admin → comfy/admin}/cms/_footer_js.html.haml +2 -2
  115. data/app/views/layouts/{admin → comfy/admin}/cms/_head.html.haml +1 -1
  116. data/app/views/layouts/comfy/admin/cms/_left.html.haml +16 -0
  117. data/app/views/layouts/comfy/admin/cms/_right.html.haml +5 -0
  118. data/comfortable_mexican_sofa.gemspec +6 -4
  119. data/config/initializers/comfortable_mexican_sofa.rb +0 -5
  120. data/config/locales/da.yml +233 -0
  121. data/config/locales/de.yml +203 -214
  122. data/config/locales/en.yml +198 -210
  123. data/config/locales/es.yml +195 -207
  124. data/config/locales/fr.yml +195 -207
  125. data/config/locales/it.yml +201 -212
  126. data/config/locales/ja.yml +195 -208
  127. data/config/locales/nl.yml +201 -213
  128. data/config/locales/pl.yml +195 -207
  129. data/config/locales/pt-BR.yml +196 -208
  130. data/config/locales/ru.yml +203 -213
  131. data/config/locales/sv.yml +194 -206
  132. data/config/locales/zh-CN.yml +201 -213
  133. data/db/cms_fixtures/sample-site/layouts/default/nested/content.haml +3 -0
  134. data/db/cms_fixtures/sample-site/pages/index/child/left.haml +1 -0
  135. data/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png +0 -0
  136. data/db/migrate/01_create_cms.rb +40 -38
  137. data/db/upgrade_migrations/08_upgrade_to_1_12_0.rb +41 -0
  138. data/lib/comfortable_mexican_sofa.rb +1 -0
  139. data/lib/comfortable_mexican_sofa/configuration.rb +2 -8
  140. data/lib/comfortable_mexican_sofa/engine.rb +3 -1
  141. data/lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb +6 -0
  142. data/lib/comfortable_mexican_sofa/extensions/cms_manageable.rb +106 -0
  143. data/lib/comfortable_mexican_sofa/extensions/has_revisions.rb +2 -1
  144. data/lib/comfortable_mexican_sofa/extensions/is_categorized.rb +4 -4
  145. data/lib/comfortable_mexican_sofa/extensions/is_mirrored.rb +8 -8
  146. data/lib/comfortable_mexican_sofa/fixture.rb +2 -9
  147. data/lib/comfortable_mexican_sofa/fixture/category.rb +6 -6
  148. data/lib/comfortable_mexican_sofa/fixture/file.rb +1 -1
  149. data/lib/comfortable_mexican_sofa/fixture/layout.rb +8 -3
  150. data/lib/comfortable_mexican_sofa/fixture/page.rb +13 -3
  151. data/lib/comfortable_mexican_sofa/fixture/snippet.rb +7 -3
  152. data/lib/comfortable_mexican_sofa/form_builder.rb +30 -17
  153. data/lib/comfortable_mexican_sofa/render_methods.rb +58 -50
  154. data/lib/comfortable_mexican_sofa/routes/cms.rb +12 -10
  155. data/lib/comfortable_mexican_sofa/routes/cms_admin.rb +26 -24
  156. data/lib/comfortable_mexican_sofa/tag.rb +14 -14
  157. data/lib/comfortable_mexican_sofa/tags/asset.rb +3 -3
  158. data/lib/comfortable_mexican_sofa/tags/file.rb +2 -2
  159. data/lib/comfortable_mexican_sofa/tags/page_file.rb +29 -18
  160. data/lib/comfortable_mexican_sofa/tags/page_files.rb +34 -35
  161. data/lib/comfortable_mexican_sofa/tags/snippet.rb +3 -3
  162. data/lib/comfortable_mexican_sofa/version.rb +1 -1
  163. data/lib/comfortable_mexican_sofa/view_methods.rb +67 -74
  164. data/lib/generators/comfy/scaffold/scaffold_generator.rb +1 -1
  165. data/lib/generators/comfy/scaffold/templates/controller.rb +4 -4
  166. data/lib/generators/comfy/scaffold/templates/tests/controller.rb +3 -3
  167. data/lib/generators/comfy/scaffold/templates/views/_form.haml +1 -1
  168. data/lib/generators/comfy/scaffold/templates/views/index.haml +6 -6
  169. data/test/controllers/{admin → comfy/admin}/cms/base_controller_test.rb +3 -3
  170. data/test/controllers/comfy/admin/cms/categories_controller_test.rb +70 -0
  171. data/test/controllers/{admin → comfy/admin}/cms/files_controller_test.rb +53 -45
  172. data/test/controllers/{admin → comfy/admin}/cms/layouts_controller_test.rb +29 -29
  173. data/test/controllers/{admin → comfy/admin}/cms/pages_controller_test.rb +111 -110
  174. data/test/controllers/comfy/admin/cms/revisions_controller_test.rb +138 -0
  175. data/test/controllers/{admin → comfy/admin}/cms/sites_controller_test.rb +15 -15
  176. data/test/controllers/{admin → comfy/admin}/cms/snippets_controller_test.rb +29 -29
  177. data/test/controllers/comfy/cms/assets_controller_test.rb +38 -0
  178. data/test/controllers/{cms → comfy/cms}/content_controller_test.rb +28 -28
  179. data/test/fixtures/{cms → comfy/cms}/blocks.yml +2 -2
  180. data/test/fixtures/{cms → comfy/cms}/categories.yml +1 -1
  181. data/test/fixtures/comfy/cms/categorizations.yml +3 -0
  182. data/test/fixtures/{cms → comfy/cms}/files.yml +0 -0
  183. data/test/fixtures/{cms → comfy/cms}/layouts.yml +0 -0
  184. data/test/fixtures/{cms → comfy/cms}/pages.yml +2 -2
  185. data/test/fixtures/{cms → comfy/cms}/revisions.yml +3 -3
  186. data/test/fixtures/{cms → comfy/cms}/sites.yml +0 -0
  187. data/test/fixtures/{cms → comfy/cms}/snippets.yml +0 -0
  188. data/test/fixtures/generators/scaffold/controller.rb +4 -4
  189. data/test/fixtures/generators/scaffold/tests/controller.rb +3 -3
  190. data/test/fixtures/generators/scaffold/views/_form.haml +1 -1
  191. data/test/fixtures/generators/scaffold/views/index.haml +6 -6
  192. data/test/gemfiles/Gemfile.rails.4.0 +4 -2
  193. data/test/gemfiles/Gemfile.rails.4.1 +5 -3
  194. data/test/gemfiles/Gemfile.rails.master +22 -0
  195. data/test/generators/scaffold_generator_test.rb +1 -1
  196. data/test/integration/authentication_test.rb +2 -2
  197. data/test/integration/fixtures_test.rb +26 -24
  198. data/test/integration/mirrors_test.rb +14 -14
  199. data/test/integration/render_cms_test.rb +17 -16
  200. data/test/integration/sites_test.rb +21 -21
  201. data/test/integration/view_hooks_test.rb +7 -7
  202. data/test/lib/configuration_test.rb +1 -5
  203. data/test/lib/fixtures/categories_test.rb +8 -8
  204. data/test/lib/fixtures/files_test.rb +11 -11
  205. data/test/lib/fixtures/layouts_test.rb +19 -19
  206. data/test/lib/fixtures/pages_test.rb +24 -24
  207. data/test/lib/fixtures/snippets_test.rb +14 -14
  208. data/test/lib/fixtures_test.rb +8 -8
  209. data/test/lib/mirrors_test.rb +25 -25
  210. data/test/lib/revisions_test.rb +26 -26
  211. data/test/lib/tag_test.rb +26 -26
  212. data/test/lib/tags/asset_test.rb +11 -11
  213. data/test/lib/tags/collection_test.rb +33 -32
  214. data/test/lib/tags/field_boolean_test.rb +6 -6
  215. data/test/lib/tags/field_datetime_test.rb +6 -6
  216. data/test/lib/tags/field_integer_test.rb +6 -6
  217. data/test/lib/tags/field_rich_text_test.rb +6 -6
  218. data/test/lib/tags/field_string_test.rb +7 -7
  219. data/test/lib/tags/field_text_test.rb +6 -6
  220. data/test/lib/tags/file_test.rb +12 -12
  221. data/test/lib/tags/helper_test.rb +10 -10
  222. data/test/lib/tags/page_datetime_test.rb +6 -6
  223. data/test/lib/tags/page_file_test.rb +11 -11
  224. data/test/lib/tags/page_files_test.rb +12 -11
  225. data/test/lib/tags/page_integer_test.rb +6 -6
  226. data/test/lib/tags/page_markdown_test.rb +6 -6
  227. data/test/lib/tags/page_rich_text_test.rb +6 -6
  228. data/test/lib/tags/page_string_test.rb +6 -6
  229. data/test/lib/tags/page_text_test.rb +7 -7
  230. data/test/lib/tags/partial_test.rb +10 -10
  231. data/test/lib/tags/snippet_test.rb +6 -6
  232. data/test/lib/tags/template_test.rb +7 -7
  233. data/test/lib/view_methods_test.rb +89 -120
  234. data/test/models/block_test.rb +34 -34
  235. data/test/models/categorization_test.rb +25 -25
  236. data/test/models/category_test.rb +9 -9
  237. data/test/models/file_test.rb +38 -21
  238. data/test/models/layout_test.rb +27 -27
  239. data/test/models/page_test.rb +101 -71
  240. data/test/models/site_test.rb +50 -50
  241. data/test/models/snippet_test.rb +9 -9
  242. data/test/test_helper.rb +7 -9
  243. metadata +174 -147
  244. data/app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings-white.png +0 -0
  245. data/app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings.png +0 -0
  246. data/app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.js +0 -492
  247. data/app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap.js +0 -6
  248. data/app/assets/javascripts/comfortable_mexican_sofa/lib/wysihtml5.js +0 -261
  249. data/app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.css +0 -102
  250. data/app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap.css +0 -9
  251. data/app/assets/stylesheets/comfortable_mexican_sofa/wysihtml5_overrides.css.sass +0 -5
  252. data/app/models/concerns/cms/base.rb +0 -17
  253. data/app/views/admin/cms/categories/_edit.html.haml +0 -6
  254. data/app/views/admin/cms/categories/_index.html.haml +0 -24
  255. data/app/views/admin/cms/files/_form.html.haml +0 -18
  256. data/app/views/admin/cms/files/_index.html.haml +0 -14
  257. data/app/views/admin/cms/files/index.html.haml +0 -32
  258. data/app/views/admin/cms/layouts/_index_branch.html.haml +0 -23
  259. data/app/views/admin/cms/layouts/edit.html.haml +0 -9
  260. data/app/views/admin/cms/layouts/index.html.haml +0 -13
  261. data/app/views/admin/cms/pages/_form.html.haml +0 -39
  262. data/app/views/admin/cms/pages/edit.html.haml +0 -9
  263. data/app/views/admin/cms/pages/index.html.haml +0 -15
  264. data/app/views/admin/cms/revisions/show.html.haml +0 -29
  265. data/app/views/admin/cms/sites/_form.html.haml +0 -14
  266. data/app/views/admin/cms/sites/_mirrors.html.haml +0 -18
  267. data/app/views/admin/cms/sites/index.html.haml +0 -28
  268. data/app/views/admin/cms/snippets/_form.html.haml +0 -15
  269. data/app/views/admin/cms/snippets/index.html.haml +0 -32
  270. data/app/views/layouts/admin/cms.html.haml +0 -4
  271. data/app/views/layouts/admin/cms/_body.html.haml +0 -17
  272. data/app/views/layouts/admin/cms/_left.html.haml +0 -16
  273. data/app/views/layouts/admin/cms/_right.html.haml +0 -5
  274. data/db/cms_fixtures/sample-site/layouts/default/nested/content.html +0 -2
  275. data/db/cms_fixtures/sample-site/pages/index/child/left.html +0 -1
  276. data/doc/sofa.png +0 -0
  277. data/test/controllers/admin/cms/categories_controller_test.rb +0 -70
  278. data/test/controllers/admin/cms/revisions_controller_test.rb +0 -138
  279. data/test/controllers/cms/assets_controller_test.rb +0 -29
  280. data/test/fixtures/cms/categorizations.yml +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a35ba0c1902bd02fd420650d31f0640f2c7c261
4
- data.tar.gz: 6bdef6661eaf0b3b66cb8daa1df5181d52c72ee7
3
+ metadata.gz: e362f2fa5ecfc8b054e8af4c5929c0b5dedde90c
4
+ data.tar.gz: 1339b5a30cec409390fd03e16dc7cf4c1a643ff2
5
5
  SHA512:
6
- metadata.gz: 3559118792688dc5c6605727f1d19b4e01b0b85530eaeb2f16d98aafd1a9915604f542fb4e9f66b6a90060a0dcaebd95e94c5696025242a5e741bcb1d04baa36
7
- data.tar.gz: 53b453415bc65a90a0083bead5d6a30341e81b6cdcf1dec8a179b0d43c329915a8ab3af163761048935b0194492b0439c10bfb24a09e4ec7f9bc4c8f8e7acc42
6
+ metadata.gz: d8c7ff6ae3b7d9cf4f38f8ea22b02ec088aceb1695e7ad3674a126191478cccb75924a78f33bdc393af27100791d0cff3ef9575d0831a7fa85b3e5cb5545a833
7
+ data.tar.gz: dac90aa9c8e2b655aaa798bcd71eb19a74a1d9bd2277668711cb22ff39b421bf936c3edeaf4284156d81480cc48019a04cc0bdb666b19c70f32db2b842a5bd92
@@ -2,14 +2,19 @@ language: ruby
2
2
  before_script:
3
3
  - rake db:migrate
4
4
  script:
5
- - rake test:all
5
+ - rake ci
6
6
  rvm:
7
7
  - 1.9.3
8
8
  - 2.0.0
9
- - 2.1.0
9
+ - 2.1.1
10
10
  gemfile:
11
11
  - test/gemfiles/Gemfile.rails.4.0
12
12
  - test/gemfiles/Gemfile.rails.4.1
13
+ - test/gemfiles/Gemfile.rails.master
13
14
  branches:
14
15
  only:
15
16
  - master
17
+ matrix:
18
+ fast_finish: true
19
+ allow_failures:
20
+ - gemfile: test/gemfiles/Gemfile.rails.master
@@ -0,0 +1,29 @@
1
+ # Contributing
2
+ Contribute your code to ComfortableMexicanSofa in 5 easy steps:
3
+
4
+ ### 1. Fork it
5
+
6
+ Fork the project. Optionally, create a branch you want to work on.
7
+
8
+ ### 2. Get it running locally
9
+
10
+ - Install gem dependencies with `bundle install`
11
+ - There's nothing to configure, by default database is SQLite so it will be created for you
12
+ - Make sure that existing tests are passing by running `rake test:all`
13
+ - You should be able to start the app via `rails s` and navigate to http://localhost:3000/admin
14
+
15
+ ### 3. Hack away
16
+
17
+ - Create a few small pull requests instead of a humoungous one. I can merge small stuff faster.
18
+ - When adding new code just make sure it follows the same slyle as the existing code.
19
+ - Avoid adding 3rd party dependencies if you can.
20
+ - Tests please, but nothing complicated. UnitTest / Fixtures all the way. Make sure all tests pass.
21
+
22
+ ### 4. Make a pull request
23
+
24
+ If you never done it before read this: https://help.github.com/articles/using-pull-requests
25
+
26
+ ### 5. Done!
27
+
28
+ If everything is good your changes will be merged into master branch. Eventually a new version of gem will be cut.
29
+
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # ComfortableMexicanSofa
2
- [![Gem Version](https://badge.fury.io/rb/comfortable_mexican_sofa.png)](http://rubygems.org/gems/comfortable_mexican_sofa) [![Build Status](https://travis-ci.org/comfy/comfortable-mexican-sofa.png?branch=master)](https://travis-ci.org/comfy/comfortable-mexican-sofa) [![Dependency Status](https://gemnasium.com/comfy/comfortable-mexican-sofa.png)](https://gemnasium.com/comfy/comfortable-mexican-sofa) [![Code Climate](https://codeclimate.com/github/comfy/comfortable-mexican-sofa.png)](https://codeclimate.com/github/comfy/comfortable-mexican-sofa) [![Coverage Status](https://coveralls.io/repos/comfy/comfortable-mexican-sofa/badge.png?branch=master)](https://coveralls.io/r/comfy/comfortable-mexican-sofa)
2
+ [![Gem Version](https://badge.fury.io/rb/comfortable_mexican_sofa.svg)](http://rubygems.org/gems/comfortable_mexican_sofa) [![Build Status](https://travis-ci.org/comfy/comfortable-mexican-sofa.svg?branch=master)](https://travis-ci.org/comfy/comfortable-mexican-sofa) [![Dependency Status](https://gemnasium.com/comfy/comfortable-mexican-sofa.png)](https://gemnasium.com/comfy/comfortable-mexican-sofa) [![Code Climate](https://codeclimate.com/github/comfy/comfortable-mexican-sofa.png)](https://codeclimate.com/github/comfy/comfortable-mexican-sofa) [![Coverage Status](https://coveralls.io/repos/comfy/comfortable-mexican-sofa/badge.png?branch=master)](https://coveralls.io/r/comfy/comfortable-mexican-sofa)
3
3
 
4
- ComfortableMexicanSofa is a powerful CMS Engine for your Rails 4 applications.
4
+ ComfortableMexicanSofa is a powerful Rails 4 CMS Engine
5
+
6
+ ## Features
5
7
 
6
- Features
7
- --------
8
8
  * Simple integration with Rails 4 apps
9
9
  * Build your application in Rails, not in CMS
10
10
  * Powerful page templating capability using [Tags](https://github.com/comfy/comfortable-mexican-sofa/wiki/Tags)
@@ -12,10 +12,10 @@ Features
12
12
  * Multilingual
13
13
  * [Fixtures](https://github.com/comfy/comfortable-mexican-sofa/wiki/Working-with-CMS-fixtures) for initial content population
14
14
  * [Revision History](https://github.com/comfy/comfortable-mexican-sofa/wiki/Revisions)
15
- * [Great extendable admin interface](https://github.com/comfy/comfortable-mexican-sofa/wiki/Reusing-sofa%27s-admin-area) built with [Bootstrap](http://twitter.github.com/bootstrap/), [CodeMirror](http://codemirror.net/) and [WYSIHTML5](http://xing.github.com/wysihtml5/)
15
+ * [Great extendable admin interface](https://github.com/comfy/comfortable-mexican-sofa/wiki/Reusing-sofa%27s-admin-area) built with [Bootstrap](http://twitter.github.com/bootstrap/), [CodeMirror](http://codemirror.net/) and [TinyMCE](http://www.tinymce.com/)
16
+
17
+ ## Installation
16
18
 
17
- Installation
18
- ------------
19
19
  Add gem definition to your Gemfile:
20
20
 
21
21
  ```ruby
@@ -37,16 +37,16 @@ comfy_route :cms, :path => '/', :sitemap => false
37
37
 
38
38
  When upgrading from the older version please take a look at [Upgrading ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa/wiki/Upgrading-ComfortableMexicanSofa)
39
39
 
40
- Installation for Rails 3
41
- ------------------------
40
+ ### Installation for Rails 3
41
+
42
42
  For Rails 3 apps feel free to use [1.8 release](https://github.com/comfy/comfortable-mexican-sofa/tree/1.8)
43
43
 
44
44
  ```ruby
45
45
  gem 'comfortable_mexican_sofa', '~> 1.8.0'
46
46
  ```
47
47
 
48
- Quick Start Guide
49
- -----------------
48
+ ## Quick Start Guide
49
+
50
50
  After finishing installation you should be able to navigate to http://yoursite/admin
51
51
 
52
52
  Default username and password is 'username' and 'password'. You probably want to change it right away. Admin credentials (among other things) can be found and changed in the cms initializer: [/config/initializers/comfortable\_mexican\_sofa.rb](https://github.com/comfy/comfortable-mexican-sofa/blob/master/config/initializers/comfortable_mexican_sofa.rb)
@@ -59,19 +59,24 @@ After creating a Site, you need to make a Layout. Layout is the template of your
59
59
  <html>
60
60
  <body>
61
61
  <h1>{{ cms:page:header:string }}</h1>
62
- {{ cms:page:content:text }}
62
+ {{ cms:page:content:rich_text }}
63
63
  </body>
64
64
  </html>
65
65
  ```
66
66
 
67
+ [See Wiki entry on available Tags you can use](https://github.com/comfy/comfortable-mexican-sofa/wiki/Tags)
68
+
67
69
  Once you have a layout, you may start creating pages and populating content. It's that easy.
68
70
 
69
- For more information please [see Wiki pages](https://github.com/comfy/comfortable-mexican-sofa/wiki).
71
+ For more information please refer to [Wiki](https://github.com/comfy/comfortable-mexican-sofa/wiki).
70
72
 
71
73
  ![Sofa's Page Edit View](https://github.com/comfy/comfortable-mexican-sofa/raw/master/doc/preview.png)
72
74
 
73
- Help and Contact
74
- ----------------
75
+ #### Dependencies
76
+
77
+ As long as you sucessfuly ran `bundle install` you should be ok. However, Paperclip requires *ImageMagick* to be installed to handle thumbnail generation.
78
+
79
+ #### Help and Contact
75
80
 
76
81
  GoogleGroups: http://groups.google.com/group/comfortable-mexican-sofa
77
82
  Twitter: [@GroceryBagHead](http://twitter.com/#!/GroceryBagHead)
@@ -81,3 +86,7 @@ Twitter: [@GroceryBagHead](http://twitter.com/#!/GroceryBagHead)
81
86
  ComfortableMexicanSofa is released under the [MIT license](https://github.com/comfy/comfortable-mexican-sofa/raw/master/LICENSE)
82
87
 
83
88
  Copyright 2009-2014 Oleg Khabarov
89
+
90
+ ---
91
+
92
+ DOGE: DMTBhZjcgUZunCKMpKCJogBXBhQx2h7h5c
data/Rakefile CHANGED
@@ -1,21 +1,29 @@
1
- require_relative 'config/application'
1
+ require 'bundler'
2
+ Bundler.setup
3
+
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:ci) do |t|
7
+ t.libs << 'test'
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ t.verbose = true
10
+ end
2
11
 
12
+ require_relative 'config/application'
3
13
  ComfortableMexicanSofa::Application.load_tasks
4
14
 
5
15
  namespace :test do
6
-
7
16
  Rake::TestTask.new(:lib) do |t|
8
17
  t.libs << 'test'
9
18
  t.pattern = 'test/lib/**/*_test.rb'
10
19
  t.verbose = true
11
20
  end
12
-
21
+
13
22
  Rake::TestTask.new(:generators) do |t|
14
23
  t.libs << 'test'
15
24
  t.pattern = 'test/generators/**/*_test.rb'
16
25
  t.verbose = true
17
26
  end
18
-
19
27
  end
20
28
 
21
29
  Rake::Task[:test].enhance do
@@ -1,6 +1,7 @@
1
1
  #= require jquery
2
2
  #= require jquery_ujs
3
3
  #= require jquery.ui.all
4
+ #= require tinymce-jquery
4
5
  #= require codemirror
5
6
  #= require codemirror/modes/css
6
7
  #= require codemirror/modes/htmlmixed
@@ -8,10 +9,9 @@
8
9
  #= require codemirror/modes/markdown
9
10
  #= require codemirror/modes/xml
10
11
  #= require codemirror/addons/edit/closetag
11
- #= require comfortable_mexican_sofa/lib/bootstrap
12
- #= require comfortable_mexican_sofa/lib/wysihtml5
13
- #= require comfortable_mexican_sofa/lib/bootstrap-wysihtml5
12
+ #= require bootstrap
14
13
  #= require comfortable_mexican_sofa/lib/bootstrap-datetimepicker
14
+ #= require comfortable_mexican_sofa/lib/diff
15
15
 
16
16
  $ ->
17
17
  CMS.init()
@@ -52,12 +52,13 @@ window.CMS.slugify = ->
52
52
 
53
53
 
54
54
  window.CMS.wysiwyg = ->
55
- $('textarea[data-cms-rich-text]').each (i, element) ->
56
- $(element).wysihtml5
57
- html: true
58
- color: false
59
- stylesheets: []
60
-
55
+ tinymce.init
56
+ selector: 'textarea[data-cms-rich-text]'
57
+ plugins: ['link', 'image', 'code']
58
+ toolbar: 'undo redo | styleselect | bullist numlist | link unlink image | code'
59
+ menubar: false
60
+ statusbar: false
61
+ relative_urls: false
61
62
 
62
63
  window.CMS.codemirror = ->
63
64
  $('textarea[data-cms-cm-mode]').each (i, element) ->
@@ -95,7 +96,7 @@ window.CMS.page_blocks = ->
95
96
  $('select#page_layout_id').bind 'change.cms', ->
96
97
  $.ajax
97
98
  url: $(this).data('url'),
98
- data:
99
+ data:
99
100
  layout_id: $(this).val()
100
101
  complete: ->
101
102
  CMS.wysiwyg()
@@ -0,0 +1,9 @@
1
+ #= require comfortable_mexican_sofa/lib/diff/diff_match_patch.min
2
+ #= require comfortable_mexican_sofa/lib/diff/pretty_text_diff.min
3
+
4
+ $ ->
5
+ $("table.diff").prettyTextDiff ->
6
+ cleanup: true
7
+ originalContainer: 'tr td.original'
8
+ changedContainer: 'tr td.changed'
9
+ diffContainer: 'tr td.diff'
@@ -0,0 +1,49 @@
1
+ (function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
2
+ diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
3
+ b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
4
+ diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
5
+ d):this.diff_bisect_(a,b,d)};
6
+ diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
7
+ diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
8
+ u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
9
+ diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
10
+ diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
11
+ diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
12
+ diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
13
+ diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
14
+ diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
15
+ var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
16
+ diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
17
+ d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
18
+ diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
19
+ return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
20
+ h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
21
+ diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
22
+ diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
23
+ g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
24
+ a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
25
+ diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&amp;").replace(d,"&lt;").replace(e,"&gt;").replace(f,"&para;<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
26
+ diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
27
+ diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
28
+ diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
29
+ f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
30
+ diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
31
+ k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
32
+ diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
33
+ diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
34
+ c.length+d.length;a.length2+=c.length+d.length}};
35
+ diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
36
+ if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
37
+ e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
38
+ diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
39
+ if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
40
+ j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
41
+ diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
42
+ c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
43
+ diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
44
+ j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
45
+ (h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
46
+ diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
47
+ parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
48
+ diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
49
+ this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
@@ -0,0 +1,5 @@
1
+ /*
2
+ @preserve jQuery.PrettyTextDiff 1.0.2
3
+ See https://github.com/arnab/jQuery.PrettyTextDiff/
4
+ */
5
+ (function(){var $;$=jQuery;$.fn.extend({prettyTextDiff:function(options){var dmp,settings;settings={originalContainer:".original",changedContainer:".changed",diffContainer:".diff",cleanup:true,debug:false};settings=$.extend(settings,options);$.fn.prettyTextDiff.debug("Options: ",settings,settings);dmp=new diff_match_patch;return this.each(function(){var changed,diff_as_html,diffs,original;original=$(settings.originalContainer,this).text();$.fn.prettyTextDiff.debug("Original text found: ",original,settings);changed=$(settings.changedContainer,this).text();$.fn.prettyTextDiff.debug("Changed text found: ",changed,settings);diffs=dmp.diff_main(original,changed);if(settings.cleanup){dmp.diff_cleanupSemantic(diffs)}$.fn.prettyTextDiff.debug("Diffs: ",diffs,settings);diff_as_html=diffs.map(function(diff){return $.fn.prettyTextDiff.createHTML(diff)});$(settings.diffContainer,this).html(diff_as_html.join(""));return this})}});$.fn.prettyTextDiff.debug=function(message,object,settings){if(settings.debug){return console.log(message,object)}};$.fn.prettyTextDiff.createHTML=function(diff){var data,html,operation,pattern_amp,pattern_gt,pattern_lt,pattern_para,text;html=[];pattern_amp=/&/g;pattern_lt=/</g;pattern_gt=/>/g;pattern_para=/\n/g;operation=diff[0],data=diff[1];text=data.replace(pattern_amp,"&amp;").replace(pattern_lt,"&lt;").replace(pattern_gt,"&gt;").replace(pattern_para,"<br>");switch(operation){case DIFF_INSERT:return"<ins>"+text+"</ins>";case DIFF_DELETE:return"<del>"+text+"</del>";case DIFF_EQUAL:return"<span>"+text+"</span>"}}}).call(this);
@@ -1,9 +1,7 @@
1
- //= require jquery.ui.all
2
- //= require codemirror
3
- //= require comfortable_mexican_sofa/lib/bootstrap
4
- //= require comfortable_mexican_sofa/lib/bootstrap-wysihtml5
5
- //= require comfortable_mexican_sofa/lib/bootstrap-datetimepicker
6
- //= require comfortable_mexican_sofa/bootstrap_overrides
7
- //= require comfortable_mexican_sofa/codemirror_overrides
8
- //= require comfortable_mexican_sofa/wysihtml5_overrides
9
- //= require comfortable_mexican_sofa/base
1
+ @import "jquery.ui.all"
2
+ @import "codemirror"
3
+ @import "bootstrap"
4
+ @import "comfortable_mexican_sofa/lib/bootstrap-datetimepicker"
5
+ @import "comfortable_mexican_sofa/bootstrap_overrides"
6
+ @import "comfortable_mexican_sofa/codemirror_overrides"
7
+ @import "comfortable_mexican_sofa/base"
@@ -1,3 +1,14 @@
1
+ //= depend_on_asset "comfortable_mexican_sofa/checkerboard.gif"
2
+ //= depend_on_asset "comfortable_mexican_sofa/icon_page.gif"
3
+ //= depend_on_asset "comfortable_mexican_sofa/icon_move.gif"
4
+ //= depend_on_asset "comfortable_mexican_sofa/arrow_bottom.gif"
5
+ //= depend_on_asset "comfortable_mexican_sofa/arrow_right.gif"
6
+ //= depend_on_asset "comfortable_mexican_sofa/icon_draft.gif"
7
+ //= depend_on_asset "comfortable_mexican_sofa/icon_site.gif"
8
+ //= depend_on_asset "comfortable_mexican_sofa/icon_layout.gif"
9
+ //= depend_on_asset "comfortable_mexican_sofa/icon_snippet.gif"
10
+ //= depend_on_asset "comfortable_mexican_sofa/icon_file.gif"
11
+
1
12
  html, body#comfy
2
13
  height: 100%
3
14
 
@@ -33,6 +44,7 @@ body#comfy
33
44
  .left-column-content ul.navigation
34
45
  list-style: none
35
46
  margin: 0
47
+ padding: 0
36
48
  a
37
49
  position: relative
38
50
  display: block
@@ -70,6 +82,7 @@ body#comfy
70
82
  margin-bottom: 10px
71
83
  overflow: auto
72
84
  #mirrors select
85
+ width: 100%
73
86
  margin-bottom: 0
74
87
  #form-save
75
88
  label
@@ -238,16 +251,17 @@ body#comfy
238
251
  display: none
239
252
  form
240
253
  margin: 0
241
- .input-append
242
- margin: 0
243
- input[type=text]
254
+ .input-group
255
+ input.form-control
244
256
  width: 125px
245
- font-size: 11px
246
- line-height: 14px
257
+ height: 22px
247
258
  padding: 3px
259
+ font-size: 11px
260
+ line-height: 11px
248
261
 
249
262
  // -- Sortable List -------------------------------------------------------
250
263
  ul.list
264
+ padding: 0
251
265
  margin: 0
252
266
  list-style: none
253
267
  .item
@@ -283,15 +297,16 @@ body#comfy
283
297
  float: right
284
298
  li ul
285
299
  list-style: none
300
+ padding: 0
286
301
  margin: 0 0 0 28px
287
302
 
288
303
  // -- Sites ---------------------------------------------------------------
289
- &.c-admin-cms-sites
304
+ &.c-comfy-admin-cms-sites
290
305
  table .icon
291
306
  background: url(image-path("comfortable_mexican_sofa/icon_site.gif"))
292
307
 
293
308
  // -- Layouts -------------------------------------------------------------
294
- &.c-admin-cms-layouts
309
+ &.c-comfy-admin-cms-layouts
295
310
  ul.list
296
311
  .item
297
312
  .icon
@@ -300,7 +315,7 @@ body#comfy
300
315
  margin-left: 35px
301
316
 
302
317
  // -- Pages ---------------------------------------------------------------
303
- &.c-admin-cms-pages
318
+ &.c-comfy-admin-cms-pages
304
319
  #form-blocks
305
320
  ul.nav-tabs
306
321
  margin-left: 180px
@@ -321,22 +336,34 @@ body#comfy
321
336
  font-size: 12px
322
337
 
323
338
  // -- Snippets ------------------------------------------------------------
324
- &.c-admin-cms-snippets
339
+ &.c-comfy-admin-cms-snippets
325
340
  table .icon
326
341
  background: url(image-path("comfortable_mexican_sofa/icon_snippet.gif"))
327
342
 
328
343
  // -- Files ---------------------------------------------------------------
329
- &.c-admin-cms-files
344
+ &.c-comfy-admin-cms-files
330
345
  table .icon
331
346
  background: url(image-path("comfortable_mexican_sofa/icon_file.gif"))
332
347
 
333
348
  // -- Revisions -----------------------------------------------------------
334
- &.c-admin-cms-revisions
335
- table
349
+ &.c-comfy-admin-cms-revisions
350
+ td.with-table
351
+ padding: 0
352
+ table.diff
353
+ th, td
354
+ border: 0
336
355
  th
337
- min-width: 175px
338
- td.main
339
- width: 50%
356
+ color: #ccc
357
+ width: 100%
358
+ ins, del
359
+ display: inline
360
+ ins
361
+ background-color: #c6ffc6
362
+ text-decoration: none
363
+ del
364
+ background-color: #ffc6c6
365
+ tr.hide
366
+ display: none
340
367
  .box.revisions
341
368
  a
342
369
  font-size: 11px
@@ -345,5 +372,8 @@ body#comfy
345
372
  padding: 0 7px
346
373
  border-radius: 3px
347
374
  margin-bottom: 2px
375
+ text-decoration: none
348
376
  a:hover
349
377
  background-color: #f5f5f5
378
+ a.active
379
+ border-color: #0088CC