very_simple_cms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/app/assets/javascripts/very_simple_cms/application.js +13 -0
  5. data/app/assets/stylesheets/very_simple_cms/application.css +11 -0
  6. data/app/controllers/very_simple_cms/application_controller.rb +5 -0
  7. data/app/controllers/very_simple_cms/contents_controller.rb +24 -0
  8. data/app/helpers/very_simple_cms/application_helper.rb +4 -0
  9. data/app/helpers/very_simple_cms/cms_helper.rb +12 -0
  10. data/app/helpers/very_simple_cms/shared_helper.rb +11 -0
  11. data/app/models/very_simple_cms/html_block.rb +18 -0
  12. data/config/locales/en.yml +25 -0
  13. data/config/routes.rb +3 -0
  14. data/lib/generators/very_simple_cms/init_mercury/USAGE +5 -0
  15. data/lib/generators/very_simple_cms/init_mercury/init_mercury_generator.rb +23 -0
  16. data/lib/generators/very_simple_cms/install/USAGE +8 -0
  17. data/lib/generators/very_simple_cms/install/install_generator.rb +13 -0
  18. data/lib/generators/very_simple_cms/install/templates/very_simple_cms.rb +5 -0
  19. data/lib/tasks/very_simple_cms_tasks.rake +4 -0
  20. data/lib/very_simple_cms.rb +10 -0
  21. data/lib/very_simple_cms/engine.rb +12 -0
  22. data/lib/very_simple_cms/version.rb +3 -0
  23. data/test/controllers/very_simple_cms/mercury_controller_test.rb +11 -0
  24. data/test/dummy/README.rdoc +28 -0
  25. data/test/dummy/Rakefile +6 -0
  26. data/test/dummy/app/assets/javascripts/application.js +16 -0
  27. data/test/dummy/app/assets/javascripts/jquery-migrate-1.2.1.js +521 -0
  28. data/test/dummy/app/assets/javascripts/mercury.js +466 -0
  29. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  30. data/test/dummy/app/assets/stylesheets/mercury.css +24 -0
  31. data/test/dummy/app/controllers/application_controller.rb +5 -0
  32. data/test/dummy/app/controllers/home_controller.rb +8 -0
  33. data/test/dummy/app/helpers/application_helper.rb +2 -0
  34. data/test/dummy/app/views/home/index.html.erb +6 -0
  35. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  36. data/test/dummy/app/views/layouts/mercury.html.erb +23 -0
  37. data/test/dummy/bin/bundle +3 -0
  38. data/test/dummy/bin/rails +4 -0
  39. data/test/dummy/bin/rake +4 -0
  40. data/test/dummy/config.ru +4 -0
  41. data/test/dummy/config/application.rb +25 -0
  42. data/test/dummy/config/boot.rb +5 -0
  43. data/test/dummy/config/cms/en/html_blocks.yml +5 -0
  44. data/test/dummy/config/environment.rb +5 -0
  45. data/test/dummy/config/environments/development.rb +29 -0
  46. data/test/dummy/config/environments/production.rb +80 -0
  47. data/test/dummy/config/environments/test.rb +36 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/dummy/config/initializers/inflections.rb +16 -0
  51. data/test/dummy/config/initializers/mime_types.rb +5 -0
  52. data/test/dummy/config/initializers/secret_token.rb +12 -0
  53. data/test/dummy/config/initializers/session_store.rb +3 -0
  54. data/test/dummy/config/initializers/very_simple_cms.rb +5 -0
  55. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  56. data/test/dummy/config/routes.rb +6 -0
  57. data/test/dummy/db/development.sqlite3 +0 -0
  58. data/test/dummy/db/production.sqlite3 +0 -0
  59. data/test/dummy/db/test.sqlite3 +0 -0
  60. data/test/dummy/log/development.log +137166 -0
  61. data/test/dummy/public/404.html +58 -0
  62. data/test/dummy/public/422.html +58 -0
  63. data/test/dummy/public/500.html +57 -0
  64. data/test/dummy/public/favicon.ico +0 -0
  65. data/test/dummy/test/controllers/home_controller_test.rb +9 -0
  66. data/test/dummy/test/helpers/home_helper_test.rb +4 -0
  67. data/test/dummy/tmp/cache/assets/development/sprockets/00028b58c446030f0a22a1487048f26e +0 -0
  68. data/test/dummy/tmp/cache/assets/development/sprockets/0011c19b61bf0cbb75ba5e38cfbc8f4a +0 -0
  69. data/test/dummy/tmp/cache/assets/development/sprockets/0056c6a977a6621634d152495de3e50b +0 -0
  70. data/test/dummy/tmp/cache/assets/development/sprockets/03286b9cf6c6936d9e5de9e03eb90629 +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/042924c8dc663a08ff4f578aae5e401a +0 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/04610e1e97561c1369476d2cac734f96 +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/0547284c2aa807a01748608afd3b246b +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/05b68fdb5b2be635ca3f9127f4e6664b +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/05e22fca4dc1ff6f6dd92b4876a17e12 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/069d29d8087b95440f66630c6be179c6 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/070c39c9857466a8056ee6c51eddd61a +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/07e05dc6915f3c6b44c56ef93ccfd679 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/094b8a5ad28463cd36bcbf460b6fda3a +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/097aab472504b7036dd50080711115d5 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/0a2f898a4ca4b7894ae835f3f4bd4dbe +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/0ab32bb38bff6508b9688cc8cfa2e985 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/0abacf1cac04a2924f538dd84567fc27 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/0be22cbbb82e3ee0835cbb82e5d5afdd +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/0e70e976a3755b6b9f73dbc091765298 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/0fe44f741a34c6e1728c1d18074a42bb +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/111ae2afecf72d393a8ab217fd390cab +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/1186f2f017052067d2688d49c58f897f +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/13381ea8fe8186c9082457b1ca436a44 +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/160f8969745daeddaccd35d9865ed32c +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/16309321034042426f4676685eafd9a4 +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/1a2e2e0caec22ba25a62a24f56fed1ed +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/1b4b0f6b69ae4c0e84721cc94aa24c27 +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/1b50cf55f3ea26aa7fc741106557d2af +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/1c2cc2736c7f3e0b2c1bbe84162913b7 +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/1e1691fb0af836958c3f42d4299420ab +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/1fd334d8d091ada842e3c5f244b63776 +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/203f749a4445e3d5710358a0e192c356 +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/2128cc4ce36f010671a73f5cc170574c +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/22243978a6018f594b5c32c2d0608049 +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/23ab1b58b0208524613a1cf15344ccb4 +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/2414a260a1dc4173edc185b522739a96 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/24a23dea7bf76a85ea24d7dcdf012eb6 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/250850c5c73a7b377fd488ff97fda5bc +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/252783037314754cd74202b1bd3c1764 +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/253ea5e9ee11e9bf78ab11fbbb24aeea +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/275e8c0919fd7691d77be1bb294acd8e +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/27b34f6c5a9ebb842deda38918318b63 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/2822de3b22c28bd5e718c9bf500457b2 +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/28bcf08e243ef91d93bb0d94ff0da92a +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/2e23c0f83ead4785c49d7d22361822ec +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/3011758443aae913685406ad32f1da8f +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/30257b53609415ba56a0ce8d703c818b +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/317605da70af48a0ef493bde3e8cf45d +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/31d01c58c9c7cad25dcd83c9f5cd25f7 +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/32f4a63af43b8900fcb9e0684b83f367 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/34dcbcfd24d807342f53f7506dfc8640 +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/35e64f6e8f93306394e042c8b02f2faf +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/35fd2ca177cb329aa28ba615284db4ea +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/36c614d095441c52f002152dceffc034 +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/37dd1c0b34fa3234950dd3a2cb3d37ef +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/39c98fd88d6c5d785221b6f0c7c17810 +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/3ce32327a4aa979ffe948c500cd442e7 +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/3d3c80668f91ee6ba9ed9794a705b4ab +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/3dee23eaec5b033aeb282aa63f673f44 +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/3e0fa12d0a217ab84534aea831780a62 +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/40fc2f3d2a468a00e463f1d313cb1683 +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/4101b8ce6db4a81c7c2f92e2a4748df6 +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/43728809634137be9d0f408ff3ac00ac +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/4474d5f5b3c2b54e18f90d0bfff46d4b +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/447afa649a0f9543e6d6a0673d3fb90b +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/46e004e51b097ec92b47cbf8dc00cd50 +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/48391eb2fe95e89abb300fa22e932492 +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/48fce556721c7aed1bf5aa18d05b3e4a +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/4bb5b142a3a26ad5887c736365eab2b3 +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/4cdca8861e5697a7b196e8894b2fad72 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/4cf155bced1ad00eca81cd38cbf6653e +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/4e8df1428a05b9d4cf8ad3d869fe7c97 +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/4eb985f0de8b1ca4daf53f4447fe1fbe +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/4f0b190a3f75907643118cbdffaba8a6 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/4f26b3b69b612c3a20e0f9bbedeeaf94 +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/4f5d00ac6c6f239ba7d62de2a8b36c8f +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/50ca6135906f23cd05cfcc76cec88060 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/50f9c217b84f2a4ca760bfb4c9c58ce7 +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/517b83bd35bb1c1d8441b6d1742d1edd +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/53255340b736d5503b0212b2620e7366 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/58570c7fc74fa8d4fe84fe262c0318db +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/59263637894c92e6b5984a836a070a7d +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/5a872425c7c20380737f8b35ea98651a +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/5befdfec92399ba2764396a8b88ff905 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/5c9ac835188361d529481ceb86531752 +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/5ecdda1098202f0881e8956ca8cfc8a1 +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/5fc9bb4a3f6c5c855b150ea9c6453d78 +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/5fe00e5f355f8021c1b3cdd7b16328e8 +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/6095dba6ff77f2d4d591fd4a7f5cda43 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/61a2d79a975c9ba040b9707b77d2fc6e +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/625e8bf6225593d031c2eb6bbbce6191 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/63e7e4f72dff5241891a355df25c8603 +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/64615a7f88ec704431cb2d1c66bdab69 +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/6616eaf3a2cfb073f67ec54e34253f6e +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/667caa8cc4c56de908e1f970cff05ade +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/689cedf626851fe962212833d5d64c47 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/69b71774683a0b2affaba265d760d427 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/6b1d7509f56240c61db27483e81fac80 +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/6ba1c49316b6f7d1b57327c9ea52409e +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/6bdefc01a361f5b773bd0c74e6b85e16 +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/6c17f7b897decc616d880cf1ef731320 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/6c593e78216456242fd13d025774cb7f +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/708a9d2a0a4e28443ea136e3783096bb +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/71150bc46bff3fa1a5dd11a28c6a071b +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/71d544a8af8d6d869a805f3d1772c93f +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/739435551a4e53b0b2ab94a92359982b +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/75f9e7b1613516c481d205f0831aef26 +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/7697ec3a4ad7f6c93a24b7c83b82c580 +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/76acc0441fa1b421a0abffc1c488828c +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/773640e6f537c89520a5e11439b8c50b +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/7963d8da93a0fa44a418039413b13482 +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/7997d8546b947030bc84ac33afb7718c +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/7be9721e07140c43a1eef7aeda57151f +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/7c6e3dcaf6c4ac2b38c81d5d502ecca6 +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/7e6139eff3130c4bb6ca407e75d80848 +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/7e8950cc26f3274854f27f98b8c223d5 +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/7eac0bd722538bff660891166c1e9b53 +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/7fe6fd2ee31c1d41180d60d3571e0110 +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/806d337ed4d52c04650b22d66ac722f7 +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/81cc7f3409821cf6b3263e7e513c2f5f +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/8204f2c32be4ddb7276b3dfa8671a8cd +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/83c4d0d51d3013a10d2f75db31b1db4c +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/83cb1ae689fb63cc982244306079bdc8 +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/841429c0109e0561ecc16135f7186b02 +0 -0
  195. data/test/dummy/tmp/cache/assets/development/sprockets/843b3747ed1d70aa603e3c81849532c0 +0 -0
  196. data/test/dummy/tmp/cache/assets/development/sprockets/84d9c3abfd9f3f3d99f1476fddc1416c +0 -0
  197. data/test/dummy/tmp/cache/assets/development/sprockets/880a65555873bb4be57309e8d9ed3a5c +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/880dc5be8ff6d18d5b9ff4d4efd05bbd +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/89ceb5681b3cd99eb764b881ba4400e1 +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/89dd18f1230829eb2a531c7a95c6e473 +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/8bb5bc1930e988adf41ce08f2a594949 +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/914cdcacc0ff7e67ecc65a1b0c2bf067 +0 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/9170d0829f2d4403620d643baa13fcb4 +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/91f10278ea8b4ee3b3431bdedb0f7a86 +0 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/92b5a0793333cfeb22dfa4fd5b2b6310 +0 -0
  206. data/test/dummy/tmp/cache/assets/development/sprockets/93ffcd15f7a59c783058c550dff53bf1 +0 -0
  207. data/test/dummy/tmp/cache/assets/development/sprockets/96e2084e5a1dcdaa48e4c3a8fefbb2c0 +0 -0
  208. data/test/dummy/tmp/cache/assets/development/sprockets/970542737e7326f868fac80bc50c3c89 +0 -0
  209. data/test/dummy/tmp/cache/assets/development/sprockets/9777128a1f39e5e33734721652515fcc +0 -0
  210. data/test/dummy/tmp/cache/assets/development/sprockets/9965e775a68466a0c06445ae181e1da2 +0 -0
  211. data/test/dummy/tmp/cache/assets/development/sprockets/998de3d617c2d6d8e43a7aa8ed832a0d +0 -0
  212. data/test/dummy/tmp/cache/assets/development/sprockets/9ab4fe4f05b539887f78500a083b98a5 +0 -0
  213. data/test/dummy/tmp/cache/assets/development/sprockets/9ac336bbd29e3a6dcb4d83ab31175409 +0 -0
  214. data/test/dummy/tmp/cache/assets/development/sprockets/9d48f0895b21d893c206ad3b4116ecce +0 -0
  215. data/test/dummy/tmp/cache/assets/development/sprockets/9dae23b2eb2b755cdd78cb66f571ec46 +0 -0
  216. data/test/dummy/tmp/cache/assets/development/sprockets/9e38d199dd0930eb63bd491e2585b561 +0 -0
  217. data/test/dummy/tmp/cache/assets/development/sprockets/a098ec3b2944d747536bec7a4dc245c6 +0 -0
  218. data/test/dummy/tmp/cache/assets/development/sprockets/a4479fef973c8052f59186ba1d4af4d1 +0 -0
  219. data/test/dummy/tmp/cache/assets/development/sprockets/a4d027bbc293c3c6d9d1e87c419c98fb +0 -0
  220. data/test/dummy/tmp/cache/assets/development/sprockets/a5606ffb50d930c124310b95834f2a4d +0 -0
  221. data/test/dummy/tmp/cache/assets/development/sprockets/a6910f8c4ba8ab19c1696dcd8851de96 +0 -0
  222. data/test/dummy/tmp/cache/assets/development/sprockets/a76c6f639bf5bf8c160266d7f9e70a98 +0 -0
  223. data/test/dummy/tmp/cache/assets/development/sprockets/a77130ae0d4adcdffac3d56b1d89d68e +0 -0
  224. data/test/dummy/tmp/cache/assets/development/sprockets/a9f028f7a492b5907ed80268be8f50f4 +0 -0
  225. data/test/dummy/tmp/cache/assets/development/sprockets/aa75ca15eb15f4f9650c0aea9e39a5f0 +0 -0
  226. data/test/dummy/tmp/cache/assets/development/sprockets/ab5a07129b7fd15d88d5d936f861ba9b +0 -0
  227. data/test/dummy/tmp/cache/assets/development/sprockets/abac9398b6ce20b4edecaf30586e3a8f +0 -0
  228. data/test/dummy/tmp/cache/assets/development/sprockets/ae35cc3853457a324107891944e6e7e5 +0 -0
  229. data/test/dummy/tmp/cache/assets/development/sprockets/aed4dba27191a711313d47a58bdaf291 +0 -0
  230. data/test/dummy/tmp/cache/assets/development/sprockets/af92c83d77100ddf17bc9270fa954c79 +0 -0
  231. data/test/dummy/tmp/cache/assets/development/sprockets/b0f28b51bc444f30b2eeb7c80d12af56 +0 -0
  232. data/test/dummy/tmp/cache/assets/development/sprockets/b27abf7dbc85cbaf33dccbbe254fbfa7 +0 -0
  233. data/test/dummy/tmp/cache/assets/development/sprockets/b287b6a93b7b56384b809becd443529a +0 -0
  234. data/test/dummy/tmp/cache/assets/development/sprockets/b2ca595f430a45eed21c908e5c85c349 +0 -0
  235. data/test/dummy/tmp/cache/assets/development/sprockets/b2ffbb1ed0fdca048006a7a06b481bd7 +0 -0
  236. data/test/dummy/tmp/cache/assets/development/sprockets/b35f1f2d72ecf1f5182797a6c1a41ffc +0 -0
  237. data/test/dummy/tmp/cache/assets/development/sprockets/b3a17ba95c8abd1b1ab1cb25e69babb2 +0 -0
  238. data/test/dummy/tmp/cache/assets/development/sprockets/b3e6a09325d8a69c99c78c2ab518bcda +0 -0
  239. data/test/dummy/tmp/cache/assets/development/sprockets/b4d7b5258ded169a5ab02611d400727f +0 -0
  240. data/test/dummy/tmp/cache/assets/development/sprockets/b5bd64a83afdc1eb8995c2514be4bf63 +0 -0
  241. data/test/dummy/tmp/cache/assets/development/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  242. data/test/dummy/tmp/cache/assets/development/sprockets/b9f602aff99fc22416cdde210a4adcb7 +0 -0
  243. data/test/dummy/tmp/cache/assets/development/sprockets/ba25ba5d88cd5822faecbcb96eaccb83 +0 -0
  244. data/test/dummy/tmp/cache/assets/development/sprockets/ba4793f1526f99fd87917a445ae24624 +0 -0
  245. data/test/dummy/tmp/cache/assets/development/sprockets/bb4b6471f09cc9d75b59e564b6134e14 +0 -0
  246. data/test/dummy/tmp/cache/assets/development/sprockets/bccd838465bcfe1b5104689e55582187 +0 -0
  247. data/test/dummy/tmp/cache/assets/development/sprockets/bcd141ebf67cc98fb6882eb82d8689b9 +0 -0
  248. data/test/dummy/tmp/cache/assets/development/sprockets/bdd93dca532d6de6a34086003dfc44f8 +0 -0
  249. data/test/dummy/tmp/cache/assets/development/sprockets/bf027344ea9f4bfb241e8e465c851c3a +0 -0
  250. data/test/dummy/tmp/cache/assets/development/sprockets/bff630c7aa970e14ddf407f04e94658d +0 -0
  251. data/test/dummy/tmp/cache/assets/development/sprockets/c02fe0360f4aa271bf6d1398d3f0552a +0 -0
  252. data/test/dummy/tmp/cache/assets/development/sprockets/c06389fc49af2bbb10efb3ca611a3b7c +0 -0
  253. data/test/dummy/tmp/cache/assets/development/sprockets/c0d6117f60ad60d57f85e5d55103eb4a +0 -0
  254. data/test/dummy/tmp/cache/assets/development/sprockets/c1b7fcd07fdbeadf93c3c2debe92beba +0 -0
  255. data/test/dummy/tmp/cache/assets/development/sprockets/c2d3f2caa64c79d33ffbad0043398fe3 +0 -0
  256. data/test/dummy/tmp/cache/assets/development/sprockets/c503600ec9cdf4b204d7d75a5edbc8eb +0 -0
  257. data/test/dummy/tmp/cache/assets/development/sprockets/c833f6867baa50c9e2459432e36bab9d +0 -0
  258. data/test/dummy/tmp/cache/assets/development/sprockets/c8f11a1b68820a03840803612bcd32a7 +0 -0
  259. data/test/dummy/tmp/cache/assets/development/sprockets/ca49e464ab73a27251187dd909165c69 +0 -0
  260. data/test/dummy/tmp/cache/assets/development/sprockets/caddd644f7d3ee375572e58a20213b35 +0 -0
  261. data/test/dummy/tmp/cache/assets/development/sprockets/cb9ece3b5d3823e47f01b97c6f018522 +0 -0
  262. data/test/dummy/tmp/cache/assets/development/sprockets/ccd5cfbec1ebd7c2d3e2d1f081193ac4 +0 -0
  263. data/test/dummy/tmp/cache/assets/development/sprockets/cce68f414ed574403bb7cfede848b78e +0 -0
  264. data/test/dummy/tmp/cache/assets/development/sprockets/cedf7b6a3921e2658c93ae686134c6e3 +0 -0
  265. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  266. data/test/dummy/tmp/cache/assets/development/sprockets/d0a0940b55e2a10317580396db3256c9 +0 -0
  267. data/test/dummy/tmp/cache/assets/development/sprockets/d0b6672a6c0b4ea31e1a6ab2e85de4b9 +0 -0
  268. data/test/dummy/tmp/cache/assets/development/sprockets/d267459f312fa4e5ecca4f94daf7560e +0 -0
  269. data/test/dummy/tmp/cache/assets/development/sprockets/d2afff46e4bf390929cffd0e71e85bfe +0 -0
  270. data/test/dummy/tmp/cache/assets/development/sprockets/d2c61b3a231107ed97e316d07f619489 +0 -0
  271. data/test/dummy/tmp/cache/assets/development/sprockets/d342ab3e8f13aa1f6a0f493c5b1ce46e +0 -0
  272. data/test/dummy/tmp/cache/assets/development/sprockets/d34c24d82badddc9ba03f204d05eaf0d +0 -0
  273. data/test/dummy/tmp/cache/assets/development/sprockets/d3c3de17681063c79cd77eac60d0274c +0 -0
  274. data/test/dummy/tmp/cache/assets/development/sprockets/d6e6146eeb1fc717dd6fea654d079083 +0 -0
  275. data/test/dummy/tmp/cache/assets/development/sprockets/d7276a1023afbb69794002b1f5b603a6 +0 -0
  276. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  277. data/test/dummy/tmp/cache/assets/development/sprockets/d869ad2a53f75a5129de23c56264519d +0 -0
  278. data/test/dummy/tmp/cache/assets/development/sprockets/d869c0302ce3b91a207ffcff2d0aeb7f +0 -0
  279. data/test/dummy/tmp/cache/assets/development/sprockets/d8eb6cdd088e1ef9f4ff5db326895fc7 +0 -0
  280. data/test/dummy/tmp/cache/assets/development/sprockets/d90283f77a0493b539c41e3b664bbf8c +0 -0
  281. data/test/dummy/tmp/cache/assets/development/sprockets/d9313c7a91193d501b87ae6c04180b3d +0 -0
  282. data/test/dummy/tmp/cache/assets/development/sprockets/d9b5a6a505e5a5d89bd693ac6fcba773 +0 -0
  283. data/test/dummy/tmp/cache/assets/development/sprockets/db0d324ab8edb4318df4ec60695487f2 +0 -0
  284. data/test/dummy/tmp/cache/assets/development/sprockets/db6480d4fb79806aadb21318201422e7 +0 -0
  285. data/test/dummy/tmp/cache/assets/development/sprockets/dbbf9635406623ff3bcf54f61e9ff220 +0 -0
  286. data/test/dummy/tmp/cache/assets/development/sprockets/dbbfea5309666de81e34fd84a90c8199 +0 -0
  287. data/test/dummy/tmp/cache/assets/development/sprockets/dbecb399b20a9bcc813b96e1740eebf9 +0 -0
  288. data/test/dummy/tmp/cache/assets/development/sprockets/ddd1a183b4d8c54f52c1673f7bfa7f97 +0 -0
  289. data/test/dummy/tmp/cache/assets/development/sprockets/ddf5eac39c10a72904d7d2f7fcdfb37d +0 -0
  290. data/test/dummy/tmp/cache/assets/development/sprockets/de91fa09fccdb5c53ad711f62c22ba69 +0 -0
  291. data/test/dummy/tmp/cache/assets/development/sprockets/df8aaea491f36e722c969f3c11582208 +0 -0
  292. data/test/dummy/tmp/cache/assets/development/sprockets/e239ba3477f86205d48ba1b3b8ea6240 +0 -0
  293. data/test/dummy/tmp/cache/assets/development/sprockets/e3ca14e93b890ede9c281d6eb74e7fbe +0 -0
  294. data/test/dummy/tmp/cache/assets/development/sprockets/e527a968c24a6c4fb386cd68ba9b259f +0 -0
  295. data/test/dummy/tmp/cache/assets/development/sprockets/e52e91c8e44bf16e44402a285c0849f2 +0 -0
  296. data/test/dummy/tmp/cache/assets/development/sprockets/e671a27105bf981f91ad9ab34e76440a +0 -0
  297. data/test/dummy/tmp/cache/assets/development/sprockets/e68bffc7be46d1ad5b17ff900d7a6aeb +0 -0
  298. data/test/dummy/tmp/cache/assets/development/sprockets/e78dc61048d62c6251b04f36fecd09b2 +0 -0
  299. data/test/dummy/tmp/cache/assets/development/sprockets/e8ff0908f381593cd234318fedbd9344 +0 -0
  300. data/test/dummy/tmp/cache/assets/development/sprockets/e92d00a987ccf1bad18583d0945e8b27 +0 -0
  301. data/test/dummy/tmp/cache/assets/development/sprockets/e9b65cbbbbe6ddadeed072df32042baa +0 -0
  302. data/test/dummy/tmp/cache/assets/development/sprockets/eb474af33c68e37bafb705e9b552dbcc +0 -0
  303. data/test/dummy/tmp/cache/assets/development/sprockets/ebdbd594563090002d0b6d21a80812d6 +0 -0
  304. data/test/dummy/tmp/cache/assets/development/sprockets/ed1a6e00a3d9b858d7ac4c91a9830f37 +0 -0
  305. data/test/dummy/tmp/cache/assets/development/sprockets/edbef6e0d0a4742346cf479f2c522eb0 +0 -0
  306. data/test/dummy/tmp/cache/assets/development/sprockets/ef45f10846a61f9e21392e805b6d641d +0 -0
  307. data/test/dummy/tmp/cache/assets/development/sprockets/efb49c23ef255baa659719490ab15912 +0 -0
  308. data/test/dummy/tmp/cache/assets/development/sprockets/f0b7a8ce1e177c1301ae79d37219749c +0 -0
  309. data/test/dummy/tmp/cache/assets/development/sprockets/f1da9db4546c9a30394f470f1216464d +0 -0
  310. data/test/dummy/tmp/cache/assets/development/sprockets/f28c753bf8cb7b7dc27fb3ff2e967000 +0 -0
  311. data/test/dummy/tmp/cache/assets/development/sprockets/f393566de24990d79ad31cbea9787d52 +0 -0
  312. data/test/dummy/tmp/cache/assets/development/sprockets/f4f9061e48ee5a9ea5d50e158ff99a9d +0 -0
  313. data/test/dummy/tmp/cache/assets/development/sprockets/f5b58ca493a9b10e4d2052f999340598 +0 -0
  314. data/test/dummy/tmp/cache/assets/development/sprockets/f5ba8070d8a5b22c99345a3a7b80a0c9 +0 -0
  315. data/test/dummy/tmp/cache/assets/development/sprockets/f61b2c6c72d37020e009920eb142f37a +0 -0
  316. data/test/dummy/tmp/cache/assets/development/sprockets/f699d7b90862831dae589e8d29fdd5e2 +0 -0
  317. data/test/dummy/tmp/cache/assets/development/sprockets/f7a8456d35999a5d8d1ee8535fac0976 +0 -0
  318. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  319. data/test/dummy/tmp/cache/assets/development/sprockets/f8a4be08405068ee38629b5ed9175b2b +0 -0
  320. data/test/dummy/tmp/cache/assets/development/sprockets/f9a0336b589eb3a497b9b07725d26478 +0 -0
  321. data/test/dummy/tmp/cache/assets/development/sprockets/fae9990c3279fc65ae2691ca0283c38e +0 -0
  322. data/test/dummy/tmp/cache/assets/development/sprockets/fbf0091f4247e5a1692445ecf9db232a +0 -0
  323. data/test/dummy/tmp/cache/assets/development/sprockets/fc6fdc8f00670c4544a83882fb2380c2 +0 -0
  324. data/test/dummy/tmp/cache/assets/development/sprockets/fd5120ba1a2854bcecbb9cb24a69c9b6 +0 -0
  325. data/test/dummy/tmp/cache/assets/development/sprockets/fd70bc873f3fa61b20d0a8cdb0208c78 +0 -0
  326. data/test/helpers/very_simple_cms/cms_helper_test.rb +6 -0
  327. data/test/helpers/very_simple_cms/mercury_helper_test.rb +6 -0
  328. data/test/integration/navigation_test.rb +10 -0
  329. data/test/test_helper.rb +15 -0
  330. data/test/very_simple_cms_test.rb +7 -0
  331. metadata +716 -0
@@ -0,0 +1,466 @@
1
+ /*!
2
+ * Mercury Editor is a CoffeeScript and jQuery based WYSIWYG editor. Documentation and other useful information can be
3
+ * found at https://github.com/jejacks0n/mercury
4
+ *
5
+ * Minimum jQuery requirements are 1.7
6
+ *= require_self
7
+ *
8
+ * You can include the Rails jQuery ujs script here to get some nicer behaviors in modals, panels and lightviews when
9
+ * using :remote => true within the contents rendered in them.
10
+ * require jquery_ujs
11
+ *
12
+ * Add any requires for the support libraries that integrate nicely with Mercury Editor.
13
+ * require mercury/support/history
14
+ *
15
+ * Require Mercury Editor itself.
16
+ *= require mercury/mercury
17
+ *
18
+ * Require any localizations you wish to support
19
+ * Example: es.locale, or fr.locale -- regional dialects are in each language file so never en_US for instance.
20
+ * Make sure you enable the localization feature in the configuration.
21
+ * require mercury/locales/swedish_chef.locale
22
+ *
23
+ * Add all requires for plugins that extend or change the behavior of Mercury Editor.
24
+ * require mercury/plugins/save_as_xml/plugin.js
25
+ *
26
+ * Require any files you want to use that either extend, or change the default Mercury behavior.
27
+ * require mercury_overrides
28
+ */
29
+ window.Mercury = {
30
+
31
+ // # Mercury Configuration
32
+ config: {
33
+ // ## Toolbars
34
+ //
35
+ // This is where you can customize the toolbars by adding or removing buttons, or changing them and their
36
+ // behaviors. Any top level object put here will create a new toolbar. Buttons are simply nested inside the
37
+ // toolbars, along with button groups.
38
+ //
39
+ // Some toolbars are custom (the snippets toolbar for instance), and to denote that use _custom: true. You can then
40
+ // build the toolbar yourself with it's own behavior.
41
+ //
42
+ // Buttons can be grouped, and a button group is simply a way to wrap buttons for styling -- they can also handle
43
+ // enabling or disabling all the buttons within it by using a context. The table button group is a good example of
44
+ // this.
45
+ //
46
+ // It's important to note that each of the button names (keys), in each toolbar object must be unique, regardless of
47
+ // if it's in a button group, or nested, etc. This is because styling is applied to them by name, and because their
48
+ // name is used in the event that's fired when you click on them.
49
+ //
50
+ // Button format: `[label, description, {type: action, type: action, etc}]`
51
+ //
52
+ // ### The available button types are:
53
+ //
54
+ // - toggle: toggles on or off when clicked, otherwise behaves like a button
55
+ // - modal: opens a modal window, expects the action to be one of:
56
+ // 1. a string url
57
+ // 2. a function that returns a string url
58
+ // - lightview: opens a lightview window (like modal, but different UI), expects the action to be one of:
59
+ // 1. a string url
60
+ // 2. a function that returns a string url
61
+ // - panel: opens a panel dialog, expects the action to be one of:
62
+ // 1. a string url
63
+ // 2. a function that returns a string url
64
+ // - palette: opens a palette window, expects the action to be one of:
65
+ // 1. a string url
66
+ // 2. a function that returns a string url
67
+ // - select: opens a pulldown style window, expects the action to be one of:
68
+ // 1. a string url
69
+ // 2. a function that returns a string url
70
+ // - context: calls a callback function, expects the action to be:
71
+ // 1. a function that returns a boolean to highlight the button
72
+ // note: if a function isn't provided, the key will be passed to the contextHandler, in which case a default
73
+ // context will be used (for more info read the Contexts section below)
74
+ // - mode: toggle a given mode in the editor, expects the action to be:
75
+ // 1. a string, denoting the name of the mode
76
+ // note: it's assumed that when a specific mode is turned on, all other modes will be turned off, which happens
77
+ // automatically, thus putting the editor into a specific "state"
78
+ // - regions: allows buttons to be enabled/disabled based on what region type has focus, expects:
79
+ // 1. an array of region types (eg. ['full', 'markdown'])
80
+ // - preload: allows some dialog views to be loaded when the button is created instead of on first open, expects:
81
+ // 1. a boolean true / false
82
+ // note: this is only used by panels, selects, and palettes
83
+ //
84
+ // Separators are any "button" that's not an array, and are expected to be a string. You can use two different
85
+ // separator styles: line ('-'), and spacer (' ').
86
+ //
87
+ // ### Adding Contexts
88
+ //
89
+ // Contexts are used callback functions used for highlighting and disabling/enabling buttons and buttongroups. When
90
+ // the cursor enters an element within an html region for instance we want to disable or highlight buttons based on
91
+ // the properties of the given node. You can see examples of contexts in, and add your own to:
92
+ // `Mercury.Toolbar.Button.contexts` and `Mercury.Toolbar.ButtonGroup.contexts`
93
+ toolbars: {
94
+ primary: {
95
+ save: ['Save', 'Save this page'],
96
+ preview: ['Preview', 'Preview this page', { toggle: true, mode: true }],
97
+ sep1: ' ',
98
+ undoredo: {
99
+ undo: ['Undo', 'Undo your last action'],
100
+ redo: ['Redo', 'Redo your last action'],
101
+ sep: ' '
102
+ },
103
+ insertLink: ['Link', 'Insert Link', { modal: '/mercury/modals/link.html', regions: ['full', 'markdown'] }],
104
+ insertMedia: ['Media', 'Insert Media (images and videos)', { modal: '/mercury/modals/media.html', regions: ['full', 'markdown'] }],
105
+ insertTable: ['Table', 'Insert Table', { modal: '/mercury/modals/table.html', regions: ['full', 'markdown'] }],
106
+ insertCharacter: ['Character', 'Special Characters', { modal: '/mercury/modals/character.html', regions: ['full', 'markdown'] }],
107
+ snippetPanel: ['Snippet', 'Snippet Panel', { panel: '/mercury/panels/snippets.html' }],
108
+ sep2: ' ',
109
+ historyPanel: ['History', 'Page Version History', { panel: '/mercury/panels/history.html' }],
110
+ sep3: ' ',
111
+ notesPanel: ['Notes', 'Page Notes', { panel: '/mercury/panels/notes.html' }]
112
+ },
113
+
114
+ editable: {
115
+ _regions: ['full', 'markdown'],
116
+ predefined: {
117
+ style: ['Style', null, { select: '/mercury/selects/style.html', preload: true }],
118
+ sep1: ' ',
119
+ formatblock: ['Block Format', null, { select: '/mercury/selects/formatblock.html', preload: true }],
120
+ sep2: '-'
121
+ },
122
+ colors: {
123
+ backColor: ['Background Color', null, { palette: '/mercury/palettes/backcolor.html', context: true, preload: true, regions: ['full'] }],
124
+ sep1: ' ',
125
+ foreColor: ['Text Color', null, { palette: '/mercury/palettes/forecolor.html', context: true, preload: true, regions: ['full'] }],
126
+ sep2: '-'
127
+ },
128
+ decoration: {
129
+ bold: ['Bold', null, { context: true }],
130
+ italic: ['Italicize', null, { context: true }],
131
+ overline: ['Overline', null, { context: true, regions: ['full'] }],
132
+ strikethrough: ['Strikethrough', null, { context: true, regions: ['full'] }],
133
+ underline: ['Underline', null, { context: true, regions: ['full'] }],
134
+ sep: '-'
135
+ },
136
+ script: {
137
+ subscript: ['Subscript', null, { context: true }],
138
+ superscript: ['Superscript', null, { context: true }],
139
+ sep: '-'
140
+ },
141
+ justify: {
142
+ justifyLeft: ['Align Left', null, { context: true, regions: ['full'] }],
143
+ justifyCenter: ['Center', null, { context: true, regions: ['full'] }],
144
+ justifyRight: ['Align Right', null, { context: true, regions: ['full'] }],
145
+ justifyFull: ['Justify Full', null, { context: true, regions: ['full'] }],
146
+ sep: '-'
147
+ },
148
+ list: {
149
+ insertUnorderedList: ['Unordered List', null, { context: true }],
150
+ insertOrderedList: ['Numbered List', null, { context: true }],
151
+ sep: '-'
152
+ },
153
+ indent: {
154
+ outdent: ['Decrease Indentation'],
155
+ indent: ['Increase Indentation'],
156
+ sep: '-'
157
+ },
158
+ table: {
159
+ _context: true,
160
+ insertRowBefore: ['Insert Table Row', 'Insert a table row before the cursor', { regions: ['full'] }],
161
+ insertRowAfter: ['Insert Table Row', 'Insert a table row after the cursor', { regions: ['full'] }],
162
+ deleteRow: ['Delete Table Row', 'Delete this table row', { regions: ['full'] }],
163
+ insertColumnBefore: ['Insert Table Column', 'Insert a table column before the cursor', { regions: ['full'] }],
164
+ insertColumnAfter: ['Insert Table Column', 'Insert a table column after the cursor', { regions: ['full'] }],
165
+ deleteColumn: ['Delete Table Column', 'Delete this table column', { regions: ['full'] }],
166
+ sep1: ' ',
167
+ increaseColspan: ['Increase Cell Columns', 'Increase the cells colspan'],
168
+ decreaseColspan: ['Decrease Cell Columns', 'Decrease the cells colspan and add a new cell'],
169
+ increaseRowspan: ['Increase Cell Rows', 'Increase the cells rowspan'],
170
+ decreaseRowspan: ['Decrease Cell Rows', 'Decrease the cells rowspan and add a new cell'],
171
+ sep2: '-'
172
+ },
173
+ rules: {
174
+ horizontalRule: ['Horizontal Rule', 'Insert a horizontal rule'],
175
+ sep1: '-'
176
+ },
177
+ formatting: {
178
+ removeFormatting: ['Remove Formatting', 'Remove formatting for the selection', { regions: ['full'] }],
179
+ sep2: ' '
180
+ },
181
+ editors: {
182
+ htmlEditor: ['Edit HTML', 'Edit the HTML content', { regions: ['full'] }]
183
+ }
184
+ },
185
+
186
+ snippets: {
187
+ _custom: true,
188
+ actions: {
189
+ editSnippet: ['Edit Snippet Settings'],
190
+ sep1: ' ',
191
+ removeSnippet: ['Remove Snippet']
192
+ }
193
+ }
194
+ },
195
+
196
+
197
+ // ## Region Options
198
+ //
199
+ // You can customize some aspects of how regions are found, identified, and saved.
200
+ //
201
+ // attribute: Mercury identifies editable regions by a data-mercury attribute. This attribute has to be added in
202
+ // your HTML in advance, and is the only real code/naming exposed in the implementation of Mercury. To allow this
203
+ // to be as configurable as possible, you can set the name of this attribute. If you change this, you should adjust
204
+ // the injected styles as well.
205
+ //
206
+ // identifier: This is used as a unique identifier for any given region (and thus should be unique to the page).
207
+ // By default this is the id attribute but can be changed to a data attribute should you want to use something
208
+ // custom instead.
209
+ //
210
+ // dataAttributes: The dataAttributes is an array of data attributes that will be serialized and returned to the
211
+ // server upon saving. These attributes, when applied to a Mercury region element, will be automatically serialized
212
+ // and submitted with the AJAX request sent when a page is saved. These are expected to be HTML5 data attributes,
213
+ // and 'data-' will automatically be prepended to each item in this directive. (ex. ['scope', 'version'])
214
+ //
215
+ // determineType: This function is called after checking the data-type attribute for the correct field type. Use
216
+ // it if you want to dynamically set the type based on inspection of the region.
217
+ regions: {
218
+ attribute: 'data-mercury',
219
+ identifier: 'id',
220
+ dataAttributes: []
221
+ // determineType: function(region){},
222
+ },
223
+
224
+
225
+ // ## Snippet Options / Preview
226
+ //
227
+ // When a user drags a snippet onto the page they'll be prompted to enter options for the given snippet. The server
228
+ // is expected to respond with a form. Once the user submits this form, an Ajax request is sent to the server with
229
+ // the options provided; this preview request is expected to respond with the rendered markup for the snippet.
230
+ //
231
+ // method: The HTTP method used when submitting both the options and the preview. We use POST by default because a
232
+ // snippet options form may contain large text inputs and we don't want that to be truncated when sent to the
233
+ // server.
234
+ //
235
+ // optionsUrl: The url that the options form will be loaded from.
236
+ //
237
+ // previewUrl: The url that the options will be submitted to, and will return the rendered snippet markup.
238
+ //
239
+ // **Note:** `:name` will be replaced with the snippet name in the urls (eg. /mercury/snippets/example/options.html)
240
+ snippets: {
241
+ method: 'POST',
242
+ optionsUrl: '/mercury/snippets/:name/options.html',
243
+ previewUrl: '/mercury/snippets/:name/preview.html'
244
+ },
245
+
246
+
247
+ // ## Image Uploading
248
+ //
249
+ // If you drag images from your desktop into regions that support it, it will be uploaded to the server and inserted
250
+ // into the region. You can disable or enable this feature, the accepted mime-types, file size restrictions, and
251
+ // other things related to uploading.
252
+ //
253
+ // **Note:** Image uploading is only supported in some region types, and some browsers.
254
+ //
255
+ // enabled: You can set this to true, or false if you want to disable the feature entirely.
256
+ //
257
+ // allowedMimeTypes: You can restrict the types of files that can be uploaded by providing a list of allowed mime
258
+ // types.
259
+ //
260
+ // maxFileSize: You can restrict large files by setting the maxFileSize (in bytes).
261
+ //
262
+ // inputName: When uploading, a form is generated and submitted to the server via Ajax. If your server would prefer
263
+ // a different name for how the image comes through, you can change the inputName.
264
+ //
265
+ // url: The url that the image upload will be submitted to.
266
+ //
267
+ // handler: You can use false to let Mercury handle it for you, or you can provide a handler function that can
268
+ // modify the response from the server. This can be useful if your server doesn't respond the way Mercury expects.
269
+ // The handler function should take the response from the server and return an object that matches:
270
+ // `{image: {url: '[your provided url]'}`
271
+ uploading: {
272
+ enabled: true,
273
+ allowedMimeTypes: ['image/jpeg', 'image/gif', 'image/png'],
274
+ maxFileSize: 1235242880,
275
+ inputName: 'image[image]',
276
+ url: '/mercury/images',
277
+ handler: false
278
+ },
279
+
280
+
281
+ // ## Localization / I18n
282
+ //
283
+ // Include the .locale files you want to support when loading Mercury. The files are always named by the language,
284
+ // and not the regional dialect (eg. en.locale.js) because the regional dialects are nested within the primary
285
+ // locale files.
286
+ //
287
+ // The client locale will be used first, and if no proper locale file is found for their language then the fallback
288
+ // preferredLocale configuration will be used. If one isn't provided, and the client locale isn't included, the
289
+ // strings will remain untranslated.
290
+ //
291
+ // enabled: Set to false to disable, true to enable.
292
+ //
293
+ // preferredLocale: If a client doesn't support the locales you've included, this is used as a fallback.
294
+ localization: {
295
+ enabled: false,
296
+ preferredLocale: 'swedish_chef-BORK'
297
+ },
298
+
299
+
300
+ // ## Behaviors
301
+ //
302
+ // Behaviors are used to change the default behaviors of a given region type when a given button is clicked. For
303
+ // example, you may prefer to add HR tags using an HR wrapped within a div with a classname (for styling). You
304
+ // can add your own complex behaviors here and they'll be shared across all regions.
305
+ //
306
+ // If you want to add behaviors to specific region types, you can mix them into the actions property of any region
307
+ // type.
308
+ //
309
+ // Mercury.Regions.Full.actions.htmlEditor = function() {}
310
+ //
311
+ // You can see how the behavior matches up directly with the button names. It's also important to note that the
312
+ // callback functions are executed within the scope of the given region, so you have access to all it's methods.
313
+ behaviors: {
314
+ //foreColor: function(selection, options) { selection.wrap('<span style="color:' + options.value.toHex() + '">', true) },
315
+ htmlEditor: function() { Mercury.modal('/mercury/modals/htmleditor.html', { title: 'HTML Editor', fullHeight: true, handler: 'htmlEditor' }); }
316
+ },
317
+
318
+
319
+ // ## Global Behaviors
320
+ //
321
+ // Global behaviors are much like behaviors, but are more "global". Things like save, exit, etc. can be included
322
+ // here. They'll only be called once, and execute within the scope of whatever editor is instantiated (eg.
323
+ // PageEditor).
324
+ //
325
+ // An example of changing how saving works:
326
+ //
327
+ // save: function() {
328
+ // var data = top.JSON.stringify(this.serialize(), null, ' ');
329
+ // var content = '<textarea style="width:500px;height:200px" wrap="off">' + data + '</textarea>';
330
+ // Mercury.modal(null, {title: 'Saving', closeButton: true, content: content})
331
+ // }
332
+ //
333
+ // This is a nice way to add functionality, when the behaviors aren't region specific. These can be triggered by a
334
+ // button, or manually with `Mercury.trigger('action', {action: 'barrelRoll'})`
335
+ globalBehaviors: {
336
+ exit: function() { window.location.href = this.iframeSrc() },
337
+ barrelRoll: function() { $('body').css({webkitTransform: 'rotate(360deg)'}) }
338
+ },
339
+
340
+
341
+ // ## Ajax and CSRF Headers
342
+ //
343
+ // Some server frameworks require that you provide a specific header for Ajax requests. The values for these CSRF
344
+ // tokens are typically stored in the rendered DOM. By default, Mercury will look for the Rails specific meta tag,
345
+ // and provide the X-CSRF-Token header on Ajax requests, but you can modify this configuration if the system you're
346
+ // using doesn't follow the same standard.
347
+ csrfSelector: 'meta[name="csrf-token"]',
348
+ csrfHeader: 'X-CSRF-Token',
349
+
350
+
351
+ // ## Editor URLs
352
+ //
353
+ // When loading a given page, you may want to tweak this regex. It's to allow the url to differ from the page
354
+ // you're editing, and the url at which you access it.
355
+ editorUrlRegEx: /([http|https]:\/\/.[^\/]*)\/editor\/?(.*)/i,
356
+
357
+
358
+ // ## Hijacking Links & Forms
359
+ //
360
+ // Mercury will hijack links and forms that don't have a target set, or the target is set to _self and will set it
361
+ // to _parent. This is because the target must be set properly for Mercury to not get in the way of some
362
+ // functionality, like proper page loads on form submissions etc. Mercury doesn't do this to links or forms that
363
+ // are within editable regions because it doesn't want to impact the html that's saved. With that being explained,
364
+ // you can add classes to links or forms that you don't want this behavior added to. Let's say you have links that
365
+ // open a lightbox style window, and you don't want the targets of these to be set to _parent. You can add classes
366
+ // to this array, and they will be ignored when the hijacking is applied.
367
+ nonHijackableClasses: [],
368
+
369
+
370
+ // ## Pasting & Sanitizing
371
+ //
372
+ // When pasting content into Mercury it may sometimes contain HTML tags and attributes. This markup is used to
373
+ // style the content and makes the pasted content look (and behave) the same as the original content. This can be a
374
+ // desired feature or an annoyance, so you can enable various sanitizing methods to clean the content when it's
375
+ // pasted.
376
+ //
377
+ // sanitize: Can be any of the following:
378
+ // - false: no sanitizing is done, the content is pasted the exact same as it was copied by the user
379
+ // - 'whitelist': content is cleaned using the settings specified in the tag white list (described below)
380
+ // - 'text': all html is stripped before pasting, leaving only the raw text
381
+ //
382
+ // whitelist: The white list allows you to specify tags and attributes that are allowed when pasting content. Each
383
+ // item in this object should contain the allowed tag, and an array of attributes that are allowed on that tag. If
384
+ // the allowed attributes array is empty, all attributes will be removed. If a tag is not present in this list, it
385
+ // will be removed, but without removing any of the text or tags inside it.
386
+ //
387
+ // **Note:** Content is *always* sanitized if looks like it's from MS Word or similar editors regardless of this
388
+ // configuration.
389
+ pasting: {
390
+ sanitize: 'whitelist',
391
+ whitelist: {
392
+ h1: [],
393
+ h2: [],
394
+ h3: [],
395
+ h4: [],
396
+ h5: [],
397
+ h6: [],
398
+ table: [],
399
+ thead: [],
400
+ tbody: [],
401
+ tfoot: [],
402
+ tr: [],
403
+ th: ['colspan', 'rowspan'],
404
+ td: ['colspan', 'rowspan'],
405
+ div: ['class'],
406
+ span: ['class'],
407
+ ul: [],
408
+ ol: [],
409
+ li: [],
410
+ b: [],
411
+ strong: [],
412
+ i: [],
413
+ em: [],
414
+ u: [],
415
+ strike: [],
416
+ br: [],
417
+ p: [],
418
+ hr: [],
419
+ a: ['href', 'target', 'title', 'name'],
420
+ img: ['src', 'title', 'alt']
421
+ }
422
+ },
423
+
424
+
425
+ // ## Injected Styles
426
+ //
427
+ // Mercury tries to stay as much out of your code as possible, but because regions appear within your document we
428
+ // need to include a few styles to indicate regions, as well as the different states of them (eg. focused). These
429
+ // styles are injected into your document, and as simple as they might be, you may want to change them.
430
+ injectedStyles: '' +
431
+ '[data-mercury] { min-height: 10px; outline: 1px dotted #09F } ' +
432
+ '[data-mercury]:focus { outline: none; -webkit-box-shadow: 0 0 10px #09F, 0 0 1px #045; box-shadow: 0 0 10px #09F, 0 0 1px #045 }' +
433
+ '[data-mercury].focus { outline: none; -webkit-box-shadow: 0 0 10px #09F, 0 0 1px #045; box-shadow: 0 0 10px #09F, 0 0 1px #045 }' +
434
+ '[data-mercury]:after { content: "."; display: block; visibility: hidden; clear: both; height: 0; overflow: hidden; }' +
435
+ '[data-mercury] table { border: 1px dotted red; min-width: 6px; }' +
436
+ '[data-mercury] th { border: 1px dotted red; min-width: 6px; }' +
437
+ '[data-mercury] td { border: 1px dotted red; min-width: 6px; }' +
438
+ '[data-mercury] .mercury-textarea { border: 0; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; resize: none; }' +
439
+ '[data-mercury] .mercury-textarea:focus { outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }'
440
+ },
441
+
442
+ // ## Silent Mode
443
+ //
444
+ // Turning silent mode on will disable asking about unsaved changes before leaving the page.
445
+ silent: false,
446
+
447
+ // ## Debug Mode
448
+ //
449
+ // Turning debug mode on will log events and other various things (using console.debug if available).
450
+ debug: false
451
+
452
+ };
453
+
454
+ $(window).on('mercury:ready', function() {
455
+ var link = $('.admin_edit_link');
456
+
457
+ if(Mercury.saveUrl !== null) {
458
+ Mercury.saveUrl = link.attr('data-save-url');
459
+ }
460
+ link.hide(Mercury.saveUrl);
461
+ });
462
+
463
+ $(window).on('mercury:saved', function() {
464
+ window.location = window.location.href.replace(/\/editor\//i, '/');
465
+ });
466
+