contentment 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. data/README.rdoc +15 -0
  2. data/config/routes.rb +18 -0
  3. data/lib/contentment.rb +8 -0
  4. data/lib/contentment/engine.rb +16 -0
  5. data/lib/extensions/action_controller/base.rb +5 -0
  6. data/lib/generators/contentment/contentment_views_templates/contents/_preview.html.erb +9 -0
  7. data/lib/generators/contentment/contentment_views_templates/contents/edit.html.erb +56 -0
  8. data/lib/generators/contentment/contentment_views_templates/contents/index.html.erb +28 -0
  9. data/lib/generators/contentment/contentment_views_templates/contents/new.html.erb +37 -0
  10. data/lib/generators/contentment/contentment_views_templates/contents/show.html.erb +22 -0
  11. data/lib/generators/contentment/templates/content.rb +48 -0
  12. data/lib/generators/contentment/templates/contents_controller.rb +58 -0
  13. data/lib/generators/contentment/templates/migration.rb +24 -0
  14. data/lib/generators/contentment_generator.rb +46 -0
  15. data/lib/generators/contentment_views_generator.rb +15 -0
  16. data/public/javascripts/tiny_mce/langs/en.js +169 -0
  17. data/public/javascripts/tiny_mce/license.txt +504 -0
  18. data/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  19. data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  20. data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  21. data/public/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
  22. data/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
  23. data/public/javascripts/tiny_mce/plugins/advhr/rule.htm +62 -0
  24. data/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  25. data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  26. data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  27. data/public/javascripts/tiny_mce/plugins/advimage/image.htm +237 -0
  28. data/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  29. data/public/javascripts/tiny_mce/plugins/advimage/js/image.js +443 -0
  30. data/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
  31. data/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  32. data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  33. data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  34. data/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
  35. data/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
  36. data/public/javascripts/tiny_mce/plugins/advlink/link.htm +338 -0
  37. data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  38. data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
  39. data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  40. data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +117 -0
  41. data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  42. data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +422 -0
  43. data/public/javascripts/tiny_mce/plugins/autosave/langs/en.js +4 -0
  44. data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  45. data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  46. data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  47. data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +127 -0
  48. data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  49. data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  50. data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  51. data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  52. data/public/javascripts/tiny_mce/plugins/emotions/emotions.htm +40 -0
  53. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  54. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  55. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  56. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  57. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  58. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  59. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  60. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  61. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  62. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  63. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  64. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  65. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  66. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  67. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  68. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  69. data/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  70. data/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  71. data/public/javascripts/tiny_mce/plugins/example/dialog.htm +27 -0
  72. data/public/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
  73. data/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  74. data/public/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
  75. data/public/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
  76. data/public/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
  77. data/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  78. data/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  79. data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  80. data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +149 -0
  81. data/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +576 -0
  82. data/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +471 -0
  83. data/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  84. data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  85. data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +148 -0
  86. data/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -0
  87. data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  88. data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  89. data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  90. data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +635 -0
  91. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  92. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  93. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  94. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  95. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  96. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  97. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  98. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  99. data/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  100. data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  101. data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  102. data/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  103. data/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +212 -0
  104. data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  105. data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +133 -0
  106. data/public/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
  107. data/public/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
  108. data/public/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
  109. data/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +414 -0
  110. data/public/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
  111. data/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
  112. data/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
  113. data/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
  114. data/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
  115. data/public/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
  116. data/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
  117. data/public/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
  118. data/public/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
  119. data/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
  120. data/public/javascripts/tiny_mce/plugins/media/media.htm +822 -0
  121. data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  122. data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  123. data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  124. data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
  125. data/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
  126. data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  127. data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +77 -0
  128. data/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
  129. data/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
  130. data/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  131. data/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +929 -0
  132. data/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  133. data/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  134. data/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  135. data/public/javascripts/tiny_mce/plugins/paste/pastetext.htm +33 -0
  136. data/public/javascripts/tiny_mce/plugins/paste/pasteword.htm +27 -0
  137. data/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  138. data/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  139. data/public/javascripts/tiny_mce/plugins/preview/example.html +28 -0
  140. data/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  141. data/public/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
  142. data/public/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
  143. data/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  144. data/public/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
  145. data/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  146. data/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  147. data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  148. data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +57 -0
  149. data/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +126 -0
  150. data/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  151. data/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +104 -0
  152. data/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  153. data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  154. data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +341 -0
  155. data/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  156. data/public/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
  157. data/public/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
  158. data/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  159. data/public/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
  160. data/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +63 -0
  161. data/public/javascripts/tiny_mce/plugins/style/props.htm +730 -0
  162. data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  163. data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +112 -0
  164. data/public/javascripts/tiny_mce/plugins/table/cell.htm +183 -0
  165. data/public/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
  166. data/public/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
  167. data/public/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
  168. data/public/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
  169. data/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1118 -0
  170. data/public/javascripts/tiny_mce/plugins/table/js/cell.js +269 -0
  171. data/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  172. data/public/javascripts/tiny_mce/plugins/table/js/row.js +212 -0
  173. data/public/javascripts/tiny_mce/plugins/table/js/table.js +449 -0
  174. data/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  175. data/public/javascripts/tiny_mce/plugins/table/merge_cells.htm +37 -0
  176. data/public/javascripts/tiny_mce/plugins/table/row.htm +160 -0
  177. data/public/javascripts/tiny_mce/plugins/table/table.htm +192 -0
  178. data/public/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
  179. data/public/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
  180. data/public/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
  181. data/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  182. data/public/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
  183. data/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  184. data/public/javascripts/tiny_mce/plugins/template/template.htm +38 -0
  185. data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  186. data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +76 -0
  187. data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  188. data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +98 -0
  189. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +148 -0
  190. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +148 -0
  191. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +153 -0
  192. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +148 -0
  193. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  194. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  195. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +169 -0
  196. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  197. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +139 -0
  198. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +169 -0
  199. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  200. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  201. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +126 -0
  202. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  203. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +63 -0
  204. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +234 -0
  205. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +62 -0
  206. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  207. data/public/javascripts/tiny_mce/themes/advanced/about.htm +56 -0
  208. data/public/javascripts/tiny_mce/themes/advanced/anchor.htm +31 -0
  209. data/public/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
  210. data/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +75 -0
  211. data/public/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
  212. data/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1209 -0
  213. data/public/javascripts/tiny_mce/themes/advanced/image.htm +85 -0
  214. data/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  215. data/public/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  216. data/public/javascripts/tiny_mce/themes/advanced/js/about.js +72 -0
  217. data/public/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
  218. data/public/javascripts/tiny_mce/themes/advanced/js/charmap.js +335 -0
  219. data/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js +253 -0
  220. data/public/javascripts/tiny_mce/themes/advanced/js/image.js +245 -0
  221. data/public/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
  222. data/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js +62 -0
  223. data/public/javascripts/tiny_mce/themes/advanced/langs/en.js +62 -0
  224. data/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +51 -0
  225. data/public/javascripts/tiny_mce/themes/advanced/link.htm +63 -0
  226. data/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css +36 -0
  227. data/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +116 -0
  228. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  229. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  230. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  231. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  232. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  233. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  234. data/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +215 -0
  235. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +35 -0
  236. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +115 -0
  237. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  238. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  239. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  240. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +216 -0
  241. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  242. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  243. data/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +31 -0
  244. data/public/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
  245. data/public/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
  246. data/public/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
  247. data/public/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
  248. data/public/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
  249. data/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  250. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  251. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  252. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  253. data/public/javascripts/tiny_mce/tiny_mce.js +1 -0
  254. data/public/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
  255. data/public/javascripts/tiny_mce/tiny_mce_src.js +13771 -0
  256. data/public/javascripts/tiny_mce/utils/editable_selects.js +70 -0
  257. data/public/javascripts/tiny_mce/utils/form_utils.js +200 -0
  258. data/public/javascripts/tiny_mce/utils/mctabs.js +77 -0
  259. data/public/javascripts/tiny_mce/utils/validate.js +220 -0
  260. metadata +322 -0
data/README.rdoc ADDED
@@ -0,0 +1,15 @@
1
+ =Contentment
2
+
3
+ ===Contentment is a extremely basic Content Management System.
4
+
5
+ The primary advantage it offers over a roll-your-own CMS is consistency.
6
+ Use Contentment whenever you need a basic CMS and you can stop re-inventing the wheel and start pumping code.
7
+
8
+
9
+ ==Thanks
10
+
11
+ A thousand thanks to @modestrubyist from http://www.themodestrubyist.com/ , without whose tutorials on the subject of Rails 3 Engines I would be nowhere.
12
+
13
+ Also thanks to the thoughtbot team and the clearance gem, which I looked at to learn more. https://github.com/thoughtbot/clearance
14
+
15
+ And also finally thanks to https://github.com/elricstorm/baby_dove which is where I copied most of this from.
data/config/routes.rb ADDED
@@ -0,0 +1,18 @@
1
+ Rails.application.routes.draw do
2
+
3
+ # We are adding full resources for bird and declaring which controller to use
4
+ resources :contents#, :controller => 'baby_dove/birds'
5
+
6
+ # If you had nests and wanted to nest your nests you would do:
7
+
8
+ # resources :birds, :controller => 'baby_dove/birds' do
9
+ # resources :nests, :controller => 'baby_dove/nests'
10
+ # end
11
+
12
+ # It's that simple. Run rake routes from your 'main app' and you will see
13
+ # the routes from the engine listed after any routes you define in the main
14
+ # app.
15
+
16
+ # root :to => "baby_dove/birds#index"
17
+
18
+ end
@@ -0,0 +1,8 @@
1
+ module Contentment
2
+ # This require basically states that we're going to require the engine
3
+ # if you are using rails and your rails version is 3.x..
4
+ require 'contentment/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
5
+ end
6
+ # Adding a couple of extra files here and you can view all of the source
7
+ # to see what they have in them.
8
+ require 'extensions/action_controller/base'
@@ -0,0 +1,16 @@
1
+ require "contentment"
2
+ require "rails"
3
+ #require "action_controller"
4
+ module Contentment
5
+ class Engine < Rails::Engine
6
+ engine_name :contentment
7
+
8
+ # # We can add all of the public assets from our engine and make them
9
+ # # available to use. This allows us to use javascripts, images, stylesheets
10
+ # # etc.
11
+ # initializer "static assets" do |app|
12
+ # app.middleware.use ::ActionDispatch::Static, "#{root}/public"
13
+ # end
14
+
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ class ActionController::Base
2
+ # add methods here
3
+ private
4
+ # add more methods here
5
+ end
@@ -0,0 +1,9 @@
1
+ <div class="panel" id="preview">
2
+ <h3>Preview</h3>
3
+ <div class='content_preview_title'>
4
+ <%= raw content.title %>
5
+ </div>
6
+ <div class='content_preview_body'>
7
+ <%= raw content.body %>
8
+ </div>
9
+ </div>
@@ -0,0 +1,56 @@
1
+ <%= link_to 'New content', new_content_path, :class => 'button', :id => "add-content" %>
2
+ <%= link_to "Back to Content List", contents_path, :class => 'button', :id => 'back-to-contents' %>
3
+ <%= content_for :scripts do %>
4
+ <script src='/javascripts/tinymce_hammer.js' type='text/javascript'></script>
5
+ <script type='text/javascript'>
6
+ TinymceHammer = {
7
+ init : function() {
8
+ var init = { paste_convert_headers_to_strong : true, paste_convert_middot_lists : true, paste_remove_spans : true, paste_remove_styles : true, paste_strip_class_attributes : true, theme : "advanced", theme_advanced_buttons1 : "undo,redo,cut,copy,paste,pastetext,|,bold,italic,strikethrough,blockquote,charmap,bullist,numlist,removeformat,|,link,unlink,image,|,cleanup,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_align : "left", theme_advanced_toolbar_location : "top", valid_elements : "a[href|title,blockquote[cite],br,caption,cite,code,dl,dt,dd,em,i,img[src|alt|title|width|height|align],li,ol,p,pre,q[cite],small,strike,strong/b,sub,sup,u,ul", setup : function(ed) { ed.onKeyUp.add(function(ed, evt) { var iframe = document.getElementById('content_body_ifr'); var paul = iframe.contentWindow.document.body.innerHTML; $('.content_preview_body').html(paul); }); } };
9
+ init.mode = 'specific_textareas';
10
+ init.editor_selector = 'tinymce';
11
+ init.plugins = 'paste';
12
+ init.language = 'en';
13
+
14
+ tinyMCE.init(init);
15
+ },
16
+ addEditor : function(dom_id) {
17
+ tinyMCE.execCommand('mceAddControl', true, dom_id);
18
+ }
19
+ }
20
+ DomReady.ready(TinymceHammer.init);
21
+ </script>
22
+ <% end %>
23
+ <div class="panel clearfix">
24
+ <h3>Edit content</h3>
25
+ <% form_for(@content) do |f| %>
26
+ <div class="tools">
27
+ <%= link_to 'Back', contents_path %>
28
+ <%= f.submit 'Update' %>
29
+ </div>
30
+ <div class="main">
31
+ <%= f.text_field :title, :placeholder => "Content Title", :class => 'title' %>
32
+ <%= f.label :body %>
33
+ <%= f.tinymce :body %>
34
+ </div>
35
+ <div class="side">
36
+ <p>
37
+ <%= f.label :type %>
38
+ <%= f.select :tipe, content_tipe_options %>
39
+ </p>
40
+ <p>
41
+ <%= f.label "DOM id" %>
42
+ <%= f.text_field :dom_id %>
43
+ </p>
44
+
45
+ <p>
46
+ <%= f.label :position %>
47
+ <%= f.text_field :position %>
48
+ </p>
49
+ <p>
50
+ <%= f.label :visible %>
51
+ <%= f.check_box :visible%>
52
+ </p>
53
+ </div>
54
+ <% end %>
55
+ </div>
56
+ <%= render :partial => "preview", :locals => { :form => '.edit_content', :content => @content } %>
@@ -0,0 +1,28 @@
1
+ <div id="cms">
2
+ <%= link_to 'New content', new_content_path, :class => 'button', :id => "add-content" %>
3
+ <h1 class="intro">Content Management</h1>
4
+ <table class="alternating admin admin-table" id="content-table">
5
+ <tr>
6
+ <th>Title</th>
7
+ <th>Type</th>
8
+ <th>DOM ID</th>
9
+ <th>Position</th>
10
+
11
+ <th></th>
12
+ </tr>
13
+
14
+ <% @contents.each do |content| %>
15
+ <tr class=<%= cycle("even", "odd")%>>
16
+ <td><strong><%=h content.title %></strong></td>
17
+ <td><%=h content.tipe %></td>
18
+ <td><%=h content.dom_id %></td>
19
+ <td><%=h content.position %></td>
20
+ <td style="width: 150px;">
21
+ <%= link_to 'Show', content %>
22
+ <%= link_to 'Edit', edit_content_path(content) %>
23
+ <%= link_to 'Destroy', content, :confirm => 'Are you sure?', :method => :delete %>
24
+ </td>
25
+ </tr>
26
+ <% end %>
27
+ </table>
28
+ </div>
@@ -0,0 +1,37 @@
1
+ <div class="panel clearfix">
2
+ <h3>New content</h3>
3
+ <% form_for(@content) do |f| %>
4
+ <div class="tools">
5
+ <%= link_to 'Cancel', contents_path %>
6
+ <%= f.submit 'Create' %>
7
+ </div>
8
+
9
+ <div class="main">
10
+ <%= f.text_field :title, :placeholder => "Content Title", :class => 'title' %>
11
+
12
+ <%= f.label :body %>
13
+ <%= f.text_area :body %>
14
+
15
+ </div>
16
+ <div class="side">
17
+ <p>
18
+ <%= f.label :type %>
19
+ <%= f.select :tipe, content_tipe_options %>
20
+ </p>
21
+ <p>
22
+ <%= f.label "DOM id" %>
23
+ <%= f.text_field :dom_id %>
24
+ </p>
25
+
26
+ <p>
27
+ <%= f.label :position %>
28
+ <%= f.text_field :position %>
29
+ </p>
30
+ <p>
31
+ <%= f.label :visible %>
32
+ <%= f.check_box :visible%>
33
+ </p>
34
+ </div>
35
+ <% end %>
36
+ </div>
37
+ <%= render :partial => "preview", :locals => { :form => '.new_content', :content => @content } %>
@@ -0,0 +1,22 @@
1
+ <div class="clear">
2
+ <p>
3
+ <b>Title:</b>
4
+ <%=h @content.title %>
5
+ </p>
6
+
7
+ <p>
8
+ <b>Body:</b>
9
+ <%=h @content.body %>
10
+ </p>
11
+
12
+ <p>
13
+ <b>Type:</b>
14
+ <%=h @content.tipe %>
15
+ </p>
16
+
17
+
18
+ <%= link_to 'Edit', edit_content_path(@content) %> |
19
+ <%= link_to 'Back', contents_path %>
20
+
21
+ <%= link_to "new", new_content_path %>
22
+ </div>
@@ -0,0 +1,48 @@
1
+ class Content < ActiveRecord::Base
2
+
3
+ # ADJUST_POSTIONS DOES NOT WORK RIGHT NOW
4
+ # before_save :adjust_positions
5
+
6
+ class << self; attr_accessor :tipes; end
7
+
8
+ @tipes = [
9
+ # "Billboard",
10
+ # "What You Learn",
11
+ # "Tips",
12
+ # "Questions Copy",
13
+ # "FAQ",
14
+ # "Examples",
15
+ # "Testimonial",
16
+ # "Navigation",
17
+ ]
18
+
19
+ @tipes.each do |thing|
20
+ scope "for_#{thing.downcase.gsub(' ', '_')}".intern, where("tipe = ?", thing)
21
+ end
22
+
23
+ scope :visible, lambda {|x| where(:visible => x)}
24
+
25
+
26
+ def brothers
27
+ Content.where("tipe = ?", self.tipe).where("id NOT in (#{self.id})")
28
+ end
29
+
30
+ private
31
+ def adjust_positions
32
+
33
+ # return true unless changed.include?('position')
34
+ #
35
+ # @contents = brothers.order('position ASC')
36
+ # @contents.each_with_index do |x, idx|
37
+ # unless x.position > self.position
38
+ # if x.position
39
+ # x.update_attribute :position, x.position + 1
40
+ # else
41
+ # x.update_attribute :position, self.position + idx
42
+ # end
43
+ # end
44
+ # end
45
+ end
46
+
47
+
48
+ end
@@ -0,0 +1,58 @@
1
+ class ContentsController < ApplicationController
2
+
3
+ def index
4
+ @contents = Content.order("tipe ASC, position ASC")
5
+ respond_to do |format|
6
+ format.html
7
+ end
8
+ end
9
+
10
+ def show
11
+ @content = Content.find(params[:id])
12
+ respond_to do |format|
13
+ format.html
14
+ end
15
+ end
16
+
17
+ def new
18
+ @content = Content.new
19
+ respond_to do |format|
20
+ format.html
21
+ end
22
+ end
23
+
24
+ def edit
25
+ @content = Content.find(params[:id])
26
+ end
27
+
28
+ def create
29
+ @content = Content.new(params[:content])
30
+ respond_to do |format|
31
+ if @content.save
32
+ format.html { redirect_to edit_content_path(@content.id), :notice => 'Content was successfully created.' }
33
+ else
34
+ format.html { redirect_to new_content_path, :notice => "There was a problem creating that content" + @content.errors.full_messages.join(', ') }
35
+ end
36
+ end
37
+ end
38
+
39
+ def update
40
+ @content = Content.find(params[:id])
41
+ respond_to do |format|
42
+ if @content.save
43
+ format.html { redirect_to edit_content_path(@content.id), :notice => 'Content was successfully updated.' }
44
+ else
45
+ format.html { redirect_to new_content_path, :notice => "There was a problem updating that content" + @content.errors.full_messages.join(', ') }
46
+ end
47
+ end
48
+ end
49
+
50
+ def destroy
51
+ @content = Content.find(params[:id])
52
+ @content.destroy
53
+ respond_to do |format|
54
+ format.html { redirect_to(contents_url) }
55
+ end
56
+ end
57
+
58
+ end
@@ -0,0 +1,24 @@
1
+ # Everything listed in this migration will be added to a migration file
2
+ # inside of your main app.
3
+ class CreateContents < ActiveRecord::Migration
4
+ def self.up
5
+
6
+ # Birds Table
7
+ create_table :contents do |t|
8
+ t.string :title
9
+ t.text :body
10
+ t.string :tipe
11
+ t.string :dom_id
12
+ t.integer :position
13
+ t.boolean :visible
14
+
15
+ t.timestamps
16
+ end
17
+
18
+ end # End of self.up
19
+
20
+ def self.down
21
+ drop_table :contents
22
+ # You can drop more tables here
23
+ end # End of self.down
24
+ end
@@ -0,0 +1,46 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ class ContentmentGenerator < Rails::Generators::Base
5
+ desc "This generator creates the contents model and table"
6
+ include Rails::Generators::Migration
7
+
8
+ def self.source_root
9
+ # This must be defined. It tells the generator where to find the template for your migration.
10
+ File.join(File.dirname(__FILE__), 'contentment/templates')
11
+ end
12
+
13
+ def self.next_migration_number(dirname) #:nodoc:
14
+ if ActiveRecord::Base.timestamped_migrations
15
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
16
+ else
17
+ "%.3d" % (current_migration_number(dirname) + 1)
18
+ end
19
+ end
20
+
21
+ def install
22
+ content_model = "app/models/content.rb"
23
+ if File.exists?(content_model)
24
+ puts "Well, Fuck."
25
+ # Need to figure out how to ask the user if they would like to overwrite their model.
26
+ else
27
+ template 'content.rb', content_model
28
+ end
29
+
30
+ contents_controller = 'app/controllers/contents_controller.rb'
31
+ if File.exists?(contents_controller)
32
+ puts "Damn, him too?"
33
+ # Again, figure out how to ask the user if they want to overwrite it.
34
+ else
35
+ template 'contents_controller.rb', contents_controller
36
+ end
37
+ end
38
+
39
+ # This method is pulling all of the migration data from the migration.rb template.
40
+ # After it pulls the migration date, it generates a migration in the main application
41
+ # called create_contents...
42
+ # You can change the name of this if and when you make your own engine.
43
+ def create_migration_file
44
+ migration_template 'migration.rb', 'db/migrate/create_contents.rb'
45
+ end
46
+ end
@@ -0,0 +1,15 @@
1
+ require 'rails/generators'
2
+
3
+ class ContentmentViewsGenerator < Rails::Generators::Base
4
+ desc "This generator creates the views for Contentment"
5
+
6
+ def self.source_root
7
+ File.join(File.dirname(__FILE__), 'contentment/contentment_views_templates')
8
+ end
9
+
10
+ def install
11
+ puts "Installing Views"
12
+ directory 'contents', 'app/views/contents'
13
+ end
14
+
15
+ end
@@ -0,0 +1,169 @@
1
+ tinyMCE.addI18n({en:{
2
+ common:{
3
+ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
4
+ apply:"Apply",
5
+ insert:"Insert",
6
+ update:"Update",
7
+ cancel:"Cancel",
8
+ close:"Close",
9
+ browse:"Browse",
10
+ class_name:"Class",
11
+ not_set:"-- Not set --",
12
+ clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
13
+ clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
14
+ popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
15
+ invalid_data:"Error: Invalid values entered, these are marked in red.",
16
+ more_colors:"More colors"
17
+ },
18
+ contextmenu:{
19
+ align:"Alignment",
20
+ left:"Left",
21
+ center:"Center",
22
+ right:"Right",
23
+ full:"Full"
24
+ },
25
+ insertdatetime:{
26
+ date_fmt:"%Y-%m-%d",
27
+ time_fmt:"%H:%M:%S",
28
+ insertdate_desc:"Insert date",
29
+ inserttime_desc:"Insert time",
30
+ months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
31
+ months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
32
+ day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
33
+ day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
34
+ },
35
+ print:{
36
+ print_desc:"Print"
37
+ },
38
+ preview:{
39
+ preview_desc:"Preview"
40
+ },
41
+ directionality:{
42
+ ltr_desc:"Direction left to right",
43
+ rtl_desc:"Direction right to left"
44
+ },
45
+ layer:{
46
+ insertlayer_desc:"Insert new layer",
47
+ forward_desc:"Move forward",
48
+ backward_desc:"Move backward",
49
+ absolute_desc:"Toggle absolute positioning",
50
+ content:"New layer..."
51
+ },
52
+ save:{
53
+ save_desc:"Save",
54
+ cancel_desc:"Cancel all changes"
55
+ },
56
+ nonbreaking:{
57
+ nonbreaking_desc:"Insert non-breaking space character"
58
+ },
59
+ iespell:{
60
+ iespell_desc:"Run spell checking",
61
+ download:"ieSpell not detected. Do you want to install it now?"
62
+ },
63
+ advhr:{
64
+ advhr_desc:"Horizontal rule"
65
+ },
66
+ emotions:{
67
+ emotions_desc:"Emotions"
68
+ },
69
+ searchreplace:{
70
+ search_desc:"Find",
71
+ replace_desc:"Find/Replace"
72
+ },
73
+ advimage:{
74
+ image_desc:"Insert/edit image"
75
+ },
76
+ advlink:{
77
+ link_desc:"Insert/edit link"
78
+ },
79
+ xhtmlxtras:{
80
+ cite_desc:"Citation",
81
+ abbr_desc:"Abbreviation",
82
+ acronym_desc:"Acronym",
83
+ del_desc:"Deletion",
84
+ ins_desc:"Insertion",
85
+ attribs_desc:"Insert/Edit Attributes"
86
+ },
87
+ style:{
88
+ desc:"Edit CSS Style"
89
+ },
90
+ paste:{
91
+ paste_text_desc:"Paste as Plain Text",
92
+ paste_word_desc:"Paste from Word",
93
+ selectall_desc:"Select All"
94
+ },
95
+ paste_dlg:{
96
+ text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
97
+ text_linebreaks:"Keep linebreaks",
98
+ word_title:"Use CTRL+V on your keyboard to paste the text into the window."
99
+ },
100
+ table:{
101
+ desc:"Inserts a new table",
102
+ row_before_desc:"Insert row before",
103
+ row_after_desc:"Insert row after",
104
+ delete_row_desc:"Delete row",
105
+ col_before_desc:"Insert column before",
106
+ col_after_desc:"Insert column after",
107
+ delete_col_desc:"Remove column",
108
+ split_cells_desc:"Split merged table cells",
109
+ merge_cells_desc:"Merge table cells",
110
+ row_desc:"Table row properties",
111
+ cell_desc:"Table cell properties",
112
+ props_desc:"Table properties",
113
+ paste_row_before_desc:"Paste table row before",
114
+ paste_row_after_desc:"Paste table row after",
115
+ cut_row_desc:"Cut table row",
116
+ copy_row_desc:"Copy table row",
117
+ del:"Delete table",
118
+ row:"Row",
119
+ col:"Column",
120
+ cell:"Cell"
121
+ },
122
+ autosave:{
123
+ unload_msg:"The changes you made will be lost if you navigate away from this page.",
124
+ restore_content: "Restore auto-saved content",
125
+ warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
126
+ },
127
+ fullscreen:{
128
+ desc:"Toggle fullscreen mode"
129
+ },
130
+ media:{
131
+ desc:"Insert / edit embedded media",
132
+ edit:"Edit embedded media"
133
+ },
134
+ fullpage:{
135
+ desc:"Document properties"
136
+ },
137
+ template:{
138
+ desc:"Insert predefined template content"
139
+ },
140
+ visualchars:{
141
+ desc:"Visual control characters on/off."
142
+ },
143
+ spellchecker:{
144
+ desc:"Toggle spellchecker",
145
+ menu:"Spellchecker settings",
146
+ ignore_word:"Ignore word",
147
+ ignore_words:"Ignore all",
148
+ langs:"Languages",
149
+ wait:"Please wait...",
150
+ sug:"Suggestions",
151
+ no_sug:"No suggestions",
152
+ no_mpell:"No misspellings found."
153
+ },
154
+ pagebreak:{
155
+ desc:"Insert page break."
156
+ },
157
+ advlist : {
158
+ types : 'Types',
159
+ def : 'Default',
160
+ lower_alpha : "Lower alpha",
161
+ lower_greek : "Lower greek",
162
+ lower_roman : "Lower roman",
163
+ upper_alpha : "Upper alpha",
164
+ upper_roman : "Upper roman",
165
+ circle : "Circle",
166
+ disc : "Disc",
167
+ square : "Square"
168
+ }
169
+ }});