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,449 @@
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
4
+
5
+ function insertTable() {
6
+ var formObj = document.forms[0];
7
+ var inst = tinyMCEPopup.editor, dom = inst.dom;
8
+ var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
9
+ var html = '', capEl, elm;
10
+ var cellLimit, rowLimit, colLimit;
11
+
12
+ tinyMCEPopup.restoreSelection();
13
+
14
+ if (!AutoValidator.validate(formObj)) {
15
+ tinyMCEPopup.alert(inst.getLang('invalid_data'));
16
+ return false;
17
+ }
18
+
19
+ elm = dom.getParent(inst.selection.getNode(), 'table');
20
+
21
+ // Get form data
22
+ cols = formObj.elements['cols'].value;
23
+ rows = formObj.elements['rows'].value;
24
+ border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
+ cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
+ cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
+ align = getSelectValue(formObj, "align");
28
+ frame = getSelectValue(formObj, "tframe");
29
+ rules = getSelectValue(formObj, "rules");
30
+ width = formObj.elements['width'].value;
31
+ height = formObj.elements['height'].value;
32
+ bordercolor = formObj.elements['bordercolor'].value;
33
+ bgcolor = formObj.elements['bgcolor'].value;
34
+ className = getSelectValue(formObj, "class");
35
+ id = formObj.elements['id'].value;
36
+ summary = formObj.elements['summary'].value;
37
+ style = formObj.elements['style'].value;
38
+ dir = formObj.elements['dir'].value;
39
+ lang = formObj.elements['lang'].value;
40
+ background = formObj.elements['backgroundimage'].value;
41
+ caption = formObj.elements['caption'].checked;
42
+
43
+ cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);
44
+ rowLimit = tinyMCEPopup.getParam('table_row_limit', false);
45
+ colLimit = tinyMCEPopup.getParam('table_col_limit', false);
46
+
47
+ // Validate table size
48
+ if (colLimit && cols > colLimit) {
49
+ tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));
50
+ return false;
51
+ } else if (rowLimit && rows > rowLimit) {
52
+ tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));
53
+ return false;
54
+ } else if (cellLimit && cols * rows > cellLimit) {
55
+ tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));
56
+ return false;
57
+ }
58
+
59
+ // Update table
60
+ if (action == "update") {
61
+ inst.execCommand('mceBeginUndoLevel');
62
+
63
+ dom.setAttrib(elm, 'cellPadding', cellpadding, true);
64
+ dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
65
+ dom.setAttrib(elm, 'border', border);
66
+ dom.setAttrib(elm, 'align', align);
67
+ dom.setAttrib(elm, 'frame', frame);
68
+ dom.setAttrib(elm, 'rules', rules);
69
+ dom.setAttrib(elm, 'class', className);
70
+ dom.setAttrib(elm, 'style', style);
71
+ dom.setAttrib(elm, 'id', id);
72
+ dom.setAttrib(elm, 'summary', summary);
73
+ dom.setAttrib(elm, 'dir', dir);
74
+ dom.setAttrib(elm, 'lang', lang);
75
+
76
+ capEl = inst.dom.select('caption', elm)[0];
77
+
78
+ if (capEl && !caption)
79
+ capEl.parentNode.removeChild(capEl);
80
+
81
+ if (!capEl && caption) {
82
+ capEl = elm.ownerDocument.createElement('caption');
83
+
84
+ if (!tinymce.isIE)
85
+ capEl.innerHTML = '<br _mce_bogus="1"/>';
86
+
87
+ elm.insertBefore(capEl, elm.firstChild);
88
+ }
89
+
90
+ if (width && inst.settings.inline_styles) {
91
+ dom.setStyle(elm, 'width', width);
92
+ dom.setAttrib(elm, 'width', '');
93
+ } else {
94
+ dom.setAttrib(elm, 'width', width, true);
95
+ dom.setStyle(elm, 'width', '');
96
+ }
97
+
98
+ // Remove these since they are not valid XHTML
99
+ dom.setAttrib(elm, 'borderColor', '');
100
+ dom.setAttrib(elm, 'bgColor', '');
101
+ dom.setAttrib(elm, 'background', '');
102
+
103
+ if (height && inst.settings.inline_styles) {
104
+ dom.setStyle(elm, 'height', height);
105
+ dom.setAttrib(elm, 'height', '');
106
+ } else {
107
+ dom.setAttrib(elm, 'height', height, true);
108
+ dom.setStyle(elm, 'height', '');
109
+ }
110
+
111
+ if (background != '')
112
+ elm.style.backgroundImage = "url('" + background + "')";
113
+ else
114
+ elm.style.backgroundImage = '';
115
+
116
+ /* if (tinyMCEPopup.getParam("inline_styles")) {
117
+ if (width != '')
118
+ elm.style.width = getCSSSize(width);
119
+ }*/
120
+
121
+ if (bordercolor != "") {
122
+ elm.style.borderColor = bordercolor;
123
+ elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
124
+ elm.style.borderWidth = border == "" ? "1px" : border;
125
+ } else
126
+ elm.style.borderColor = '';
127
+
128
+ elm.style.backgroundColor = bgcolor;
129
+ elm.style.height = getCSSSize(height);
130
+
131
+ inst.addVisual();
132
+
133
+ // Fix for stange MSIE align bug
134
+ //elm.outerHTML = elm.outerHTML;
135
+
136
+ inst.nodeChanged();
137
+ inst.execCommand('mceEndUndoLevel');
138
+
139
+ // Repaint if dimensions changed
140
+ if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
141
+ inst.execCommand('mceRepaint');
142
+
143
+ tinyMCEPopup.close();
144
+ return true;
145
+ }
146
+
147
+ // Create new table
148
+ html += '<table';
149
+
150
+ html += makeAttrib('id', id);
151
+ html += makeAttrib('border', border);
152
+ html += makeAttrib('cellpadding', cellpadding);
153
+ html += makeAttrib('cellspacing', cellspacing);
154
+ html += makeAttrib('_mce_new', '1');
155
+
156
+ if (width && inst.settings.inline_styles) {
157
+ if (style)
158
+ style += '; ';
159
+
160
+ // Force px
161
+ if (/^[0-9\.]+$/.test(width))
162
+ width += 'px';
163
+
164
+ style += 'width: ' + width;
165
+ } else
166
+ html += makeAttrib('width', width);
167
+
168
+ /* if (height) {
169
+ if (style)
170
+ style += '; ';
171
+
172
+ style += 'height: ' + height;
173
+ }*/
174
+
175
+ //html += makeAttrib('height', height);
176
+ //html += makeAttrib('bordercolor', bordercolor);
177
+ //html += makeAttrib('bgcolor', bgcolor);
178
+ html += makeAttrib('align', align);
179
+ html += makeAttrib('frame', frame);
180
+ html += makeAttrib('rules', rules);
181
+ html += makeAttrib('class', className);
182
+ html += makeAttrib('style', style);
183
+ html += makeAttrib('summary', summary);
184
+ html += makeAttrib('dir', dir);
185
+ html += makeAttrib('lang', lang);
186
+ html += '>';
187
+
188
+ if (caption) {
189
+ if (!tinymce.isIE)
190
+ html += '<caption><br _mce_bogus="1"/></caption>';
191
+ else
192
+ html += '<caption></caption>';
193
+ }
194
+
195
+ for (var y=0; y<rows; y++) {
196
+ html += "<tr>";
197
+
198
+ for (var x=0; x<cols; x++) {
199
+ if (!tinymce.isIE)
200
+ html += '<td><br _mce_bogus="1"/></td>';
201
+ else
202
+ html += '<td></td>';
203
+ }
204
+
205
+ html += "</tr>";
206
+ }
207
+
208
+ html += "</table>";
209
+
210
+ inst.execCommand('mceBeginUndoLevel');
211
+
212
+ // Move table
213
+ if (inst.settings.fix_table_elements) {
214
+ var patt = '';
215
+
216
+ inst.focus();
217
+ inst.selection.setContent('<br class="_mce_marker" />');
218
+
219
+ tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {
220
+ if (patt)
221
+ patt += ',';
222
+
223
+ patt += n + ' ._mce_marker';
224
+ });
225
+
226
+ tinymce.each(inst.dom.select(patt), function(n) {
227
+ inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);
228
+ });
229
+
230
+ dom.setOuterHTML(dom.select('br._mce_marker')[0], html);
231
+ } else
232
+ inst.execCommand('mceInsertContent', false, html);
233
+
234
+ tinymce.each(dom.select('table[_mce_new]'), function(node) {
235
+ var td = dom.select('td', node);
236
+
237
+ inst.selection.select(td[0], true);
238
+ inst.selection.collapse();
239
+
240
+ dom.setAttrib(node, '_mce_new', '');
241
+ });
242
+
243
+ inst.addVisual();
244
+ inst.execCommand('mceEndUndoLevel');
245
+
246
+ tinyMCEPopup.close();
247
+ }
248
+
249
+ function makeAttrib(attrib, value) {
250
+ var formObj = document.forms[0];
251
+ var valueElm = formObj.elements[attrib];
252
+
253
+ if (typeof(value) == "undefined" || value == null) {
254
+ value = "";
255
+
256
+ if (valueElm)
257
+ value = valueElm.value;
258
+ }
259
+
260
+ if (value == "")
261
+ return "";
262
+
263
+ // XML encode it
264
+ value = value.replace(/&/g, '&amp;');
265
+ value = value.replace(/\"/g, '&quot;');
266
+ value = value.replace(/</g, '&lt;');
267
+ value = value.replace(/>/g, '&gt;');
268
+
269
+ return ' ' + attrib + '="' + value + '"';
270
+ }
271
+
272
+ function init() {
273
+ tinyMCEPopup.resizeToInnerSize();
274
+
275
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
276
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
277
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
278
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
279
+
280
+ var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
281
+ var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
282
+ var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
283
+ var inst = tinyMCEPopup.editor, dom = inst.dom;
284
+ var formObj = document.forms[0];
285
+ var elm = dom.getParent(inst.selection.getNode(), "table");
286
+
287
+ action = tinyMCEPopup.getWindowArg('action');
288
+
289
+ if (!action)
290
+ action = elm ? "update" : "insert";
291
+
292
+ if (elm && action != "insert") {
293
+ var rowsAr = elm.rows;
294
+ var cols = 0;
295
+ for (var i=0; i<rowsAr.length; i++)
296
+ if (rowsAr[i].cells.length > cols)
297
+ cols = rowsAr[i].cells.length;
298
+
299
+ cols = cols;
300
+ rows = rowsAr.length;
301
+
302
+ st = dom.parseStyle(dom.getAttrib(elm, "style"));
303
+ border = trimSize(getStyle(elm, 'border', 'borderWidth'));
304
+ cellpadding = dom.getAttrib(elm, 'cellpadding', "");
305
+ cellspacing = dom.getAttrib(elm, 'cellspacing', "");
306
+ width = trimSize(getStyle(elm, 'width', 'width'));
307
+ height = trimSize(getStyle(elm, 'height', 'height'));
308
+ bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
309
+ bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
310
+ align = dom.getAttrib(elm, 'align', align);
311
+ frame = dom.getAttrib(elm, 'frame');
312
+ rules = dom.getAttrib(elm, 'rules');
313
+ className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));
314
+ id = dom.getAttrib(elm, 'id');
315
+ summary = dom.getAttrib(elm, 'summary');
316
+ style = dom.serializeStyle(st);
317
+ dir = dom.getAttrib(elm, 'dir');
318
+ lang = dom.getAttrib(elm, 'lang');
319
+ background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
320
+ formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
321
+
322
+ orgTableWidth = width;
323
+ orgTableHeight = height;
324
+
325
+ action = "update";
326
+ formObj.insert.value = inst.getLang('update');
327
+ }
328
+
329
+ addClassesToList('class', "table_styles");
330
+ TinyMCE_EditableSelects.init();
331
+
332
+ // Update form
333
+ selectByValue(formObj, 'align', align);
334
+ selectByValue(formObj, 'tframe', frame);
335
+ selectByValue(formObj, 'rules', rules);
336
+ selectByValue(formObj, 'class', className, true, true);
337
+ formObj.cols.value = cols;
338
+ formObj.rows.value = rows;
339
+ formObj.border.value = border;
340
+ formObj.cellpadding.value = cellpadding;
341
+ formObj.cellspacing.value = cellspacing;
342
+ formObj.width.value = width;
343
+ formObj.height.value = height;
344
+ formObj.bordercolor.value = bordercolor;
345
+ formObj.bgcolor.value = bgcolor;
346
+ formObj.id.value = id;
347
+ formObj.summary.value = summary;
348
+ formObj.style.value = style;
349
+ formObj.dir.value = dir;
350
+ formObj.lang.value = lang;
351
+ formObj.backgroundimage.value = background;
352
+
353
+ updateColor('bordercolor_pick', 'bordercolor');
354
+ updateColor('bgcolor_pick', 'bgcolor');
355
+
356
+ // Resize some elements
357
+ if (isVisible('backgroundimagebrowser'))
358
+ document.getElementById('backgroundimage').style.width = '180px';
359
+
360
+ // Disable some fields in update mode
361
+ if (action == "update") {
362
+ formObj.cols.disabled = true;
363
+ formObj.rows.disabled = true;
364
+ }
365
+ }
366
+
367
+ function changedSize() {
368
+ var formObj = document.forms[0];
369
+ var st = dom.parseStyle(formObj.style.value);
370
+
371
+ /* var width = formObj.width.value;
372
+ if (width != "")
373
+ st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";
374
+ else
375
+ st['width'] = "";*/
376
+
377
+ var height = formObj.height.value;
378
+ if (height != "")
379
+ st['height'] = getCSSSize(height);
380
+ else
381
+ st['height'] = "";
382
+
383
+ formObj.style.value = dom.serializeStyle(st);
384
+ }
385
+
386
+ function changedBackgroundImage() {
387
+ var formObj = document.forms[0];
388
+ var st = dom.parseStyle(formObj.style.value);
389
+
390
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
391
+
392
+ formObj.style.value = dom.serializeStyle(st);
393
+ }
394
+
395
+ function changedBorder() {
396
+ var formObj = document.forms[0];
397
+ var st = dom.parseStyle(formObj.style.value);
398
+
399
+ // Update border width if the element has a color
400
+ if (formObj.border.value != "" && formObj.bordercolor.value != "")
401
+ st['border-width'] = formObj.border.value + "px";
402
+
403
+ formObj.style.value = dom.serializeStyle(st);
404
+ }
405
+
406
+ function changedColor() {
407
+ var formObj = document.forms[0];
408
+ var st = dom.parseStyle(formObj.style.value);
409
+
410
+ st['background-color'] = formObj.bgcolor.value;
411
+
412
+ if (formObj.bordercolor.value != "") {
413
+ st['border-color'] = formObj.bordercolor.value;
414
+
415
+ // Add border-width if it's missing
416
+ if (!st['border-width'])
417
+ st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
418
+ }
419
+
420
+ formObj.style.value = dom.serializeStyle(st);
421
+ }
422
+
423
+ function changedStyle() {
424
+ var formObj = document.forms[0];
425
+ var st = dom.parseStyle(formObj.style.value);
426
+
427
+ if (st['background-image'])
428
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
429
+ else
430
+ formObj.backgroundimage.value = '';
431
+
432
+ if (st['width'])
433
+ formObj.width.value = trimSize(st['width']);
434
+
435
+ if (st['height'])
436
+ formObj.height.value = trimSize(st['height']);
437
+
438
+ if (st['background-color']) {
439
+ formObj.bgcolor.value = st['background-color'];
440
+ updateColor('bgcolor_pick','bgcolor');
441
+ }
442
+
443
+ if (st['border-color']) {
444
+ formObj.bordercolor.value = st['border-color'];
445
+ updateColor('bordercolor_pick','bordercolor');
446
+ }
447
+ }
448
+
449
+ tinyMCEPopup.onInit.add(init);
@@ -0,0 +1,74 @@
1
+ tinyMCE.addI18n('en.table_dlg',{
2
+ general_tab:"General",
3
+ advanced_tab:"Advanced",
4
+ general_props:"General properties",
5
+ advanced_props:"Advanced properties",
6
+ rowtype:"Row in table part",
7
+ title:"Insert/Modify table",
8
+ width:"Width",
9
+ height:"Height",
10
+ cols:"Cols",
11
+ rows:"Rows",
12
+ cellspacing:"Cellspacing",
13
+ cellpadding:"Cellpadding",
14
+ border:"Border",
15
+ align:"Alignment",
16
+ align_default:"Default",
17
+ align_left:"Left",
18
+ align_right:"Right",
19
+ align_middle:"Center",
20
+ row_title:"Table row properties",
21
+ cell_title:"Table cell properties",
22
+ cell_type:"Cell type",
23
+ valign:"Vertical alignment",
24
+ align_top:"Top",
25
+ align_bottom:"Bottom",
26
+ bordercolor:"Border color",
27
+ bgcolor:"Background color",
28
+ merge_cells_title:"Merge table cells",
29
+ id:"Id",
30
+ style:"Style",
31
+ langdir:"Language direction",
32
+ langcode:"Language code",
33
+ mime:"Target MIME type",
34
+ ltr:"Left to right",
35
+ rtl:"Right to left",
36
+ bgimage:"Background image",
37
+ summary:"Summary",
38
+ td:"Data",
39
+ th:"Header",
40
+ cell_cell:"Update current cell",
41
+ cell_row:"Update all cells in row",
42
+ cell_all:"Update all cells in table",
43
+ row_row:"Update current row",
44
+ row_odd:"Update odd rows in table",
45
+ row_even:"Update even rows in table",
46
+ row_all:"Update all rows in table",
47
+ thead:"Table Head",
48
+ tbody:"Table Body",
49
+ tfoot:"Table Foot",
50
+ scope:"Scope",
51
+ rowgroup:"Row Group",
52
+ colgroup:"Col Group",
53
+ col_limit:"You've exceeded the maximum number of columns of {$cols}.",
54
+ row_limit:"You've exceeded the maximum number of rows of {$rows}.",
55
+ cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
56
+ missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
57
+ caption:"Table caption",
58
+ frame:"Frame",
59
+ frame_none:"none",
60
+ frame_groups:"groups",
61
+ frame_rows:"rows",
62
+ frame_cols:"cols",
63
+ frame_all:"all",
64
+ rules:"Rules",
65
+ rules_void:"void",
66
+ rules_above:"above",
67
+ rules_below:"below",
68
+ rules_hsides:"hsides",
69
+ rules_lhs:"lhs",
70
+ rules_rhs:"rhs",
71
+ rules_vsides:"vsides",
72
+ rules_box:"box",
73
+ rules_border:"border"
74
+ });