use_tinymce 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.markdown +48 -0
  3. data/Rakefile +44 -0
  4. data/assets/tinymce/changelog.txt +1303 -0
  5. data/assets/tinymce/examples/accessibility.html +101 -0
  6. data/assets/tinymce/examples/css/content.css +105 -0
  7. data/assets/tinymce/examples/css/word.css +53 -0
  8. data/assets/tinymce/examples/custom_formats.html +111 -0
  9. data/assets/tinymce/examples/full.html +101 -0
  10. data/assets/tinymce/examples/index.html +10 -0
  11. data/assets/tinymce/examples/lists/image_list.js +9 -0
  12. data/assets/tinymce/examples/lists/link_list.js +10 -0
  13. data/assets/tinymce/examples/lists/media_list.js +14 -0
  14. data/assets/tinymce/examples/lists/template_list.js +9 -0
  15. data/assets/tinymce/examples/media/logo.jpg +0 -0
  16. data/assets/tinymce/examples/media/logo_over.jpg +0 -0
  17. data/assets/tinymce/examples/media/sample.avi +0 -0
  18. data/assets/tinymce/examples/media/sample.dcr +0 -0
  19. data/assets/tinymce/examples/media/sample.flv +0 -0
  20. data/assets/tinymce/examples/media/sample.mov +0 -0
  21. data/assets/tinymce/examples/media/sample.ram +1 -0
  22. data/assets/tinymce/examples/media/sample.rm +0 -0
  23. data/assets/tinymce/examples/media/sample.swf +0 -0
  24. data/assets/tinymce/examples/menu.html +18 -0
  25. data/assets/tinymce/examples/simple.html +47 -0
  26. data/assets/tinymce/examples/skins.html +216 -0
  27. data/assets/tinymce/examples/templates/layout1.htm +15 -0
  28. data/assets/tinymce/examples/templates/snippet1.htm +1 -0
  29. data/assets/tinymce/examples/word.html +72 -0
  30. data/assets/tinymce/jscripts/tiny_mce/langs/en.js +223 -0
  31. data/assets/tinymce/jscripts/tiny_mce/license.txt +504 -0
  32. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  33. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  34. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  35. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
  36. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js +7 -0
  37. data/assets/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm +58 -0
  38. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  39. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  40. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  41. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm +235 -0
  42. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  43. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js +458 -0
  44. data/assets/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js +45 -0
  45. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  46. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  47. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  48. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js +532 -0
  49. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js +54 -0
  50. data/assets/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm +338 -0
  51. data/assets/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  52. data/assets/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js +161 -0
  53. data/assets/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
  54. data/assets/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js +169 -0
  55. data/assets/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  56. data/assets/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +128 -0
  57. data/assets/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  58. data/assets/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js +431 -0
  59. data/assets/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js +4 -0
  60. data/assets/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  61. data/assets/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  62. data/assets/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  63. data/assets/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +161 -0
  64. data/assets/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  65. data/assets/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  66. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  67. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  68. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm +41 -0
  69. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  70. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  71. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  72. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  73. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  74. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  75. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  76. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  77. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  78. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  79. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  80. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  81. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  82. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  83. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  84. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  85. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  86. data/assets/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  87. data/assets/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm +22 -0
  88. data/assets/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
  89. data/assets/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  90. data/assets/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif +0 -0
  91. data/assets/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js +19 -0
  92. data/assets/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js +3 -0
  93. data/assets/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  94. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css +143 -0
  95. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  96. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +399 -0
  97. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm +259 -0
  98. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js +232 -0
  99. data/assets/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  100. data/assets/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  101. data/assets/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -0
  102. data/assets/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
  103. data/assets/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  104. data/assets/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  105. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  106. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +696 -0
  107. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  108. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  109. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  110. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  111. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  112. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  113. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  114. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  115. data/assets/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  116. data/assets/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  117. data/assets/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  118. data/assets/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  119. data/assets/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js +214 -0
  120. data/assets/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  121. data/assets/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  122. data/assets/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js +1 -0
  123. data/assets/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js +617 -0
  124. data/assets/tinymce/jscripts/tiny_mce/plugins/media/css/media.css +17 -0
  125. data/assets/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
  126. data/assets/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js +770 -0
  127. data/assets/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js +73 -0
  128. data/assets/tinymce/jscripts/tiny_mce/plugins/media/js/media.js +354 -0
  129. data/assets/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js +109 -0
  130. data/assets/tinymce/jscripts/tiny_mce/plugins/media/media.htm +812 -0
  131. data/assets/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  132. data/assets/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  133. data/assets/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  134. data/assets/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  135. data/assets/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +92 -0
  136. data/assets/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  137. data/assets/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  138. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  139. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js +933 -0
  140. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  141. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  142. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  143. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm +27 -0
  144. data/assets/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm +21 -0
  145. data/assets/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  146. data/assets/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  147. data/assets/tinymce/jscripts/tiny_mce/plugins/preview/example.html +28 -0
  148. data/assets/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  149. data/assets/tinymce/jscripts/tiny_mce/plugins/preview/preview.html +17 -0
  150. data/assets/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
  151. data/assets/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  152. data/assets/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
  153. data/assets/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  154. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  155. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  156. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +61 -0
  157. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +142 -0
  158. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  159. data/assets/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
  160. data/assets/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  161. data/assets/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  162. data/assets/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +435 -0
  163. data/assets/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  164. data/assets/tinymce/jscripts/tiny_mce/plugins/style/css/props.css +13 -0
  165. data/assets/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
  166. data/assets/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  167. data/assets/tinymce/jscripts/tiny_mce/plugins/style/js/props.js +635 -0
  168. data/assets/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js +70 -0
  169. data/assets/tinymce/jscripts/tiny_mce/plugins/style/props.htm +838 -0
  170. data/assets/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  171. data/assets/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +114 -0
  172. data/assets/tinymce/jscripts/tiny_mce/plugins/table/cell.htm +178 -0
  173. data/assets/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css +17 -0
  174. data/assets/tinymce/jscripts/tiny_mce/plugins/table/css/row.css +25 -0
  175. data/assets/tinymce/jscripts/tiny_mce/plugins/table/css/table.css +13 -0
  176. data/assets/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
  177. data/assets/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js +1202 -0
  178. data/assets/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js +284 -0
  179. data/assets/tinymce/jscripts/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  180. data/assets/tinymce/jscripts/tiny_mce/plugins/table/js/row.js +232 -0
  181. data/assets/tinymce/jscripts/tiny_mce/plugins/table/js/table.js +450 -0
  182. data/assets/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  183. data/assets/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm +32 -0
  184. data/assets/tinymce/jscripts/tiny_mce/plugins/table/row.htm +157 -0
  185. data/assets/tinymce/jscripts/tiny_mce/plugins/table/table.htm +188 -0
  186. data/assets/tinymce/jscripts/tiny_mce/plugins/template/blank.htm +12 -0
  187. data/assets/tinymce/jscripts/tiny_mce/plugins/template/css/template.css +23 -0
  188. data/assets/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
  189. data/assets/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  190. data/assets/tinymce/jscripts/tiny_mce/plugins/template/js/template.js +106 -0
  191. data/assets/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  192. data/assets/tinymce/jscripts/tiny_mce/plugins/template/template.htm +31 -0
  193. data/assets/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  194. data/assets/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
  195. data/assets/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  196. data/assets/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +114 -0
  197. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  198. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  199. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  200. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  201. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  202. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  203. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  204. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  205. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  206. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  207. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  208. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  209. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +111 -0
  210. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  211. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  212. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  213. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  214. data/assets/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  215. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/about.htm +52 -0
  216. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm +26 -0
  217. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm +51 -0
  218. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm +74 -0
  219. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js +1 -0
  220. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js +1360 -0
  221. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/image.htm +80 -0
  222. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  223. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
  224. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  225. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  226. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  227. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  228. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  229. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  230. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif +0 -0
  231. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif +0 -0
  232. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  233. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js +73 -0
  234. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js +42 -0
  235. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js +355 -0
  236. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js +329 -0
  237. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js +247 -0
  238. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js +153 -0
  239. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js +56 -0
  240. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js +68 -0
  241. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js +54 -0
  242. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/link.htm +57 -0
  243. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm +47 -0
  244. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css +47 -0
  245. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  246. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  247. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  248. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  249. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  250. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  251. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  252. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
  253. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css +23 -0
  254. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  255. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css +101 -0
  256. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css +46 -0
  257. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -0
  258. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  259. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  260. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  261. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +216 -0
  262. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  263. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  264. data/assets/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm +25 -0
  265. data/assets/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js +1 -0
  266. data/assets/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js +84 -0
  267. data/assets/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif +0 -0
  268. data/assets/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js +11 -0
  269. data/assets/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
  270. data/assets/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  271. data/assets/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  272. data/assets/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  273. data/assets/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  274. data/assets/tinymce/jscripts/tiny_mce/tiny_mce.js +1 -0
  275. data/assets/tinymce/jscripts/tiny_mce/tiny_mce_popup.js +5 -0
  276. data/assets/tinymce/jscripts/tiny_mce/tiny_mce_src.js +15812 -0
  277. data/assets/tinymce/jscripts/tiny_mce/utils/editable_selects.js +70 -0
  278. data/assets/tinymce/jscripts/tiny_mce/utils/form_utils.js +210 -0
  279. data/assets/tinymce/jscripts/tiny_mce/utils/mctabs.js +162 -0
  280. data/assets/tinymce/jscripts/tiny_mce/utils/validate.js +252 -0
  281. data/assets/use_tinymce_init_advanced.js +15 -0
  282. data/assets/use_tinymce_init_simple.js +5 -0
  283. data/lib/tasks/use_tinymce.rake +25 -0
  284. data/lib/use_tinymce/railengine.rb +12 -0
  285. data/lib/use_tinymce/use_tinymce.rb +33 -0
  286. data/lib/use_tinymce.rb +4 -0
  287. data/test/use_tinymce_base_test.rb +70 -0
  288. metadata +353 -0
@@ -0,0 +1,617 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2011, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
13
+
14
+ // Skips text nodes that only contain whitespace since they aren't semantically important.
15
+ function skipWhitespaceNodes(e, next) {
16
+ while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
17
+ e = next(e);
18
+ }
19
+ return e;
20
+ }
21
+
22
+ function skipWhitespaceNodesBackwards(e) {
23
+ return skipWhitespaceNodes(e, function(e) { return e.previousSibling; });
24
+ }
25
+
26
+ function skipWhitespaceNodesForwards(e) {
27
+ return skipWhitespaceNodes(e, function(e) { return e.nextSibling; });
28
+ }
29
+
30
+ function hasParentInList(ed, e, list) {
31
+ return ed.dom.getParent(e, function(p) {
32
+ return tinymce.inArray(list, p) !== -1;
33
+ });
34
+ }
35
+
36
+ function isList(e) {
37
+ return e && (e.tagName === 'OL' || e.tagName === 'UL');
38
+ }
39
+
40
+ function splitNestedLists(element, dom) {
41
+ var tmp, nested, wrapItem;
42
+ tmp = skipWhitespaceNodesBackwards(element.lastChild);
43
+ while (isList(tmp)) {
44
+ nested = tmp;
45
+ tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
46
+ }
47
+ if (nested) {
48
+ wrapItem = dom.create('li', { style: 'list-style-type: none;'});
49
+ dom.split(element, nested);
50
+ dom.insertAfter(wrapItem, nested);
51
+ wrapItem.appendChild(nested);
52
+ wrapItem.appendChild(nested);
53
+ element = wrapItem.previousSibling;
54
+ }
55
+ return element;
56
+ }
57
+
58
+ function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
59
+ e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
60
+ return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
61
+ }
62
+
63
+ function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
64
+ var prev = skipWhitespaceNodesBackwards(e.previousSibling);
65
+ if (prev) {
66
+ return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
67
+ } else {
68
+ return e;
69
+ }
70
+ }
71
+
72
+ function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
73
+ var next = skipWhitespaceNodesForwards(e.nextSibling);
74
+ if (next) {
75
+ return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
76
+ } else {
77
+ return e;
78
+ }
79
+ }
80
+
81
+ function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
82
+ if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
83
+ return merge(e1, e2, differentStylesMasterElement);
84
+ } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
85
+ // Fix invalidly nested lists.
86
+ e1.appendChild(e2);
87
+ }
88
+ return e2;
89
+ }
90
+
91
+ function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
92
+ if (!e1 || !e2) {
93
+ return false;
94
+ } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
95
+ return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
96
+ } else if (isList(e1)) {
97
+ return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
98
+ } else if (mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P') {
99
+ return true;
100
+ } else {
101
+ return false;
102
+ }
103
+ }
104
+
105
+ function isListForIndent(e) {
106
+ var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
107
+ return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
108
+ }
109
+
110
+ function containsOnlyAList(e) {
111
+ var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
112
+ return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
113
+ }
114
+
115
+ function merge(e1, e2, masterElement) {
116
+ var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
117
+ if (e1.tagName === 'P') {
118
+ e1.appendChild(e1.ownerDocument.createElement('br'));
119
+ }
120
+ while (e2.firstChild) {
121
+ e1.appendChild(e2.firstChild);
122
+ }
123
+ if (masterElement) {
124
+ e1.style.listStyleType = masterElement.style.listStyleType;
125
+ }
126
+ e2.parentNode.removeChild(e2);
127
+ attemptMerge(lastOriginal, firstNew, false);
128
+ return e1;
129
+ }
130
+
131
+ function findItemToOperateOn(e, dom) {
132
+ var item;
133
+ if (!dom.is(e, 'li,ol,ul')) {
134
+ item = dom.getParent(e, 'li');
135
+ if (item) {
136
+ e = item;
137
+ }
138
+ }
139
+ return e;
140
+ }
141
+
142
+ tinymce.create('tinymce.plugins.Lists', {
143
+ init: function(ed, url) {
144
+ var enterDownInEmptyList = false;
145
+ function isTriggerKey(e) {
146
+ return e.keyCode === 9 && (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
147
+ }
148
+ function isEnterInEmptyListItem(ed, e) {
149
+ var sel = ed.selection, n;
150
+ if (e.keyCode === 13) {
151
+ n = sel.getStart();
152
+ enterDownInEmptyList = sel.isCollapsed() && n && n.tagName === 'LI' && n.childNodes.length === 0;
153
+ return enterDownInEmptyList;
154
+ }
155
+ }
156
+ function cancelKeys(ed, e) {
157
+ if (isTriggerKey(e) || isEnterInEmptyListItem(ed, e)) {
158
+ return Event.cancel(e);
159
+ }
160
+ }
161
+
162
+ this.ed = ed;
163
+ ed.addCommand('Indent', this.indent, this);
164
+ ed.addCommand('Outdent', this.outdent, this);
165
+ ed.addCommand('InsertUnorderedList', function() {
166
+ this.applyList('UL', 'OL');
167
+ }, this);
168
+ ed.addCommand('InsertOrderedList', function() {
169
+ this.applyList('OL', 'UL');
170
+ }, this);
171
+
172
+ ed.onInit.add(function() {
173
+ ed.editorCommands.addCommands({
174
+ 'outdent': function() {
175
+ var sel = ed.selection, dom = ed.dom;
176
+ function hasStyleIndent(n) {
177
+ n = dom.getParent(n, dom.isBlock);
178
+ return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
179
+ }
180
+ return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
181
+ }
182
+ }, 'state');
183
+ });
184
+
185
+ ed.onKeyUp.add(function(ed, e) {
186
+ var n, rng;
187
+ if (isTriggerKey(e)) {
188
+ ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
189
+ return Event.cancel(e);
190
+ } else if (enterDownInEmptyList && isEnterInEmptyListItem(ed, e)) {
191
+ if (ed.queryCommandState('InsertOrderedList')) {
192
+ ed.execCommand('InsertOrderedList');
193
+ } else {
194
+ ed.execCommand('InsertUnorderedList');
195
+ }
196
+ n = ed.selection.getStart();
197
+ if (n && n.tagName === 'LI') {
198
+ // Fix the caret position on IE since it jumps back up to the previous list item.
199
+ n = ed.dom.getParent(n, 'ol,ul').nextSibling;
200
+ if (n && n.tagName === 'P') {
201
+ if (!n.firstChild) {
202
+ n.appendChild(ed.getDoc().createTextNode(''));
203
+ }
204
+ rng = ed.dom.createRng();
205
+ rng.setStart(n.firstChild, 1);
206
+ rng.setEnd(n.firstChild, 1);
207
+ ed.selection.setRng(rng);
208
+ }
209
+ }
210
+ return Event.cancel(e);
211
+ }
212
+ });
213
+ ed.onKeyPress.add(cancelKeys);
214
+ ed.onKeyDown.add(cancelKeys);
215
+ },
216
+
217
+ applyList: function(targetListType, oppositeListType) {
218
+ var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
219
+ selectedBlocks = ed.selection.getSelectedBlocks();
220
+
221
+ function cleanupBr(e) {
222
+ if (e && e.tagName === 'BR') {
223
+ dom.remove(e);
224
+ }
225
+ }
226
+
227
+ function makeList(element) {
228
+ var list = dom.create(targetListType), li;
229
+ function adjustIndentForNewList(element) {
230
+ // If there's a margin-left, outdent one level to account for the extra list margin.
231
+ if (element.style.marginLeft || element.style.paddingLeft) {
232
+ t.adjustPaddingFunction(false)(element);
233
+ }
234
+ }
235
+
236
+ if (element.tagName === 'LI') {
237
+ // No change required.
238
+ } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
239
+ processBrs(element, function(startSection, br, previousBR) {
240
+ doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
241
+ li = startSection.parentNode;
242
+ adjustIndentForNewList(li);
243
+ cleanupBr(br);
244
+ });
245
+ if (element.tagName === 'P' || selectedBlocks.length > 1) {
246
+ dom.split(li.parentNode.parentNode, li.parentNode);
247
+ }
248
+ attemptMergeWithAdjacent(li.parentNode, true);
249
+ return;
250
+ } else {
251
+ // Put the list around the element.
252
+ li = dom.create('li');
253
+ dom.insertAfter(li, element);
254
+ li.appendChild(element);
255
+ adjustIndentForNewList(element);
256
+ element = li;
257
+ }
258
+ dom.insertAfter(list, element);
259
+ list.appendChild(element);
260
+ attemptMergeWithAdjacent(list, true);
261
+ applied.push(element);
262
+ }
263
+
264
+ function doWrapList(start, end, template) {
265
+ var li, n = start, tmp, i;
266
+ while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
267
+ start = dom.split(start.parentNode, start.previousSibling);
268
+ start = start.nextSibling;
269
+ n = start;
270
+ }
271
+ if (template) {
272
+ li = template.cloneNode(true);
273
+ start.parentNode.insertBefore(li, start);
274
+ while (li.firstChild) dom.remove(li.firstChild);
275
+ li = dom.rename(li, 'li');
276
+ } else {
277
+ li = dom.create('li');
278
+ start.parentNode.insertBefore(li, start);
279
+ }
280
+ while (n && n != end) {
281
+ tmp = n.nextSibling;
282
+ li.appendChild(n);
283
+ n = tmp;
284
+ }
285
+ if (li.childNodes.length === 0) {
286
+ li.innerHTML = '<br _mce_bogus="1" />';
287
+ }
288
+ makeList(li);
289
+ }
290
+
291
+ function processBrs(element, callback) {
292
+ var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
293
+ breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
294
+ function isAnyPartSelected(start, end) {
295
+ var r = dom.createRng(), sel;
296
+ bookmark.keep = true;
297
+ ed.selection.moveToBookmark(bookmark);
298
+ bookmark.keep = false;
299
+ sel = ed.selection.getRng(true);
300
+ if (!end) {
301
+ end = start.parentNode.lastChild;
302
+ }
303
+ r.setStartBefore(start);
304
+ r.setEndAfter(end);
305
+ return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
306
+ }
307
+ function nextLeaf(br) {
308
+ if (br.nextSibling)
309
+ return br.nextSibling;
310
+ if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
311
+ return nextLeaf(br.parentNode);
312
+ }
313
+ // Split on BRs within the range and process those.
314
+ startSection = element.firstChild;
315
+ // First mark the BRs that have any part of the previous section selected.
316
+ var trailingContentSelected = false;
317
+ each(dom.select(breakElements, element), function(br) {
318
+ var b;
319
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
320
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
321
+ }
322
+ if (isAnyPartSelected(startSection, br)) {
323
+ dom.addClass(br, '_mce_tagged_br');
324
+ startSection = nextLeaf(br);
325
+ }
326
+ });
327
+ trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
328
+ startSection = element.firstChild;
329
+ each(dom.select(breakElements, element), function(br) {
330
+ // Got a section from start to br.
331
+ var tmp = nextLeaf(br);
332
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
333
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
334
+ }
335
+ if (dom.hasClass(br, '_mce_tagged_br')) {
336
+ callback(startSection, br, previousBR);
337
+ previousBR = null;
338
+ } else {
339
+ previousBR = br;
340
+ }
341
+ startSection = tmp;
342
+ });
343
+ if (trailingContentSelected) {
344
+ callback(startSection, undefined, previousBR);
345
+ }
346
+ }
347
+
348
+ function wrapList(element) {
349
+ processBrs(element, function(startSection, br, previousBR) {
350
+ // Need to indent this part
351
+ doWrapList(startSection, br);
352
+ cleanupBr(br);
353
+ cleanupBr(previousBR);
354
+ });
355
+ }
356
+
357
+ function changeList(element) {
358
+ if (tinymce.inArray(applied, element) !== -1) {
359
+ return;
360
+ }
361
+ if (element.parentNode.tagName === oppositeListType) {
362
+ dom.split(element.parentNode, element);
363
+ makeList(element);
364
+ attemptMergeWithNext(element.parentNode, false);
365
+ }
366
+ applied.push(element);
367
+ }
368
+
369
+ function convertListItemToParagraph(element) {
370
+ var child, nextChild, mergedElement, splitLast;
371
+ if (tinymce.inArray(applied, element) !== -1) {
372
+ return;
373
+ }
374
+ element = splitNestedLists(element, dom);
375
+ while (dom.is(element.parentNode, 'ol,ul,li')) {
376
+ dom.split(element.parentNode, element);
377
+ }
378
+ // Push the original element we have from the selection, not the renamed one.
379
+ applied.push(element);
380
+ element = dom.rename(element, 'p');
381
+ mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
382
+ if (mergedElement === element) {
383
+ // Now split out any block elements that can't be contained within a P.
384
+ // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
385
+ child = element.firstChild;
386
+ while (child) {
387
+ if (dom.isBlock(child)) {
388
+ child = dom.split(child.parentNode, child);
389
+ splitLast = true;
390
+ nextChild = child.nextSibling && child.nextSibling.firstChild;
391
+ } else {
392
+ nextChild = child.nextSibling;
393
+ if (splitLast && child.tagName === 'BR') {
394
+ dom.remove(child);
395
+ }
396
+ splitLast = false;
397
+ }
398
+ child = nextChild;
399
+ }
400
+ }
401
+ }
402
+
403
+ each(selectedBlocks, function(e) {
404
+ e = findItemToOperateOn(e, dom);
405
+ if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
406
+ hasOppositeType = true;
407
+ } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
408
+ hasSameType = true;
409
+ } else {
410
+ hasNonList = true;
411
+ }
412
+ });
413
+
414
+ if (hasNonList || hasOppositeType || selectedBlocks.length === 0) {
415
+ actions = {
416
+ 'LI': changeList,
417
+ 'H1': makeList,
418
+ 'H2': makeList,
419
+ 'H3': makeList,
420
+ 'H4': makeList,
421
+ 'H5': makeList,
422
+ 'H6': makeList,
423
+ 'P': makeList,
424
+ 'BODY': makeList,
425
+ 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
426
+ defaultAction: wrapList
427
+ };
428
+ } else {
429
+ actions = {
430
+ defaultAction: convertListItemToParagraph
431
+ };
432
+ }
433
+ this.process(actions);
434
+ },
435
+
436
+ indent: function() {
437
+ var ed = this.ed, dom = ed.dom, indented = [];
438
+
439
+ function createWrapItem(element) {
440
+ var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
441
+ dom.insertAfter(wrapItem, element);
442
+ return wrapItem;
443
+ }
444
+
445
+ function createWrapList(element) {
446
+ var wrapItem = createWrapItem(element),
447
+ list = dom.getParent(element, 'ol,ul'),
448
+ listType = list.tagName,
449
+ listStyle = dom.getStyle(list, 'list-style-type'),
450
+ attrs = {},
451
+ wrapList;
452
+ if (listStyle !== '') {
453
+ attrs.style = 'list-style-type: ' + listStyle + ';';
454
+ }
455
+ wrapList = dom.create(listType, attrs);
456
+ wrapItem.appendChild(wrapList);
457
+ return wrapList;
458
+ }
459
+
460
+ function indentLI(element) {
461
+ if (!hasParentInList(ed, element, indented)) {
462
+ element = splitNestedLists(element, dom);
463
+ var wrapList = createWrapList(element);
464
+ wrapList.appendChild(element);
465
+ attemptMergeWithAdjacent(wrapList.parentNode, false);
466
+ attemptMergeWithAdjacent(wrapList, false);
467
+ indented.push(element);
468
+ }
469
+ }
470
+
471
+ this.process({
472
+ 'LI': indentLI,
473
+ defaultAction: this.adjustPaddingFunction(true)
474
+ });
475
+
476
+ },
477
+
478
+ outdent: function() {
479
+ var t = this, ed = t.ed, dom = ed.dom, outdented = [];
480
+
481
+ function outdentLI(element) {
482
+ var listElement, targetParent, align;
483
+ if (!hasParentInList(ed, element, outdented)) {
484
+ if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
485
+ return t.adjustPaddingFunction(false)(element);
486
+ }
487
+ align = dom.getStyle(element, 'text-align', true);
488
+ if (align === 'center' || align === 'right') {
489
+ dom.setStyle(element, 'text-align', 'left');
490
+ return;
491
+ }
492
+ element = splitNestedLists(element, dom);
493
+ listElement = element.parentNode;
494
+ targetParent = element.parentNode.parentNode;
495
+ if (targetParent.tagName === 'P') {
496
+ dom.split(targetParent, element.parentNode);
497
+ } else {
498
+ dom.split(listElement, element);
499
+ if (targetParent.tagName === 'LI') {
500
+ // Nested list, need to split the LI and go back out to the OL/UL element.
501
+ dom.split(targetParent, element);
502
+ } else if (!dom.is(targetParent, 'ol,ul')) {
503
+ dom.rename(element, 'p');
504
+ }
505
+ }
506
+ outdented.push(element);
507
+ }
508
+ }
509
+
510
+ this.process({
511
+ 'LI': outdentLI,
512
+ defaultAction: this.adjustPaddingFunction(false)
513
+ });
514
+
515
+ each(outdented, attemptMergeWithAdjacent);
516
+ },
517
+
518
+ process: function(actions) {
519
+ var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
520
+ function processElement(element) {
521
+ dom.removeClass(element, '_mce_act_on');
522
+ if (!element || element.nodeType !== 1) {
523
+ return;
524
+ }
525
+ element = findItemToOperateOn(element, dom);
526
+ var action = actions[element.tagName];
527
+ if (!action) {
528
+ action = actions.defaultAction;
529
+ }
530
+ action(element);
531
+ }
532
+ function recurse(element) {
533
+ t.splitSafeEach(element.childNodes, processElement);
534
+ }
535
+ function brAtEdgeOfSelection(container, offset) {
536
+ return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
537
+ container.childNodes[offset].tagName === 'BR';
538
+ }
539
+ selectedBlocks = sel.getSelectedBlocks();
540
+ if (selectedBlocks.length === 0) {
541
+ selectedBlocks = [ dom.getRoot() ];
542
+ }
543
+
544
+ r = sel.getRng(true);
545
+ if (!r.collapsed) {
546
+ if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
547
+ r.setEnd(r.endContainer, r.endOffset - 1);
548
+ sel.setRng(r);
549
+ }
550
+ if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
551
+ r.setStart(r.startContainer, r.startOffset + 1);
552
+ sel.setRng(r);
553
+ }
554
+ }
555
+ bookmark = sel.getBookmark();
556
+ actions.OL = actions.UL = recurse;
557
+ t.splitSafeEach(selectedBlocks, processElement);
558
+ sel.moveToBookmark(bookmark);
559
+ bookmark = null;
560
+ // Avoids table or image handles being left behind in Firefox.
561
+ t.ed.execCommand('mceRepaint');
562
+ },
563
+
564
+ splitSafeEach: function(elements, f) {
565
+ if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
566
+ /Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
567
+ this.classBasedEach(elements, f);
568
+ } else {
569
+ each(elements, f);
570
+ }
571
+ },
572
+
573
+ classBasedEach: function(elements, f) {
574
+ var dom = this.ed.dom, nodes, element;
575
+ // Mark nodes
576
+ each(elements, function(element) {
577
+ dom.addClass(element, '_mce_act_on');
578
+ });
579
+ nodes = dom.select('._mce_act_on');
580
+ while (nodes.length > 0) {
581
+ element = nodes.shift();
582
+ dom.removeClass(element, '_mce_act_on');
583
+ f(element);
584
+ nodes = dom.select('._mce_act_on');
585
+ }
586
+ },
587
+
588
+ adjustPaddingFunction: function(isIndent) {
589
+ var indentAmount, indentUnits, ed = this.ed;
590
+ indentAmount = ed.settings.indentation;
591
+ indentUnits = /[a-z%]+/i.exec(indentAmount);
592
+ indentAmount = parseInt(indentAmount, 10);
593
+ return function(element) {
594
+ var currentIndent, newIndentAmount;
595
+ currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
596
+ if (isIndent) {
597
+ newIndentAmount = currentIndent + indentAmount;
598
+ } else {
599
+ newIndentAmount = currentIndent - indentAmount;
600
+ }
601
+ ed.dom.setStyle(element, 'padding-left', '');
602
+ ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
603
+ };
604
+ },
605
+
606
+ getInfo: function() {
607
+ return {
608
+ longname : 'Lists',
609
+ author : 'Moxiecode Systems AB',
610
+ authorurl : 'http://tinymce.moxiecode.com',
611
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
612
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
613
+ };
614
+ }
615
+ });
616
+ tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
617
+ }());
@@ -0,0 +1,17 @@
1
+ #id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
2
+ #hspace, #vspace { width: 50px }
3
+ #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
4
+ #flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px }
5
+ #width, #height { width: 40px }
6
+ #src, #media_type { width: 250px }
7
+ #class { width: 120px }
8
+ #prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto }
9
+ .panel_wrapper div.current { height: 420px; overflow: auto }
10
+ #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
11
+ .mceAddSelectValue { background-color: #DDDDDD }
12
+ #qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
13
+ #wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
14
+ #rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
15
+ #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
16
+ #qt_qtsrc { width: 200px }
17
+ iframe {border: 1px solid gray}
@@ -0,0 +1 @@
1
+ (function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m<f.length;m++){k=f[m][0];q={name:k,clsids:tinymce.explode(f[m][1]||""),mimes:tinymce.explode(f[m][2]||""),codebase:f[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;a+=(a?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mp3,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});a=new RegExp("write("+a+")\\(([^)]+)\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(i,s){if(s.name==="img"&&n.dom.hasClass(s.node,"mceItemMedia")){s.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(s,t,i){if(i.nodeName==="IMG"&&i.className.indexOf("mceItemMedia")!==-1){t.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var s,i;i=n.selection.getNode();if(o(i)){s=g.parse(n.dom.getAttrib(i,"data-mce-json"));tinymce.each(d,function(t){var u=n.dom.getAttrib(i,t);if(u){s[t]=u}});s.type=r.getType(i.className).name.toLowerCase()}if(!s){s={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:s})});n.addButton("media",{title:"media.desc",cmd:"mceMedia"});n.onNodeChange.add(function(s,i,t){i.setActive("media",o(t))})},convertUrl:function(k,n){var j=this,m=j.editor,l=m.settings,o=l.url_converter,i=l.url_converter_scope||j;if(!k){return k}if(n){return m.documentBaseURI.toAbsolute(k)}return o.call(i,k,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":g.serialize(m,"'")});n.width=m.width||"320";n.height=m.height||"240";return n},dataToHtml:function(i,j){return this.editor.serializer.serialize(this.dataToImg(i,j),{force_absolute:j})},htmlToData:function(k){var j,i,l;l={type:"flash",video:{sources:[]},params:{}};j=this.editor.parser.parse(k);i=j.getAll("img")[0];if(i){l=g.parse(i.attr("data-mce-json"));l.type=this.getType(i.attr("class")).name.toLowerCase();tinymce.each(d,function(m){var n=i.attr(m);if(n){l[m]=n}})}return l},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(x,n){var t=this,o=t.editor,A,E,j,s,F,w,D,u,k,C,r,p,y,B,m,v,l,z;function q(i,G){var K,J,L,I,H;H=o.getParam("flash_video_player_url",t.convertUrl(t.url+"/moxieplayer.swf"));if(H){K=o.documentBaseURI;D.params.src=H;if(o.getParam("flash_video_player_absvideourl",true)){i=K.toAbsolute(i||"",true);G=K.toAbsolute(G||"",true)}L="";J=o.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(J,function(N,M){N=N.replace(/\$url/,i||"");N=N.replace(/\$poster/,G||"");if(N.length>0){L+=(L?"&":"")+M+"="+escape(N)}});if(L.length){D.params.flashvars=L}I=o.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(I,function(N,M){D.params[M]=""+N})}}D=g.parse(x.attr("data-mce-json"));p=this.getType(x.attr("class"));z=x.attr("data-mce-style");if(!z){z=x.attr("style");if(z){z=o.dom.serializeStyle(o.dom.parseStyle(z,"img"))}}if(p.name==="Iframe"){v=new b("iframe",1);tinymce.each(d,function(i){var G=x.attr(i);if(i=="class"&&G){G=G.replace(/mceItem.+ ?/g,"")}if(G&&G.length>0){v.attr(i,G)}});for(F in D.params){v.attr(F,D.params[F])}v.attr({style:z,src:D.params.src});x.replace(v);return}if(this.editor.settings.media_use_script){v=new b("script",1).attr("type","text/javascript");w=new b("#text",3);w.value="write"+p.name+"("+g.serialize(tinymce.extend(D.params,{width:x.attr("width"),height:x.attr("height")}))+");";v.append(w);x.replace(v);return}if(p.name==="Video"&&D.video.sources[0]){A=new b("video",1).attr(tinymce.extend({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z},D.video.attrs));if(D.video.attrs){l=D.video.attrs.poster}k=D.video.sources=c(D.video.sources);for(y=0;y<k.length;y++){if(/\.mp4$/.test(k[y].src)){m=k[y].src}}if(!k[0].type){A.attr("src",k[0].src);k.splice(0,1)}for(y=0;y<k.length;y++){u=new b("source",1).attr(k[y]);u.shortEnded=true;A.append(u)}if(m){q(m,l);p=t.getType("flash")}else{D.params.src=""}}if(D.params.src){if(/\.flv$/i.test(D.params.src)){q(D.params.src,"")}if(n&&n.force_absolute){D.params.src=o.documentBaseURI.toAbsolute(D.params.src)}E=new b("object",1).attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z});tinymce.each(d,function(i){if(D[i]&&i!="type"){E.attr(i,D[i])}});for(F in D.params){r=new b("param",1);r.shortEnded=true;w=D.params[F];if(F==="src"&&p.name==="WindowsMedia"){F="url"}r.attr({name:F,value:w});E.append(r)}if(this.editor.getParam("media_strict",true)){E.attr({data:D.params.src,type:p.mimes[0]})}else{E.attr({classid:"clsid:"+p.clsids[0],codebase:p.codebase});j=new b("embed",1);j.shortEnded=true;j.attr({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z,type:p.mimes[0]});for(F in D.params){j.attr(F,D.params[F])}tinymce.each(d,function(i){if(D[i]&&i!="type"){j.attr(i,D[i])}});E.append(j)}if(D.object_html){w=new b("#text",3);w.raw=true;w.value=D.object_html;E.append(w)}if(A){A.append(E)}}if(A){if(D.video_html){w=new b("#text",3);w.raw=true;w.value=D.video_html;A.append(w)}}if(A||E){x.replace(A||E)}else{x.remove()}},objectToImg:function(y){var F,j,A,p,G,H,u,w,t,B,z,q,o,D,x,k,E,n,C=this.lookup,l,v,s=this.editor.settings.url_converter,m=this.editor.settings.url_converter_scope;function r(i){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(i)}if(!y.parent){return}if(y.name==="script"){if(y.firstChild){l=a.exec(y.firstChild.value)}if(!l){return}n=l[1];E={video:{},params:g.parse(l[2])};w=E.params.width;t=E.params.height}E=E||{video:{},params:{}};G=new b("img",1);G.attr({src:this.editor.theme.url+"/img/trans.gif"});H=y.name;if(H==="video"){A=y;F=y.getAll("object")[0];j=y.getAll("embed")[0];w=A.attr("width");t=A.attr("height");u=A.attr("id");E.video={attrs:{},sources:[]};v=E.video.attrs;for(H in A.attributes.map){v[H]=A.attributes.map[H]}x=y.attr("src");if(x){E.video.sources.push({src:s.call(m,x,"src","video")})}k=A.getAll("source");for(z=0;z<k.length;z++){x=k[z].remove();E.video.sources.push({src:s.call(m,x.attr("src"),"src","source"),type:x.attr("type"),media:x.attr("media")})}if(v.poster){v.poster=s.call(m,v.poster,"poster","video")}}if(y.name==="object"){F=y;j=y.getAll("embed")[0]}if(y.name==="embed"){j=y}if(y.name==="iframe"){p=y;n="Iframe"}if(F){w=w||F.attr("width");t=t||F.attr("height");B=B||F.attr("style");u=u||F.attr("id");D=F.getAll("param");for(z=0;z<D.length;z++){o=D[z];H=o.remove().attr("name");if(!h[H]){E.params[H]=o.attr("value")}}E.params.src=E.params.src||F.attr("data")}if(j){w=w||j.attr("width");t=t||j.attr("height");B=B||j.attr("style");u=u||j.attr("id");for(H in j.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=j.attributes.map[H]}}}if(p){w=p.attr("width");t=p.attr("height");B=B||p.attr("style");u=p.attr("id");tinymce.each(d,function(i){G.attr(i,p.attr(i))});for(H in p.attributes.map){if(!h[H]&&!E.params[H]){E.params[H]=p.attributes.map[H]}}}if(E.params.movie){E.params.src=E.params.src||E.params.movie;delete E.params.movie}if(E.params.src){E.params.src=s.call(m,E.params.src,"src","object")}if(A){n=C.video.name}if(F&&!n){n=(C[(F.attr("clsid")||"").toLowerCase()]||C[(F.attr("type")||"").toLowerCase()]||{}).name}if(j&&!n){n=(C[(j.attr("type")||"").toLowerCase()]||{}).name}y.replace(G);if(j){j.remove()}if(F){q=r(F.remove());if(q){E.object_html=q}}if(A){q=r(A.remove());if(q){E.video_html=q}}G.attr({id:u,"class":"mceItemMedia mceItem"+(n||"Flash"),style:B,width:w||"320",height:t||"240","data-mce-json":g.serialize(E,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();