contentment 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,269 @@
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var ed;
4
+
5
+ function init() {
6
+ ed = tinyMCEPopup.editor;
7
+ tinyMCEPopup.resizeToInnerSize();
8
+
9
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
10
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
11
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
+
13
+ var inst = ed;
14
+ var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th");
15
+ var formObj = document.forms[0];
16
+ var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
+
18
+ // Get table cell data
19
+ var celltype = tdElm.nodeName.toLowerCase();
20
+ var align = ed.dom.getAttrib(tdElm, 'align');
21
+ var valign = ed.dom.getAttrib(tdElm, 'valign');
22
+ var width = trimSize(getStyle(tdElm, 'width', 'width'));
23
+ var height = trimSize(getStyle(tdElm, 'height', 'height'));
24
+ var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25
+ var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26
+ var className = ed.dom.getAttrib(tdElm, 'class');
27
+ var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
28
+ var id = ed.dom.getAttrib(tdElm, 'id');
29
+ var lang = ed.dom.getAttrib(tdElm, 'lang');
30
+ var dir = ed.dom.getAttrib(tdElm, 'dir');
31
+ var scope = ed.dom.getAttrib(tdElm, 'scope');
32
+
33
+ // Setup form
34
+ addClassesToList('class', 'table_cell_styles');
35
+ TinyMCE_EditableSelects.init();
36
+
37
+ formObj.bordercolor.value = bordercolor;
38
+ formObj.bgcolor.value = bgcolor;
39
+ formObj.backgroundimage.value = backgroundimage;
40
+ formObj.width.value = width;
41
+ formObj.height.value = height;
42
+ formObj.id.value = id;
43
+ formObj.lang.value = lang;
44
+ formObj.style.value = ed.dom.serializeStyle(st);
45
+ selectByValue(formObj, 'align', align);
46
+ selectByValue(formObj, 'valign', valign);
47
+ selectByValue(formObj, 'class', className, true, true);
48
+ selectByValue(formObj, 'celltype', celltype);
49
+ selectByValue(formObj, 'dir', dir);
50
+ selectByValue(formObj, 'scope', scope);
51
+
52
+ // Resize some elements
53
+ if (isVisible('backgroundimagebrowser'))
54
+ document.getElementById('backgroundimage').style.width = '180px';
55
+
56
+ updateColor('bordercolor_pick', 'bordercolor');
57
+ updateColor('bgcolor_pick', 'bgcolor');
58
+ }
59
+
60
+ function updateAction() {
61
+ var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
62
+
63
+ tinyMCEPopup.restoreSelection();
64
+ el = ed.selection.getStart();
65
+ tdElm = ed.dom.getParent(el, "td,th");
66
+ trElm = ed.dom.getParent(el, "tr");
67
+ tableElm = ed.dom.getParent(el, "table");
68
+
69
+ ed.execCommand('mceBeginUndoLevel');
70
+
71
+ switch (getSelectValue(formObj, 'action')) {
72
+ case "cell":
73
+ var celltype = getSelectValue(formObj, 'celltype');
74
+ var scope = getSelectValue(formObj, 'scope');
75
+
76
+ function doUpdate(s) {
77
+ if (s) {
78
+ updateCell(tdElm);
79
+
80
+ ed.addVisual();
81
+ ed.nodeChanged();
82
+ inst.execCommand('mceEndUndoLevel');
83
+ tinyMCEPopup.close();
84
+ }
85
+ };
86
+
87
+ if (ed.getParam("accessibility_warnings", 1)) {
88
+ if (celltype == "th" && scope == "")
89
+ tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);
90
+ else
91
+ doUpdate(1);
92
+
93
+ return;
94
+ }
95
+
96
+ updateCell(tdElm);
97
+ break;
98
+
99
+ case "row":
100
+ var cell = trElm.firstChild;
101
+
102
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
103
+ cell = nextCell(cell);
104
+
105
+ do {
106
+ cell = updateCell(cell, true);
107
+ } while ((cell = nextCell(cell)) != null);
108
+
109
+ break;
110
+
111
+ case "all":
112
+ var rows = tableElm.getElementsByTagName("tr");
113
+
114
+ for (var i=0; i<rows.length; i++) {
115
+ var cell = rows[i].firstChild;
116
+
117
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
118
+ cell = nextCell(cell);
119
+
120
+ do {
121
+ cell = updateCell(cell, true);
122
+ } while ((cell = nextCell(cell)) != null);
123
+ }
124
+
125
+ break;
126
+ }
127
+
128
+ ed.addVisual();
129
+ ed.nodeChanged();
130
+ inst.execCommand('mceEndUndoLevel');
131
+ tinyMCEPopup.close();
132
+ }
133
+
134
+ function nextCell(elm) {
135
+ while ((elm = elm.nextSibling) != null) {
136
+ if (elm.nodeName == "TD" || elm.nodeName == "TH")
137
+ return elm;
138
+ }
139
+
140
+ return null;
141
+ }
142
+
143
+ function updateCell(td, skip_id) {
144
+ var inst = ed;
145
+ var formObj = document.forms[0];
146
+ var curCellType = td.nodeName.toLowerCase();
147
+ var celltype = getSelectValue(formObj, 'celltype');
148
+ var doc = inst.getDoc();
149
+ var dom = ed.dom;
150
+
151
+ if (!skip_id)
152
+ td.setAttribute('id', formObj.id.value);
153
+
154
+ td.setAttribute('align', formObj.align.value);
155
+ td.setAttribute('vAlign', formObj.valign.value);
156
+ td.setAttribute('lang', formObj.lang.value);
157
+ td.setAttribute('dir', getSelectValue(formObj, 'dir'));
158
+ td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
159
+ td.setAttribute('scope', formObj.scope.value);
160
+ ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
161
+
162
+ // Clear deprecated attributes
163
+ ed.dom.setAttrib(td, 'width', '');
164
+ ed.dom.setAttrib(td, 'height', '');
165
+ ed.dom.setAttrib(td, 'bgColor', '');
166
+ ed.dom.setAttrib(td, 'borderColor', '');
167
+ ed.dom.setAttrib(td, 'background', '');
168
+
169
+ // Set styles
170
+ td.style.width = getCSSSize(formObj.width.value);
171
+ td.style.height = getCSSSize(formObj.height.value);
172
+ if (formObj.bordercolor.value != "") {
173
+ td.style.borderColor = formObj.bordercolor.value;
174
+ td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
175
+ td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
176
+ } else
177
+ td.style.borderColor = '';
178
+
179
+ td.style.backgroundColor = formObj.bgcolor.value;
180
+
181
+ if (formObj.backgroundimage.value != "")
182
+ td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
183
+ else
184
+ td.style.backgroundImage = '';
185
+
186
+ if (curCellType != celltype) {
187
+ // changing to a different node type
188
+ var newCell = doc.createElement(celltype);
189
+
190
+ for (var c=0; c<td.childNodes.length; c++)
191
+ newCell.appendChild(td.childNodes[c].cloneNode(1));
192
+
193
+ for (var a=0; a<td.attributes.length; a++)
194
+ ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));
195
+
196
+ td.parentNode.replaceChild(newCell, td);
197
+ td = newCell;
198
+ }
199
+
200
+ dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
201
+
202
+ return td;
203
+ }
204
+
205
+ function changedBackgroundImage() {
206
+ var formObj = document.forms[0];
207
+ var st = ed.dom.parseStyle(formObj.style.value);
208
+
209
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
210
+
211
+ formObj.style.value = ed.dom.serializeStyle(st);
212
+ }
213
+
214
+ function changedSize() {
215
+ var formObj = document.forms[0];
216
+ var st = ed.dom.parseStyle(formObj.style.value);
217
+
218
+ var width = formObj.width.value;
219
+ if (width != "")
220
+ st['width'] = getCSSSize(width);
221
+ else
222
+ st['width'] = "";
223
+
224
+ var height = formObj.height.value;
225
+ if (height != "")
226
+ st['height'] = getCSSSize(height);
227
+ else
228
+ st['height'] = "";
229
+
230
+ formObj.style.value = ed.dom.serializeStyle(st);
231
+ }
232
+
233
+ function changedColor() {
234
+ var formObj = document.forms[0];
235
+ var st = ed.dom.parseStyle(formObj.style.value);
236
+
237
+ st['background-color'] = formObj.bgcolor.value;
238
+ st['border-color'] = formObj.bordercolor.value;
239
+
240
+ formObj.style.value = ed.dom.serializeStyle(st);
241
+ }
242
+
243
+ function changedStyle() {
244
+ var formObj = document.forms[0];
245
+ var st = ed.dom.parseStyle(formObj.style.value);
246
+
247
+ if (st['background-image'])
248
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
249
+ else
250
+ formObj.backgroundimage.value = '';
251
+
252
+ if (st['width'])
253
+ formObj.width.value = trimSize(st['width']);
254
+
255
+ if (st['height'])
256
+ formObj.height.value = trimSize(st['height']);
257
+
258
+ if (st['background-color']) {
259
+ formObj.bgcolor.value = st['background-color'];
260
+ updateColor('bgcolor_pick','bgcolor');
261
+ }
262
+
263
+ if (st['border-color']) {
264
+ formObj.bordercolor.value = st['border-color'];
265
+ updateColor('bordercolor_pick','bordercolor');
266
+ }
267
+ }
268
+
269
+ tinyMCEPopup.onInit.add(init);
@@ -0,0 +1,27 @@
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var MergeCellsDialog = {
4
+ init : function() {
5
+ var f = document.forms[0];
6
+
7
+ f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);
8
+ f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);
9
+ },
10
+
11
+ merge : function() {
12
+ var func, f = document.forms[0];
13
+
14
+ tinyMCEPopup.restoreSelection();
15
+
16
+ func = tinyMCEPopup.getWindowArg('onaction');
17
+
18
+ func({
19
+ cols : f.numcols.value,
20
+ rows : f.numrows.value
21
+ });
22
+
23
+ tinyMCEPopup.close();
24
+ }
25
+ };
26
+
27
+ tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);
@@ -0,0 +1,212 @@
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ function init() {
4
+ tinyMCEPopup.resizeToInnerSize();
5
+
6
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
7
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
8
+
9
+ var inst = tinyMCEPopup.editor;
10
+ var dom = inst.dom;
11
+ var trElm = dom.getParent(inst.selection.getStart(), "tr");
12
+ var formObj = document.forms[0];
13
+ var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
+
15
+ // Get table row data
16
+ var rowtype = trElm.parentNode.nodeName.toLowerCase();
17
+ var align = dom.getAttrib(trElm, 'align');
18
+ var valign = dom.getAttrib(trElm, 'valign');
19
+ var height = trimSize(getStyle(trElm, 'height', 'height'));
20
+ var className = dom.getAttrib(trElm, 'class');
21
+ var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22
+ var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
23
+ var id = dom.getAttrib(trElm, 'id');
24
+ var lang = dom.getAttrib(trElm, 'lang');
25
+ var dir = dom.getAttrib(trElm, 'dir');
26
+
27
+ // Setup form
28
+ addClassesToList('class', 'table_row_styles');
29
+ TinyMCE_EditableSelects.init();
30
+
31
+ formObj.bgcolor.value = bgcolor;
32
+ formObj.backgroundimage.value = backgroundimage;
33
+ formObj.height.value = height;
34
+ formObj.id.value = id;
35
+ formObj.lang.value = lang;
36
+ formObj.style.value = dom.serializeStyle(st);
37
+ selectByValue(formObj, 'align', align);
38
+ selectByValue(formObj, 'valign', valign);
39
+ selectByValue(formObj, 'class', className, true, true);
40
+ selectByValue(formObj, 'rowtype', rowtype);
41
+ selectByValue(formObj, 'dir', dir);
42
+
43
+ // Resize some elements
44
+ if (isVisible('backgroundimagebrowser'))
45
+ document.getElementById('backgroundimage').style.width = '180px';
46
+
47
+ updateColor('bgcolor_pick', 'bgcolor');
48
+ }
49
+
50
+ function updateAction() {
51
+ var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
52
+ var action = getSelectValue(formObj, 'action');
53
+
54
+ tinyMCEPopup.restoreSelection();
55
+ trElm = dom.getParent(inst.selection.getStart(), "tr");
56
+ tableElm = dom.getParent(inst.selection.getStart(), "table");
57
+
58
+ inst.execCommand('mceBeginUndoLevel');
59
+
60
+ switch (action) {
61
+ case "row":
62
+ updateRow(trElm);
63
+ break;
64
+
65
+ case "all":
66
+ var rows = tableElm.getElementsByTagName("tr");
67
+
68
+ for (var i=0; i<rows.length; i++)
69
+ updateRow(rows[i], true);
70
+
71
+ break;
72
+
73
+ case "odd":
74
+ case "even":
75
+ var rows = tableElm.getElementsByTagName("tr");
76
+
77
+ for (var i=0; i<rows.length; i++) {
78
+ if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
79
+ updateRow(rows[i], true, true);
80
+ }
81
+
82
+ break;
83
+ }
84
+
85
+ inst.addVisual();
86
+ inst.nodeChanged();
87
+ inst.execCommand('mceEndUndoLevel');
88
+ tinyMCEPopup.close();
89
+ }
90
+
91
+ function updateRow(tr_elm, skip_id, skip_parent) {
92
+ var inst = tinyMCEPopup.editor;
93
+ var formObj = document.forms[0];
94
+ var dom = inst.dom;
95
+ var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
96
+ var rowtype = getSelectValue(formObj, 'rowtype');
97
+ var doc = inst.getDoc();
98
+
99
+ // Update row element
100
+ if (!skip_id)
101
+ tr_elm.setAttribute('id', formObj.id.value);
102
+
103
+ tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
104
+ tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
105
+ tr_elm.setAttribute('lang', formObj.lang.value);
106
+ tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
107
+ tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
108
+ dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
109
+
110
+ // Clear deprecated attributes
111
+ tr_elm.setAttribute('background', '');
112
+ tr_elm.setAttribute('bgColor', '');
113
+ tr_elm.setAttribute('height', '');
114
+
115
+ // Set styles
116
+ tr_elm.style.height = getCSSSize(formObj.height.value);
117
+ tr_elm.style.backgroundColor = formObj.bgcolor.value;
118
+
119
+ if (formObj.backgroundimage.value != "")
120
+ tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
121
+ else
122
+ tr_elm.style.backgroundImage = '';
123
+
124
+ // Setup new rowtype
125
+ if (curRowType != rowtype && !skip_parent) {
126
+ // first, clone the node we are working on
127
+ var newRow = tr_elm.cloneNode(1);
128
+
129
+ // next, find the parent of its new destination (creating it if necessary)
130
+ var theTable = dom.getParent(tr_elm, "table");
131
+ var dest = rowtype;
132
+ var newParent = null;
133
+ for (var i = 0; i < theTable.childNodes.length; i++) {
134
+ if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
135
+ newParent = theTable.childNodes[i];
136
+ }
137
+
138
+ if (newParent == null) {
139
+ newParent = doc.createElement(dest);
140
+
141
+ if (dest == "thead") {
142
+ if (theTable.firstChild.nodeName == 'CAPTION')
143
+ inst.dom.insertAfter(newParent, theTable.firstChild);
144
+ else
145
+ theTable.insertBefore(newParent, theTable.firstChild);
146
+ } else
147
+ theTable.appendChild(newParent);
148
+ }
149
+
150
+ // append the row to the new parent
151
+ newParent.appendChild(newRow);
152
+
153
+ // remove the original
154
+ tr_elm.parentNode.removeChild(tr_elm);
155
+
156
+ // set tr_elm to the new node
157
+ tr_elm = newRow;
158
+ }
159
+
160
+ dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
161
+ }
162
+
163
+ function changedBackgroundImage() {
164
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
165
+ var st = dom.parseStyle(formObj.style.value);
166
+
167
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
168
+
169
+ formObj.style.value = dom.serializeStyle(st);
170
+ }
171
+
172
+ function changedStyle() {
173
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
174
+ var st = dom.parseStyle(formObj.style.value);
175
+
176
+ if (st['background-image'])
177
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
178
+ else
179
+ formObj.backgroundimage.value = '';
180
+
181
+ if (st['height'])
182
+ formObj.height.value = trimSize(st['height']);
183
+
184
+ if (st['background-color']) {
185
+ formObj.bgcolor.value = st['background-color'];
186
+ updateColor('bgcolor_pick','bgcolor');
187
+ }
188
+ }
189
+
190
+ function changedSize() {
191
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
192
+ var st = dom.parseStyle(formObj.style.value);
193
+
194
+ var height = formObj.height.value;
195
+ if (height != "")
196
+ st['height'] = getCSSSize(height);
197
+ else
198
+ st['height'] = "";
199
+
200
+ formObj.style.value = dom.serializeStyle(st);
201
+ }
202
+
203
+ function changedColor() {
204
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
205
+ var st = dom.parseStyle(formObj.style.value);
206
+
207
+ st['background-color'] = formObj.bgcolor.value;
208
+
209
+ formObj.style.value = dom.serializeStyle(st);
210
+ }
211
+
212
+ tinyMCEPopup.onInit.add(init);