compass-jquery-plugin 0.3.2.5 → 0.3.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. data/README.md +16 -1
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +21 -0
  4. data/lib/jquery/gridify/grid_view.rb +2 -2
  5. data/lib/jquery/jquery_selector_assertions.rb +0 -36
  6. data/lib/jquery/tiny_mce.rb +5 -0
  7. data/templates/dynatree/jquery.dynatree.js +17 -24
  8. data/templates/dynatree/jquery.dynatree.min.js +10 -10
  9. data/templates/ical/jquery.ical.js +107 -25
  10. data/templates/ical/jquery.ical.min.js +182 -180
  11. data/templates/ical/jquery/ical.scss +2 -2
  12. data/templates/jqgrid/jquery.jqGrid.js +2498 -2072
  13. data/templates/jqgrid/jquery.jqGrid.min.js +447 -431
  14. data/templates/jqgrid/jquery/jqGrid.scss +11 -9
  15. data/templates/jquery/history.adapter.jquery.js +52 -52
  16. data/templates/jquery/history.html4.js +680 -680
  17. data/templates/jquery/history.js +1288 -1288
  18. data/templates/jquery/jquery.js +8168 -8143
  19. data/templates/jquery/jquery/ui/cowboy.scss +87 -0
  20. data/templates/jquery/jquery/ui/cowboy/cowboy_hat.png +0 -0
  21. data/templates/jquery/jquery/ui/cowboy/ui-anim_basic_16x16.gif +0 -0
  22. data/templates/jquery/jquery/ui/cowboy/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  23. data/templates/jquery/jquery/ui/cowboy/ui-bg_diagonals-thick_20_ff7f00_40x40.png +0 -0
  24. data/templates/jquery/jquery/ui/cowboy/ui-bg_flat_10_000000_40x100.png +0 -0
  25. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_100_fdebdc_1x400.png +0 -0
  26. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_100_ffd6af_1x400.png +0 -0
  27. data/templates/jquery/jquery/ui/cowboy/ui-bg_glass_65_eeeeee_1x400.png +0 -0
  28. data/templates/jquery/jquery/ui/cowboy/ui-bg_gloss-wave_35_ff7f00_500x100.png +0 -0
  29. data/templates/jquery/jquery/ui/cowboy/ui-bg_highlight-soft_100_dddddd_1x100.png +0 -0
  30. data/templates/jquery/jquery/ui/cowboy/ui-bg_highlight-soft_75_c4884f_1x100.png +0 -0
  31. data/templates/jquery/jquery/ui/cowboy/ui-icons_222222_256x240.png +0 -0
  32. data/templates/jquery/jquery/ui/cowboy/ui-icons_228ef1_256x240.png +0 -0
  33. data/templates/jquery/jquery/ui/cowboy/ui-icons_333333_256x240.png +0 -0
  34. data/templates/jquery/jquery/ui/cowboy/ui-icons_913d00_256x240.png +0 -0
  35. data/templates/jquery/jquery/ui/cowboy/ui-icons_ff7f00_256x240.png +0 -0
  36. data/templates/jquery/jquery/ui/cowboy/ui-icons_ffd27a_256x240.png +0 -0
  37. data/templates/jquery/jquery/ui/cowboy/ui-icons_ffffff_256x240.png +0 -0
  38. data/templates/jquery/json2.js +214 -214
  39. data/templates/jquery/manifest.rb +19 -0
  40. data/templates/mobile/jquery.mobile.js +149 -96
  41. data/templates/mobile/jquery.mobile.min.js +2 -2
  42. data/templates/secret_sauce/app/views/shared/_ui_grid_for_without_block.js.haml +1 -1
  43. data/templates/tiny_mce/config/initializers/tiny_mce.rb +3 -0
  44. data/templates/tiny_mce/manifest.rb +251 -0
  45. data/templates/tiny_mce/tiny_mce/jquery.tinymce.js +1 -0
  46. data/templates/tiny_mce/tiny_mce/langs/en.js +222 -0
  47. data/templates/tiny_mce/tiny_mce/license.txt +504 -0
  48. data/templates/tiny_mce/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  49. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  50. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  51. data/templates/tiny_mce/tiny_mce/plugins/advhr/js/rule.js +43 -0
  52. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/en_dlg.js +7 -0
  53. data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +58 -0
  54. data/templates/tiny_mce/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  55. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  56. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  57. data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +235 -0
  58. data/templates/tiny_mce/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  59. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +445 -0
  60. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/en_dlg.js +45 -0
  61. data/templates/tiny_mce/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  62. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  63. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  64. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +525 -0
  65. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +54 -0
  66. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +338 -0
  67. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  68. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
  69. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  70. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -0
  71. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  72. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +431 -0
  73. data/templates/tiny_mce/tiny_mce/plugins/autosave/langs/en.js +4 -0
  74. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  75. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  76. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  77. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +154 -0
  78. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  79. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  80. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  81. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  82. data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +41 -0
  83. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  84. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  85. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  86. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  87. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  88. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  89. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  90. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  91. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  92. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  93. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  94. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  95. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  96. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  97. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  98. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  99. data/templates/tiny_mce/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  100. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  101. data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +22 -0
  102. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin.js +1 -0
  103. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  104. data/templates/tiny_mce/tiny_mce/plugins/example/img/example.gif +0 -0
  105. data/templates/tiny_mce/tiny_mce/plugins/example/js/dialog.js +19 -0
  106. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en.js +3 -0
  107. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  108. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  109. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  110. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +166 -0
  111. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +571 -0
  112. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +492 -0
  113. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  114. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  115. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -0
  116. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
  117. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  118. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  119. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  120. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +696 -0
  121. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  122. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  123. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  124. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  125. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  126. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  127. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  128. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  129. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  130. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  131. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  132. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  133. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin_src.js +214 -0
  134. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  135. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  136. data/templates/tiny_mce/tiny_mce/plugins/media/css/media.css +17 -0
  137. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -0
  138. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +770 -0
  139. data/templates/tiny_mce/tiny_mce/plugins/media/js/embed.js +73 -0
  140. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +340 -0
  141. data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +109 -0
  142. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +812 -0
  143. data/templates/tiny_mce/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  144. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  145. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  146. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  147. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
  148. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  149. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  150. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  151. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +899 -0
  152. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  153. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  154. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  155. data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +27 -0
  156. data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +21 -0
  157. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  158. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  159. data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +28 -0
  160. data/templates/tiny_mce/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  161. data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +17 -0
  162. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin.js +1 -0
  163. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  164. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin.js +1 -0
  165. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  166. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  167. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  168. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin_src.js +61 -0
  169. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +140 -0
  170. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  171. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
  172. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  173. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  174. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +415 -0
  175. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  176. data/templates/tiny_mce/tiny_mce/plugins/style/css/props.css +13 -0
  177. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin.js +1 -0
  178. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  179. data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +635 -0
  180. data/templates/tiny_mce/tiny_mce/plugins/style/langs/en_dlg.js +70 -0
  181. data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +838 -0
  182. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  183. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +114 -0
  184. data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +178 -0
  185. data/templates/tiny_mce/tiny_mce/plugins/table/css/cell.css +17 -0
  186. data/templates/tiny_mce/tiny_mce/plugins/table/css/row.css +25 -0
  187. data/templates/tiny_mce/tiny_mce/plugins/table/css/table.css +13 -0
  188. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -0
  189. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1183 -0
  190. data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +284 -0
  191. data/templates/tiny_mce/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  192. data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +232 -0
  193. data/templates/tiny_mce/tiny_mce/plugins/table/js/table.js +450 -0
  194. data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  195. data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +32 -0
  196. data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +157 -0
  197. data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +188 -0
  198. data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +12 -0
  199. data/templates/tiny_mce/tiny_mce/plugins/template/css/template.css +23 -0
  200. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin.js +1 -0
  201. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  202. data/templates/tiny_mce/tiny_mce/plugins/template/js/template.js +106 -0
  203. data/templates/tiny_mce/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  204. data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +31 -0
  205. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  206. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
  207. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  208. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +114 -0
  209. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  210. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  211. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  212. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  213. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  214. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  215. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  216. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  217. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  218. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  219. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  220. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  221. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +125 -0
  222. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  223. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  224. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  225. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  226. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  227. data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +52 -0
  228. data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +26 -0
  229. data/templates/tiny_mce/tiny_mce/themes/advanced/charmap.htm +51 -0
  230. data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +74 -0
  231. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -0
  232. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1328 -0
  233. data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +80 -0
  234. data/templates/tiny_mce/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  235. data/templates/tiny_mce/tiny_mce/themes/advanced/img/flash.gif +0 -0
  236. data/templates/tiny_mce/tiny_mce/themes/advanced/img/icons.gif +0 -0
  237. data/templates/tiny_mce/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  238. data/templates/tiny_mce/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  239. data/templates/tiny_mce/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  240. data/templates/tiny_mce/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  241. data/templates/tiny_mce/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  242. data/templates/tiny_mce/tiny_mce/themes/advanced/img/trans.gif +0 -0
  243. data/templates/tiny_mce/tiny_mce/themes/advanced/img/video.gif +0 -0
  244. data/templates/tiny_mce/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  245. data/templates/tiny_mce/tiny_mce/themes/advanced/js/about.js +73 -0
  246. data/templates/tiny_mce/tiny_mce/themes/advanced/js/anchor.js +42 -0
  247. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +354 -0
  248. data/templates/tiny_mce/tiny_mce/themes/advanced/js/color_picker.js +329 -0
  249. data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +247 -0
  250. data/templates/tiny_mce/tiny_mce/themes/advanced/js/link.js +153 -0
  251. data/templates/tiny_mce/tiny_mce/themes/advanced/js/source_editor.js +56 -0
  252. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en.js +68 -0
  253. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +54 -0
  254. data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +57 -0
  255. data/templates/tiny_mce/tiny_mce/themes/advanced/shortcuts.htm +47 -0
  256. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +47 -0
  257. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  258. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  259. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  260. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  261. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  262. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  263. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  264. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
  265. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/content.css +23 -0
  266. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  267. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +101 -0
  268. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +46 -0
  269. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +116 -0
  270. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  271. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  272. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  273. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
  274. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  275. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  276. data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +25 -0
  277. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template.js +1 -0
  278. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template_src.js +84 -0
  279. data/templates/tiny_mce/tiny_mce/themes/simple/img/icons.gif +0 -0
  280. data/templates/tiny_mce/tiny_mce/themes/simple/langs/en.js +11 -0
  281. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/content.css +25 -0
  282. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  283. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  284. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  285. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  286. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -0
  287. data/templates/tiny_mce/tiny_mce/tiny_mce_popup.js +5 -0
  288. data/templates/tiny_mce/tiny_mce/utils/editable_selects.js +70 -0
  289. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +207 -0
  290. data/templates/tiny_mce/tiny_mce/utils/mctabs.js +162 -0
  291. data/templates/tiny_mce/tiny_mce/utils/validate.js +252 -0
  292. metadata +273 -4
@@ -0,0 +1 @@
1
+ (function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">&nbsp;</span>':"&nbsp;")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();
@@ -0,0 +1,53 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, 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
+ tinymce.create('tinymce.plugins.Nonbreaking', {
13
+ init : function(ed, url) {
14
+ var t = this;
15
+
16
+ t.editor = ed;
17
+
18
+ // Register commands
19
+ ed.addCommand('mceNonBreaking', function() {
20
+ ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">&nbsp;</span>' : '&nbsp;');
21
+ });
22
+
23
+ // Register buttons
24
+ ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
25
+
26
+ if (ed.getParam('nonbreaking_force_tab')) {
27
+ ed.onKeyDown.add(function(ed, e) {
28
+ if (tinymce.isIE && e.keyCode == 9) {
29
+ ed.execCommand('mceNonBreaking');
30
+ ed.execCommand('mceNonBreaking');
31
+ ed.execCommand('mceNonBreaking');
32
+ tinymce.dom.Event.cancel(e);
33
+ }
34
+ });
35
+ }
36
+ },
37
+
38
+ getInfo : function() {
39
+ return {
40
+ longname : 'Nonbreaking space',
41
+ author : 'Moxiecode Systems AB',
42
+ authorurl : 'http://tinymce.moxiecode.com',
43
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
44
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
45
+ };
46
+ }
47
+
48
+ // Private methods
49
+ });
50
+
51
+ // Register plugin
52
+ tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
53
+ })();
@@ -0,0 +1 @@
1
+ (function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();
@@ -0,0 +1,90 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, 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 Event = tinymce.dom.Event;
13
+
14
+ tinymce.create('tinymce.plugins.NonEditablePlugin', {
15
+ init : function(ed, url) {
16
+ var t = this, editClass, nonEditClass;
17
+
18
+ t.editor = ed;
19
+ editClass = ed.getParam("noneditable_editable_class", "mceEditable");
20
+ nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");
21
+
22
+ ed.onNodeChange.addToTop(function(ed, cm, n) {
23
+ var sc, ec;
24
+
25
+ // Block if start or end is inside a non editable element
26
+ sc = ed.dom.getParent(ed.selection.getStart(), function(n) {
27
+ return ed.dom.hasClass(n, nonEditClass);
28
+ });
29
+
30
+ ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {
31
+ return ed.dom.hasClass(n, nonEditClass);
32
+ });
33
+
34
+ // Block or unblock
35
+ if (sc || ec) {
36
+ t._setDisabled(1);
37
+ return false;
38
+ } else
39
+ t._setDisabled(0);
40
+ });
41
+ },
42
+
43
+ getInfo : function() {
44
+ return {
45
+ longname : 'Non editable elements',
46
+ author : 'Moxiecode Systems AB',
47
+ authorurl : 'http://tinymce.moxiecode.com',
48
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',
49
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
50
+ };
51
+ },
52
+
53
+ _block : function(ed, e) {
54
+ var k = e.keyCode;
55
+
56
+ // Don't block arrow keys, pg up/down, and F1-F12
57
+ if ((k > 32 && k < 41) || (k > 111 && k < 124))
58
+ return;
59
+
60
+ return Event.cancel(e);
61
+ },
62
+
63
+ _setDisabled : function(s) {
64
+ var t = this, ed = t.editor;
65
+
66
+ tinymce.each(ed.controlManager.controls, function(c) {
67
+ c.setDisabled(s);
68
+ });
69
+
70
+ if (s !== t.disabled) {
71
+ if (s) {
72
+ ed.onKeyDown.addToTop(t._block);
73
+ ed.onKeyPress.addToTop(t._block);
74
+ ed.onKeyUp.addToTop(t._block);
75
+ ed.onPaste.addToTop(t._block);
76
+ } else {
77
+ ed.onKeyDown.remove(t._block);
78
+ ed.onKeyPress.remove(t._block);
79
+ ed.onKeyUp.remove(t._block);
80
+ ed.onPaste.remove(t._block);
81
+ }
82
+
83
+ t.disabled = s;
84
+ }
85
+ }
86
+ });
87
+
88
+ // Register plugin
89
+ tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
90
+ })();
@@ -0,0 +1 @@
1
+ (function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+b.theme.url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();
@@ -0,0 +1,74 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, 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
+ tinymce.create('tinymce.plugins.PageBreakPlugin', {
13
+ init : function(ed, url) {
14
+ var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
15
+
16
+ pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
17
+
18
+ // Register commands
19
+ ed.addCommand('mcePageBreak', function() {
20
+ ed.execCommand('mceInsertContent', 0, pb);
21
+ });
22
+
23
+ // Register buttons
24
+ ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
25
+
26
+ ed.onInit.add(function() {
27
+ if (ed.theme.onResolveName) {
28
+ ed.theme.onResolveName.add(function(th, o) {
29
+ if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
30
+ o.name = 'pagebreak';
31
+ });
32
+ }
33
+ });
34
+
35
+ ed.onClick.add(function(ed, e) {
36
+ e = e.target;
37
+
38
+ if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
39
+ ed.selection.select(e);
40
+ });
41
+
42
+ ed.onNodeChange.add(function(ed, cm, n) {
43
+ cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
44
+ });
45
+
46
+ ed.onBeforeSetContent.add(function(ed, o) {
47
+ o.content = o.content.replace(pbRE, pb);
48
+ });
49
+
50
+ ed.onPostProcess.add(function(ed, o) {
51
+ if (o.get)
52
+ o.content = o.content.replace(/<img[^>]+>/g, function(im) {
53
+ if (im.indexOf('class="mcePageBreak') !== -1)
54
+ im = sep;
55
+
56
+ return im;
57
+ });
58
+ });
59
+ },
60
+
61
+ getInfo : function() {
62
+ return {
63
+ longname : 'PageBreak',
64
+ author : 'Moxiecode Systems AB',
65
+ authorurl : 'http://tinymce.moxiecode.com',
66
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',
67
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
68
+ };
69
+ }
70
+ });
71
+
72
+ // Register plugin
73
+ tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);
74
+ })();
@@ -0,0 +1 @@
1
+ (function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.pasteAsPlainText=false;function h(m,k){var l=d.dom,i,j;f.onPreProcess.dispatch(f,m);m.node=l.create("div",0,m.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){j=l.select("p,h1,h2,h3,h4,h5,h6,pre",m.node);if(j.length==1){l.remove(j.reverse(),true)}}}f.onPostProcess.dispatch(f,m);m.content=d.serializer.serialize(m.node,{getInner:1});if((!k)&&(d.pasteAsPlainText)){f._insertPlainText(d,l,m.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(m.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:r.replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},'\uFEFF<br data-mce-bogus="1">');if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort().y}o.setStyles(l,{position:"absolute",left:-10000,top:i,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}h({content:l.innerHTML});return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,1);k.setRng(j);window.setTimeout(function(){var t="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(v){var u=v.firstChild;if(u&&u.nodeName=="DIV"&&u.style.marginTop&&u.style.backgroundColor){o.remove(u,1)}c(o.select("span.Apple-style-span",v),function(w){o.remove(w,1)});c(o.select("br[data-mce-bogus]",v),function(w){o.remove(w)});if(v.parentNode.className!="mcePaste"){t+=v.innerHTML}})}else{t="<pre>"+o.encode(r).replace(/\r?\n/g,"<br />")+"</pre>"}c(o.select("div.mcePaste"),function(u){o.remove(u)});if(p){k.setRng(p)}h({content:t});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.add(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}if(b(d,"paste_block_drop")){d.onInit.add(function(){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})})}f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){i.remove(v)}else{if(/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(d){c(d,function(h){if(h.constructor==RegExp){v=v.replace(h,"")}else{v=v.replace(h[0],h[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.decode(tinymce.html.Entities.encodeRaw(v));if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"<br />"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"</p><p>"],[/\n/g,"<br />"]])}}if((l=v.indexOf("</p><p>"))!=-1){k=v.lastIndexOf("</p><p>");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t<u;t++){p+="</"+e[t].nodeName.toLowerCase()+">";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+'<span id="_plain_text_marker">&nbsp;</span>');window.setTimeout(function(){var d=x.get("_plain_text_marker"),A,h,w,i;s.select(d,false);z.execCommand("Delete",false,null);d=null;A=s.getStart();h=x.getViewPort(n);w=x.getPos(A).y;i=A.clientHeight;if((w<h.y)||(w+i>h.y+h.h)){z.body.scrollTop=w<h.y?w:w-h.h+25}},0)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
@@ -0,0 +1,899 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, 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,
13
+ defs = {
14
+ paste_auto_cleanup_on_paste : true,
15
+ paste_block_drop : false,
16
+ paste_retain_style_properties : "none",
17
+ paste_strip_class_attributes : "mso",
18
+ paste_remove_spans : false,
19
+ paste_remove_styles : false,
20
+ paste_remove_styles_if_webkit : true,
21
+ paste_convert_middot_lists : true,
22
+ paste_convert_headers_to_strong : false,
23
+ paste_dialog_width : "450",
24
+ paste_dialog_height : "400",
25
+ paste_text_use_dialog : false,
26
+ paste_text_sticky : false,
27
+ paste_text_notifyalways : false,
28
+ paste_text_linebreaktype : "p",
29
+ paste_text_replacements : [
30
+ [/\u2026/g, "..."],
31
+ [/[\x93\x94\u201c\u201d]/g, '"'],
32
+ [/[\x60\x91\x92\u2018\u2019]/g, "'"]
33
+ ]
34
+ };
35
+
36
+ function getParam(ed, name) {
37
+ return ed.getParam(name, defs[name]);
38
+ }
39
+
40
+ tinymce.create('tinymce.plugins.PastePlugin', {
41
+ init : function(ed, url) {
42
+ var t = this;
43
+
44
+ t.editor = ed;
45
+ t.url = url;
46
+
47
+ // Setup plugin events
48
+ t.onPreProcess = new tinymce.util.Dispatcher(t);
49
+ t.onPostProcess = new tinymce.util.Dispatcher(t);
50
+
51
+ // Register default handlers
52
+ t.onPreProcess.add(t._preProcess);
53
+ t.onPostProcess.add(t._postProcess);
54
+
55
+ // Register optional preprocess handler
56
+ t.onPreProcess.add(function(pl, o) {
57
+ ed.execCallback('paste_preprocess', pl, o);
58
+ });
59
+
60
+ // Register optional postprocess
61
+ t.onPostProcess.add(function(pl, o) {
62
+ ed.execCallback('paste_postprocess', pl, o);
63
+ });
64
+
65
+ // Initialize plain text flag
66
+ ed.pasteAsPlainText = false;
67
+
68
+ // This function executes the process handlers and inserts the contents
69
+ // force_rich overrides plain text mode set by user, important for pasting with execCommand
70
+ function process(o, force_rich) {
71
+ var dom = ed.dom, rng, nodes;
72
+
73
+ // Execute pre process handlers
74
+ t.onPreProcess.dispatch(t, o);
75
+
76
+ // Create DOM structure
77
+ o.node = dom.create('div', 0, o.content);
78
+
79
+ // If pasting inside the same element and the contents is only one block
80
+ // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
81
+ if (tinymce.isGecko) {
82
+ rng = ed.selection.getRng(true);
83
+ if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
84
+ nodes = dom.select('p,h1,h2,h3,h4,h5,h6,pre', o.node);
85
+
86
+ if (nodes.length == 1)
87
+ dom.remove(nodes.reverse(), true);
88
+ }
89
+ }
90
+
91
+ // Execute post process handlers
92
+ t.onPostProcess.dispatch(t, o);
93
+
94
+ // Serialize content
95
+ o.content = ed.serializer.serialize(o.node, {getInner : 1});
96
+
97
+ // Plain text option active?
98
+ if ((!force_rich) && (ed.pasteAsPlainText)) {
99
+ t._insertPlainText(ed, dom, o.content);
100
+
101
+ if (!getParam(ed, "paste_text_sticky")) {
102
+ ed.pasteAsPlainText = false;
103
+ ed.controlManager.setActive("pastetext", false);
104
+ }
105
+ } else {
106
+ t._insert(o.content);
107
+ }
108
+ }
109
+
110
+ // Add command for external usage
111
+ ed.addCommand('mceInsertClipboardContent', function(u, o) {
112
+ process(o, true);
113
+ });
114
+
115
+ if (!getParam(ed, "paste_text_use_dialog")) {
116
+ ed.addCommand('mcePasteText', function(u, v) {
117
+ var cookie = tinymce.util.Cookie;
118
+
119
+ ed.pasteAsPlainText = !ed.pasteAsPlainText;
120
+ ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
121
+
122
+ if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
123
+ if (getParam(ed, "paste_text_sticky")) {
124
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
125
+ } else {
126
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
127
+ }
128
+
129
+ if (!getParam(ed, "paste_text_notifyalways")) {
130
+ cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
131
+ }
132
+ }
133
+ });
134
+ }
135
+
136
+ ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
137
+ ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
138
+
139
+ // This function grabs the contents from the clipboard by adding a
140
+ // hidden div and placing the caret inside it and after the browser paste
141
+ // is done it grabs that contents and processes that
142
+ function grabContent(e) {
143
+ var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
144
+
145
+ // Check if browser supports direct plaintext access
146
+ if (e.clipboardData || dom.doc.dataTransfer) {
147
+ textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
148
+
149
+ if (ed.pasteAsPlainText) {
150
+ e.preventDefault();
151
+ process({content : textContent.replace(/\r?\n/g, '<br />')});
152
+ return;
153
+ }
154
+ }
155
+
156
+ if (dom.get('_mcePaste'))
157
+ return;
158
+
159
+ // Create container to paste into
160
+ n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF<br data-mce-bogus="1">');
161
+
162
+ // If contentEditable mode we need to find out the position of the closest element
163
+ if (body != ed.getDoc().body)
164
+ posY = dom.getPos(ed.selection.getStart(), body).y;
165
+ else
166
+ posY = body.scrollTop + dom.getViewPort().y;
167
+
168
+ // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
169
+ dom.setStyles(n, {
170
+ position : 'absolute',
171
+ left : -10000,
172
+ top : posY,
173
+ width : 1,
174
+ height : 1,
175
+ overflow : 'hidden'
176
+ });
177
+
178
+ if (tinymce.isIE) {
179
+ // Select the container
180
+ rng = dom.doc.body.createTextRange();
181
+ rng.moveToElementText(n);
182
+ rng.execCommand('Paste');
183
+
184
+ // Remove container
185
+ dom.remove(n);
186
+
187
+ // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
188
+ // to IE security settings so we pass the junk though better than nothing right
189
+ if (n.innerHTML === '\uFEFF') {
190
+ ed.execCommand('mcePasteWord');
191
+ e.preventDefault();
192
+ return;
193
+ }
194
+
195
+ // Process contents
196
+ process({content : n.innerHTML});
197
+
198
+ // Block the real paste event
199
+ return tinymce.dom.Event.cancel(e);
200
+ } else {
201
+ function block(e) {
202
+ e.preventDefault();
203
+ };
204
+
205
+ // Block mousedown and click to prevent selection change
206
+ dom.bind(ed.getDoc(), 'mousedown', block);
207
+ dom.bind(ed.getDoc(), 'keydown', block);
208
+
209
+ or = ed.selection.getRng();
210
+
211
+ // Move caret into hidden div
212
+ n = n.firstChild;
213
+ rng = ed.getDoc().createRange();
214
+ rng.setStart(n, 0);
215
+ rng.setEnd(n, 1);
216
+ sel.setRng(rng);
217
+
218
+ // Wait a while and grab the pasted contents
219
+ window.setTimeout(function() {
220
+ var h = '', nl;
221
+
222
+ // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
223
+ if (!dom.select('div.mcePaste > div.mcePaste').length) {
224
+ nl = dom.select('div.mcePaste');
225
+
226
+ // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
227
+ each(nl, function(n) {
228
+ var child = n.firstChild;
229
+
230
+ // WebKit inserts a DIV container with lots of odd styles
231
+ if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
232
+ dom.remove(child, 1);
233
+ }
234
+
235
+ // Remove apply style spans
236
+ each(dom.select('span.Apple-style-span', n), function(n) {
237
+ dom.remove(n, 1);
238
+ });
239
+
240
+ // Remove bogus br elements
241
+ each(dom.select('br[data-mce-bogus]', n), function(n) {
242
+ dom.remove(n);
243
+ });
244
+
245
+ // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
246
+ if (n.parentNode.className != 'mcePaste')
247
+ h += n.innerHTML;
248
+ });
249
+ } else {
250
+ // Found WebKit weirdness so force the content into plain text mode
251
+ h = '<pre>' + dom.encode(textContent).replace(/\r?\n/g, '<br />') + '</pre>';
252
+ }
253
+
254
+ // Remove the nodes
255
+ each(dom.select('div.mcePaste'), function(n) {
256
+ dom.remove(n);
257
+ });
258
+
259
+ // Restore the old selection
260
+ if (or)
261
+ sel.setRng(or);
262
+
263
+ process({content : h});
264
+
265
+ // Unblock events ones we got the contents
266
+ dom.unbind(ed.getDoc(), 'mousedown', block);
267
+ dom.unbind(ed.getDoc(), 'keydown', block);
268
+ }, 0);
269
+ }
270
+ }
271
+
272
+ // Check if we should use the new auto process method
273
+ if (getParam(ed, "paste_auto_cleanup_on_paste")) {
274
+ // Is it's Opera or older FF use key handler
275
+ if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
276
+ ed.onKeyDown.add(function(ed, e) {
277
+ if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
278
+ grabContent(e);
279
+ });
280
+ } else {
281
+ // Grab contents on paste event on Gecko and WebKit
282
+ ed.onPaste.addToTop(function(ed, e) {
283
+ return grabContent(e);
284
+ });
285
+ }
286
+ }
287
+
288
+ // Block all drag/drop events
289
+ if (getParam(ed, "paste_block_drop")) {
290
+ ed.onInit.add(function() {
291
+ ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
292
+ e.preventDefault();
293
+ e.stopPropagation();
294
+
295
+ return false;
296
+ });
297
+ });
298
+ }
299
+
300
+ // Add legacy support
301
+ t._legacySupport();
302
+ },
303
+
304
+ getInfo : function() {
305
+ return {
306
+ longname : 'Paste text/word',
307
+ author : 'Moxiecode Systems AB',
308
+ authorurl : 'http://tinymce.moxiecode.com',
309
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
310
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
311
+ };
312
+ },
313
+
314
+ _preProcess : function(pl, o) {
315
+ //console.log('Before preprocess:' + o.content);
316
+
317
+ var ed = this.editor,
318
+ h = o.content,
319
+ grep = tinymce.grep,
320
+ explode = tinymce.explode,
321
+ trim = tinymce.trim,
322
+ len, stripClass;
323
+
324
+ function process(items) {
325
+ each(items, function(v) {
326
+ // Remove or replace
327
+ if (v.constructor == RegExp)
328
+ h = h.replace(v, '');
329
+ else
330
+ h = h.replace(v[0], v[1]);
331
+ });
332
+ }
333
+
334
+ // Detect Word content and process it more aggressive
335
+ if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
336
+ o.wordContent = true; // Mark the pasted contents as word specific content
337
+ //console.log('Word contents detected.');
338
+
339
+ // Process away some basic content
340
+ process([
341
+ /^\s*(&nbsp;)+/gi, // &nbsp; entities at the start of contents
342
+ /(&nbsp;|<br[^>]*>)+\s*$/gi // &nbsp; entities at the end of contents
343
+ ]);
344
+
345
+ if (getParam(ed, "paste_convert_headers_to_strong")) {
346
+ h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
347
+ }
348
+
349
+ if (getParam(ed, "paste_convert_middot_lists")) {
350
+ process([
351
+ [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
352
+ [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
353
+ [/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
354
+ ]);
355
+ }
356
+
357
+ process([
358
+ // Word comments like conditional comments etc
359
+ /<!--[\s\S]+?-->/gi,
360
+
361
+ // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
362
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
363
+
364
+ // Convert <s> into <strike> for line-though
365
+ [/<(\/?)s>/gi, "<$1strike>"],
366
+
367
+ // Replace nsbp entites to char since it's easier to handle
368
+ [/&nbsp;/gi, "\u00a0"]
369
+ ]);
370
+
371
+ // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
372
+ // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
373
+ do {
374
+ len = h.length;
375
+ h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
376
+ } while (len != h.length);
377
+
378
+ // Remove all spans if no styles is to be retained
379
+ if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
380
+ h = h.replace(/<\/?span[^>]*>/gi, "");
381
+ } else {
382
+ // We're keeping styles, so at least clean them up.
383
+ // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
384
+
385
+ process([
386
+ // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
387
+ [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
388
+ function(str, spaces) {
389
+ return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
390
+ }
391
+ ],
392
+
393
+ // Examine all styles: delete junk, transform some, and keep the rest
394
+ [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
395
+ function(str, tag, style) {
396
+ var n = [],
397
+ i = 0,
398
+ s = explode(trim(style).replace(/&quot;/gi, "'"), ";");
399
+
400
+ // Examine each style definition within the tag's style attribute
401
+ each(s, function(v) {
402
+ var name, value,
403
+ parts = explode(v, ":");
404
+
405
+ function ensureUnits(v) {
406
+ return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
407
+ }
408
+
409
+ if (parts.length == 2) {
410
+ name = parts[0].toLowerCase();
411
+ value = parts[1].toLowerCase();
412
+
413
+ // Translate certain MS Office styles into their CSS equivalents
414
+ switch (name) {
415
+ case "mso-padding-alt":
416
+ case "mso-padding-top-alt":
417
+ case "mso-padding-right-alt":
418
+ case "mso-padding-bottom-alt":
419
+ case "mso-padding-left-alt":
420
+ case "mso-margin-alt":
421
+ case "mso-margin-top-alt":
422
+ case "mso-margin-right-alt":
423
+ case "mso-margin-bottom-alt":
424
+ case "mso-margin-left-alt":
425
+ case "mso-table-layout-alt":
426
+ case "mso-height":
427
+ case "mso-width":
428
+ case "mso-vertical-align-alt":
429
+ n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
430
+ return;
431
+
432
+ case "horiz-align":
433
+ n[i++] = "text-align:" + value;
434
+ return;
435
+
436
+ case "vert-align":
437
+ n[i++] = "vertical-align:" + value;
438
+ return;
439
+
440
+ case "font-color":
441
+ case "mso-foreground":
442
+ n[i++] = "color:" + value;
443
+ return;
444
+
445
+ case "mso-background":
446
+ case "mso-highlight":
447
+ n[i++] = "background:" + value;
448
+ return;
449
+
450
+ case "mso-default-height":
451
+ n[i++] = "min-height:" + ensureUnits(value);
452
+ return;
453
+
454
+ case "mso-default-width":
455
+ n[i++] = "min-width:" + ensureUnits(value);
456
+ return;
457
+
458
+ case "mso-padding-between-alt":
459
+ n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
460
+ return;
461
+
462
+ case "text-line-through":
463
+ if ((value == "single") || (value == "double")) {
464
+ n[i++] = "text-decoration:line-through";
465
+ }
466
+ return;
467
+
468
+ case "mso-zero-height":
469
+ if (value == "yes") {
470
+ n[i++] = "display:none";
471
+ }
472
+ return;
473
+ }
474
+
475
+ // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
476
+ if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {
477
+ return;
478
+ }
479
+
480
+ // If it reached this point, it must be a valid CSS style
481
+ n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case
482
+ }
483
+ });
484
+
485
+ // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
486
+ if (i > 0) {
487
+ return tag + ' style="' + n.join(';') + '"';
488
+ } else {
489
+ return tag;
490
+ }
491
+ }
492
+ ]
493
+ ]);
494
+ }
495
+ }
496
+
497
+ // Replace headers with <strong>
498
+ if (getParam(ed, "paste_convert_headers_to_strong")) {
499
+ process([
500
+ [/<h[1-6][^>]*>/gi, "<p><strong>"],
501
+ [/<\/h[1-6][^>]*>/gi, "</strong></p>"]
502
+ ]);
503
+ }
504
+
505
+ process([
506
+ // Copy paste from Java like Open Office will produce this junk on FF
507
+ [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
508
+ ]);
509
+
510
+ // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
511
+ // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
512
+ stripClass = getParam(ed, "paste_strip_class_attributes");
513
+
514
+ if (stripClass !== "none") {
515
+ function removeClasses(match, g1) {
516
+ if (stripClass === "all")
517
+ return '';
518
+
519
+ var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
520
+ function(v) {
521
+ return (/^(?!mso)/i.test(v));
522
+ }
523
+ );
524
+
525
+ return cls.length ? ' class="' + cls.join(" ") + '"' : '';
526
+ };
527
+
528
+ h = h.replace(/ class="([^"]+)"/gi, removeClasses);
529
+ h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
530
+ }
531
+
532
+ // Remove spans option
533
+ if (getParam(ed, "paste_remove_spans")) {
534
+ h = h.replace(/<\/?span[^>]*>/gi, "");
535
+ }
536
+
537
+ //console.log('After preprocess:' + h);
538
+
539
+ o.content = h;
540
+ },
541
+
542
+ /**
543
+ * Various post process items.
544
+ */
545
+ _postProcess : function(pl, o) {
546
+ var t = this, ed = t.editor, dom = ed.dom, styleProps;
547
+
548
+ if (o.wordContent) {
549
+ // Remove named anchors or TOC links
550
+ each(dom.select('a', o.node), function(a) {
551
+ if (!a.href || a.href.indexOf('#_Toc') != -1)
552
+ dom.remove(a, 1);
553
+ });
554
+
555
+ if (getParam(ed, "paste_convert_middot_lists")) {
556
+ t._convertLists(pl, o);
557
+ }
558
+
559
+ // Process styles
560
+ styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
561
+
562
+ // Process only if a string was specified and not equal to "all" or "*"
563
+ if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
564
+ styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
565
+
566
+ // Retains some style properties
567
+ each(dom.select('*', o.node), function(el) {
568
+ var newStyle = {}, npc = 0, i, sp, sv;
569
+
570
+ // Store a subset of the existing styles
571
+ if (styleProps) {
572
+ for (i = 0; i < styleProps.length; i++) {
573
+ sp = styleProps[i];
574
+ sv = dom.getStyle(el, sp);
575
+
576
+ if (sv) {
577
+ newStyle[sp] = sv;
578
+ npc++;
579
+ }
580
+ }
581
+ }
582
+
583
+ // Remove all of the existing styles
584
+ dom.setAttrib(el, 'style', '');
585
+
586
+ if (styleProps && npc > 0)
587
+ dom.setStyles(el, newStyle); // Add back the stored subset of styles
588
+ else // Remove empty span tags that do not have class attributes
589
+ if (el.nodeName == 'SPAN' && !el.className)
590
+ dom.remove(el, true);
591
+ });
592
+ }
593
+ }
594
+
595
+ // Remove all style information or only specifically on WebKit to avoid the style bug on that browser
596
+ if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
597
+ each(dom.select('*[style]', o.node), function(el) {
598
+ el.removeAttribute('style');
599
+ el.removeAttribute('data-mce-style');
600
+ });
601
+ } else {
602
+ if (tinymce.isWebKit) {
603
+ // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
604
+ // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
605
+ each(dom.select('*', o.node), function(el) {
606
+ el.removeAttribute('data-mce-style');
607
+ });
608
+ }
609
+ }
610
+ },
611
+
612
+ /**
613
+ * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
614
+ */
615
+ _convertLists : function(pl, o) {
616
+ var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
617
+
618
+ // Convert middot lists into real semantic lists
619
+ each(dom.select('p', o.node), function(p) {
620
+ var sib, val = '', type, html, idx, parents;
621
+
622
+ // Get text node value at beginning of paragraph
623
+ for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
624
+ val += sib.nodeValue;
625
+
626
+ val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');
627
+
628
+ // Detect unordered lists look for bullets
629
+ if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val))
630
+ type = 'ul';
631
+
632
+ // Detect ordered lists 1., a. or ixv.
633
+ if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
634
+ type = 'ol';
635
+
636
+ // Check if node value matches the list pattern: o&nbsp;&nbsp;
637
+ if (type) {
638
+ margin = parseFloat(p.style.marginLeft || 0);
639
+
640
+ if (margin > lastMargin)
641
+ levels.push(margin);
642
+
643
+ if (!listElm || type != lastType) {
644
+ listElm = dom.create(type);
645
+ dom.insertAfter(listElm, p);
646
+ } else {
647
+ // Nested list element
648
+ if (margin > lastMargin) {
649
+ listElm = li.appendChild(dom.create(type));
650
+ } else if (margin < lastMargin) {
651
+ // Find parent level based on margin value
652
+ idx = tinymce.inArray(levels, margin);
653
+ parents = dom.getParents(listElm.parentNode, type);
654
+ listElm = parents[parents.length - 1 - idx] || listElm;
655
+ }
656
+ }
657
+
658
+ // Remove middot or number spans if they exists
659
+ each(dom.select('span', p), function(span) {
660
+ var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
661
+
662
+ // Remove span with the middot or the number
663
+ if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html))
664
+ dom.remove(span);
665
+ else if (/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(html))
666
+ dom.remove(span);
667
+ });
668
+
669
+ html = p.innerHTML;
670
+
671
+ // Remove middot/list items
672
+ if (type == 'ul')
673
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/, '');
674
+ else
675
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/, '');
676
+
677
+ // Create li and add paragraph data into the new li
678
+ li = listElm.appendChild(dom.create('li', 0, html));
679
+ dom.remove(p);
680
+
681
+ lastMargin = margin;
682
+ lastType = type;
683
+ } else
684
+ listElm = lastMargin = 0; // End list element
685
+ });
686
+
687
+ // Remove any left over makers
688
+ html = o.node.innerHTML;
689
+ if (html.indexOf('__MCE_ITEM__') != -1)
690
+ o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
691
+ },
692
+
693
+ /**
694
+ * Inserts the specified contents at the caret position.
695
+ */
696
+ _insert : function(h, skip_undo) {
697
+ var ed = this.editor, r = ed.selection.getRng();
698
+
699
+ // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
700
+ if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
701
+ ed.getDoc().execCommand('Delete', false, null);
702
+
703
+ // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents
704
+ ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
705
+ },
706
+
707
+ /**
708
+ * Instead of the old plain text method which tried to re-create a paste operation, the
709
+ * new approach adds a plain text mode toggle switch that changes the behavior of paste.
710
+ * This function is passed the same input that the regular paste plugin produces.
711
+ * It performs additional scrubbing and produces (and inserts) the plain text.
712
+ * This approach leverages all of the great existing functionality in the paste
713
+ * plugin, and requires minimal changes to add the new functionality.
714
+ * Speednet - June 2009
715
+ */
716
+ _insertPlainText : function(ed, dom, h) {
717
+ var i, len, pos, rpos, node, breakElms, before, after,
718
+ w = ed.getWin(),
719
+ d = ed.getDoc(),
720
+ sel = ed.selection,
721
+ is = tinymce.is,
722
+ inArray = tinymce.inArray,
723
+ linebr = getParam(ed, "paste_text_linebreaktype"),
724
+ rl = getParam(ed, "paste_text_replacements");
725
+
726
+ function process(items) {
727
+ each(items, function(v) {
728
+ if (v.constructor == RegExp)
729
+ h = h.replace(v, "");
730
+ else
731
+ h = h.replace(v[0], v[1]);
732
+ });
733
+ };
734
+
735
+ if ((typeof(h) === "string") && (h.length > 0)) {
736
+ // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
737
+ if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) {
738
+ process([
739
+ /[\n\r]+/g
740
+ ]);
741
+ } else {
742
+ // Otherwise just get rid of carriage returns (only need linefeeds)
743
+ process([
744
+ /\r+/g
745
+ ]);
746
+ }
747
+
748
+ process([
749
+ [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them
750
+ [/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows
751
+ [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
752
+ /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
753
+ [/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
754
+ [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars.
755
+ [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks
756
+ /^\s+|\s+$/g // Trim the front & back
757
+ ]);
758
+
759
+ h = dom.decode(tinymce.html.Entities.encodeRaw(h));
760
+
761
+ // Delete any highlighted text before pasting
762
+ if (!sel.isCollapsed()) {
763
+ d.execCommand("Delete", false, null);
764
+ }
765
+
766
+ // Perform default or custom replacements
767
+ if (is(rl, "array") || (is(rl, "array"))) {
768
+ process(rl);
769
+ }
770
+ else if (is(rl, "string")) {
771
+ process(new RegExp(rl, "gi"));
772
+ }
773
+
774
+ // Treat paragraphs as specified in the config
775
+ if (linebr == "none") {
776
+ process([
777
+ [/\n+/g, " "]
778
+ ]);
779
+ }
780
+ else if (linebr == "br") {
781
+ process([
782
+ [/\n/g, "<br />"]
783
+ ]);
784
+ }
785
+ else {
786
+ process([
787
+ /^\s+|\s+$/g,
788
+ [/\n\n/g, "</p><p>"],
789
+ [/\n/g, "<br />"]
790
+ ]);
791
+ }
792
+
793
+ // This next piece of code handles the situation where we're pasting more than one paragraph of plain
794
+ // text, and we are pasting the content into the middle of a block node in the editor. The block
795
+ // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining).
796
+ // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the
797
+ // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between
798
+ // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and
799
+ // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the
800
+ // plain text take the same style as the existing paragraph.)
801
+ if ((pos = h.indexOf("</p><p>")) != -1) {
802
+ rpos = h.lastIndexOf("</p><p>");
803
+ node = sel.getNode();
804
+ breakElms = []; // Get list of elements to break
805
+
806
+ do {
807
+ if (node.nodeType == 1) {
808
+ // Don't break tables and break at body
809
+ if (node.nodeName == "TD" || node.nodeName == "BODY") {
810
+ break;
811
+ }
812
+
813
+ breakElms[breakElms.length] = node;
814
+ }
815
+ } while (node = node.parentNode);
816
+
817
+ // Are we in the middle of a block node?
818
+ if (breakElms.length > 0) {
819
+ before = h.substring(0, pos);
820
+ after = "";
821
+
822
+ for (i=0, len=breakElms.length; i<len; i++) {
823
+ before += "</" + breakElms[i].nodeName.toLowerCase() + ">";
824
+ after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">";
825
+ }
826
+
827
+ if (pos == rpos) {
828
+ h = before + after + h.substring(pos+7);
829
+ }
830
+ else {
831
+ h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7);
832
+ }
833
+ }
834
+ }
835
+
836
+ // Insert content at the caret, plus add a marker for repositioning the caret
837
+ ed.execCommand("mceInsertRawHTML", false, h + '<span id="_plain_text_marker">&nbsp;</span>');
838
+
839
+ // Reposition the caret to the marker, which was placed immediately after the inserted content.
840
+ // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers.
841
+ // The second part of the code scrolls the content up if the caret is positioned off-screen.
842
+ // This is only necessary for WebKit browsers, but it doesn't hurt to use for all.
843
+ window.setTimeout(function() {
844
+ var marker = dom.get('_plain_text_marker'),
845
+ elm, vp, y, elmHeight;
846
+
847
+ sel.select(marker, false);
848
+ d.execCommand("Delete", false, null);
849
+ marker = null;
850
+
851
+ // Get element, position and height
852
+ elm = sel.getStart();
853
+ vp = dom.getViewPort(w);
854
+ y = dom.getPos(elm).y;
855
+ elmHeight = elm.clientHeight;
856
+
857
+ // Is element within viewport if not then scroll it into view
858
+ if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) {
859
+ d.body.scrollTop = y < vp.y ? y : y - vp.h + 25;
860
+ }
861
+ }, 0);
862
+ }
863
+ },
864
+
865
+ /**
866
+ * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
867
+ */
868
+ _legacySupport : function() {
869
+ var t = this, ed = t.editor;
870
+
871
+ // Register command(s) for backwards compatibility
872
+ ed.addCommand("mcePasteWord", function() {
873
+ ed.windowManager.open({
874
+ file: t.url + "/pasteword.htm",
875
+ width: parseInt(getParam(ed, "paste_dialog_width")),
876
+ height: parseInt(getParam(ed, "paste_dialog_height")),
877
+ inline: 1
878
+ });
879
+ });
880
+
881
+ if (getParam(ed, "paste_text_use_dialog")) {
882
+ ed.addCommand("mcePasteText", function() {
883
+ ed.windowManager.open({
884
+ file : t.url + "/pastetext.htm",
885
+ width: parseInt(getParam(ed, "paste_dialog_width")),
886
+ height: parseInt(getParam(ed, "paste_dialog_height")),
887
+ inline : 1
888
+ });
889
+ });
890
+ }
891
+
892
+ // Register button for backwards compatibility
893
+ ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
894
+ }
895
+ });
896
+
897
+ // Register plugin
898
+ tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
899
+ })();