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,329 @@
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false;
4
+
5
+ var colors = [
6
+ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
7
+ "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
8
+ "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
9
+ "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
10
+ "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
11
+ "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
12
+ "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
13
+ "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
14
+ "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
15
+ "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
16
+ "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
17
+ "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
18
+ "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
19
+ "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
20
+ "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
21
+ "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
22
+ "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
23
+ "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
24
+ "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
25
+ "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
26
+ "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
27
+ "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
28
+ "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
29
+ "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
30
+ "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
31
+ "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
32
+ "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
33
+ ];
34
+
35
+ var named = {
36
+ '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
37
+ '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
38
+ '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
39
+ '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
40
+ '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
41
+ '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
42
+ '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
43
+ '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
44
+ '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
45
+ '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
46
+ '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
47
+ '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
48
+ '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
49
+ '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
50
+ '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
51
+ '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
52
+ '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
53
+ '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
54
+ '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
55
+ '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
56
+ '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
57
+ '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
58
+ '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
59
+ };
60
+
61
+ var namedLookup = {};
62
+
63
+ function init() {
64
+ var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
65
+
66
+ tinyMCEPopup.resizeToInnerSize();
67
+
68
+ generatePicker();
69
+ generateWebColors();
70
+ generateNamedColors();
71
+
72
+ if (inputColor) {
73
+ changeFinalColor(inputColor);
74
+
75
+ col = convertHexToRGB(inputColor);
76
+
77
+ if (col)
78
+ updateLight(col.r, col.g, col.b);
79
+ }
80
+
81
+ for (key in named) {
82
+ value = named[key];
83
+ namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
84
+ }
85
+ }
86
+
87
+ function toHexColor(color) {
88
+ var matches, red, green, blue, toInt = parseInt;
89
+
90
+ function hex(value) {
91
+ value = parseInt(value).toString(16);
92
+
93
+ return value.length > 1 ? value : '0' + value; // Padd with leading zero
94
+ };
95
+
96
+ color = color.replace(/[\s#]+/g, '').toLowerCase();
97
+ color = namedLookup[color] || color;
98
+ matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color);
99
+
100
+ if (matches) {
101
+ if (matches[1]) {
102
+ red = toInt(matches[1]);
103
+ green = toInt(matches[2]);
104
+ blue = toInt(matches[3]);
105
+ } else if (matches[4]) {
106
+ red = toInt(matches[4], 16);
107
+ green = toInt(matches[5], 16);
108
+ blue = toInt(matches[6], 16);
109
+ } else if (matches[7]) {
110
+ red = toInt(matches[7] + matches[7], 16);
111
+ green = toInt(matches[8] + matches[8], 16);
112
+ blue = toInt(matches[9] + matches[9], 16);
113
+ }
114
+
115
+ return '#' + hex(red) + hex(green) + hex(blue);
116
+ }
117
+
118
+ return '';
119
+ }
120
+
121
+ function insertAction() {
122
+ var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
123
+
124
+ tinyMCEPopup.restoreSelection();
125
+
126
+ if (f)
127
+ f(toHexColor(color));
128
+
129
+ tinyMCEPopup.close();
130
+ }
131
+
132
+ function showColor(color, name) {
133
+ if (name)
134
+ document.getElementById("colorname").innerHTML = name;
135
+
136
+ document.getElementById("preview").style.backgroundColor = color;
137
+ document.getElementById("color").value = color.toUpperCase();
138
+ }
139
+
140
+ function convertRGBToHex(col) {
141
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
142
+
143
+ if (!col)
144
+ return col;
145
+
146
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
147
+ if (rgb.length == 3) {
148
+ r = parseInt(rgb[0]).toString(16);
149
+ g = parseInt(rgb[1]).toString(16);
150
+ b = parseInt(rgb[2]).toString(16);
151
+
152
+ r = r.length == 1 ? '0' + r : r;
153
+ g = g.length == 1 ? '0' + g : g;
154
+ b = b.length == 1 ? '0' + b : b;
155
+
156
+ return "#" + r + g + b;
157
+ }
158
+
159
+ return col;
160
+ }
161
+
162
+ function convertHexToRGB(col) {
163
+ if (col.indexOf('#') != -1) {
164
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
165
+
166
+ r = parseInt(col.substring(0, 2), 16);
167
+ g = parseInt(col.substring(2, 4), 16);
168
+ b = parseInt(col.substring(4, 6), 16);
169
+
170
+ return {r : r, g : g, b : b};
171
+ }
172
+
173
+ return null;
174
+ }
175
+
176
+ function generatePicker() {
177
+ var el = document.getElementById('light'), h = '', i;
178
+
179
+ for (i = 0; i < detail; i++){
180
+ h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
181
+ + ' onclick="changeFinalColor(this.style.backgroundColor)"'
182
+ + ' onmousedown="isMouseDown = true; return false;"'
183
+ + ' onmouseup="isMouseDown = false;"'
184
+ + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
185
+ + ' onmouseover="isMouseOver = true;"'
186
+ + ' onmouseout="isMouseOver = false;"'
187
+ + '></div>';
188
+ }
189
+
190
+ el.innerHTML = h;
191
+ }
192
+
193
+ function generateWebColors() {
194
+ var el = document.getElementById('webcolors'), h = '', i;
195
+
196
+ if (el.className == 'generated')
197
+ return;
198
+
199
+ // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
200
+ h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
201
+ + '<tr>';
202
+
203
+ for (i=0; i<colors.length; i++) {
204
+ h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
205
+ + '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
206
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
207
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
208
+ }
209
+ h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
210
+ h += '</a></td>';
211
+ if ((i+1) % 18 == 0)
212
+ h += '</tr><tr>';
213
+ }
214
+
215
+ h += '</table></div>';
216
+
217
+ el.innerHTML = h;
218
+ el.className = 'generated';
219
+
220
+ paintCanvas(el);
221
+ enableKeyboardNavigation(el.firstChild);
222
+ }
223
+
224
+ function paintCanvas(el) {
225
+ tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
226
+ var context;
227
+ if (canvas.getContext && (context = canvas.getContext("2d"))) {
228
+ context.fillStyle = canvas.getAttribute('data-color');
229
+ context.fillRect(0, 0, 10, 10);
230
+ }
231
+ });
232
+ }
233
+ function generateNamedColors() {
234
+ var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
235
+
236
+ if (el.className == 'generated')
237
+ return;
238
+
239
+ for (n in named) {
240
+ v = named[n];
241
+ h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
242
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
243
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
244
+ }
245
+ h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
246
+ h += '</a>';
247
+ i++;
248
+ }
249
+
250
+ el.innerHTML = h;
251
+ el.className = 'generated';
252
+
253
+ paintCanvas(el);
254
+ enableKeyboardNavigation(el);
255
+ }
256
+
257
+ function enableKeyboardNavigation(el) {
258
+ tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
259
+ root: el,
260
+ items: tinyMCEPopup.dom.select('a', el)
261
+ }, tinyMCEPopup.dom);
262
+ }
263
+
264
+ function dechex(n) {
265
+ return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
266
+ }
267
+
268
+ function computeColor(e) {
269
+ var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
270
+
271
+ x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
272
+ y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
273
+
274
+ partWidth = document.getElementById('colors').width / 6;
275
+ partDetail = detail / 2;
276
+ imHeight = document.getElementById('colors').height;
277
+
278
+ r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
279
+ g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
280
+ b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
281
+
282
+ coef = (imHeight - y) / imHeight;
283
+ r = 128 + (r - 128) * coef;
284
+ g = 128 + (g - 128) * coef;
285
+ b = 128 + (b - 128) * coef;
286
+
287
+ changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
288
+ updateLight(r, g, b);
289
+ }
290
+
291
+ function updateLight(r, g, b) {
292
+ var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
293
+
294
+ for (i=0; i<detail; i++) {
295
+ if ((i>=0) && (i<partDetail)) {
296
+ finalCoef = i / partDetail;
297
+ finalR = dechex(255 - (255 - r) * finalCoef);
298
+ finalG = dechex(255 - (255 - g) * finalCoef);
299
+ finalB = dechex(255 - (255 - b) * finalCoef);
300
+ } else {
301
+ finalCoef = 2 - i / partDetail;
302
+ finalR = dechex(r * finalCoef);
303
+ finalG = dechex(g * finalCoef);
304
+ finalB = dechex(b * finalCoef);
305
+ }
306
+
307
+ color = finalR + finalG + finalB;
308
+
309
+ setCol('gs' + i, '#'+color);
310
+ }
311
+ }
312
+
313
+ function changeFinalColor(color) {
314
+ if (color.indexOf('#') == -1)
315
+ color = convertRGBToHex(color);
316
+
317
+ setCol('preview', color);
318
+ document.getElementById('color').value = color;
319
+ }
320
+
321
+ function setCol(e, c) {
322
+ try {
323
+ document.getElementById(e).style.backgroundColor = c;
324
+ } catch (ex) {
325
+ // Ignore IE warning
326
+ }
327
+ }
328
+
329
+ tinyMCEPopup.onInit.add(init);
@@ -0,0 +1,247 @@
1
+ var ImageDialog = {
2
+ preInit : function() {
3
+ var url;
4
+
5
+ tinyMCEPopup.requireLangPack();
6
+
7
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))
8
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
9
+ },
10
+
11
+ init : function() {
12
+ var f = document.forms[0], ed = tinyMCEPopup.editor;
13
+
14
+ // Setup browse button
15
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
16
+ if (isVisible('srcbrowser'))
17
+ document.getElementById('src').style.width = '180px';
18
+
19
+ e = ed.selection.getNode();
20
+
21
+ this.fillFileList('image_list', 'tinyMCEImageList');
22
+
23
+ if (e.nodeName == 'IMG') {
24
+ f.src.value = ed.dom.getAttrib(e, 'src');
25
+ f.alt.value = ed.dom.getAttrib(e, 'alt');
26
+ f.border.value = this.getAttrib(e, 'border');
27
+ f.vspace.value = this.getAttrib(e, 'vspace');
28
+ f.hspace.value = this.getAttrib(e, 'hspace');
29
+ f.width.value = ed.dom.getAttrib(e, 'width');
30
+ f.height.value = ed.dom.getAttrib(e, 'height');
31
+ f.insert.value = ed.getLang('update');
32
+ this.styleVal = ed.dom.getAttrib(e, 'style');
33
+ selectByValue(f, 'image_list', f.src.value);
34
+ selectByValue(f, 'align', this.getAttrib(e, 'align'));
35
+ this.updateStyle();
36
+ }
37
+ },
38
+
39
+ fillFileList : function(id, l) {
40
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
41
+
42
+ l = window[l];
43
+
44
+ if (l && l.length > 0) {
45
+ lst.options[lst.options.length] = new Option('', '');
46
+
47
+ tinymce.each(l, function(o) {
48
+ lst.options[lst.options.length] = new Option(o[0], o[1]);
49
+ });
50
+ } else
51
+ dom.remove(dom.getParent(id, 'tr'));
52
+ },
53
+
54
+ update : function() {
55
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
56
+
57
+ tinyMCEPopup.restoreSelection();
58
+
59
+ if (f.src.value === '') {
60
+ if (ed.selection.getNode().nodeName == 'IMG') {
61
+ ed.dom.remove(ed.selection.getNode());
62
+ ed.execCommand('mceRepaint');
63
+ }
64
+
65
+ tinyMCEPopup.close();
66
+ return;
67
+ }
68
+
69
+ if (!ed.settings.inline_styles) {
70
+ args = tinymce.extend(args, {
71
+ vspace : nl.vspace.value,
72
+ hspace : nl.hspace.value,
73
+ border : nl.border.value,
74
+ align : getSelectValue(f, 'align')
75
+ });
76
+ } else
77
+ args.style = this.styleVal;
78
+
79
+ tinymce.extend(args, {
80
+ src : f.src.value.replace(/ /g, '%20'),
81
+ alt : f.alt.value,
82
+ width : f.width.value,
83
+ height : f.height.value
84
+ });
85
+
86
+ el = ed.selection.getNode();
87
+
88
+ if (el && el.nodeName == 'IMG') {
89
+ ed.dom.setAttribs(el, args);
90
+ tinyMCEPopup.editor.execCommand('mceRepaint');
91
+ tinyMCEPopup.editor.focus();
92
+ } else {
93
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
94
+ ed.dom.setAttribs('__mce_tmp', args);
95
+ ed.dom.setAttrib('__mce_tmp', 'id', '');
96
+ ed.undoManager.add();
97
+ }
98
+
99
+ tinyMCEPopup.close();
100
+ },
101
+
102
+ updateStyle : function() {
103
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
104
+
105
+ if (tinyMCEPopup.editor.settings.inline_styles) {
106
+ st = tinyMCEPopup.dom.parseStyle(this.styleVal);
107
+
108
+ // Handle align
109
+ v = getSelectValue(f, 'align');
110
+ if (v) {
111
+ if (v == 'left' || v == 'right') {
112
+ st['float'] = v;
113
+ delete st['vertical-align'];
114
+ } else {
115
+ st['vertical-align'] = v;
116
+ delete st['float'];
117
+ }
118
+ } else {
119
+ delete st['float'];
120
+ delete st['vertical-align'];
121
+ }
122
+
123
+ // Handle border
124
+ v = f.border.value;
125
+ if (v || v == '0') {
126
+ if (v == '0')
127
+ st['border'] = '0';
128
+ else
129
+ st['border'] = v + 'px solid black';
130
+ } else
131
+ delete st['border'];
132
+
133
+ // Handle hspace
134
+ v = f.hspace.value;
135
+ if (v) {
136
+ delete st['margin'];
137
+ st['margin-left'] = v + 'px';
138
+ st['margin-right'] = v + 'px';
139
+ } else {
140
+ delete st['margin-left'];
141
+ delete st['margin-right'];
142
+ }
143
+
144
+ // Handle vspace
145
+ v = f.vspace.value;
146
+ if (v) {
147
+ delete st['margin'];
148
+ st['margin-top'] = v + 'px';
149
+ st['margin-bottom'] = v + 'px';
150
+ } else {
151
+ delete st['margin-top'];
152
+ delete st['margin-bottom'];
153
+ }
154
+
155
+ // Merge
156
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');
157
+ this.styleVal = dom.serializeStyle(st, 'img');
158
+ }
159
+ },
160
+
161
+ getAttrib : function(e, at) {
162
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
163
+
164
+ if (ed.settings.inline_styles) {
165
+ switch (at) {
166
+ case 'align':
167
+ if (v = dom.getStyle(e, 'float'))
168
+ return v;
169
+
170
+ if (v = dom.getStyle(e, 'vertical-align'))
171
+ return v;
172
+
173
+ break;
174
+
175
+ case 'hspace':
176
+ v = dom.getStyle(e, 'margin-left')
177
+ v2 = dom.getStyle(e, 'margin-right');
178
+ if (v && v == v2)
179
+ return parseInt(v.replace(/[^0-9]/g, ''));
180
+
181
+ break;
182
+
183
+ case 'vspace':
184
+ v = dom.getStyle(e, 'margin-top')
185
+ v2 = dom.getStyle(e, 'margin-bottom');
186
+ if (v && v == v2)
187
+ return parseInt(v.replace(/[^0-9]/g, ''));
188
+
189
+ break;
190
+
191
+ case 'border':
192
+ v = 0;
193
+
194
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
195
+ sv = dom.getStyle(e, 'border-' + sv + '-width');
196
+
197
+ // False or not the same as prev
198
+ if (!sv || (sv != v && v !== 0)) {
199
+ v = 0;
200
+ return false;
201
+ }
202
+
203
+ if (sv)
204
+ v = sv;
205
+ });
206
+
207
+ if (v)
208
+ return parseInt(v.replace(/[^0-9]/g, ''));
209
+
210
+ break;
211
+ }
212
+ }
213
+
214
+ if (v = dom.getAttrib(e, at))
215
+ return v;
216
+
217
+ return '';
218
+ },
219
+
220
+ resetImageData : function() {
221
+ var f = document.forms[0];
222
+
223
+ f.width.value = f.height.value = "";
224
+ },
225
+
226
+ updateImageData : function() {
227
+ var f = document.forms[0], t = ImageDialog;
228
+
229
+ if (f.width.value == "")
230
+ f.width.value = t.preloadImg.width;
231
+
232
+ if (f.height.value == "")
233
+ f.height.value = t.preloadImg.height;
234
+ },
235
+
236
+ getImageData : function() {
237
+ var f = document.forms[0];
238
+
239
+ this.preloadImg = new Image();
240
+ this.preloadImg.onload = this.updateImageData;
241
+ this.preloadImg.onerror = this.resetImageData;
242
+ this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);
243
+ }
244
+ };
245
+
246
+ ImageDialog.preInit();
247
+ tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);