compass-jquery-plugin 0.3.2.6 → 0.3.2.7.nil

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/README.md +2 -1
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +21 -2
  4. data/templates/dynatree/jquery.dynatree.js +23 -20
  5. data/templates/dynatree/jquery.dynatree.min.js +38 -38
  6. data/templates/dynatree/jquery/dynatree/aero.scss +1 -1
  7. data/templates/dynatree/jquery/dynatree/aqua.scss +1 -1
  8. data/templates/dynatree/jquery/dynatree/crystal.scss +1 -1
  9. data/templates/dynatree/jquery/dynatree/xp.scss +2 -2
  10. data/templates/ical/jquery/ical.scss +10 -10
  11. data/templates/jqgrid/i18n/jqgrid/locale-lt.js +134 -0
  12. data/templates/jqgrid/i18n/jqgrid/locale-lt.min.js +7 -0
  13. data/templates/jqgrid/jquery.jqGrid.js +155 -65
  14. data/templates/jqgrid/jquery.jqGrid.min.js +396 -393
  15. data/templates/jqgrid/manifest.rb +2 -0
  16. data/templates/jqtouch/jquery.jqtouch.js +166 -195
  17. data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
  18. data/templates/jqtouch/jquery/touch/apple.scss +5 -5
  19. data/templates/jqtouch/jquery/touch/default.scss +5 -5
  20. data/templates/jqtouch/jquery/touch/jqt.scss +12 -7
  21. data/templates/jqtouch/jquery/touch/jqtouch.scss +11 -13
  22. data/templates/jquery/history.adapter.jquery.js +54 -67
  23. data/templates/jquery/history.adapter.jquery.min.js +2 -2
  24. data/templates/jquery/history.html4.js +587 -680
  25. data/templates/jquery/history.html4.min.js +8 -18
  26. data/templates/jquery/history.js +1670 -1289
  27. data/templates/jquery/history.min.js +25 -21
  28. data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +1 -1
  29. data/templates/jquery/i18n/jquery.ui/datepicker-ar.min.js +1 -1
  30. data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +23 -0
  31. data/templates/jquery/i18n/jquery.ui/datepicker-tj.min.js +2 -0
  32. data/templates/jquery/jquery-ui.js +97 -61
  33. data/templates/jquery/jquery-ui.min.js +175 -175
  34. data/templates/jquery/jquery.dst.js +86 -151
  35. data/templates/jquery/jquery/ui/_theme.scss +13 -13
  36. data/templates/jquery/json2.js +214 -214
  37. data/templates/jquery/manifest.rb +2 -0
  38. data/templates/mobile/jquery.mobile.js +324 -225
  39. data/templates/mobile/jquery.mobile.min.js +4 -4
  40. data/templates/mobile/jquery/mobile/_base.scss +60 -48
  41. data/templates/mobile/jquery/mobile/default.scss +57 -80
  42. data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
  43. data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
  44. data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
  45. data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
  46. data/templates/mobile/jquery/mobile/valencia.scss +61 -73
  47. data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
  48. data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
  49. data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
  50. data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
  51. data/templates/mobile/manifest.rb +0 -8
  52. data/templates/ribbon/jquery/ribbon/office.scss +12 -12
  53. data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
  54. data/templates/tiny_mce/manifest.rb +16 -0
  55. data/templates/tiny_mce/tiny_mce/jquery.tinymce.js +1 -1
  56. data/templates/tiny_mce/tiny_mce/langs/de.js +1 -0
  57. data/templates/tiny_mce/tiny_mce/langs/en.js +1 -222
  58. data/templates/tiny_mce/tiny_mce/plugins/advhr/css/advhr.css +1 -5
  59. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin.js +1 -1
  60. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin_src.js +1 -57
  61. data/templates/tiny_mce/tiny_mce/plugins/advhr/js/rule.js +1 -43
  62. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/de_dlg.js +1 -0
  63. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/en_dlg.js +1 -7
  64. data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +1 -58
  65. data/templates/tiny_mce/tiny_mce/plugins/advimage/css/advimage.css +1 -13
  66. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
  67. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +1 -50
  68. data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +1 -235
  69. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -445
  70. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/de_dlg.js +1 -0
  71. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/en_dlg.js +1 -45
  72. data/templates/tiny_mce/tiny_mce/plugins/advlink/css/advlink.css +1 -8
  73. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin.js +1 -1
  74. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin_src.js +1 -61
  75. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +1 -525
  76. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/de_dlg.js +1 -0
  77. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -54
  78. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -338
  79. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
  80. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -154
  81. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
  82. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -119
  83. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
  84. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +1 -431
  85. data/templates/tiny_mce/tiny_mce/plugins/autosave/langs/en.js +1 -4
  86. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin.js +1 -1
  87. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin_src.js +1 -120
  88. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  89. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -154
  90. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin.js +1 -1
  91. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin_src.js +1 -82
  92. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin.js +1 -1
  93. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin_src.js +1 -43
  94. data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +1 -41
  95. data/templates/tiny_mce/tiny_mce/plugins/emotions/js/emotions.js +1 -22
  96. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/de_dlg.js +1 -0
  97. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -20
  98. data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +1 -22
  99. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin.js +1 -1
  100. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin_src.js +1 -84
  101. data/templates/tiny_mce/tiny_mce/plugins/example/js/dialog.js +1 -19
  102. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en.js +1 -3
  103. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en_dlg.js +1 -3
  104. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +1 -182
  105. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  106. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -166
  107. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -571
  108. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +1 -492
  109. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/de_dlg.js +1 -0
  110. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/en_dlg.js +1 -85
  111. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -1
  112. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin_src.js +1 -159
  113. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/fullscreen.htm +1 -109
  114. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin.js +1 -1
  115. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin_src.js +1 -54
  116. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -1
  117. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +1 -696
  118. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +1 -90
  119. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +1 -387
  120. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -1
  121. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +1 -83
  122. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin.js +1 -1
  123. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin_src.js +1 -214
  124. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -1
  125. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +1 -139
  126. data/templates/tiny_mce/tiny_mce/plugins/media/css/media.css +1 -17
  127. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -1
  128. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +1 -770
  129. data/templates/tiny_mce/tiny_mce/plugins/media/js/embed.js +1 -73
  130. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -340
  131. data/templates/tiny_mce/tiny_mce/plugins/media/langs/de_dlg.js +1 -0
  132. data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +1 -109
  133. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -812
  134. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -1
  135. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +1 -53
  136. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
  137. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -90
  138. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -1
  139. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin_src.js +1 -74
  140. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
  141. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -899
  142. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pastetext.js +1 -36
  143. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pasteword.js +1 -51
  144. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/de_dlg.js +1 -0
  145. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/en_dlg.js +1 -5
  146. data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +1 -27
  147. data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +1 -21
  148. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin.js +1 -1
  149. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin_src.js +1 -53
  150. data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +17 -16
  151. data/templates/tiny_mce/tiny_mce/plugins/preview/jscripts/embed.js +1 -73
  152. data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +10 -9
  153. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin.js +1 -1
  154. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin_src.js +1 -34
  155. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin.js +1 -1
  156. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin_src.js +1 -101
  157. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/css/searchreplace.css +1 -6
  158. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -1
  159. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin_src.js +1 -61
  160. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +1 -140
  161. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/de_dlg.js +1 -0
  162. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/en_dlg.js +1 -16
  163. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +1 -100
  164. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/css/content.css +1 -1
  165. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
  166. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -415
  167. data/templates/tiny_mce/tiny_mce/plugins/style/css/props.css +1 -13
  168. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin.js +1 -1
  169. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin_src.js +1 -55
  170. data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +1 -635
  171. data/templates/tiny_mce/tiny_mce/plugins/style/langs/de_dlg.js +1 -0
  172. data/templates/tiny_mce/tiny_mce/plugins/style/langs/en_dlg.js +1 -70
  173. data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +1 -838
  174. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -1
  175. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +1 -114
  176. data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +1 -178
  177. data/templates/tiny_mce/tiny_mce/plugins/table/css/cell.css +1 -17
  178. data/templates/tiny_mce/tiny_mce/plugins/table/css/row.css +1 -25
  179. data/templates/tiny_mce/tiny_mce/plugins/table/css/table.css +1 -13
  180. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
  181. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1183
  182. data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +1 -284
  183. data/templates/tiny_mce/tiny_mce/plugins/table/js/merge_cells.js +1 -27
  184. data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +1 -232
  185. data/templates/tiny_mce/tiny_mce/plugins/table/js/table.js +1 -450
  186. data/templates/tiny_mce/tiny_mce/plugins/table/langs/de_dlg.js +1 -0
  187. data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +1 -74
  188. data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +1 -32
  189. data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +1 -157
  190. data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +1 -188
  191. data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +1 -12
  192. data/templates/tiny_mce/tiny_mce/plugins/template/css/template.css +1 -23
  193. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin.js +1 -1
  194. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin_src.js +1 -159
  195. data/templates/tiny_mce/tiny_mce/plugins/template/js/template.js +1 -106
  196. data/templates/tiny_mce/tiny_mce/plugins/template/langs/de_dlg.js +1 -0
  197. data/templates/tiny_mce/tiny_mce/plugins/template/langs/en_dlg.js +1 -15
  198. data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +1 -31
  199. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin.js +1 -1
  200. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin_src.js +1 -83
  201. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -1
  202. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +1 -114
  203. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +1 -142
  204. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +1 -142
  205. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +1 -149
  206. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +1 -142
  207. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/attributes.css +1 -11
  208. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/popup.css +1 -9
  209. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +1 -162
  210. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -1
  211. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +1 -132
  212. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +1 -162
  213. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/abbr.js +1 -28
  214. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/acronym.js +1 -28
  215. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +1 -125
  216. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/cite.js +1 -28
  217. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/del.js +1 -53
  218. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/element_common.js +1 -229
  219. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/ins.js +1 -53
  220. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/de_dlg.js +1 -0
  221. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +1 -32
  222. data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +1 -52
  223. data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +1 -26
  224. data/templates/tiny_mce/tiny_mce/themes/advanced/charmap.htm +1 -51
  225. data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +1 -74
  226. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
  227. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1328
  228. data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +1 -80
  229. data/templates/tiny_mce/tiny_mce/themes/advanced/js/about.js +1 -73
  230. data/templates/tiny_mce/tiny_mce/themes/advanced/js/anchor.js +1 -42
  231. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +1 -354
  232. data/templates/tiny_mce/tiny_mce/themes/advanced/js/color_picker.js +1 -329
  233. data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +1 -247
  234. data/templates/tiny_mce/tiny_mce/themes/advanced/js/link.js +1 -153
  235. data/templates/tiny_mce/tiny_mce/themes/advanced/js/source_editor.js +1 -56
  236. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de.js +1 -0
  237. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de_dlg.js +1 -0
  238. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en.js +1 -68
  239. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +1 -54
  240. data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +1 -57
  241. data/templates/tiny_mce/tiny_mce/themes/advanced/shortcuts.htm +1 -47
  242. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +1 -47
  243. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +1 -117
  244. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -213
  245. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/content.css +1 -23
  246. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +1 -105
  247. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +1 -101
  248. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +1 -46
  249. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -116
  250. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -215
  251. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -8
  252. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -5
  253. data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +1 -25
  254. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template.js +1 -1
  255. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template_src.js +1 -84
  256. data/templates/tiny_mce/tiny_mce/themes/simple/langs/de.js +1 -0
  257. data/templates/tiny_mce/tiny_mce/themes/simple/langs/en.js +1 -11
  258. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/content.css +1 -25
  259. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +1 -32
  260. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css +1 -17
  261. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +1 -35
  262. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
  263. data/templates/tiny_mce/tiny_mce/tiny_mce_popup.js +1 -5
  264. data/templates/tiny_mce/tiny_mce/utils/editable_selects.js +1 -70
  265. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +1 -207
  266. data/templates/tiny_mce/tiny_mce/utils/mctabs.js +1 -162
  267. data/templates/tiny_mce/tiny_mce/utils/validate.js +1 -252
  268. metadata +32 -17
  269. data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
  270. data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
  271. data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
  272. data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
  273. data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
  274. data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
  275. data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
  276. data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
@@ -1 +1 @@
1
- (function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(r){n=c.select(":input:enabled,*[tabindex]");function i(s){return s.type!="hidden"&&s.tabIndex!="-1"&&!(n[m].style.display=="none")&&!(n[m].style.visibility=="hidden")}d(n,function(t,s){if(t.id==l.id){j=s;return false}});if(r>0){for(m=j+1;m<n.length;m++){if(i(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(i(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
1
+ (function(){var h=tinymce.DOM,f=tinymce.dom.Event,g=tinymce.each,e=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(c,b){function d(l,k){if(k.keyCode===9){return f.cancel(k)}}function a(r,v){var t,i,w,x,s;function u(k){x=h.select(":input:enabled,*[tabindex]");function j(l){return l.type!="hidden"&&l.tabIndex!="-1"&&!(x[i].style.display=="none")&&!(x[i].style.visibility=="hidden")}g(x,function(l,m){if(l.id==r.id){t=m;return false}});if(k>0){for(i=t+1;i<x.length;i++){if(j(x[i])){return x[i]}}}else{for(i=t-1;i>=0;i--){if(j(x[i])){return x[i]}}}return null}if(v.keyCode===9){s=e(r.getParam("tab_focus",r.getParam("tabfocus_elements",":prev,:next")));if(s.length==1){s[1]=s[0];s[0]=":prev"}if(v.shiftKey){if(s[0]==":prev"){x=u(-1)}else{x=h.get(s[0])}}else{if(s[1]==":next"){x=u(1)}else{x=h.get(s[1])}}if(x){if(x.id&&(r=tinymce.get(x.id||x.name))){r.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}x.focus()},10)}return f.cancel(v)}}}c.onKeyUp.add(d);if(tinymce.isGecko){c.onKeyPress.add(a);c.onKeyDown.add(d)}else{c.onKeyDown.add(a)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
@@ -1,114 +1 @@
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 DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
13
-
14
- tinymce.create('tinymce.plugins.TabFocusPlugin', {
15
- init : function(ed, url) {
16
- function tabCancel(ed, e) {
17
- if (e.keyCode === 9)
18
- return Event.cancel(e);
19
- };
20
-
21
- function tabHandler(ed, e) {
22
- var x, i, f, el, v;
23
-
24
- function find(d) {
25
- el = DOM.select(':input:enabled,*[tabindex]');
26
- function canSelect(e) {
27
- return e.type != 'hidden' &&
28
- e.tabIndex != '-1' &&
29
- !(el[i].style.display == "none") &&
30
- !(el[i].style.visibility == "hidden");
31
- }
32
-
33
- each(el, function(e, i) {
34
- if (e.id == ed.id) {
35
- x = i;
36
- return false;
37
- }
38
- });
39
-
40
- if (d > 0) {
41
- for (i = x + 1; i < el.length; i++) {
42
- if (canSelect(el[i]))
43
- return el[i];
44
- }
45
- } else {
46
- for (i = x - 1; i >= 0; i--) {
47
- if (canSelect(el[i]))
48
- return el[i];
49
- }
50
- }
51
-
52
- return null;
53
- };
54
-
55
- if (e.keyCode === 9) {
56
- v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
57
-
58
- if (v.length == 1) {
59
- v[1] = v[0];
60
- v[0] = ':prev';
61
- }
62
-
63
- // Find element to focus
64
- if (e.shiftKey) {
65
- if (v[0] == ':prev')
66
- el = find(-1);
67
- else
68
- el = DOM.get(v[0]);
69
- } else {
70
- if (v[1] == ':next')
71
- el = find(1);
72
- else
73
- el = DOM.get(v[1]);
74
- }
75
-
76
- if (el) {
77
- if (el.id && (ed = tinymce.get(el.id || el.name)))
78
- ed.focus();
79
- else
80
- window.setTimeout(function() {
81
- if (!tinymce.isWebKit)
82
- window.focus();
83
- el.focus();
84
- }, 10);
85
-
86
- return Event.cancel(e);
87
- }
88
- }
89
- };
90
-
91
- ed.onKeyUp.add(tabCancel);
92
-
93
- if (tinymce.isGecko) {
94
- ed.onKeyPress.add(tabHandler);
95
- ed.onKeyDown.add(tabCancel);
96
- } else
97
- ed.onKeyDown.add(tabHandler);
98
-
99
- },
100
-
101
- getInfo : function() {
102
- return {
103
- longname : 'Tabfocus',
104
- author : 'Moxiecode Systems AB',
105
- authorurl : 'http://tinymce.moxiecode.com',
106
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
107
- version : tinymce.majorVersion + "." + tinymce.minorVersion
108
- };
109
- }
110
- });
111
-
112
- // Register plugin
113
- tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
114
- })();
1
+ (function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(r){n=c.select(":input:enabled,*[tabindex]");function i(s){return s.type!="hidden"&&s.tabIndex!="-1"&&!(n[m].style.display=="none")&&!(n[m].style.visibility=="hidden")}d(n,function(t,s){if(t.id==l.id){j=s;return false}});if(r>0){for(m=j+1;m<n.length;m++){if(i(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(i(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
@@ -1,178 +1 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#table_dlg.cell_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/cell.js"></script>
10
- <link href="css/cell.css" rel="stylesheet" type="text/css" />
11
- </head>
12
- <body id="tablecell" style="display: none" role="application">
13
- <form onsubmit="updateAction();return false;" action="#">
14
- <div class="tabs">
15
- <ul>
16
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
17
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
18
- </ul>
19
- </div>
20
-
21
- <div class="panel_wrapper">
22
- <div id="general_panel" class="panel current">
23
- <fieldset>
24
- <legend>{#table_dlg.general_props}</legend>
25
-
26
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
27
- <tr>
28
- <td><label for="align">{#table_dlg.align}</label></td>
29
- <td>
30
- <select id="align" name="align" class="mceFocus">
31
- <option value="">{#not_set}</option>
32
- <option value="center">{#table_dlg.align_middle}</option>
33
- <option value="left">{#table_dlg.align_left}</option>
34
- <option value="right">{#table_dlg.align_right}</option>
35
- </select>
36
- </td>
37
-
38
- <td><label for="celltype">{#table_dlg.cell_type}</label></td>
39
- <td>
40
- <select id="celltype" name="celltype">
41
- <option value="td">{#table_dlg.td}</option>
42
- <option value="th">{#table_dlg.th}</option>
43
- </select>
44
- </td>
45
- </tr>
46
-
47
- <tr>
48
- <td><label for="valign">{#table_dlg.valign}</label></td>
49
- <td>
50
- <select id="valign" name="valign">
51
- <option value="">{#not_set}</option>
52
- <option value="top">{#table_dlg.align_top}</option>
53
- <option value="middle">{#table_dlg.align_middle}</option>
54
- <option value="bottom">{#table_dlg.align_bottom}</option>
55
- </select>
56
- </td>
57
-
58
- <td><label for="scope">{#table_dlg.scope}</label></td>
59
- <td>
60
- <select id="scope" name="scope">
61
- <option value="">{#not_set}</option>
62
- <option value="col">{#table.col}</option>
63
- <option value="row">{#table.row}</option>
64
- <option value="rowgroup">{#table_dlg.rowgroup}</option>
65
- <option value="colgroup">{#table_dlg.colgroup}</option>
66
- </select>
67
- </td>
68
-
69
- </tr>
70
-
71
- <tr>
72
- <td><label for="width">{#table_dlg.width}</label></td>
73
- <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
74
-
75
- <td><label for="height">{#table_dlg.height}</label></td>
76
- <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
77
- </tr>
78
-
79
- <tr id="styleSelectRow">
80
- <td><label for="class">{#class_name}</label></td>
81
- <td colspan="3">
82
- <select id="class" name="class" class="mceEditableSelect">
83
- <option value="" selected="selected">{#not_set}</option>
84
- </select>
85
- </td>
86
- </tr>
87
- </table>
88
- </fieldset>
89
- </div>
90
-
91
- <div id="advanced_panel" class="panel">
92
- <fieldset>
93
- <legend>{#table_dlg.advanced_props}</legend>
94
-
95
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">
96
- <tr>
97
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>
98
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
99
- </tr>
100
-
101
- <tr>
102
- <td><label for="style">{#table_dlg.style}</label></td>
103
- <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
104
- </tr>
105
-
106
- <tr>
107
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
108
- <td>
109
- <select id="dir" name="dir" style="width: 200px">
110
- <option value="">{#not_set}</option>
111
- <option value="ltr">{#table_dlg.ltr}</option>
112
- <option value="rtl">{#table_dlg.rtl}</option>
113
- </select>
114
- </td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
119
- <td>
120
- <input id="lang" name="lang" type="text" value="" style="width: 200px" />
121
- </td>
122
- </tr>
123
-
124
- <tr>
125
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
126
- <td>
127
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
128
- <tr>
129
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
130
- <td id="backgroundimagebrowsercontainer">&nbsp;</td>
131
- </tr>
132
- </table>
133
- </td>
134
- </tr>
135
-
136
- <tr role="group" aria-labelledby="bordercolor_label">
137
- <td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
138
- <td>
139
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
140
- <tr>
141
- <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
142
- <td id="bordercolor_pickcontainer">&nbsp;</td>
143
- </tr>
144
- </table>
145
- </td>
146
- </tr>
147
-
148
- <tr role="group" aria-labelledby="bgcolor_label">
149
- <td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
150
- <td>
151
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
152
- <tr>
153
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
154
- <td id="bgcolor_pickcontainer">&nbsp;</td>
155
- </tr>
156
- </table>
157
- </td>
158
- </tr>
159
- </table>
160
- </fieldset>
161
- </div>
162
- </div>
163
-
164
- <div class="mceActionPanel">
165
- <div>
166
- <select id="action" name="action">
167
- <option value="cell">{#table_dlg.cell_cell}</option>
168
- <option value="row">{#table_dlg.cell_row}</option>
169
- <option value="all">{#table_dlg.cell_all}</option>
170
- </select>
171
- </div>
172
-
173
- <input type="submit" id="insert" name="insert" value="{#update}" />
174
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
175
- </div>
176
- </form>
177
- </body>
178
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>{#table_dlg.cell_title}</title><script type="text/javascript" src="../../tiny_mce_popup.js"></script><script type="text/javascript" src="../../utils/mctabs.js"></script><script type="text/javascript" src="../../utils/form_utils.js"></script><script type="text/javascript" src="../../utils/editable_selects.js"></script><script type="text/javascript" src="js/cell.js"></script><link href="css/cell.css" rel="stylesheet" type="text/css"/></head><body id="tablecell" style="display: none" role="application"><form onsubmit="updateAction();return false;" action="#"><div class="tabs"><ul><li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li><li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li></ul></div><div class="panel_wrapper"><div id="general_panel" class="panel current"><fieldset><legend>{#table_dlg.general_props}</legend><table role="presentation" border="0" cellpadding="4" cellspacing="0"><tr><td><label for="align">{#table_dlg.align}</label></td><td><select id="align" name="align" class="mceFocus"><option value="">{#not_set}</option><option value="center">{#table_dlg.align_middle}</option><option value="left">{#table_dlg.align_left}</option><option value="right">{#table_dlg.align_right}</option></select></td><td><label for="celltype">{#table_dlg.cell_type}</label></td><td><select id="celltype" name="celltype"><option value="td">{#table_dlg.td}</option><option value="th">{#table_dlg.th}</option></select></td></tr><tr><td><label for="valign">{#table_dlg.valign}</label></td><td><select id="valign" name="valign"><option value="">{#not_set}</option><option value="top">{#table_dlg.align_top}</option><option value="middle">{#table_dlg.align_middle}</option><option value="bottom">{#table_dlg.align_bottom}</option></select></td><td><label for="scope">{#table_dlg.scope}</label></td><td><select id="scope" name="scope"><option value="">{#not_set}</option><option value="col">{#table.col}</option><option value="row">{#table.row}</option><option value="rowgroup">{#table_dlg.rowgroup}</option><option value="colgroup">{#table_dlg.colgroup}</option></select></td></tr><tr><td><label for="width">{#table_dlg.width}</label></td><td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();"/></td><td><label for="height">{#table_dlg.height}</label></td><td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();"/></td></tr><tr id="styleSelectRow"><td><label for="class">{#class_name}</label></td><td colspan="3"><select id="class" name="class" class="mceEditableSelect"><option value="" selected="selected">{#not_set}</option></select></td></tr></table></fieldset></div><div id="advanced_panel" class="panel"><fieldset><legend>{#table_dlg.advanced_props}</legend><table role="presentation" border="0" cellpadding="0" cellspacing="4"><tr><td class="column1"><label for="id">{#table_dlg.id}</label></td><td><input id="id" name="id" type="text" value="" style="width: 200px"/></td></tr><tr><td><label for="style">{#table_dlg.style}</label></td><td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();"/></td></tr><tr><td class="column1"><label for="dir">{#table_dlg.langdir}</label></td><td><select id="dir" name="dir" style="width: 200px"><option value="">{#not_set}</option><option value="ltr">{#table_dlg.ltr}</option><option value="rtl">{#table_dlg.rtl}</option></select></td></tr><tr><td class="column1"><label for="lang">{#table_dlg.langcode}</label></td><td><input id="lang" name="lang" type="text" value="" style="width: 200px"/></td></tr><tr><td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td><td><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();"/></td><td id="backgroundimagebrowsercontainer">&nbsp;</td></tr></table></td></tr><tr role="group" aria-labelledby="bordercolor_label"><td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td><td><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();"/></td><td id="bordercolor_pickcontainer">&nbsp;</td></tr></table></td></tr><tr role="group" aria-labelledby="bgcolor_label"><td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td><td><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();"/></td><td id="bgcolor_pickcontainer">&nbsp;</td></tr></table></td></tr></table></fieldset></div></div><div class="mceActionPanel"><div><select id="action" name="action"><option value="cell">{#table_dlg.cell_cell}</option><option value="row">{#table_dlg.cell_row}</option><option value="all">{#table_dlg.cell_all}</option></select></div><input type="submit" id="insert" name="insert" value="{#update}"/><input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();"/></div></form></body></html>
@@ -1,17 +1 @@
1
- /* CSS file for cell dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 200px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #action {
12
- margin-bottom: 3px;
13
- }
14
-
15
- #class {
16
- width: 150px;
17
- }
1
+ .panel_wrapper div.current{height:200px}.advfield{width:200px}#action{margin-bottom:3px}#class{width:150px}
@@ -1,25 +1 @@
1
- /* CSS file for row dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 200px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #action {
12
- margin-bottom: 3px;
13
- }
14
-
15
- #rowtype,#align,#valign,#class,#height {
16
- width: 150px;
17
- }
18
-
19
- #height {
20
- width: 50px;
21
- }
22
-
23
- .col2 {
24
- padding-left: 20px;
25
- }
1
+ .panel_wrapper div.current{height:200px}.advfield{width:200px}#action{margin-bottom:3px}#rowtype,#align,#valign,#class,#height{width:150px}#height{width:50px}.col2{padding-left:20px}
@@ -1,13 +1 @@
1
- /* CSS file for table dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 245px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #class {
12
- width: 150px;
13
- }
1
+ .panel_wrapper div.current{height:245px}.advfield{width:200px}#class{width:150px}
@@ -1 +1 @@
1
- (function(c){var d=c.each;function b(f,g){var h=g.ownerDocument,e=h.createRange(),j;e.setStartBefore(g);e.setEnd(f.endContainer,f.endOffset);j=h.createElement("body");j.appendChild(e.cloneContents());return j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(H,G,K){var f,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;f=[];d(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);d(O,function(P,Q){Q+=M;d(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(f[Q]){while(f[Q][R]){R++}}U=h(W,"rowspan");V=h(W,"colspan");for(T=Q;T<Q+U;T++){if(!f[T]){f[T]=[]}for(S=R;S<R+V;S++){f[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=f[O];if(N){return N[M]}}function h(N,M){return parseInt(N.getAttribute(M)||1)}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return G.hasClass(M.elm,"mceSelected")||M==o}function k(){var M=[];d(H.rows,function(N){d(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function e(M){var N;c.walk(M,function(P){var O;if(P.nodeType==3){d(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=c.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowspan",1);s(M,"colspan",1);if(N){M.appendChild(N)}else{if(!c.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();d(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}d(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=f[Math.min(f.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=f[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=f[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(e(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(e(P.cells[0]),P.cells[0])}}}}}function C(){d(f,function(M,N){d(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=h(P,"colspan");R=h(P,"rowspan");if(S>1||R>1){s(P,"rowspan",1);s(P,"colspan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(e(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colspan",(X-P)+1);s(T,"rowspan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){V=f[R][U].elm;if(V!=T){N=c.grep(V.childNodes);d(N,function(Z){T.appendChild(Z)});if(N.length){N=c.grep(T.childNodes);Q=0;d(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(P){var M,R,O,Q,S,T,N,U;d(f,function(V,W){d(V,function(Y,X){if(j(Y)){Y=Y.elm;S=Y.parentNode;T=A(S,false);M=W;if(P){return false}}});if(P){return !M}});for(Q=0;Q<f[0].length;Q++){R=f[M][Q].elm;if(R!=O){if(!P){rowSpan=h(R,"rowspan");if(rowSpan>1){s(R,"rowspan",rowSpan+1);continue}}else{if(M>0&&f[M-1][Q]){U=f[M-1][Q].elm;rowSpan=h(U,"rowspan");if(rowSpan>1){s(U,"rowspan",rowSpan+1);continue}}}N=e(R);s(N,"colspan",R.colSpan);T.appendChild(N);O=R}}if(T.hasChildNodes()){if(!P){G.insertAfter(T,S)}else{S.parentNode.insertBefore(T,S)}}}function g(N){var O,M;d(f,function(P,Q){d(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});d(f,function(S,T){var P=S[O].elm,Q,R;if(P!=M){R=h(P,"colspan");Q=h(P,"rowspan");if(R==1){if(!N){G.insertAfter(e(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(e(P),P);u(O,T,Q-1,R)}}else{s(P,"colspan",P.colSpan+1)}M=P}})}function n(){var M=[];d(f,function(N,O){d(N,function(Q,P){if(j(Q)&&c.inArray(M,P)===-1){d(f,function(T){var R=T[P].elm,S;S=h(R,"colspan");if(S>1){s(R,"colspan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");d(Q.cells,function(S){var T=h(S,"rowspan");if(T>1){s(S,"rowspan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);d(f[R.y],function(S){var T;S=S.elm;if(S!=O){T=h(S,"rowspan");if(T<=1){G.remove(S)}else{s(S,"rowspan",T-1)}O=S}})}N=k();d(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();d(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;d(f,function(S){var R;Q=0;d(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}d(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colspan",1);s(R,"rowspan",1)}for(i=S;i<Q;i++){T.appendChild(e(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}})}function F(M){var N;d(f,function(O,P){d(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;d(f,function(P,Q){d(P,function(S,R){var U,T;if(j(S)){S=f[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=f[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=f[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=f[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){G.addClass(f[y][x].elm,"mceSelected")}}}}c.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:g,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}c.create("tinymce.plugins.TablePlugin",{init:function(f,g){var e,k;function j(n){var m=f.selection,l=f.dom.getParent(n||m.getNode(),"table");if(l){return new a(l,f.dom,m)}}function h(){f.getBody().style.webkitUserSelect="";f.dom.removeClass(f.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}d([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(l){f.addButton(l[0],{title:l[1],cmd:l[2],ui:l[3]})});if(!c.isIE){f.onClick.add(function(l,m){m=m.target;if(m.nodeName==="TABLE"){l.selection.select(m)}})}f.onPreProcess.add(function(m,n){var l,o,p,r=m.dom,q;l=r.select("table",n.node);o=l.length;while(o--){p=l[o];r.setAttrib(p,"data-mce-style","");if((q=r.getAttrib(p,"width"))){r.setStyle(p,"width",q);r.setAttrib(p,"width","")}if((q=r.getAttrib(p,"height"))){r.setStyle(p,"height",q);r.setAttrib(p,"height","")}}});f.onNodeChange.add(function(m,l,q){var o;q=m.selection.getStart();o=m.dom.getParent(q,"td,th,caption");l.setActive("table",q.nodeName==="TABLE"||!!o);if(o&&o.nodeName==="CAPTION"){o=0}l.setDisabled("delete_table",!o);l.setDisabled("delete_col",!o);l.setDisabled("delete_table",!o);l.setDisabled("delete_row",!o);l.setDisabled("col_after",!o);l.setDisabled("col_before",!o);l.setDisabled("row_after",!o);l.setDisabled("row_before",!o);l.setDisabled("row_props",!o);l.setDisabled("cell_props",!o);l.setDisabled("split_cells",!o);l.setDisabled("merge_cells",!o)});f.onInit.add(function(m){var l,p,q=m.dom,n;e=m.windowManager;m.onMouseDown.add(function(r,s){if(s.button!=2){h();p=q.getParent(s.target,"td,th");l=q.getParent(p,"table")}});q.bind(m.getDoc(),"mouseover",function(u){var s,r,t=u.target;if(p&&(n||t!=p)&&(t.nodeName=="TD"||t.nodeName=="TH")){r=q.getParent(t,"table");if(r==l){if(!n){n=j(r);n.setStartCell(p);m.getBody().style.webkitUserSelect="none"}n.setEndCell(t)}s=m.selection.getSel();if(s.removeAllRanges){s.removeAllRanges()}else{s.empty()}u.preventDefault()}});m.onMouseUp.add(function(A,B){var s,u=A.selection,C,D=u.getSel(),r,v,t,z;if(p){if(n){A.getBody().style.webkitUserSelect=""}function w(E,G){var F=new c.dom.TreeWalker(E,E);do{if(E.nodeType==3&&c.trim(E.nodeValue).length!=0){if(G){s.setStart(E,0)}else{s.setEnd(E,E.nodeValue.length)}return}if(E.nodeName=="BR"){if(G){s.setStartBefore(E)}else{s.setEndBefore(E)}return}}while(E=(G?F.next():F.prev()))}C=q.select("td.mceSelected,th.mceSelected");if(C.length>0){s=q.createRng();v=C[0];z=C[C.length-1];w(v,1);r=new c.dom.TreeWalker(v,q.getParent(C[0],"table"));do{if(v.nodeName=="TD"||v.nodeName=="TH"){if(!q.hasClass(v,"mceSelected")){break}t=v}}while(v=r.next());w(t);u.setRng(s)}A.nodeChanged();p=n=l=null}});m.onKeyUp.add(function(r,s){h()});if(m&&m.plugins.contextmenu){m.plugins.contextmenu.onContextMenu.add(function(t,r,v){var w,u=m.selection,s=u.getNode()||m.getBody();if(m.dom.getParent(v,"td")||m.dom.getParent(v,"th")||m.dom.select("td.mceSelected,th.mceSelected").length){r.removeAll();if(s.nodeName=="A"&&!m.dom.getAttrib(s,"name")){r.add({title:"advanced.link_desc",icon:"link",cmd:m.plugins.advlink?"mceAdvLink":"mceLink",ui:true});r.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});r.addSeparator()}if(s.nodeName=="IMG"&&s.className.indexOf("mceItem")==-1){r.add({title:"advanced.image_desc",icon:"image",cmd:m.plugins.advimage?"mceAdvImage":"mceImage",ui:true});r.addSeparator()}r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});r.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});r.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});r.addSeparator();w=r.addMenu({title:"table.cell"});w.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});w.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});w.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});w=r.addMenu({title:"table.row"});w.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});w.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});w.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});w.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});w.addSeparator();w.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});w.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});w.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!k);w.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!k);w=r.addMenu({title:"table.col"});w.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});w.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});w.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!c.isIE){function o(){var r;for(r=m.getBody().lastChild;r&&r.nodeType==3&&!r.nodeValue.length;r=r.previousSibling){}if(r&&r.nodeName=="TABLE"){m.dom.add(m.getBody(),"p",null,'<br mce_bogus="1" />')}}if(c.isGecko){m.onKeyDown.add(function(s,u){var r,t,v=s.dom;if(u.keyCode==37||u.keyCode==38){r=s.selection.getRng();t=v.getParent(r.startContainer,"table");if(t&&s.getBody().firstChild==t){if(b(r,t)){r=v.createRng();r.setStartBefore(t);r.setEndBefore(t);s.selection.setRng(r);u.preventDefault()}}}})}m.onKeyUp.add(o);m.onSetContent.add(o);m.onVisualAid.add(o);m.onPreProcess.add(function(r,t){var s=t.node.lastChild;if(s&&s.childNodes.length==1&&s.firstChild.nodeName=="BR"){r.dom.remove(s)}});o()}});d({mceTableSplitCells:function(l){l.split()},mceTableMergeCells:function(m){var n,o,l;l=f.dom.getParent(f.selection.getNode(),"th,td");if(l){n=l.rowSpan;o=l.colSpan}if(!f.dom.select("td.mceSelected,th.mceSelected").length){e.open({url:g+"/merge_cells.htm",width:240+parseInt(f.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(f.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:n,cols:o,onaction:function(p){m.merge(l,p.cols,p.rows)},plugin_url:g})}else{m.merge()}},mceTableInsertRowBefore:function(l){l.insertRow(true)},mceTableInsertRowAfter:function(l){l.insertRow()},mceTableInsertColBefore:function(l){l.insertCol(true)},mceTableInsertColAfter:function(l){l.insertCol()},mceTableDeleteCol:function(l){l.deleteCols()},mceTableDeleteRow:function(l){l.deleteRows()},mceTableCutRow:function(l){k=l.cutRows()},mceTableCopyRow:function(l){k=l.copyRows()},mceTablePasteRowBefore:function(l){l.pasteRows(k,true)},mceTablePasteRowAfter:function(l){l.pasteRows(k)},mceTableDelete:function(l){l.deleteTable()}},function(m,l){f.addCommand(l,function(){var n=j();if(n){m(n);f.execCommand("mceRepaint");h()}})});d({mceInsertTable:function(l){e.open({url:g+"/table.htm",width:400+parseInt(f.getLang("table.table_delta_width",0)),height:320+parseInt(f.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:l?l.action:0})},mceTableRowProps:function(){e.open({url:g+"/row.htm",width:400+parseInt(f.getLang("table.rowprops_delta_width",0)),height:295+parseInt(f.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})},mceTableCellProps:function(){e.open({url:g+"/cell.htm",width:400+parseInt(f.getLang("table.cellprops_delta_width",0)),height:295+parseInt(f.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}},function(m,l){f.addCommand(l,function(n,o){m(o)})})}});c.PluginManager.add("table",c.plugins.TablePlugin)})(tinymce);
1
+ (function(h){var g=h.each;function e(d,c){var b=c.ownerDocument,k=b.createRange(),a;k.setStartBefore(c);k.setEnd(d.endContainer,d.endOffset);a=b.createElement("body");a.appendChild(k.cloneContents());return a.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function f(O,Q,b){var al,a,W,ad;U();ad=Q.getParent(b.getStart(),"th,td");if(ad){a=R(ad);W=M();ad=c(a.x,a.y)}function ac(j,k){j=j.cloneNode(k);j.removeAttribute("id");return j}function U(){var j=0;al=[];g(["thead","tbody","tfoot"],function(l){var k=Q.select("> "+l+" tr",O);g(k,function(n,m){m+=j;g(Q.select("> td, > th",n),function(o,t){var s,r,q,p;if(al[m]){while(al[m][t]){t++}}q=aj(o,"rowspan");p=aj(o,"colspan");for(r=m;r<m+q;r++){if(!al[r]){al[r]=[]}for(s=t;s<t+p;s++){al[r][s]={part:l,real:r==m&&s==t,elm:o,rowspan:q,colspan:p}}}})});j+=k.length})}function c(l,j){var k;k=al[j];if(k){return k[l]}}function aj(j,k){return parseInt(j.getAttribute(k)||1)}function V(j,l,k){if(j){k=parseInt(k);if(k===1){j.removeAttribute(l,1)}else{j.setAttribute(l,k,1)}}}function ai(j){return Q.hasClass(j.elm,"mceSelected")||j==ad}function ah(){var j=[];g(O.rows,function(k){g(k.cells,function(l){if(Q.hasClass(l,"mceSelected")||l==ad.elm){j.push(k);return false}})});return j}function Y(){var j=Q.createRng();j.setStartAfter(O);j.setEndAfter(O);b.setRng(j);Q.remove(O)}function am(k){var j;h.walk(k,function(l){var m;if(l.nodeType==3){g(Q.getParents(l.parentNode,null,k).reverse(),function(n){n=ac(n,false);if(!j){j=m=n}else{if(m){m.appendChild(n)}}m=n});if(m){m.innerHTML=h.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");k=ac(k,false);V(k,"rowspan",1);V(k,"colspan",1);if(j){k.appendChild(j)}else{if(!h.isIE){k.innerHTML='<br data-mce-bogus="1" />'}}return k}function aa(){var j=Q.createRng();g(Q.select("tr",O),function(k){if(k.cells.length==0){Q.remove(k)}});if(Q.select("tr",O).length==0){j.setStartAfter(O);j.setEndAfter(O);b.setRng(j);Q.remove(O);return}g(Q.select("thead,tbody,tfoot",O),function(k){if(k.rows.length==0){Q.remove(k)}});U();row=al[Math.min(al.length-1,a.y)];if(row){b.select(row[Math.min(row.length-1,a.x)].elm,true);b.collapse(true)}}function S(l,n,j,m){var o,q,r,p,k;o=al[n][l].elm.parentNode;for(r=1;r<=j;r++){o=Q.getNext(o,"tr");if(o){for(q=l;q>=0;q--){k=al[n+r][q].elm;if(k.parentNode==o){for(p=1;p<=m;p++){Q.insertAfter(am(k),k)}break}}if(q==-1){for(p=1;p<=m;p++){o.insertBefore(am(o.cells[0]),o.cells[0])}}}}}function X(){g(al,function(k,j){g(k,function(p,q){var m,n,l,o;if(ai(p)){p=p.elm;m=aj(p,"colspan");n=aj(p,"rowspan");if(m>1||n>1){V(p,"rowspan",1);V(p,"colspan",1);for(o=0;o<m-1;o++){Q.insertAfter(am(p),p)}S(q,j,n-1,m)}}})})}function ab(m,p,j){var s,t,k,l,n,q,o,v,m,u,r;if(m){pos=R(m);s=pos.x;t=pos.y;k=s+(p-1);l=t+(j-1)}else{s=a.x;t=a.y;k=W.x;l=W.y}o=c(s,t);v=c(k,l);if(o&&v&&o.part==v.part){X();U();o=c(s,t).elm;V(o,"colspan",(k-s)+1);V(o,"rowspan",(l-t)+1);for(q=t;q<=l;q++){for(n=s;n<=k;n++){m=al[q][n].elm;if(m!=o){u=h.grep(m.childNodes);g(u,function(w){o.appendChild(w)});if(u.length){u=h.grep(o.childNodes);r=0;g(u,function(w){if(w.nodeName=="BR"&&Q.getAttrib(w,"data-mce-bogus")&&r++<u.length-1){o.removeChild(w)}})}Q.remove(m)}}}aa()}}function ag(o){var r,m,p,n,l,k,q,j;g(al,function(t,s){g(t,function(u,v){if(ai(u)){u=u.elm;l=u.parentNode;k=ac(l,false);r=s;if(o){return false}}});if(o){return !r}});for(n=0;n<al[0].length;n++){m=al[r][n].elm;if(m!=p){if(!o){rowSpan=aj(m,"rowspan");if(rowSpan>1){V(m,"rowspan",rowSpan+1);continue}}else{if(r>0&&al[r-1][n]){j=al[r-1][n].elm;rowSpan=aj(j,"rowspan");if(rowSpan>1){V(j,"rowspan",rowSpan+1);continue}}}q=am(m);V(q,"colspan",m.colSpan);k.appendChild(q);p=m}}if(k.hasChildNodes()){if(!o){Q.insertAfter(k,l)}else{l.parentNode.insertBefore(k,l)}}}function ak(k){var j,l;g(al,function(n,m){g(n,function(o,p){if(ai(o)){j=p;if(k){return false}}});if(k){return !j}});g(al,function(n,m){var q=n[j].elm,p,o;if(q!=l){o=aj(q,"colspan");p=aj(q,"rowspan");if(o==1){if(!k){Q.insertAfter(am(q),q);S(j,m,p-1,o)}else{q.parentNode.insertBefore(am(q),q);S(j,m,p-1,o)}}else{V(q,"colspan",q.colSpan+1)}l=q}})}function ae(){var j=[];g(al,function(l,k){g(l,function(m,n){if(ai(m)&&h.inArray(j,n)===-1){g(al,function(o){var q=o[n].elm,p;p=aj(q,"colspan");if(p>1){V(q,"colspan",p-1)}else{Q.remove(q)}});j.push(n)}})});aa()}function af(){var j;function k(m){var n,l,o;n=Q.getNext(m,"tr");g(m.cells,function(q){var p=aj(q,"rowspan");if(p>1){V(q,"rowspan",p-1);l=R(q);S(l.x,l.y,1,1)}});l=R(m.cells[0]);g(al[l.y],function(q){var p;q=q.elm;if(q!=o){p=aj(q,"rowspan");if(p<=1){Q.remove(q)}else{V(q,"rowspan",p-1)}o=q}})}j=ah();g(j.reverse(),function(l){k(l)});aa()}function T(){var j=ah();Q.remove(j);aa();return j}function d(){var j=ah();g(j,function(k,l){j[l]=ac(k,true)});return j}function Z(l,m){var k=ah(),n=k[m?0:k.length-1],j=n.cells.length;g(al,function(o){var p;j=0;g(o,function(q,r){if(q.real){j+=q.colspan}if(q.elm.parentNode==n){p=1}});if(p){return false}});if(!m){l.reverse()}g(l,function(o){var p=o.cells.length,q;for(i=0;i<p;i++){q=o.cells[i];V(q,"colspan",1);V(q,"rowspan",1)}for(i=p;i<j;i++){o.appendChild(am(o.cells[p-1]))}for(i=j;i<p;i++){Q.remove(o.cells[i])}if(m){n.parentNode.insertBefore(o,n)}else{Q.insertAfter(o,n)}})}function R(k){var j;g(al,function(m,l){g(m,function(n,o){if(n.elm==k){j={x:o,y:l};return false}});return !j});return j}function N(j){a=R(j)}function M(){var j,k,l;k=l=0;g(al,function(n,m){g(n,function(q,r){var o,p;if(ai(q)){q=al[m][r];if(r>k){k=r}if(m>l){l=m}if(q.real){o=q.colspan-1;p=q.rowspan-1;if(o){if(r+o>k){k=r+o}}if(p){if(m+p>l){l=m+p}}}}})});return{x:k,y:l}}function P(l){var o,p,j,k,q,r,n,m;W=R(l);if(a&&W){o=Math.min(a.x,W.x);p=Math.min(a.y,W.y);j=Math.max(a.x,W.x);k=Math.max(a.y,W.y);q=j;r=k;for(y=p;y<=r;y++){l=al[y][o];if(!l.real){if(o-(l.colspan-1)<o){o-=l.colspan-1}}}for(x=o;x<=q;x++){l=al[p][x];if(!l.real){if(p-(l.rowspan-1)<p){p-=l.rowspan-1}}}for(y=p;y<=k;y++){for(x=o;x<=j;x++){l=al[y][x];if(l.real){n=l.colspan-1;m=l.rowspan-1;if(n){if(x+n>q){q=x+n}}if(m){if(y+m>r){r=y+m}}}}}Q.removeClass(Q.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=p;y<=r;y++){for(x=o;x<=q;x++){Q.addClass(al[y][x].elm,"mceSelected")}}}}h.extend(this,{deleteTable:Y,split:X,merge:ab,insertRow:ag,insertCol:ak,deleteCols:ae,deleteRows:af,cutRows:T,copyRows:d,pasteRows:Z,getPos:R,setStartCell:N,setEndCell:P})}h.create("tinymce.plugins.TablePlugin",{init:function(l,d){var m,a;function b(o){var j=l.selection,k=l.dom.getParent(o||j.getNode(),"table");if(k){return new f(k,l.dom,j)}}function c(){l.getBody().style.webkitUserSelect="";l.dom.removeClass(l.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}g([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(j){l.addButton(j[0],{title:j[1],cmd:j[2],ui:j[3]})});if(!h.isIE){l.onClick.add(function(k,j){j=j.target;if(j.nodeName==="TABLE"){k.selection.select(j)}})}l.onPreProcess.add(function(j,w){var k,v,u,s=j.dom,t;k=s.select("table",w.node);v=k.length;while(v--){u=k[v];s.setAttrib(u,"data-mce-style","");if((t=s.getAttrib(u,"width"))){s.setStyle(u,"width",t);s.setAttrib(u,"width","")}if((t=s.getAttrib(u,"height"))){s.setStyle(u,"height",t);s.setAttrib(u,"height","")}}});l.onNodeChange.add(function(j,k,n){var p;n=j.selection.getStart();p=j.dom.getParent(n,"td,th,caption");k.setActive("table",n.nodeName==="TABLE"||!!p);if(p&&p.nodeName==="CAPTION"){p=0}k.setDisabled("delete_table",!p);k.setDisabled("delete_col",!p);k.setDisabled("delete_table",!p);k.setDisabled("delete_row",!p);k.setDisabled("col_after",!p);k.setDisabled("col_before",!p);k.setDisabled("row_after",!p);k.setDisabled("row_before",!p);k.setDisabled("row_props",!p);k.setDisabled("cell_props",!p);k.setDisabled("split_cells",!p);k.setDisabled("merge_cells",!p)});l.onInit.add(function(j){var k,s,r=j.dom,u;m=j.windowManager;j.onMouseDown.add(function(o,n){if(n.button!=2){c();s=r.getParent(n.target,"td,th");k=r.getParent(s,"table")}});r.bind(j.getDoc(),"mouseover",function(n){var p,q,o=n.target;if(s&&(u||o!=s)&&(o.nodeName=="TD"||o.nodeName=="TH")){q=r.getParent(o,"table");if(q==k){if(!u){u=b(q);u.setStartCell(s);j.getBody().style.webkitUserSelect="none"}u.setEndCell(o)}p=j.selection.getSel();if(p.removeAllRanges){p.removeAllRanges()}else{p.empty()}n.preventDefault()}});j.onMouseUp.add(function(E,q){var K,I=E.selection,p,n=I.getSel(),o,H,J,F;if(s){if(u){E.getBody().style.webkitUserSelect=""}function G(z,v){var w=new h.dom.TreeWalker(z,z);do{if(z.nodeType==3&&h.trim(z.nodeValue).length!=0){if(v){K.setStart(z,0)}else{K.setEnd(z,z.nodeValue.length)}return}if(z.nodeName=="BR"){if(v){K.setStartBefore(z)}else{K.setEndBefore(z)}return}}while(z=(v?w.next():w.prev()))}p=r.select("td.mceSelected,th.mceSelected");if(p.length>0){K=r.createRng();H=p[0];F=p[p.length-1];G(H,1);o=new h.dom.TreeWalker(H,r.getParent(p[0],"table"));do{if(H.nodeName=="TD"||H.nodeName=="TH"){if(!r.hasClass(H,"mceSelected")){break}J=H}}while(H=o.next());G(J);I.setRng(K)}E.nodeChanged();s=u=k=null}});j.onKeyUp.add(function(o,n){c()});if(j&&j.plugins.contextmenu){j.plugins.contextmenu.onContextMenu.add(function(q,A,o){var n,p=j.selection,z=p.getNode()||j.getBody();if(j.dom.getParent(o,"td")||j.dom.getParent(o,"th")||j.dom.select("td.mceSelected,th.mceSelected").length){A.removeAll();if(z.nodeName=="A"&&!j.dom.getAttrib(z,"name")){A.add({title:"advanced.link_desc",icon:"link",cmd:j.plugins.advlink?"mceAdvLink":"mceLink",ui:true});A.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});A.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){A.add({title:"advanced.image_desc",icon:"image",cmd:j.plugins.advimage?"mceAdvImage":"mceImage",ui:true});A.addSeparator()}A.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});A.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});A.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});A.addSeparator();n=A.addMenu({title:"table.cell"});n.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});n.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});n.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});n=A.addMenu({title:"table.row"});n.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});n.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});n.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});n.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});n.addSeparator();n.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});n.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});n.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!a);n.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!a);n=A.addMenu({title:"table.col"});n.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});n.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});n.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{A.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!h.isIE){function t(){var n;for(n=j.getBody().lastChild;n&&n.nodeType==3&&!n.nodeValue.length;n=n.previousSibling){}if(n&&n.nodeName=="TABLE"){j.dom.add(j.getBody(),"p",null,'<br mce_bogus="1" />')}}if(h.isGecko){j.onKeyDown.add(function(q,o){var w,p,n=q.dom;if(o.keyCode==37||o.keyCode==38){w=q.selection.getRng();p=n.getParent(w.startContainer,"table");if(p&&q.getBody().firstChild==p){if(e(w,p)){w=n.createRng();w.setStartBefore(p);w.setEndBefore(p);q.selection.setRng(w);o.preventDefault()}}}})}j.onKeyUp.add(t);j.onSetContent.add(t);j.onVisualAid.add(t);j.onPreProcess.add(function(p,n){var o=n.node.lastChild;if(o&&o.childNodes.length==1&&o.firstChild.nodeName=="BR"){p.dom.remove(o)}});t()}});g({mceTableSplitCells:function(j){j.split()},mceTableMergeCells:function(j){var q,p,k;k=l.dom.getParent(l.selection.getNode(),"th,td");if(k){q=k.rowSpan;p=k.colSpan}if(!l.dom.select("td.mceSelected,th.mceSelected").length){m.open({url:d+"/merge_cells.htm",width:240+parseInt(l.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(l.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:q,cols:p,onaction:function(n){j.merge(k,n.cols,n.rows)},plugin_url:d})}else{j.merge()}},mceTableInsertRowBefore:function(j){j.insertRow(true)},mceTableInsertRowAfter:function(j){j.insertRow()},mceTableInsertColBefore:function(j){j.insertCol(true)},mceTableInsertColAfter:function(j){j.insertCol()},mceTableDeleteCol:function(j){j.deleteCols()},mceTableDeleteRow:function(j){j.deleteRows()},mceTableCutRow:function(j){a=j.cutRows()},mceTableCopyRow:function(j){a=j.copyRows()},mceTablePasteRowBefore:function(j){j.pasteRows(a,true)},mceTablePasteRowAfter:function(j){j.pasteRows(a)},mceTableDelete:function(j){j.deleteTable()}},function(j,k){l.addCommand(k,function(){var o=b();if(o){j(o);l.execCommand("mceRepaint");c()}})});g({mceInsertTable:function(j){m.open({url:d+"/table.htm",width:400+parseInt(l.getLang("table.table_delta_width",0)),height:320+parseInt(l.getLang("table.table_delta_height",0)),inline:1},{plugin_url:d,action:j?j.action:0})},mceTableRowProps:function(){m.open({url:d+"/row.htm",width:400+parseInt(l.getLang("table.rowprops_delta_width",0)),height:295+parseInt(l.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:d})},mceTableCellProps:function(){m.open({url:d+"/cell.htm",width:400+parseInt(l.getLang("table.cellprops_delta_width",0)),height:295+parseInt(l.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:d})}},function(j,k){l.addCommand(k,function(q,p){j(p)})})}});h.PluginManager.add("table",h.plugins.TablePlugin)})(tinymce);
@@ -1,1183 +1 @@
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(tinymce) {
12
- var each = tinymce.each;
13
-
14
- // Checks if the selection/caret is at the start of the specified block element
15
- function isAtStart(rng, par) {
16
- var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
17
-
18
- rng2.setStartBefore(par);
19
- rng2.setEnd(rng.endContainer, rng.endOffset);
20
-
21
- elm = doc.createElement('body');
22
- elm.appendChild(rng2.cloneContents());
23
-
24
- // Check for text characters of other elements that should be treated as content
25
- return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
26
- };
27
-
28
- /**
29
- * Table Grid class.
30
- */
31
- function TableGrid(table, dom, selection) {
32
- var grid, startPos, endPos, selectedCell;
33
-
34
- buildGrid();
35
- selectedCell = dom.getParent(selection.getStart(), 'th,td');
36
- if (selectedCell) {
37
- startPos = getPos(selectedCell);
38
- endPos = findEndPos();
39
- selectedCell = getCell(startPos.x, startPos.y);
40
- }
41
-
42
- function cloneNode(node, children) {
43
- node = node.cloneNode(children);
44
- node.removeAttribute('id');
45
-
46
- return node;
47
- }
48
-
49
- function buildGrid() {
50
- var startY = 0;
51
-
52
- grid = [];
53
-
54
- each(['thead', 'tbody', 'tfoot'], function(part) {
55
- var rows = dom.select('> ' + part + ' tr', table);
56
-
57
- each(rows, function(tr, y) {
58
- y += startY;
59
-
60
- each(dom.select('> td, > th', tr), function(td, x) {
61
- var x2, y2, rowspan, colspan;
62
-
63
- // Skip over existing cells produced by rowspan
64
- if (grid[y]) {
65
- while (grid[y][x])
66
- x++;
67
- }
68
-
69
- // Get col/rowspan from cell
70
- rowspan = getSpanVal(td, 'rowspan');
71
- colspan = getSpanVal(td, 'colspan');
72
-
73
- // Fill out rowspan/colspan right and down
74
- for (y2 = y; y2 < y + rowspan; y2++) {
75
- if (!grid[y2])
76
- grid[y2] = [];
77
-
78
- for (x2 = x; x2 < x + colspan; x2++) {
79
- grid[y2][x2] = {
80
- part : part,
81
- real : y2 == y && x2 == x,
82
- elm : td,
83
- rowspan : rowspan,
84
- colspan : colspan
85
- };
86
- }
87
- }
88
- });
89
- });
90
-
91
- startY += rows.length;
92
- });
93
- };
94
-
95
- function getCell(x, y) {
96
- var row;
97
-
98
- row = grid[y];
99
- if (row)
100
- return row[x];
101
- };
102
-
103
- function getSpanVal(td, name) {
104
- return parseInt(td.getAttribute(name) || 1);
105
- };
106
-
107
- function setSpanVal(td, name, val) {
108
- if (td) {
109
- val = parseInt(val);
110
-
111
- if (val === 1)
112
- td.removeAttribute(name, 1);
113
- else
114
- td.setAttribute(name, val, 1);
115
- }
116
- }
117
-
118
- function isCellSelected(cell) {
119
- return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell;
120
- };
121
-
122
- function getSelectedRows() {
123
- var rows = [];
124
-
125
- each(table.rows, function(row) {
126
- each(row.cells, function(cell) {
127
- if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
128
- rows.push(row);
129
- return false;
130
- }
131
- });
132
- });
133
-
134
- return rows;
135
- };
136
-
137
- function deleteTable() {
138
- var rng = dom.createRng();
139
-
140
- rng.setStartAfter(table);
141
- rng.setEndAfter(table);
142
-
143
- selection.setRng(rng);
144
-
145
- dom.remove(table);
146
- };
147
-
148
- function cloneCell(cell) {
149
- var formatNode;
150
-
151
- // Clone formats
152
- tinymce.walk(cell, function(node) {
153
- var curNode;
154
-
155
- if (node.nodeType == 3) {
156
- each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
157
- node = cloneNode(node, false);
158
-
159
- if (!formatNode)
160
- formatNode = curNode = node;
161
- else if (curNode)
162
- curNode.appendChild(node);
163
-
164
- curNode = node;
165
- });
166
-
167
- // Add something to the inner node
168
- if (curNode)
169
- curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />';
170
-
171
- return false;
172
- }
173
- }, 'childNodes');
174
-
175
- cell = cloneNode(cell, false);
176
- setSpanVal(cell, 'rowspan', 1);
177
- setSpanVal(cell, 'colspan', 1);
178
-
179
- if (formatNode) {
180
- cell.appendChild(formatNode);
181
- } else {
182
- if (!tinymce.isIE)
183
- cell.innerHTML = '<br data-mce-bogus="1" />';
184
- }
185
-
186
- return cell;
187
- };
188
-
189
- function cleanup() {
190
- var rng = dom.createRng();
191
-
192
- // Empty rows
193
- each(dom.select('tr', table), function(tr) {
194
- if (tr.cells.length == 0)
195
- dom.remove(tr);
196
- });
197
-
198
- // Empty table
199
- if (dom.select('tr', table).length == 0) {
200
- rng.setStartAfter(table);
201
- rng.setEndAfter(table);
202
- selection.setRng(rng);
203
- dom.remove(table);
204
- return;
205
- }
206
-
207
- // Empty header/body/footer
208
- each(dom.select('thead,tbody,tfoot', table), function(part) {
209
- if (part.rows.length == 0)
210
- dom.remove(part);
211
- });
212
-
213
- // Restore selection to start position if it still exists
214
- buildGrid();
215
-
216
- // Restore the selection to the closest table position
217
- row = grid[Math.min(grid.length - 1, startPos.y)];
218
- if (row) {
219
- selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
220
- selection.collapse(true);
221
- }
222
- };
223
-
224
- function fillLeftDown(x, y, rows, cols) {
225
- var tr, x2, r, c, cell;
226
-
227
- tr = grid[y][x].elm.parentNode;
228
- for (r = 1; r <= rows; r++) {
229
- tr = dom.getNext(tr, 'tr');
230
-
231
- if (tr) {
232
- // Loop left to find real cell
233
- for (x2 = x; x2 >= 0; x2--) {
234
- cell = grid[y + r][x2].elm;
235
-
236
- if (cell.parentNode == tr) {
237
- // Append clones after
238
- for (c = 1; c <= cols; c++)
239
- dom.insertAfter(cloneCell(cell), cell);
240
-
241
- break;
242
- }
243
- }
244
-
245
- if (x2 == -1) {
246
- // Insert nodes before first cell
247
- for (c = 1; c <= cols; c++)
248
- tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
249
- }
250
- }
251
- }
252
- };
253
-
254
- function split() {
255
- each(grid, function(row, y) {
256
- each(row, function(cell, x) {
257
- var colSpan, rowSpan, newCell, i;
258
-
259
- if (isCellSelected(cell)) {
260
- cell = cell.elm;
261
- colSpan = getSpanVal(cell, 'colspan');
262
- rowSpan = getSpanVal(cell, 'rowspan');
263
-
264
- if (colSpan > 1 || rowSpan > 1) {
265
- setSpanVal(cell, 'rowspan', 1);
266
- setSpanVal(cell, 'colspan', 1);
267
-
268
- // Insert cells right
269
- for (i = 0; i < colSpan - 1; i++)
270
- dom.insertAfter(cloneCell(cell), cell);
271
-
272
- fillLeftDown(x, y, rowSpan - 1, colSpan);
273
- }
274
- }
275
- });
276
- });
277
- };
278
-
279
- function merge(cell, cols, rows) {
280
- var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;
281
-
282
- // Use specified cell and cols/rows
283
- if (cell) {
284
- pos = getPos(cell);
285
- startX = pos.x;
286
- startY = pos.y;
287
- endX = startX + (cols - 1);
288
- endY = startY + (rows - 1);
289
- } else {
290
- // Use selection
291
- startX = startPos.x;
292
- startY = startPos.y;
293
- endX = endPos.x;
294
- endY = endPos.y;
295
- }
296
-
297
- // Find start/end cells
298
- startCell = getCell(startX, startY);
299
- endCell = getCell(endX, endY);
300
-
301
- // Check if the cells exists and if they are of the same part for example tbody = tbody
302
- if (startCell && endCell && startCell.part == endCell.part) {
303
- // Split and rebuild grid
304
- split();
305
- buildGrid();
306
-
307
- // Set row/col span to start cell
308
- startCell = getCell(startX, startY).elm;
309
- setSpanVal(startCell, 'colspan', (endX - startX) + 1);
310
- setSpanVal(startCell, 'rowspan', (endY - startY) + 1);
311
-
312
- // Remove other cells and add it's contents to the start cell
313
- for (y = startY; y <= endY; y++) {
314
- for (x = startX; x <= endX; x++) {
315
- cell = grid[y][x].elm;
316
-
317
- if (cell != startCell) {
318
- // Move children to startCell
319
- children = tinymce.grep(cell.childNodes);
320
- each(children, function(node) {
321
- startCell.appendChild(node);
322
- });
323
-
324
- // Remove bogus nodes if there is children in the target cell
325
- if (children.length) {
326
- children = tinymce.grep(startCell.childNodes);
327
- count = 0;
328
- each(children, function(node) {
329
- if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
330
- startCell.removeChild(node);
331
- });
332
- }
333
-
334
- // Remove cell
335
- dom.remove(cell);
336
- }
337
- }
338
- }
339
-
340
- // Remove empty rows etc and restore caret location
341
- cleanup();
342
- }
343
- };
344
-
345
- function insertRow(before) {
346
- var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell;
347
-
348
- // Find first/last row
349
- each(grid, function(row, y) {
350
- each(row, function(cell, x) {
351
- if (isCellSelected(cell)) {
352
- cell = cell.elm;
353
- rowElm = cell.parentNode;
354
- newRow = cloneNode(rowElm, false);
355
- posY = y;
356
-
357
- if (before)
358
- return false;
359
- }
360
- });
361
-
362
- if (before)
363
- return !posY;
364
- });
365
-
366
- for (x = 0; x < grid[0].length; x++) {
367
- cell = grid[posY][x].elm;
368
-
369
- if (cell != lastCell) {
370
- if (!before) {
371
- rowSpan = getSpanVal(cell, 'rowspan');
372
- if (rowSpan > 1) {
373
- setSpanVal(cell, 'rowspan', rowSpan + 1);
374
- continue;
375
- }
376
- } else {
377
- // Check if cell above can be expanded
378
- if (posY > 0 && grid[posY - 1][x]) {
379
- otherCell = grid[posY - 1][x].elm;
380
- rowSpan = getSpanVal(otherCell, 'rowspan');
381
- if (rowSpan > 1) {
382
- setSpanVal(otherCell, 'rowspan', rowSpan + 1);
383
- continue;
384
- }
385
- }
386
- }
387
-
388
- // Insert new cell into new row
389
- newCell = cloneCell(cell);
390
- setSpanVal(newCell, 'colspan', cell.colSpan);
391
-
392
- newRow.appendChild(newCell);
393
-
394
- lastCell = cell;
395
- }
396
- }
397
-
398
- if (newRow.hasChildNodes()) {
399
- if (!before)
400
- dom.insertAfter(newRow, rowElm);
401
- else
402
- rowElm.parentNode.insertBefore(newRow, rowElm);
403
- }
404
- };
405
-
406
- function insertCol(before) {
407
- var posX, lastCell;
408
-
409
- // Find first/last column
410
- each(grid, function(row, y) {
411
- each(row, function(cell, x) {
412
- if (isCellSelected(cell)) {
413
- posX = x;
414
-
415
- if (before)
416
- return false;
417
- }
418
- });
419
-
420
- if (before)
421
- return !posX;
422
- });
423
-
424
- each(grid, function(row, y) {
425
- var cell = row[posX].elm, rowSpan, colSpan;
426
-
427
- if (cell != lastCell) {
428
- colSpan = getSpanVal(cell, 'colspan');
429
- rowSpan = getSpanVal(cell, 'rowspan');
430
-
431
- if (colSpan == 1) {
432
- if (!before) {
433
- dom.insertAfter(cloneCell(cell), cell);
434
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
435
- } else {
436
- cell.parentNode.insertBefore(cloneCell(cell), cell);
437
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
438
- }
439
- } else
440
- setSpanVal(cell, 'colspan', cell.colSpan + 1);
441
-
442
- lastCell = cell;
443
- }
444
- });
445
- };
446
-
447
- function deleteCols() {
448
- var cols = [];
449
-
450
- // Get selected column indexes
451
- each(grid, function(row, y) {
452
- each(row, function(cell, x) {
453
- if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
454
- each(grid, function(row) {
455
- var cell = row[x].elm, colSpan;
456
-
457
- colSpan = getSpanVal(cell, 'colspan');
458
-
459
- if (colSpan > 1)
460
- setSpanVal(cell, 'colspan', colSpan - 1);
461
- else
462
- dom.remove(cell);
463
- });
464
-
465
- cols.push(x);
466
- }
467
- });
468
- });
469
-
470
- cleanup();
471
- };
472
-
473
- function deleteRows() {
474
- var rows;
475
-
476
- function deleteRow(tr) {
477
- var nextTr, pos, lastCell;
478
-
479
- nextTr = dom.getNext(tr, 'tr');
480
-
481
- // Move down row spanned cells
482
- each(tr.cells, function(cell) {
483
- var rowSpan = getSpanVal(cell, 'rowspan');
484
-
485
- if (rowSpan > 1) {
486
- setSpanVal(cell, 'rowspan', rowSpan - 1);
487
- pos = getPos(cell);
488
- fillLeftDown(pos.x, pos.y, 1, 1);
489
- }
490
- });
491
-
492
- // Delete cells
493
- pos = getPos(tr.cells[0]);
494
- each(grid[pos.y], function(cell) {
495
- var rowSpan;
496
-
497
- cell = cell.elm;
498
-
499
- if (cell != lastCell) {
500
- rowSpan = getSpanVal(cell, 'rowspan');
501
-
502
- if (rowSpan <= 1)
503
- dom.remove(cell);
504
- else
505
- setSpanVal(cell, 'rowspan', rowSpan - 1);
506
-
507
- lastCell = cell;
508
- }
509
- });
510
- };
511
-
512
- // Get selected rows and move selection out of scope
513
- rows = getSelectedRows();
514
-
515
- // Delete all selected rows
516
- each(rows.reverse(), function(tr) {
517
- deleteRow(tr);
518
- });
519
-
520
- cleanup();
521
- };
522
-
523
- function cutRows() {
524
- var rows = getSelectedRows();
525
-
526
- dom.remove(rows);
527
- cleanup();
528
-
529
- return rows;
530
- };
531
-
532
- function copyRows() {
533
- var rows = getSelectedRows();
534
-
535
- each(rows, function(row, i) {
536
- rows[i] = cloneNode(row, true);
537
- });
538
-
539
- return rows;
540
- };
541
-
542
- function pasteRows(rows, before) {
543
- var selectedRows = getSelectedRows(),
544
- targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
545
- targetCellCount = targetRow.cells.length;
546
-
547
- // Calc target cell count
548
- each(grid, function(row) {
549
- var match;
550
-
551
- targetCellCount = 0;
552
- each(row, function(cell, x) {
553
- if (cell.real)
554
- targetCellCount += cell.colspan;
555
-
556
- if (cell.elm.parentNode == targetRow)
557
- match = 1;
558
- });
559
-
560
- if (match)
561
- return false;
562
- });
563
-
564
- if (!before)
565
- rows.reverse();
566
-
567
- each(rows, function(row) {
568
- var cellCount = row.cells.length, cell;
569
-
570
- // Remove col/rowspans
571
- for (i = 0; i < cellCount; i++) {
572
- cell = row.cells[i];
573
- setSpanVal(cell, 'colspan', 1);
574
- setSpanVal(cell, 'rowspan', 1);
575
- }
576
-
577
- // Needs more cells
578
- for (i = cellCount; i < targetCellCount; i++)
579
- row.appendChild(cloneCell(row.cells[cellCount - 1]));
580
-
581
- // Needs less cells
582
- for (i = targetCellCount; i < cellCount; i++)
583
- dom.remove(row.cells[i]);
584
-
585
- // Add before/after
586
- if (before)
587
- targetRow.parentNode.insertBefore(row, targetRow);
588
- else
589
- dom.insertAfter(row, targetRow);
590
- });
591
- };
592
-
593
- function getPos(target) {
594
- var pos;
595
-
596
- each(grid, function(row, y) {
597
- each(row, function(cell, x) {
598
- if (cell.elm == target) {
599
- pos = {x : x, y : y};
600
- return false;
601
- }
602
- });
603
-
604
- return !pos;
605
- });
606
-
607
- return pos;
608
- };
609
-
610
- function setStartCell(cell) {
611
- startPos = getPos(cell);
612
- };
613
-
614
- function findEndPos() {
615
- var pos, maxX, maxY;
616
-
617
- maxX = maxY = 0;
618
-
619
- each(grid, function(row, y) {
620
- each(row, function(cell, x) {
621
- var colSpan, rowSpan;
622
-
623
- if (isCellSelected(cell)) {
624
- cell = grid[y][x];
625
-
626
- if (x > maxX)
627
- maxX = x;
628
-
629
- if (y > maxY)
630
- maxY = y;
631
-
632
- if (cell.real) {
633
- colSpan = cell.colspan - 1;
634
- rowSpan = cell.rowspan - 1;
635
-
636
- if (colSpan) {
637
- if (x + colSpan > maxX)
638
- maxX = x + colSpan;
639
- }
640
-
641
- if (rowSpan) {
642
- if (y + rowSpan > maxY)
643
- maxY = y + rowSpan;
644
- }
645
- }
646
- }
647
- });
648
- });
649
-
650
- return {x : maxX, y : maxY};
651
- };
652
-
653
- function setEndCell(cell) {
654
- var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
655
-
656
- endPos = getPos(cell);
657
-
658
- if (startPos && endPos) {
659
- // Get start/end positions
660
- startX = Math.min(startPos.x, endPos.x);
661
- startY = Math.min(startPos.y, endPos.y);
662
- endX = Math.max(startPos.x, endPos.x);
663
- endY = Math.max(startPos.y, endPos.y);
664
-
665
- // Expand end positon to include spans
666
- maxX = endX;
667
- maxY = endY;
668
-
669
- // Expand startX
670
- for (y = startY; y <= maxY; y++) {
671
- cell = grid[y][startX];
672
-
673
- if (!cell.real) {
674
- if (startX - (cell.colspan - 1) < startX)
675
- startX -= cell.colspan - 1;
676
- }
677
- }
678
-
679
- // Expand startY
680
- for (x = startX; x <= maxX; x++) {
681
- cell = grid[startY][x];
682
-
683
- if (!cell.real) {
684
- if (startY - (cell.rowspan - 1) < startY)
685
- startY -= cell.rowspan - 1;
686
- }
687
- }
688
-
689
- // Find max X, Y
690
- for (y = startY; y <= endY; y++) {
691
- for (x = startX; x <= endX; x++) {
692
- cell = grid[y][x];
693
-
694
- if (cell.real) {
695
- colSpan = cell.colspan - 1;
696
- rowSpan = cell.rowspan - 1;
697
-
698
- if (colSpan) {
699
- if (x + colSpan > maxX)
700
- maxX = x + colSpan;
701
- }
702
-
703
- if (rowSpan) {
704
- if (y + rowSpan > maxY)
705
- maxY = y + rowSpan;
706
- }
707
- }
708
- }
709
- }
710
-
711
- // Remove current selection
712
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
713
-
714
- // Add new selection
715
- for (y = startY; y <= maxY; y++) {
716
- for (x = startX; x <= maxX; x++)
717
- dom.addClass(grid[y][x].elm, 'mceSelected');
718
- }
719
- }
720
- };
721
-
722
- // Expose to public
723
- tinymce.extend(this, {
724
- deleteTable : deleteTable,
725
- split : split,
726
- merge : merge,
727
- insertRow : insertRow,
728
- insertCol : insertCol,
729
- deleteCols : deleteCols,
730
- deleteRows : deleteRows,
731
- cutRows : cutRows,
732
- copyRows : copyRows,
733
- pasteRows : pasteRows,
734
- getPos : getPos,
735
- setStartCell : setStartCell,
736
- setEndCell : setEndCell
737
- });
738
- };
739
-
740
- tinymce.create('tinymce.plugins.TablePlugin', {
741
- init : function(ed, url) {
742
- var winMan, clipboardRows;
743
-
744
- function createTableGrid(node) {
745
- var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
746
-
747
- if (tblElm)
748
- return new TableGrid(tblElm, ed.dom, selection);
749
- };
750
-
751
- function cleanup() {
752
- // Restore selection possibilities
753
- ed.getBody().style.webkitUserSelect = '';
754
- ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
755
- };
756
-
757
- // Register buttons
758
- each([
759
- ['table', 'table.desc', 'mceInsertTable', true],
760
- ['delete_table', 'table.del', 'mceTableDelete'],
761
- ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
762
- ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
763
- ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
764
- ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
765
- ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
766
- ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
767
- ['row_props', 'table.row_desc', 'mceTableRowProps', true],
768
- ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
769
- ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
770
- ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
771
- ], function(c) {
772
- ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
773
- });
774
-
775
- // Select whole table is a table border is clicked
776
- if (!tinymce.isIE) {
777
- ed.onClick.add(function(ed, e) {
778
- e = e.target;
779
-
780
- if (e.nodeName === 'TABLE')
781
- ed.selection.select(e);
782
- });
783
- }
784
-
785
- ed.onPreProcess.add(function(ed, args) {
786
- var nodes, i, node, dom = ed.dom, value;
787
-
788
- nodes = dom.select('table', args.node);
789
- i = nodes.length;
790
- while (i--) {
791
- node = nodes[i];
792
- dom.setAttrib(node, 'data-mce-style', '');
793
-
794
- if ((value = dom.getAttrib(node, 'width'))) {
795
- dom.setStyle(node, 'width', value);
796
- dom.setAttrib(node, 'width', '');
797
- }
798
-
799
- if ((value = dom.getAttrib(node, 'height'))) {
800
- dom.setStyle(node, 'height', value);
801
- dom.setAttrib(node, 'height', '');
802
- }
803
- }
804
- });
805
-
806
- // Handle node change updates
807
- ed.onNodeChange.add(function(ed, cm, n) {
808
- var p;
809
-
810
- n = ed.selection.getStart();
811
- p = ed.dom.getParent(n, 'td,th,caption');
812
- cm.setActive('table', n.nodeName === 'TABLE' || !!p);
813
-
814
- // Disable table tools if we are in caption
815
- if (p && p.nodeName === 'CAPTION')
816
- p = 0;
817
-
818
- cm.setDisabled('delete_table', !p);
819
- cm.setDisabled('delete_col', !p);
820
- cm.setDisabled('delete_table', !p);
821
- cm.setDisabled('delete_row', !p);
822
- cm.setDisabled('col_after', !p);
823
- cm.setDisabled('col_before', !p);
824
- cm.setDisabled('row_after', !p);
825
- cm.setDisabled('row_before', !p);
826
- cm.setDisabled('row_props', !p);
827
- cm.setDisabled('cell_props', !p);
828
- cm.setDisabled('split_cells', !p);
829
- cm.setDisabled('merge_cells', !p);
830
- });
831
-
832
- ed.onInit.add(function(ed) {
833
- var startTable, startCell, dom = ed.dom, tableGrid;
834
-
835
- winMan = ed.windowManager;
836
-
837
- // Add cell selection logic
838
- ed.onMouseDown.add(function(ed, e) {
839
- if (e.button != 2) {
840
- cleanup();
841
-
842
- startCell = dom.getParent(e.target, 'td,th');
843
- startTable = dom.getParent(startCell, 'table');
844
- }
845
- });
846
-
847
- dom.bind(ed.getDoc(), 'mouseover', function(e) {
848
- var sel, table, target = e.target;
849
-
850
- if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
851
- table = dom.getParent(target, 'table');
852
- if (table == startTable) {
853
- if (!tableGrid) {
854
- tableGrid = createTableGrid(table);
855
- tableGrid.setStartCell(startCell);
856
-
857
- ed.getBody().style.webkitUserSelect = 'none';
858
- }
859
-
860
- tableGrid.setEndCell(target);
861
- }
862
-
863
- // Remove current selection
864
- sel = ed.selection.getSel();
865
-
866
- if (sel.removeAllRanges)
867
- sel.removeAllRanges();
868
- else
869
- sel.empty();
870
-
871
- e.preventDefault();
872
- }
873
- });
874
-
875
- ed.onMouseUp.add(function(ed, e) {
876
- var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
877
-
878
- // Move selection to startCell
879
- if (startCell) {
880
- if (tableGrid)
881
- ed.getBody().style.webkitUserSelect = '';
882
-
883
- function setPoint(node, start) {
884
- var walker = new tinymce.dom.TreeWalker(node, node);
885
-
886
- do {
887
- // Text node
888
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
889
- if (start)
890
- rng.setStart(node, 0);
891
- else
892
- rng.setEnd(node, node.nodeValue.length);
893
-
894
- return;
895
- }
896
-
897
- // BR element
898
- if (node.nodeName == 'BR') {
899
- if (start)
900
- rng.setStartBefore(node);
901
- else
902
- rng.setEndBefore(node);
903
-
904
- return;
905
- }
906
- } while (node = (start ? walker.next() : walker.prev()));
907
- };
908
-
909
- // Try to expand text selection as much as we can only Gecko supports cell selection
910
- selectedCells = dom.select('td.mceSelected,th.mceSelected');
911
- if (selectedCells.length > 0) {
912
- rng = dom.createRng();
913
- node = selectedCells[0];
914
- endNode = selectedCells[selectedCells.length - 1];
915
-
916
- setPoint(node, 1);
917
- walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
918
-
919
- do {
920
- if (node.nodeName == 'TD' || node.nodeName == 'TH') {
921
- if (!dom.hasClass(node, 'mceSelected'))
922
- break;
923
-
924
- lastNode = node;
925
- }
926
- } while (node = walker.next());
927
-
928
- setPoint(lastNode);
929
-
930
- sel.setRng(rng);
931
- }
932
-
933
- ed.nodeChanged();
934
- startCell = tableGrid = startTable = null;
935
- }
936
- });
937
-
938
- ed.onKeyUp.add(function(ed, e) {
939
- cleanup();
940
- });
941
-
942
- // Add context menu
943
- if (ed && ed.plugins.contextmenu) {
944
- ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
945
- var sm, se = ed.selection, el = se.getNode() || ed.getBody();
946
-
947
- if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
948
- m.removeAll();
949
-
950
- if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
951
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
952
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
953
- m.addSeparator();
954
- }
955
-
956
- if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
957
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
958
- m.addSeparator();
959
- }
960
-
961
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
962
- m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
963
- m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
964
- m.addSeparator();
965
-
966
- // Cell menu
967
- sm = m.addMenu({title : 'table.cell'});
968
- sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
969
- sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
970
- sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
971
-
972
- // Row menu
973
- sm = m.addMenu({title : 'table.row'});
974
- sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
975
- sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
976
- sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
977
- sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
978
- sm.addSeparator();
979
- sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
980
- sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
981
- sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
982
- sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
983
-
984
- // Column menu
985
- sm = m.addMenu({title : 'table.col'});
986
- sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
987
- sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
988
- sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
989
- } else
990
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
991
- });
992
- }
993
-
994
- // Fixes an issue on Gecko where it's impossible to place the caret behind a table
995
- // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
996
- if (!tinymce.isIE) {
997
- function fixTableCaretPos() {
998
- var last;
999
-
1000
- // Skip empty text nodes form the end
1001
- for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
1002
-
1003
- if (last && last.nodeName == 'TABLE')
1004
- ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
1005
- };
1006
-
1007
- // Fixes an bug where it's impossible to place the caret before a table in Gecko
1008
- // this fix solves it by detecting when the caret is at the beginning of such a table
1009
- // and then manually moves the caret infront of the table
1010
- if (tinymce.isGecko) {
1011
- ed.onKeyDown.add(function(ed, e) {
1012
- var rng, table, dom = ed.dom;
1013
-
1014
- // On gecko it's not possible to place the caret before a table
1015
- if (e.keyCode == 37 || e.keyCode == 38) {
1016
- rng = ed.selection.getRng();
1017
- table = dom.getParent(rng.startContainer, 'table');
1018
-
1019
- if (table && ed.getBody().firstChild == table) {
1020
- if (isAtStart(rng, table)) {
1021
- rng = dom.createRng();
1022
-
1023
- rng.setStartBefore(table);
1024
- rng.setEndBefore(table);
1025
-
1026
- ed.selection.setRng(rng);
1027
-
1028
- e.preventDefault();
1029
- }
1030
- }
1031
- }
1032
- });
1033
- }
1034
-
1035
- ed.onKeyUp.add(fixTableCaretPos);
1036
- ed.onSetContent.add(fixTableCaretPos);
1037
- ed.onVisualAid.add(fixTableCaretPos);
1038
-
1039
- ed.onPreProcess.add(function(ed, o) {
1040
- var last = o.node.lastChild;
1041
-
1042
- if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
1043
- ed.dom.remove(last);
1044
- });
1045
-
1046
- fixTableCaretPos();
1047
- }
1048
- });
1049
-
1050
- // Register action commands
1051
- each({
1052
- mceTableSplitCells : function(grid) {
1053
- grid.split();
1054
- },
1055
-
1056
- mceTableMergeCells : function(grid) {
1057
- var rowSpan, colSpan, cell;
1058
-
1059
- cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
1060
- if (cell) {
1061
- rowSpan = cell.rowSpan;
1062
- colSpan = cell.colSpan;
1063
- }
1064
-
1065
- if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1066
- winMan.open({
1067
- url : url + '/merge_cells.htm',
1068
- width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1069
- height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1070
- inline : 1
1071
- }, {
1072
- rows : rowSpan,
1073
- cols : colSpan,
1074
- onaction : function(data) {
1075
- grid.merge(cell, data.cols, data.rows);
1076
- },
1077
- plugin_url : url
1078
- });
1079
- } else
1080
- grid.merge();
1081
- },
1082
-
1083
- mceTableInsertRowBefore : function(grid) {
1084
- grid.insertRow(true);
1085
- },
1086
-
1087
- mceTableInsertRowAfter : function(grid) {
1088
- grid.insertRow();
1089
- },
1090
-
1091
- mceTableInsertColBefore : function(grid) {
1092
- grid.insertCol(true);
1093
- },
1094
-
1095
- mceTableInsertColAfter : function(grid) {
1096
- grid.insertCol();
1097
- },
1098
-
1099
- mceTableDeleteCol : function(grid) {
1100
- grid.deleteCols();
1101
- },
1102
-
1103
- mceTableDeleteRow : function(grid) {
1104
- grid.deleteRows();
1105
- },
1106
-
1107
- mceTableCutRow : function(grid) {
1108
- clipboardRows = grid.cutRows();
1109
- },
1110
-
1111
- mceTableCopyRow : function(grid) {
1112
- clipboardRows = grid.copyRows();
1113
- },
1114
-
1115
- mceTablePasteRowBefore : function(grid) {
1116
- grid.pasteRows(clipboardRows, true);
1117
- },
1118
-
1119
- mceTablePasteRowAfter : function(grid) {
1120
- grid.pasteRows(clipboardRows);
1121
- },
1122
-
1123
- mceTableDelete : function(grid) {
1124
- grid.deleteTable();
1125
- }
1126
- }, function(func, name) {
1127
- ed.addCommand(name, function() {
1128
- var grid = createTableGrid();
1129
-
1130
- if (grid) {
1131
- func(grid);
1132
- ed.execCommand('mceRepaint');
1133
- cleanup();
1134
- }
1135
- });
1136
- });
1137
-
1138
- // Register dialog commands
1139
- each({
1140
- mceInsertTable : function(val) {
1141
- winMan.open({
1142
- url : url + '/table.htm',
1143
- width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1144
- height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1145
- inline : 1
1146
- }, {
1147
- plugin_url : url,
1148
- action : val ? val.action : 0
1149
- });
1150
- },
1151
-
1152
- mceTableRowProps : function() {
1153
- winMan.open({
1154
- url : url + '/row.htm',
1155
- width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1156
- height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1157
- inline : 1
1158
- }, {
1159
- plugin_url : url
1160
- });
1161
- },
1162
-
1163
- mceTableCellProps : function() {
1164
- winMan.open({
1165
- url : url + '/cell.htm',
1166
- width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1167
- height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1168
- inline : 1
1169
- }, {
1170
- plugin_url : url
1171
- });
1172
- }
1173
- }, function(func, name) {
1174
- ed.addCommand(name, function(ui, val) {
1175
- func(val);
1176
- });
1177
- });
1178
- }
1179
- });
1180
-
1181
- // Register plugin
1182
- tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1183
- })(tinymce);
1
+ (function(c){var d=c.each;function b(f,g){var h=g.ownerDocument,e=h.createRange(),j;e.setStartBefore(g);e.setEnd(f.endContainer,f.endOffset);j=h.createElement("body");j.appendChild(e.cloneContents());return j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(H,G,K){var f,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;f=[];d(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);d(O,function(P,Q){Q+=M;d(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(f[Q]){while(f[Q][R]){R++}}U=h(W,"rowspan");V=h(W,"colspan");for(T=Q;T<Q+U;T++){if(!f[T]){f[T]=[]}for(S=R;S<R+V;S++){f[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=f[O];if(N){return N[M]}}function h(N,M){return parseInt(N.getAttribute(M)||1)}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return G.hasClass(M.elm,"mceSelected")||M==o}function k(){var M=[];d(H.rows,function(N){d(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function e(M){var N;c.walk(M,function(P){var O;if(P.nodeType==3){d(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=c.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowspan",1);s(M,"colspan",1);if(N){M.appendChild(N)}else{if(!c.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();d(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}d(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=f[Math.min(f.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=f[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=f[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(e(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(e(P.cells[0]),P.cells[0])}}}}}function C(){d(f,function(M,N){d(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=h(P,"colspan");R=h(P,"rowspan");if(S>1||R>1){s(P,"rowspan",1);s(P,"colspan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(e(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colspan",(X-P)+1);s(T,"rowspan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){V=f[R][U].elm;if(V!=T){N=c.grep(V.childNodes);d(N,function(Z){T.appendChild(Z)});if(N.length){N=c.grep(T.childNodes);Q=0;d(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(P){var M,R,O,Q,S,T,N,U;d(f,function(V,W){d(V,function(Y,X){if(j(Y)){Y=Y.elm;S=Y.parentNode;T=A(S,false);M=W;if(P){return false}}});if(P){return !M}});for(Q=0;Q<f[0].length;Q++){R=f[M][Q].elm;if(R!=O){if(!P){rowSpan=h(R,"rowspan");if(rowSpan>1){s(R,"rowspan",rowSpan+1);continue}}else{if(M>0&&f[M-1][Q]){U=f[M-1][Q].elm;rowSpan=h(U,"rowspan");if(rowSpan>1){s(U,"rowspan",rowSpan+1);continue}}}N=e(R);s(N,"colspan",R.colSpan);T.appendChild(N);O=R}}if(T.hasChildNodes()){if(!P){G.insertAfter(T,S)}else{S.parentNode.insertBefore(T,S)}}}function g(N){var O,M;d(f,function(P,Q){d(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});d(f,function(S,T){var P=S[O].elm,Q,R;if(P!=M){R=h(P,"colspan");Q=h(P,"rowspan");if(R==1){if(!N){G.insertAfter(e(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(e(P),P);u(O,T,Q-1,R)}}else{s(P,"colspan",P.colSpan+1)}M=P}})}function n(){var M=[];d(f,function(N,O){d(N,function(Q,P){if(j(Q)&&c.inArray(M,P)===-1){d(f,function(T){var R=T[P].elm,S;S=h(R,"colspan");if(S>1){s(R,"colspan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");d(Q.cells,function(S){var T=h(S,"rowspan");if(T>1){s(S,"rowspan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);d(f[R.y],function(S){var T;S=S.elm;if(S!=O){T=h(S,"rowspan");if(T<=1){G.remove(S)}else{s(S,"rowspan",T-1)}O=S}})}N=k();d(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();d(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;d(f,function(S){var R;Q=0;d(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}d(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colspan",1);s(R,"rowspan",1)}for(i=S;i<Q;i++){T.appendChild(e(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}})}function F(M){var N;d(f,function(O,P){d(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;d(f,function(P,Q){d(P,function(S,R){var U,T;if(j(S)){S=f[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=f[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=f[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=f[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){G.addClass(f[y][x].elm,"mceSelected")}}}}c.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:g,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}c.create("tinymce.plugins.TablePlugin",{init:function(f,g){var e,k;function j(n){var m=f.selection,l=f.dom.getParent(n||m.getNode(),"table");if(l){return new a(l,f.dom,m)}}function h(){f.getBody().style.webkitUserSelect="";f.dom.removeClass(f.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}d([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(l){f.addButton(l[0],{title:l[1],cmd:l[2],ui:l[3]})});if(!c.isIE){f.onClick.add(function(l,m){m=m.target;if(m.nodeName==="TABLE"){l.selection.select(m)}})}f.onPreProcess.add(function(m,n){var l,o,p,r=m.dom,q;l=r.select("table",n.node);o=l.length;while(o--){p=l[o];r.setAttrib(p,"data-mce-style","");if((q=r.getAttrib(p,"width"))){r.setStyle(p,"width",q);r.setAttrib(p,"width","")}if((q=r.getAttrib(p,"height"))){r.setStyle(p,"height",q);r.setAttrib(p,"height","")}}});f.onNodeChange.add(function(m,l,q){var o;q=m.selection.getStart();o=m.dom.getParent(q,"td,th,caption");l.setActive("table",q.nodeName==="TABLE"||!!o);if(o&&o.nodeName==="CAPTION"){o=0}l.setDisabled("delete_table",!o);l.setDisabled("delete_col",!o);l.setDisabled("delete_table",!o);l.setDisabled("delete_row",!o);l.setDisabled("col_after",!o);l.setDisabled("col_before",!o);l.setDisabled("row_after",!o);l.setDisabled("row_before",!o);l.setDisabled("row_props",!o);l.setDisabled("cell_props",!o);l.setDisabled("split_cells",!o);l.setDisabled("merge_cells",!o)});f.onInit.add(function(m){var l,p,q=m.dom,n;e=m.windowManager;m.onMouseDown.add(function(r,s){if(s.button!=2){h();p=q.getParent(s.target,"td,th");l=q.getParent(p,"table")}});q.bind(m.getDoc(),"mouseover",function(u){var s,r,t=u.target;if(p&&(n||t!=p)&&(t.nodeName=="TD"||t.nodeName=="TH")){r=q.getParent(t,"table");if(r==l){if(!n){n=j(r);n.setStartCell(p);m.getBody().style.webkitUserSelect="none"}n.setEndCell(t)}s=m.selection.getSel();if(s.removeAllRanges){s.removeAllRanges()}else{s.empty()}u.preventDefault()}});m.onMouseUp.add(function(A,B){var s,u=A.selection,C,D=u.getSel(),r,v,t,z;if(p){if(n){A.getBody().style.webkitUserSelect=""}function w(E,G){var F=new c.dom.TreeWalker(E,E);do{if(E.nodeType==3&&c.trim(E.nodeValue).length!=0){if(G){s.setStart(E,0)}else{s.setEnd(E,E.nodeValue.length)}return}if(E.nodeName=="BR"){if(G){s.setStartBefore(E)}else{s.setEndBefore(E)}return}}while(E=(G?F.next():F.prev()))}C=q.select("td.mceSelected,th.mceSelected");if(C.length>0){s=q.createRng();v=C[0];z=C[C.length-1];w(v,1);r=new c.dom.TreeWalker(v,q.getParent(C[0],"table"));do{if(v.nodeName=="TD"||v.nodeName=="TH"){if(!q.hasClass(v,"mceSelected")){break}t=v}}while(v=r.next());w(t);u.setRng(s)}A.nodeChanged();p=n=l=null}});m.onKeyUp.add(function(r,s){h()});if(m&&m.plugins.contextmenu){m.plugins.contextmenu.onContextMenu.add(function(t,r,v){var w,u=m.selection,s=u.getNode()||m.getBody();if(m.dom.getParent(v,"td")||m.dom.getParent(v,"th")||m.dom.select("td.mceSelected,th.mceSelected").length){r.removeAll();if(s.nodeName=="A"&&!m.dom.getAttrib(s,"name")){r.add({title:"advanced.link_desc",icon:"link",cmd:m.plugins.advlink?"mceAdvLink":"mceLink",ui:true});r.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});r.addSeparator()}if(s.nodeName=="IMG"&&s.className.indexOf("mceItem")==-1){r.add({title:"advanced.image_desc",icon:"image",cmd:m.plugins.advimage?"mceAdvImage":"mceImage",ui:true});r.addSeparator()}r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});r.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});r.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});r.addSeparator();w=r.addMenu({title:"table.cell"});w.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});w.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});w.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});w=r.addMenu({title:"table.row"});w.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});w.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});w.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});w.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});w.addSeparator();w.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});w.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});w.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!k);w.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!k);w=r.addMenu({title:"table.col"});w.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});w.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});w.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!c.isIE){function o(){var r;for(r=m.getBody().lastChild;r&&r.nodeType==3&&!r.nodeValue.length;r=r.previousSibling){}if(r&&r.nodeName=="TABLE"){m.dom.add(m.getBody(),"p",null,'<br mce_bogus="1" />')}}if(c.isGecko){m.onKeyDown.add(function(s,u){var r,t,v=s.dom;if(u.keyCode==37||u.keyCode==38){r=s.selection.getRng();t=v.getParent(r.startContainer,"table");if(t&&s.getBody().firstChild==t){if(b(r,t)){r=v.createRng();r.setStartBefore(t);r.setEndBefore(t);s.selection.setRng(r);u.preventDefault()}}}})}m.onKeyUp.add(o);m.onSetContent.add(o);m.onVisualAid.add(o);m.onPreProcess.add(function(r,t){var s=t.node.lastChild;if(s&&s.childNodes.length==1&&s.firstChild.nodeName=="BR"){r.dom.remove(s)}});o()}});d({mceTableSplitCells:function(l){l.split()},mceTableMergeCells:function(m){var n,o,l;l=f.dom.getParent(f.selection.getNode(),"th,td");if(l){n=l.rowSpan;o=l.colSpan}if(!f.dom.select("td.mceSelected,th.mceSelected").length){e.open({url:g+"/merge_cells.htm",width:240+parseInt(f.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(f.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:n,cols:o,onaction:function(p){m.merge(l,p.cols,p.rows)},plugin_url:g})}else{m.merge()}},mceTableInsertRowBefore:function(l){l.insertRow(true)},mceTableInsertRowAfter:function(l){l.insertRow()},mceTableInsertColBefore:function(l){l.insertCol(true)},mceTableInsertColAfter:function(l){l.insertCol()},mceTableDeleteCol:function(l){l.deleteCols()},mceTableDeleteRow:function(l){l.deleteRows()},mceTableCutRow:function(l){k=l.cutRows()},mceTableCopyRow:function(l){k=l.copyRows()},mceTablePasteRowBefore:function(l){l.pasteRows(k,true)},mceTablePasteRowAfter:function(l){l.pasteRows(k)},mceTableDelete:function(l){l.deleteTable()}},function(m,l){f.addCommand(l,function(){var n=j();if(n){m(n);f.execCommand("mceRepaint");h()}})});d({mceInsertTable:function(l){e.open({url:g+"/table.htm",width:400+parseInt(f.getLang("table.table_delta_width",0)),height:320+parseInt(f.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:l?l.action:0})},mceTableRowProps:function(){e.open({url:g+"/row.htm",width:400+parseInt(f.getLang("table.rowprops_delta_width",0)),height:295+parseInt(f.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})},mceTableCellProps:function(){e.open({url:g+"/cell.htm",width:400+parseInt(f.getLang("table.cellprops_delta_width",0)),height:295+parseInt(f.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}},function(m,l){f.addCommand(l,function(n,o){m(o)})})}});c.PluginManager.add("table",c.plugins.TablePlugin)})(tinymce);