ouvrages-tinymce-rails 3.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (287) hide show
  1. data/LICENSE +18 -0
  2. data/README.md +67 -0
  3. data/Rakefile +59 -0
  4. data/assets/integration/tinymce-jquery.js +3 -0
  5. data/assets/integration/tinymce.js +2 -0
  6. data/assets/integration/tinymce/preinit.js.erb +5 -0
  7. data/assets/precompiled/tinymce/jquery.tinymce.js +1 -0
  8. data/assets/precompiled/tinymce/langs/en.js +1 -0
  9. data/assets/precompiled/tinymce/langs/fr.js +1 -0
  10. data/assets/precompiled/tinymce/license.txt +504 -0
  11. data/assets/precompiled/tinymce/plugins/advhr/css/advhr.css +5 -0
  12. data/assets/precompiled/tinymce/plugins/advhr/editor_plugin.js +1 -0
  13. data/assets/precompiled/tinymce/plugins/advhr/editor_plugin_src.js +57 -0
  14. data/assets/precompiled/tinymce/plugins/advhr/js/rule.js +43 -0
  15. data/assets/precompiled/tinymce/plugins/advhr/langs/en_dlg.js +1 -0
  16. data/assets/precompiled/tinymce/plugins/advhr/langs/fr_dlg.js +1 -0
  17. data/assets/precompiled/tinymce/plugins/advhr/rule.htm +58 -0
  18. data/assets/precompiled/tinymce/plugins/advimage/css/advimage.css +13 -0
  19. data/assets/precompiled/tinymce/plugins/advimage/editor_plugin.js +1 -0
  20. data/assets/precompiled/tinymce/plugins/advimage/editor_plugin_src.js +50 -0
  21. data/assets/precompiled/tinymce/plugins/advimage/image.htm +235 -0
  22. data/assets/precompiled/tinymce/plugins/advimage/img/sample.gif +0 -0
  23. data/assets/precompiled/tinymce/plugins/advimage/js/image.js +462 -0
  24. data/assets/precompiled/tinymce/plugins/advimage/langs/en_dlg.js +1 -0
  25. data/assets/precompiled/tinymce/plugins/advimage/langs/fr_dlg.js +1 -0
  26. data/assets/precompiled/tinymce/plugins/advlink/css/advlink.css +8 -0
  27. data/assets/precompiled/tinymce/plugins/advlink/editor_plugin.js +1 -0
  28. data/assets/precompiled/tinymce/plugins/advlink/editor_plugin_src.js +61 -0
  29. data/assets/precompiled/tinymce/plugins/advlink/js/advlink.js +532 -0
  30. data/assets/precompiled/tinymce/plugins/advlink/langs/en_dlg.js +1 -0
  31. data/assets/precompiled/tinymce/plugins/advlink/langs/fr_dlg.js +1 -0
  32. data/assets/precompiled/tinymce/plugins/advlink/link.htm +338 -0
  33. data/assets/precompiled/tinymce/plugins/advlist/editor_plugin.js +1 -0
  34. data/assets/precompiled/tinymce/plugins/advlist/editor_plugin_src.js +176 -0
  35. data/assets/precompiled/tinymce/plugins/autolink/editor_plugin.js +1 -0
  36. data/assets/precompiled/tinymce/plugins/autolink/editor_plugin_src.js +172 -0
  37. data/assets/precompiled/tinymce/plugins/autoresize/editor_plugin.js +1 -0
  38. data/assets/precompiled/tinymce/plugins/autoresize/editor_plugin_src.js +137 -0
  39. data/assets/precompiled/tinymce/plugins/autosave/editor_plugin.js +1 -0
  40. data/assets/precompiled/tinymce/plugins/autosave/editor_plugin_src.js +431 -0
  41. data/assets/precompiled/tinymce/plugins/autosave/langs/en.js +4 -0
  42. data/assets/precompiled/tinymce/plugins/bbcode/editor_plugin.js +1 -0
  43. data/assets/precompiled/tinymce/plugins/bbcode/editor_plugin_src.js +120 -0
  44. data/assets/precompiled/tinymce/plugins/contextmenu/editor_plugin.js +1 -0
  45. data/assets/precompiled/tinymce/plugins/contextmenu/editor_plugin_src.js +160 -0
  46. data/assets/precompiled/tinymce/plugins/directionality/editor_plugin.js +1 -0
  47. data/assets/precompiled/tinymce/plugins/directionality/editor_plugin_src.js +82 -0
  48. data/assets/precompiled/tinymce/plugins/emotions/editor_plugin.js +1 -0
  49. data/assets/precompiled/tinymce/plugins/emotions/editor_plugin_src.js +43 -0
  50. data/assets/precompiled/tinymce/plugins/emotions/emotions.htm +41 -0
  51. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-cool.gif +0 -0
  52. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-cry.gif +0 -0
  53. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  54. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  55. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-frown.gif +0 -0
  56. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-innocent.gif +0 -0
  57. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-kiss.gif +0 -0
  58. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-laughing.gif +0 -0
  59. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  60. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-sealed.gif +0 -0
  61. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-smile.gif +0 -0
  62. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-surprised.gif +0 -0
  63. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  64. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-undecided.gif +0 -0
  65. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-wink.gif +0 -0
  66. data/assets/precompiled/tinymce/plugins/emotions/img/smiley-yell.gif +0 -0
  67. data/assets/precompiled/tinymce/plugins/emotions/js/emotions.js +22 -0
  68. data/assets/precompiled/tinymce/plugins/emotions/langs/en_dlg.js +1 -0
  69. data/assets/precompiled/tinymce/plugins/emotions/langs/fr_dlg.js +1 -0
  70. data/assets/precompiled/tinymce/plugins/example/dialog.htm +22 -0
  71. data/assets/precompiled/tinymce/plugins/example/editor_plugin.js +1 -0
  72. data/assets/precompiled/tinymce/plugins/example/editor_plugin_src.js +84 -0
  73. data/assets/precompiled/tinymce/plugins/example/img/example.gif +0 -0
  74. data/assets/precompiled/tinymce/plugins/example/js/dialog.js +19 -0
  75. data/assets/precompiled/tinymce/plugins/example/langs/en.js +3 -0
  76. data/assets/precompiled/tinymce/plugins/example/langs/en_dlg.js +3 -0
  77. data/assets/precompiled/tinymce/plugins/example_dependency/editor_plugin.js +1 -0
  78. data/assets/precompiled/tinymce/plugins/example_dependency/editor_plugin_src.js +50 -0
  79. data/assets/precompiled/tinymce/plugins/fullpage/css/fullpage.css +143 -0
  80. data/assets/precompiled/tinymce/plugins/fullpage/editor_plugin.js +1 -0
  81. data/assets/precompiled/tinymce/plugins/fullpage/editor_plugin_src.js +405 -0
  82. data/assets/precompiled/tinymce/plugins/fullpage/fullpage.htm +259 -0
  83. data/assets/precompiled/tinymce/plugins/fullpage/js/fullpage.js +232 -0
  84. data/assets/precompiled/tinymce/plugins/fullpage/langs/en_dlg.js +1 -0
  85. data/assets/precompiled/tinymce/plugins/fullpage/langs/fr_dlg.js +1 -0
  86. data/assets/precompiled/tinymce/plugins/fullscreen/editor_plugin.js +1 -0
  87. data/assets/precompiled/tinymce/plugins/fullscreen/editor_plugin_src.js +159 -0
  88. data/assets/precompiled/tinymce/plugins/fullscreen/fullscreen.htm +110 -0
  89. data/assets/precompiled/tinymce/plugins/iespell/editor_plugin.js +1 -0
  90. data/assets/precompiled/tinymce/plugins/iespell/editor_plugin_src.js +54 -0
  91. data/assets/precompiled/tinymce/plugins/inlinepopups/editor_plugin.js +1 -0
  92. data/assets/precompiled/tinymce/plugins/inlinepopups/editor_plugin_src.js +699 -0
  93. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  94. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  95. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  96. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  97. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  98. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  99. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  100. data/assets/precompiled/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  101. data/assets/precompiled/tinymce/plugins/inlinepopups/template.htm +387 -0
  102. data/assets/precompiled/tinymce/plugins/insertdatetime/editor_plugin.js +1 -0
  103. data/assets/precompiled/tinymce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  104. data/assets/precompiled/tinymce/plugins/layer/editor_plugin.js +1 -0
  105. data/assets/precompiled/tinymce/plugins/layer/editor_plugin_src.js +262 -0
  106. data/assets/precompiled/tinymce/plugins/legacyoutput/editor_plugin.js +1 -0
  107. data/assets/precompiled/tinymce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  108. data/assets/precompiled/tinymce/plugins/lists/editor_plugin.js +1 -0
  109. data/assets/precompiled/tinymce/plugins/lists/editor_plugin_src.js +781 -0
  110. data/assets/precompiled/tinymce/plugins/media/css/media.css +17 -0
  111. data/assets/precompiled/tinymce/plugins/media/editor_plugin.js +1 -0
  112. data/assets/precompiled/tinymce/plugins/media/editor_plugin_src.js +890 -0
  113. data/assets/precompiled/tinymce/plugins/media/js/embed.js +73 -0
  114. data/assets/precompiled/tinymce/plugins/media/js/media.js +453 -0
  115. data/assets/precompiled/tinymce/plugins/media/langs/en_dlg.js +1 -0
  116. data/assets/precompiled/tinymce/plugins/media/langs/fr_dlg.js +1 -0
  117. data/assets/precompiled/tinymce/plugins/media/media.htm +922 -0
  118. data/assets/precompiled/tinymce/plugins/media/moxieplayer.swf +0 -0
  119. data/assets/precompiled/tinymce/plugins/nonbreaking/editor_plugin.js +1 -0
  120. data/assets/precompiled/tinymce/plugins/nonbreaking/editor_plugin_src.js +54 -0
  121. data/assets/precompiled/tinymce/plugins/noneditable/editor_plugin.js +1 -0
  122. data/assets/precompiled/tinymce/plugins/noneditable/editor_plugin_src.js +95 -0
  123. data/assets/precompiled/tinymce/plugins/pagebreak/editor_plugin.js +1 -0
  124. data/assets/precompiled/tinymce/plugins/pagebreak/editor_plugin_src.js +74 -0
  125. data/assets/precompiled/tinymce/plugins/paste/editor_plugin.js +1 -0
  126. data/assets/precompiled/tinymce/plugins/paste/editor_plugin_src.js +871 -0
  127. data/assets/precompiled/tinymce/plugins/paste/js/pastetext.js +36 -0
  128. data/assets/precompiled/tinymce/plugins/paste/js/pasteword.js +51 -0
  129. data/assets/precompiled/tinymce/plugins/paste/langs/en_dlg.js +1 -0
  130. data/assets/precompiled/tinymce/plugins/paste/langs/fr_dlg.js +1 -0
  131. data/assets/precompiled/tinymce/plugins/paste/pastetext.htm +27 -0
  132. data/assets/precompiled/tinymce/plugins/paste/pasteword.htm +21 -0
  133. data/assets/precompiled/tinymce/plugins/preview/editor_plugin.js +1 -0
  134. data/assets/precompiled/tinymce/plugins/preview/editor_plugin_src.js +53 -0
  135. data/assets/precompiled/tinymce/plugins/preview/example.html +28 -0
  136. data/assets/precompiled/tinymce/plugins/preview/jscripts/embed.js +73 -0
  137. data/assets/precompiled/tinymce/plugins/preview/preview.html +17 -0
  138. data/assets/precompiled/tinymce/plugins/print/editor_plugin.js +1 -0
  139. data/assets/precompiled/tinymce/plugins/print/editor_plugin_src.js +34 -0
  140. data/assets/precompiled/tinymce/plugins/save/editor_plugin.js +1 -0
  141. data/assets/precompiled/tinymce/plugins/save/editor_plugin_src.js +101 -0
  142. data/assets/precompiled/tinymce/plugins/searchreplace/css/searchreplace.css +6 -0
  143. data/assets/precompiled/tinymce/plugins/searchreplace/editor_plugin.js +1 -0
  144. data/assets/precompiled/tinymce/plugins/searchreplace/editor_plugin_src.js +61 -0
  145. data/assets/precompiled/tinymce/plugins/searchreplace/js/searchreplace.js +142 -0
  146. data/assets/precompiled/tinymce/plugins/searchreplace/langs/en_dlg.js +1 -0
  147. data/assets/precompiled/tinymce/plugins/searchreplace/langs/fr_dlg.js +1 -0
  148. data/assets/precompiled/tinymce/plugins/searchreplace/searchreplace.htm +100 -0
  149. data/assets/precompiled/tinymce/plugins/spellchecker/css/content.css +1 -0
  150. data/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin.js +1 -0
  151. data/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin_src.js +436 -0
  152. data/assets/precompiled/tinymce/plugins/spellchecker/img/wline.gif +0 -0
  153. data/assets/precompiled/tinymce/plugins/style/css/props.css +13 -0
  154. data/assets/precompiled/tinymce/plugins/style/editor_plugin.js +1 -0
  155. data/assets/precompiled/tinymce/plugins/style/editor_plugin_src.js +55 -0
  156. data/assets/precompiled/tinymce/plugins/style/js/props.js +635 -0
  157. data/assets/precompiled/tinymce/plugins/style/langs/en_dlg.js +1 -0
  158. data/assets/precompiled/tinymce/plugins/style/langs/fr_dlg.js +1 -0
  159. data/assets/precompiled/tinymce/plugins/style/props.htm +840 -0
  160. data/assets/precompiled/tinymce/plugins/tabfocus/editor_plugin.js +1 -0
  161. data/assets/precompiled/tinymce/plugins/tabfocus/editor_plugin_src.js +122 -0
  162. data/assets/precompiled/tinymce/plugins/table/cell.htm +180 -0
  163. data/assets/precompiled/tinymce/plugins/table/css/cell.css +17 -0
  164. data/assets/precompiled/tinymce/plugins/table/css/row.css +25 -0
  165. data/assets/precompiled/tinymce/plugins/table/css/table.css +13 -0
  166. data/assets/precompiled/tinymce/plugins/table/editor_plugin.js +1 -0
  167. data/assets/precompiled/tinymce/plugins/table/editor_plugin_src.js +1364 -0
  168. data/assets/precompiled/tinymce/plugins/table/js/cell.js +319 -0
  169. data/assets/precompiled/tinymce/plugins/table/js/merge_cells.js +27 -0
  170. data/assets/precompiled/tinymce/plugins/table/js/row.js +237 -0
  171. data/assets/precompiled/tinymce/plugins/table/js/table.js +450 -0
  172. data/assets/precompiled/tinymce/plugins/table/langs/en_dlg.js +1 -0
  173. data/assets/precompiled/tinymce/plugins/table/langs/fr_dlg.js +1 -0
  174. data/assets/precompiled/tinymce/plugins/table/merge_cells.htm +32 -0
  175. data/assets/precompiled/tinymce/plugins/table/row.htm +158 -0
  176. data/assets/precompiled/tinymce/plugins/table/table.htm +188 -0
  177. data/assets/precompiled/tinymce/plugins/template/blank.htm +12 -0
  178. data/assets/precompiled/tinymce/plugins/template/css/template.css +23 -0
  179. data/assets/precompiled/tinymce/plugins/template/editor_plugin.js +1 -0
  180. data/assets/precompiled/tinymce/plugins/template/editor_plugin_src.js +159 -0
  181. data/assets/precompiled/tinymce/plugins/template/js/template.js +106 -0
  182. data/assets/precompiled/tinymce/plugins/template/langs/en_dlg.js +1 -0
  183. data/assets/precompiled/tinymce/plugins/template/langs/fr_dlg.js +1 -0
  184. data/assets/precompiled/tinymce/plugins/template/template.htm +31 -0
  185. data/assets/precompiled/tinymce/plugins/visualchars/editor_plugin.js +1 -0
  186. data/assets/precompiled/tinymce/plugins/visualchars/editor_plugin_src.js +83 -0
  187. data/assets/precompiled/tinymce/plugins/wordcount/editor_plugin.js +1 -0
  188. data/assets/precompiled/tinymce/plugins/wordcount/editor_plugin_src.js +114 -0
  189. data/assets/precompiled/tinymce/plugins/xhtmlxtras/abbr.htm +142 -0
  190. data/assets/precompiled/tinymce/plugins/xhtmlxtras/acronym.htm +142 -0
  191. data/assets/precompiled/tinymce/plugins/xhtmlxtras/attributes.htm +149 -0
  192. data/assets/precompiled/tinymce/plugins/xhtmlxtras/cite.htm +142 -0
  193. data/assets/precompiled/tinymce/plugins/xhtmlxtras/css/attributes.css +11 -0
  194. data/assets/precompiled/tinymce/plugins/xhtmlxtras/css/popup.css +9 -0
  195. data/assets/precompiled/tinymce/plugins/xhtmlxtras/del.htm +162 -0
  196. data/assets/precompiled/tinymce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  197. data/assets/precompiled/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  198. data/assets/precompiled/tinymce/plugins/xhtmlxtras/ins.htm +162 -0
  199. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/abbr.js +28 -0
  200. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/acronym.js +28 -0
  201. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/attributes.js +111 -0
  202. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/cite.js +28 -0
  203. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/del.js +53 -0
  204. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/element_common.js +229 -0
  205. data/assets/precompiled/tinymce/plugins/xhtmlxtras/js/ins.js +53 -0
  206. data/assets/precompiled/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +1 -0
  207. data/assets/precompiled/tinymce/plugins/xhtmlxtras/langs/fr_dlg.js +1 -0
  208. data/assets/precompiled/tinymce/themes/advanced/about.htm +52 -0
  209. data/assets/precompiled/tinymce/themes/advanced/anchor.htm +26 -0
  210. data/assets/precompiled/tinymce/themes/advanced/charmap.htm +51 -0
  211. data/assets/precompiled/tinymce/themes/advanced/color_picker.htm +74 -0
  212. data/assets/precompiled/tinymce/themes/advanced/editor_template.js +1 -0
  213. data/assets/precompiled/tinymce/themes/advanced/editor_template_src.js +1358 -0
  214. data/assets/precompiled/tinymce/themes/advanced/image.htm +80 -0
  215. data/assets/precompiled/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
  216. data/assets/precompiled/tinymce/themes/advanced/img/flash.gif +0 -0
  217. data/assets/precompiled/tinymce/themes/advanced/img/icons.gif +0 -0
  218. data/assets/precompiled/tinymce/themes/advanced/img/iframe.gif +0 -0
  219. data/assets/precompiled/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  220. data/assets/precompiled/tinymce/themes/advanced/img/quicktime.gif +0 -0
  221. data/assets/precompiled/tinymce/themes/advanced/img/realmedia.gif +0 -0
  222. data/assets/precompiled/tinymce/themes/advanced/img/shockwave.gif +0 -0
  223. data/assets/precompiled/tinymce/themes/advanced/img/trans.gif +0 -0
  224. data/assets/precompiled/tinymce/themes/advanced/img/video.gif +0 -0
  225. data/assets/precompiled/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  226. data/assets/precompiled/tinymce/themes/advanced/js/about.js +73 -0
  227. data/assets/precompiled/tinymce/themes/advanced/js/anchor.js +43 -0
  228. data/assets/precompiled/tinymce/themes/advanced/js/charmap.js +355 -0
  229. data/assets/precompiled/tinymce/themes/advanced/js/color_picker.js +329 -0
  230. data/assets/precompiled/tinymce/themes/advanced/js/image.js +251 -0
  231. data/assets/precompiled/tinymce/themes/advanced/js/link.js +153 -0
  232. data/assets/precompiled/tinymce/themes/advanced/js/source_editor.js +56 -0
  233. data/assets/precompiled/tinymce/themes/advanced/langs/en.js +1 -0
  234. data/assets/precompiled/tinymce/themes/advanced/langs/en_dlg.js +1 -0
  235. data/assets/precompiled/tinymce/themes/advanced/langs/fr.js +1 -0
  236. data/assets/precompiled/tinymce/themes/advanced/langs/fr_dlg.js +1 -0
  237. data/assets/precompiled/tinymce/themes/advanced/link.htm +57 -0
  238. data/assets/precompiled/tinymce/themes/advanced/shortcuts.htm +47 -0
  239. data/assets/precompiled/tinymce/themes/advanced/skins/default/content.css +50 -0
  240. data/assets/precompiled/tinymce/themes/advanced/skins/default/dialog.css +117 -0
  241. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
  242. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
  243. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  244. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  245. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
  246. data/assets/precompiled/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
  247. data/assets/precompiled/tinymce/themes/advanced/skins/default/ui.css +214 -0
  248. data/assets/precompiled/tinymce/themes/advanced/skins/highcontrast/content.css +24 -0
  249. data/assets/precompiled/tinymce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  250. data/assets/precompiled/tinymce/themes/advanced/skins/highcontrast/ui.css +102 -0
  251. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/content.css +48 -0
  252. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/dialog.css +117 -0
  253. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  254. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  255. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  256. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/ui.css +217 -0
  257. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  258. data/assets/precompiled/tinymce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  259. data/assets/precompiled/tinymce/themes/advanced/source_editor.htm +25 -0
  260. data/assets/precompiled/tinymce/themes/simple/editor_template.js +1 -0
  261. data/assets/precompiled/tinymce/themes/simple/editor_template_src.js +84 -0
  262. data/assets/precompiled/tinymce/themes/simple/img/icons.gif +0 -0
  263. data/assets/precompiled/tinymce/themes/simple/langs/en.js +1 -0
  264. data/assets/precompiled/tinymce/themes/simple/langs/fr.js +1 -0
  265. data/assets/precompiled/tinymce/themes/simple/skins/default/content.css +25 -0
  266. data/assets/precompiled/tinymce/themes/simple/skins/default/ui.css +32 -0
  267. data/assets/precompiled/tinymce/themes/simple/skins/o2k7/content.css +17 -0
  268. data/assets/precompiled/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  269. data/assets/precompiled/tinymce/themes/simple/skins/o2k7/ui.css +35 -0
  270. data/assets/precompiled/tinymce/tiny_mce.js +1 -0
  271. data/assets/precompiled/tinymce/tiny_mce_jquery.js +1 -0
  272. data/assets/precompiled/tinymce/tiny_mce_jquery_src.js +15656 -0
  273. data/assets/precompiled/tinymce/tiny_mce_popup.js +5 -0
  274. data/assets/precompiled/tinymce/tiny_mce_src.js +16479 -0
  275. data/assets/precompiled/tinymce/utils/editable_selects.js +70 -0
  276. data/assets/precompiled/tinymce/utils/form_utils.js +210 -0
  277. data/assets/precompiled/tinymce/utils/mctabs.js +162 -0
  278. data/assets/precompiled/tinymce/utils/validate.js +252 -0
  279. data/assets/vendor/tinymce/jquery-tinymce.js +1 -0
  280. data/assets/vendor/tinymce/tiny_mce.js +16479 -0
  281. data/assets/vendor/tinymce/tiny_mce_jquery.js +15656 -0
  282. data/lib/tinymce-rails.rb +2 -0
  283. data/lib/tinymce/assets.rake +7 -0
  284. data/lib/tinymce/rails-3.1.0.rake +65 -0
  285. data/lib/tinymce/railtie.rb +27 -0
  286. data/lib/tinymce/version.rb +4 -0
  287. metadata +349 -0
@@ -0,0 +1 @@
1
+ (function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{if(v&&u.tagName==="P"&&t.tagName==="P"){return true}else{return false}}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(A,y){var w=0;var t=1;var H=2;var J=3;var z=J;function C(M){return M.keyCode===9&&(A.queryCommandState("InsertUnorderedList")||A.queryCommandState("InsertOrderedList"))}function x(){var M=B();var O=M.parentNode.parentNode;var N=M.parentNode.lastChild===M;return N&&!u(O)&&K(M)}function u(M){if(n(M)){return M.parentNode&&M.parentNode.tagName==="LI"}else{return M.tagName==="LI"}}function D(){return A.selection.isCollapsed()&&K(B())}function B(){var M=A.selection.getStart();return((M.tagName=="BR"||M.tagName=="")&&M.parentNode.tagName=="LI")?M.parentNode:M}function K(M){var N=M.childNodes.length;if(M.tagName==="LI"){return N==0?true:N==1&&(M.firstChild.tagName==""||F(M)||G(M))}return false}function F(M){return tinymce.isWebKit&&M.firstChild.nodeName=="BR"}function G(M){var N=tinymce.grep(M.parentNode.childNodes,function(Q){return Q.nodeName=="LI"});var O=M==N[N.length-1];var P=M.firstChild;return tinymce.isIE9&&O&&(P.nodeValue==String.fromCharCode(160)||P.nodeValue==String.fromCharCode(32))}function L(M){return M.keyCode===13}function I(M){if(C(M)){return w}else{if(L(M)&&x()){return H}else{if(L(M)&&D()){return t}else{return J}}}}function s(M,N){if(z==w||z==t){return r.cancel(N)}}function v(P,R){var U;if(!tinymce.isGecko){return}var N=P.selection.getStart();if(R.keyCode!=8||N.tagName!=="IMG"){return}function O(Y){var Z=Y.firstChild;var X=null;do{if(!Z){break}if(Z.tagName==="LI"){X=Z}}while(Z=Z.nextSibling);return X}function W(Y,X){while(Y.childNodes.length>0){X.appendChild(Y.childNodes[0])}}U=N.parentNode.previousSibling;if(!U){return}var S;if(U.tagName==="UL"||U.tagName==="OL"){S=U}else{if(U.previousSibling&&(U.previousSibling.tagName==="UL"||U.previousSibling.tagName==="OL")){S=U.previousSibling}else{return}}var V=O(S);var M=P.dom.createRng();M.setStart(V,1);M.setEnd(V,1);P.selection.setRng(M);P.selection.collapse(true);var Q=P.selection.getBookmark();var T=N.parentNode.cloneNode(true);if(T.tagName==="P"||T.tagName==="DIV"){W(T,V)}else{V.appendChild(T)}N.parentNode.parentNode.removeChild(N.parentNode);P.selection.moveToBookmark(Q)}function E(M){var N=A.dom.getParent(M,"ol,ul");if(N!=null){var O=N.lastChild;O.appendChild(A.getDoc().createElement(""));A.selection.setCursorLocation(O,0)}}this.ed=A;A.addCommand("Indent",this.indent,this);A.addCommand("Outdent",this.outdent,this);A.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);A.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);A.onInit.add(function(){A.editorCommands.addCommands({outdent:function(){var N=A.selection,O=A.dom;function M(P){P=O.getParent(P,O.isBlock);return P&&(parseInt(A.dom.getStyle(P,"margin-left")||0,10)+parseInt(A.dom.getStyle(P,"padding-left")||0,10))>0}return M(N.getStart())||M(N.getEnd())||A.queryCommandState("InsertOrderedList")||A.queryCommandState("InsertUnorderedList")}},"state")});A.onKeyUp.add(function(N,O){if(z==w){N.execCommand(O.shiftKey?"Outdent":"Indent",true,null);z=J;return r.cancel(O)}else{if(z==t){var M=B();var Q=N.settings.list_outdent_on_enter===true||O.shiftKey;N.execCommand(Q?"Outdent":"Indent",true,null);if(tinymce.isIE){E(M)}return r.cancel(O)}else{if(z==H){if(tinymce.isIE8){var P=N.getDoc().createTextNode("\uFEFF");N.selection.getNode().appendChild(P)}else{if(tinymce.isIE9){N.execCommand("Outdent");return r.cancel(O)}}}}}});A.onKeyDown.add(function(M,N){z=I(N)});A.onKeyDown.add(s);A.onKeyDown.add(v);A.onKeyPress.add(s)},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O,Q){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(M.tagName==="P"||G.length>1){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true);return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(Q,L,O){var t,P=Q,N,M;while(!I.isBlock(Q.parentNode)&&Q.parentNode!==I.getRoot()){Q=I.split(Q.parentNode,Q.previousSibling);Q=Q.nextSibling;P=Q}if(O){t=O.cloneNode(true);Q.parentNode.insertBefore(t,Q);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");Q.parentNode.insertBefore(t,Q)}while(P&&P!=L){N=P.nextSibling;t.appendChild(P);P=N}if(t.childNodes.length===0){t.innerHTML='<br _mce_bogus="1" />'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(V){var U;if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(P(N,V)){I.addClass(V,"_mce_tagged_br");N=S(V)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D}}else{B={defaultAction:x}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true)})},outdent:function(){var v=this,u=v.ed,w=u.dom,s=[];function x(t){var z,y,A;if(!d(u,t,s)){if(w.getStyle(t,"margin-left")!==""||w.getStyle(t,"padding-left")!==""){return v.adjustPaddingFunction(false)(t)}A=w.getStyle(t,"text-align",true);if(A==="center"||A==="right"){w.setStyle(t,"text-align","left");return}t=c(t,w);z=t.parentNode;y=t.parentNode.parentNode;if(y.tagName==="P"){w.split(y,t.parentNode)}else{w.split(z,t);if(y.tagName==="LI"){w.split(y,t)}else{if(!w.is(y,"ol,ul")){w.rename(t,"p")}}}s.push(t)}}this.process({LI:x,defaultAction:this.adjustPaddingFunction(false)});e(s,m)},process:function(y){var D=this,w=D.ed.selection,z=D.ed.dom,C,u;function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){D.splitSafeEach(s.childNodes,x)}function B(s,t){return t>=0&&s.hasChildNodes()&&t<s.childNodes.length&&s.childNodes[t].tagName==="BR"}C=w.getSelectedBlocks();if(C.length===0){C=[z.getRoot()]}u=w.getRng(true);if(!u.collapsed){if(B(u.endContainer,u.endOffset-1)){u.setEnd(u.endContainer,u.endOffset-1);w.setRng(u)}if(B(u.startContainer,u.startOffset)){u.setStart(u.startContainer,u.startOffset+1);w.setRng(u)}}if(tinymce.isIE8){var E=D.ed.selection.getNode();if(E.tagName==="LI"&&!(E.parentNode.lastChild===E)){var A=D.ed.getDoc().createTextNode("\uFEFF");E.appendChild(A)}}g=w.getBookmark();y.OL=y.UL=v;D.splitSafeEach(C,x);w.moveToBookmark(g);g=null;D.ed.execCommand("mceRepaint")},splitSafeEach:function(t,s){if(tinymce.isGecko&&(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent)||/Firefox\/3\.[0-4]/.test(navigator.userAgent))){this.classBasedEach(t,s)}else{e(t,s)}},classBasedEach:function(v,u){var w=this.ed.dom,s,t;e(v,function(x){w.addClass(x,"_mce_act_on")});s=w.select("._mce_act_on");while(s.length>0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}());
@@ -0,0 +1,781 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2011, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
13
+
14
+ // Skips text nodes that only contain whitespace since they aren't semantically important.
15
+ function skipWhitespaceNodes(e, next) {
16
+ while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
17
+ e = next(e);
18
+ }
19
+ return e;
20
+ }
21
+
22
+ function skipWhitespaceNodesBackwards(e) {
23
+ return skipWhitespaceNodes(e, function(e) {
24
+ return e.previousSibling;
25
+ });
26
+ }
27
+
28
+ function skipWhitespaceNodesForwards(e) {
29
+ return skipWhitespaceNodes(e, function(e) {
30
+ return e.nextSibling;
31
+ });
32
+ }
33
+
34
+ function hasParentInList(ed, e, list) {
35
+ return ed.dom.getParent(e, function(p) {
36
+ return tinymce.inArray(list, p) !== -1;
37
+ });
38
+ }
39
+
40
+ function isList(e) {
41
+ return e && (e.tagName === 'OL' || e.tagName === 'UL');
42
+ }
43
+
44
+ function splitNestedLists(element, dom) {
45
+ var tmp, nested, wrapItem;
46
+ tmp = skipWhitespaceNodesBackwards(element.lastChild);
47
+ while (isList(tmp)) {
48
+ nested = tmp;
49
+ tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
50
+ }
51
+ if (nested) {
52
+ wrapItem = dom.create('li', { style: 'list-style-type: none;'});
53
+ dom.split(element, nested);
54
+ dom.insertAfter(wrapItem, nested);
55
+ wrapItem.appendChild(nested);
56
+ wrapItem.appendChild(nested);
57
+ element = wrapItem.previousSibling;
58
+ }
59
+ return element;
60
+ }
61
+
62
+ function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
63
+ e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
64
+ return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
65
+ }
66
+
67
+ function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
68
+ var prev = skipWhitespaceNodesBackwards(e.previousSibling);
69
+ if (prev) {
70
+ return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
71
+ } else {
72
+ return e;
73
+ }
74
+ }
75
+
76
+ function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
77
+ var next = skipWhitespaceNodesForwards(e.nextSibling);
78
+ if (next) {
79
+ return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
80
+ } else {
81
+ return e;
82
+ }
83
+ }
84
+
85
+ function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
86
+ if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
87
+ return merge(e1, e2, differentStylesMasterElement);
88
+ } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
89
+ // Fix invalidly nested lists.
90
+ e1.appendChild(e2);
91
+ }
92
+ return e2;
93
+ }
94
+
95
+ function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
96
+ if (!e1 || !e2) {
97
+ return false;
98
+ } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
99
+ return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
100
+ } else if (isList(e1)) {
101
+ return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
102
+ } else if (mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P') {
103
+ return true;
104
+ } else {
105
+ return false;
106
+ }
107
+ }
108
+
109
+ function isListForIndent(e) {
110
+ var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
111
+ return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
112
+ }
113
+
114
+ function containsOnlyAList(e) {
115
+ var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
116
+ return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
117
+ }
118
+
119
+ function merge(e1, e2, masterElement) {
120
+ var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
121
+ if (e1.tagName === 'P') {
122
+ e1.appendChild(e1.ownerDocument.createElement('br'));
123
+ }
124
+ while (e2.firstChild) {
125
+ e1.appendChild(e2.firstChild);
126
+ }
127
+ if (masterElement) {
128
+ e1.style.listStyleType = masterElement.style.listStyleType;
129
+ }
130
+ e2.parentNode.removeChild(e2);
131
+ attemptMerge(lastOriginal, firstNew, false);
132
+ return e1;
133
+ }
134
+
135
+ function findItemToOperateOn(e, dom) {
136
+ var item;
137
+ if (!dom.is(e, 'li,ol,ul')) {
138
+ item = dom.getParent(e, 'li');
139
+ if (item) {
140
+ e = item;
141
+ }
142
+ }
143
+ return e;
144
+ }
145
+
146
+ tinymce.create('tinymce.plugins.Lists', {
147
+ init: function(ed, url) {
148
+ var LIST_TABBING = 0;
149
+ var LIST_EMPTY_ITEM = 1;
150
+ var LIST_ESCAPE = 2;
151
+ var LIST_UNKNOWN = 3;
152
+ var state = LIST_UNKNOWN;
153
+
154
+ function isTabInList(e) {
155
+ return e.keyCode === 9 && (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
156
+ }
157
+
158
+ function isOnLastListItem() {
159
+ var li = getLi();
160
+ var grandParent = li.parentNode.parentNode;
161
+ var isLastItem = li.parentNode.lastChild === li;
162
+ return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
163
+ }
164
+
165
+ function isNestedList(grandParent) {
166
+ if (isList(grandParent)) {
167
+ return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
168
+ } else {
169
+ return grandParent.tagName === 'LI';
170
+ }
171
+ }
172
+
173
+ function isInEmptyListItem() {
174
+ return ed.selection.isCollapsed() && isEmptyListItem(getLi());
175
+ }
176
+
177
+ function getLi() {
178
+ var n = ed.selection.getStart();
179
+ // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
180
+ return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
181
+ }
182
+
183
+ function isEmptyListItem(li) {
184
+ var numChildren = li.childNodes.length;
185
+ if (li.tagName === 'LI') {
186
+ return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || isEmptyWebKitLi(li) || isEmptyIE9Li(li));
187
+ }
188
+ return false;
189
+ }
190
+
191
+ function isEmptyWebKitLi(li) {
192
+ // Check for empty LI or a LI with just a child that is a BR since Gecko and WebKit uses BR elements to place the caret
193
+ return tinymce.isWebKit && li.firstChild.nodeName == 'BR';
194
+ }
195
+
196
+ function isEmptyIE9Li(li) {
197
+ // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
198
+ var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.nodeName == 'LI'});
199
+ var isLastLi = li == lis[lis.length - 1];
200
+ var child = li.firstChild;
201
+ return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
202
+ }
203
+
204
+ function isEnter(e) {
205
+ return e.keyCode === 13;
206
+ }
207
+
208
+ function getListKeyState(e) {
209
+ if (isTabInList(e)) {
210
+ return LIST_TABBING;
211
+ } else if (isEnter(e) && isOnLastListItem()) {
212
+ return LIST_ESCAPE;
213
+ } else if (isEnter(e) && isInEmptyListItem()) {
214
+ return LIST_EMPTY_ITEM;
215
+ } else {
216
+ return LIST_UNKNOWN;
217
+ }
218
+ }
219
+
220
+ function cancelEnterAndTab(_, e) {
221
+ if (state == LIST_TABBING || state == LIST_EMPTY_ITEM) {
222
+ return Event.cancel(e);
223
+ }
224
+ }
225
+
226
+ function imageJoiningListItem(ed, e) {
227
+ var prevSibling;
228
+
229
+ if (!tinymce.isGecko)
230
+ return;
231
+
232
+ var n = ed.selection.getStart();
233
+ if (e.keyCode != 8 || n.tagName !== 'IMG')
234
+ return;
235
+
236
+ function lastLI(node) {
237
+ var child = node.firstChild;
238
+ var li = null;
239
+ do {
240
+ if (!child)
241
+ break;
242
+
243
+ if (child.tagName === 'LI')
244
+ li = child;
245
+ } while (child = child.nextSibling);
246
+
247
+ return li;
248
+ }
249
+
250
+ function addChildren(parentNode, destination) {
251
+ while (parentNode.childNodes.length > 0)
252
+ destination.appendChild(parentNode.childNodes[0]);
253
+ }
254
+
255
+ // Check if there is a previous sibling
256
+ prevSibling = n.parentNode.previousSibling;
257
+ if (!prevSibling)
258
+ return;
259
+
260
+ var ul;
261
+ if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
262
+ ul = prevSibling;
263
+ else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
264
+ ul = prevSibling.previousSibling;
265
+ else
266
+ return;
267
+
268
+ var li = lastLI(ul);
269
+
270
+ // move the caret to the end of the list item
271
+ var rng = ed.dom.createRng();
272
+ rng.setStart(li, 1);
273
+ rng.setEnd(li, 1);
274
+ ed.selection.setRng(rng);
275
+ ed.selection.collapse(true);
276
+
277
+ // save a bookmark at the end of the list item
278
+ var bookmark = ed.selection.getBookmark();
279
+
280
+ // copy the image an its text to the list item
281
+ var clone = n.parentNode.cloneNode(true);
282
+ if (clone.tagName === 'P' || clone.tagName === 'DIV')
283
+ addChildren(clone, li);
284
+ else
285
+ li.appendChild(clone);
286
+
287
+ // remove the old copy of the image
288
+ n.parentNode.parentNode.removeChild(n.parentNode);
289
+
290
+ // move the caret where we saved the bookmark
291
+ ed.selection.moveToBookmark(bookmark);
292
+ }
293
+
294
+ // fix the cursor position to ensure it is correct in IE
295
+ function setCursorPositionToOriginalLi(li) {
296
+ var list = ed.dom.getParent(li, 'ol,ul');
297
+ if (list != null) {
298
+ var lastLi = list.lastChild;
299
+ lastLi.appendChild(ed.getDoc().createElement(''));
300
+ ed.selection.setCursorLocation(lastLi, 0);
301
+ }
302
+ }
303
+
304
+ this.ed = ed;
305
+ ed.addCommand('Indent', this.indent, this);
306
+ ed.addCommand('Outdent', this.outdent, this);
307
+ ed.addCommand('InsertUnorderedList', function() {
308
+ this.applyList('UL', 'OL');
309
+ }, this);
310
+ ed.addCommand('InsertOrderedList', function() {
311
+ this.applyList('OL', 'UL');
312
+ }, this);
313
+
314
+ ed.onInit.add(function() {
315
+ ed.editorCommands.addCommands({
316
+ 'outdent': function() {
317
+ var sel = ed.selection, dom = ed.dom;
318
+
319
+ function hasStyleIndent(n) {
320
+ n = dom.getParent(n, dom.isBlock);
321
+ return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
322
+ }
323
+
324
+ return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
325
+ }
326
+ }, 'state');
327
+ });
328
+
329
+ ed.onKeyUp.add(function(ed, e) {
330
+ if (state == LIST_TABBING) {
331
+ ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
332
+ state = LIST_UNKNOWN;
333
+ return Event.cancel(e);
334
+ } else if (state == LIST_EMPTY_ITEM) {
335
+ var li = getLi();
336
+ var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
337
+ ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
338
+ if (tinymce.isIE) {
339
+ setCursorPositionToOriginalLi(li);
340
+ }
341
+ return Event.cancel(e);
342
+ } else if (state == LIST_ESCAPE) {
343
+ if (tinymce.isIE8) {
344
+ // append a zero sized nbsp so that caret is positioned correctly in IE8 after escaping and applying formatting.
345
+ // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
346
+ // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
347
+ var n = ed.getDoc().createTextNode('\uFEFF');
348
+ ed.selection.getNode().appendChild(n);
349
+ } else if (tinymce.isIE9) {
350
+ // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
351
+ ed.execCommand('Outdent');
352
+ return Event.cancel(e);
353
+ }
354
+ }
355
+ });
356
+ ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
357
+ ed.onKeyDown.add(cancelEnterAndTab);
358
+ ed.onKeyDown.add(imageJoiningListItem);
359
+ ed.onKeyPress.add(cancelEnterAndTab);
360
+ },
361
+
362
+ applyList: function(targetListType, oppositeListType) {
363
+ var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
364
+ selectedBlocks = ed.selection.getSelectedBlocks();
365
+
366
+ function cleanupBr(e) {
367
+ if (e && e.tagName === 'BR') {
368
+ dom.remove(e);
369
+ }
370
+ }
371
+
372
+ function makeList(element) {
373
+ var list = dom.create(targetListType), li;
374
+
375
+ function adjustIndentForNewList(element) {
376
+ // If there's a margin-left, outdent one level to account for the extra list margin.
377
+ if (element.style.marginLeft || element.style.paddingLeft) {
378
+ t.adjustPaddingFunction(false)(element);
379
+ }
380
+ }
381
+
382
+ if (element.tagName === 'LI') {
383
+ // No change required.
384
+ } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
385
+ processBrs(element, function(startSection, br, previousBR) {
386
+ doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
387
+ li = startSection.parentNode;
388
+ adjustIndentForNewList(li);
389
+ cleanupBr(br);
390
+ });
391
+ if (element.tagName === 'P' || selectedBlocks.length > 1) {
392
+ dom.split(li.parentNode.parentNode, li.parentNode);
393
+ }
394
+ attemptMergeWithAdjacent(li.parentNode, true);
395
+ return;
396
+ } else {
397
+ // Put the list around the element.
398
+ li = dom.create('li');
399
+ dom.insertAfter(li, element);
400
+ li.appendChild(element);
401
+ adjustIndentForNewList(element);
402
+ element = li;
403
+ }
404
+ dom.insertAfter(list, element);
405
+ list.appendChild(element);
406
+ attemptMergeWithAdjacent(list, true);
407
+ applied.push(element);
408
+ }
409
+
410
+ function doWrapList(start, end, template) {
411
+ var li, n = start, tmp, i;
412
+ while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
413
+ start = dom.split(start.parentNode, start.previousSibling);
414
+ start = start.nextSibling;
415
+ n = start;
416
+ }
417
+ if (template) {
418
+ li = template.cloneNode(true);
419
+ start.parentNode.insertBefore(li, start);
420
+ while (li.firstChild) dom.remove(li.firstChild);
421
+ li = dom.rename(li, 'li');
422
+ } else {
423
+ li = dom.create('li');
424
+ start.parentNode.insertBefore(li, start);
425
+ }
426
+ while (n && n != end) {
427
+ tmp = n.nextSibling;
428
+ li.appendChild(n);
429
+ n = tmp;
430
+ }
431
+ if (li.childNodes.length === 0) {
432
+ li.innerHTML = '<br _mce_bogus="1" />';
433
+ }
434
+ makeList(li);
435
+ }
436
+
437
+ function processBrs(element, callback) {
438
+ var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
439
+ breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
440
+
441
+ function isAnyPartSelected(start, end) {
442
+ var r = dom.createRng(), sel;
443
+ bookmark.keep = true;
444
+ ed.selection.moveToBookmark(bookmark);
445
+ bookmark.keep = false;
446
+ sel = ed.selection.getRng(true);
447
+ if (!end) {
448
+ end = start.parentNode.lastChild;
449
+ }
450
+ r.setStartBefore(start);
451
+ r.setEndAfter(end);
452
+ return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
453
+ }
454
+
455
+ function nextLeaf(br) {
456
+ if (br.nextSibling)
457
+ return br.nextSibling;
458
+ if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
459
+ return nextLeaf(br.parentNode);
460
+ }
461
+
462
+ // Split on BRs within the range and process those.
463
+ startSection = element.firstChild;
464
+ // First mark the BRs that have any part of the previous section selected.
465
+ var trailingContentSelected = false;
466
+ each(dom.select(breakElements, element), function(br) {
467
+ var b;
468
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
469
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
470
+ }
471
+ if (isAnyPartSelected(startSection, br)) {
472
+ dom.addClass(br, '_mce_tagged_br');
473
+ startSection = nextLeaf(br);
474
+ }
475
+ });
476
+ trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
477
+ startSection = element.firstChild;
478
+ each(dom.select(breakElements, element), function(br) {
479
+ // Got a section from start to br.
480
+ var tmp = nextLeaf(br);
481
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
482
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
483
+ }
484
+ if (dom.hasClass(br, '_mce_tagged_br')) {
485
+ callback(startSection, br, previousBR);
486
+ previousBR = null;
487
+ } else {
488
+ previousBR = br;
489
+ }
490
+ startSection = tmp;
491
+ });
492
+ if (trailingContentSelected) {
493
+ callback(startSection, undefined, previousBR);
494
+ }
495
+ }
496
+
497
+ function wrapList(element) {
498
+ processBrs(element, function(startSection, br, previousBR) {
499
+ // Need to indent this part
500
+ doWrapList(startSection, br);
501
+ cleanupBr(br);
502
+ cleanupBr(previousBR);
503
+ });
504
+ }
505
+
506
+ function changeList(element) {
507
+ if (tinymce.inArray(applied, element) !== -1) {
508
+ return;
509
+ }
510
+ if (element.parentNode.tagName === oppositeListType) {
511
+ dom.split(element.parentNode, element);
512
+ makeList(element);
513
+ attemptMergeWithNext(element.parentNode, false);
514
+ }
515
+ applied.push(element);
516
+ }
517
+
518
+ function convertListItemToParagraph(element) {
519
+ var child, nextChild, mergedElement, splitLast;
520
+ if (tinymce.inArray(applied, element) !== -1) {
521
+ return;
522
+ }
523
+ element = splitNestedLists(element, dom);
524
+ while (dom.is(element.parentNode, 'ol,ul,li')) {
525
+ dom.split(element.parentNode, element);
526
+ }
527
+ // Push the original element we have from the selection, not the renamed one.
528
+ applied.push(element);
529
+ element = dom.rename(element, 'p');
530
+ mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
531
+ if (mergedElement === element) {
532
+ // Now split out any block elements that can't be contained within a P.
533
+ // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
534
+ child = element.firstChild;
535
+ while (child) {
536
+ if (dom.isBlock(child)) {
537
+ child = dom.split(child.parentNode, child);
538
+ splitLast = true;
539
+ nextChild = child.nextSibling && child.nextSibling.firstChild;
540
+ } else {
541
+ nextChild = child.nextSibling;
542
+ if (splitLast && child.tagName === 'BR') {
543
+ dom.remove(child);
544
+ }
545
+ splitLast = false;
546
+ }
547
+ child = nextChild;
548
+ }
549
+ }
550
+ }
551
+
552
+ each(selectedBlocks, function(e) {
553
+ e = findItemToOperateOn(e, dom);
554
+ if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
555
+ hasOppositeType = true;
556
+ } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
557
+ hasSameType = true;
558
+ } else {
559
+ hasNonList = true;
560
+ }
561
+ });
562
+
563
+ if (hasNonList || hasOppositeType || selectedBlocks.length === 0) {
564
+ actions = {
565
+ 'LI': changeList,
566
+ 'H1': makeList,
567
+ 'H2': makeList,
568
+ 'H3': makeList,
569
+ 'H4': makeList,
570
+ 'H5': makeList,
571
+ 'H6': makeList,
572
+ 'P': makeList,
573
+ 'BODY': makeList,
574
+ 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
575
+ defaultAction: wrapList
576
+ };
577
+ } else {
578
+ actions = {
579
+ defaultAction: convertListItemToParagraph
580
+ };
581
+ }
582
+ this.process(actions);
583
+ },
584
+
585
+ indent: function() {
586
+ var ed = this.ed, dom = ed.dom, indented = [];
587
+
588
+ function createWrapItem(element) {
589
+ var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
590
+ dom.insertAfter(wrapItem, element);
591
+ return wrapItem;
592
+ }
593
+
594
+ function createWrapList(element) {
595
+ var wrapItem = createWrapItem(element),
596
+ list = dom.getParent(element, 'ol,ul'),
597
+ listType = list.tagName,
598
+ listStyle = dom.getStyle(list, 'list-style-type'),
599
+ attrs = {},
600
+ wrapList;
601
+ if (listStyle !== '') {
602
+ attrs.style = 'list-style-type: ' + listStyle + ';';
603
+ }
604
+ wrapList = dom.create(listType, attrs);
605
+ wrapItem.appendChild(wrapList);
606
+ return wrapList;
607
+ }
608
+
609
+ function indentLI(element) {
610
+ if (!hasParentInList(ed, element, indented)) {
611
+ element = splitNestedLists(element, dom);
612
+ var wrapList = createWrapList(element);
613
+ wrapList.appendChild(element);
614
+ attemptMergeWithAdjacent(wrapList.parentNode, false);
615
+ attemptMergeWithAdjacent(wrapList, false);
616
+ indented.push(element);
617
+ }
618
+ }
619
+
620
+ this.process({
621
+ 'LI': indentLI,
622
+ defaultAction: this.adjustPaddingFunction(true)
623
+ });
624
+
625
+ },
626
+
627
+ outdent: function() {
628
+ var t = this, ed = t.ed, dom = ed.dom, outdented = [];
629
+
630
+ function outdentLI(element) {
631
+ var listElement, targetParent, align;
632
+ if (!hasParentInList(ed, element, outdented)) {
633
+ if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
634
+ return t.adjustPaddingFunction(false)(element);
635
+ }
636
+ align = dom.getStyle(element, 'text-align', true);
637
+ if (align === 'center' || align === 'right') {
638
+ dom.setStyle(element, 'text-align', 'left');
639
+ return;
640
+ }
641
+ element = splitNestedLists(element, dom);
642
+ listElement = element.parentNode;
643
+ targetParent = element.parentNode.parentNode;
644
+ if (targetParent.tagName === 'P') {
645
+ dom.split(targetParent, element.parentNode);
646
+ } else {
647
+ dom.split(listElement, element);
648
+ if (targetParent.tagName === 'LI') {
649
+ // Nested list, need to split the LI and go back out to the OL/UL element.
650
+ dom.split(targetParent, element);
651
+ } else if (!dom.is(targetParent, 'ol,ul')) {
652
+ dom.rename(element, 'p');
653
+ }
654
+ }
655
+ outdented.push(element);
656
+ }
657
+ }
658
+
659
+ this.process({
660
+ 'LI': outdentLI,
661
+ defaultAction: this.adjustPaddingFunction(false)
662
+ });
663
+
664
+ each(outdented, attemptMergeWithAdjacent);
665
+ },
666
+
667
+ process: function(actions) {
668
+ var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
669
+
670
+ function processElement(element) {
671
+ dom.removeClass(element, '_mce_act_on');
672
+ if (!element || element.nodeType !== 1) {
673
+ return;
674
+ }
675
+ element = findItemToOperateOn(element, dom);
676
+ var action = actions[element.tagName];
677
+ if (!action) {
678
+ action = actions.defaultAction;
679
+ }
680
+ action(element);
681
+ }
682
+
683
+ function recurse(element) {
684
+ t.splitSafeEach(element.childNodes, processElement);
685
+ }
686
+
687
+ function brAtEdgeOfSelection(container, offset) {
688
+ return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
689
+ container.childNodes[offset].tagName === 'BR';
690
+ }
691
+
692
+ selectedBlocks = sel.getSelectedBlocks();
693
+ if (selectedBlocks.length === 0) {
694
+ selectedBlocks = [ dom.getRoot() ];
695
+ }
696
+
697
+ r = sel.getRng(true);
698
+ if (!r.collapsed) {
699
+ if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
700
+ r.setEnd(r.endContainer, r.endOffset - 1);
701
+ sel.setRng(r);
702
+ }
703
+ if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
704
+ r.setStart(r.startContainer, r.startOffset + 1);
705
+ sel.setRng(r);
706
+ }
707
+ }
708
+
709
+
710
+ if (tinymce.isIE8) {
711
+ // append a zero sized nbsp so that caret is restored correctly using bookmark
712
+ var s = t.ed.selection.getNode();
713
+ if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
714
+ var i = t.ed.getDoc().createTextNode('\uFEFF');
715
+ s.appendChild(i);
716
+ }
717
+ }
718
+
719
+ bookmark = sel.getBookmark();
720
+ actions.OL = actions.UL = recurse;
721
+ t.splitSafeEach(selectedBlocks, processElement);
722
+ sel.moveToBookmark(bookmark);
723
+ bookmark = null;
724
+ // Avoids table or image handles being left behind in Firefox.
725
+ t.ed.execCommand('mceRepaint');
726
+ },
727
+
728
+ splitSafeEach: function(elements, f) {
729
+ if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
730
+ /Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
731
+ this.classBasedEach(elements, f);
732
+ } else {
733
+ each(elements, f);
734
+ }
735
+ },
736
+
737
+ classBasedEach: function(elements, f) {
738
+ var dom = this.ed.dom, nodes, element;
739
+ // Mark nodes
740
+ each(elements, function(element) {
741
+ dom.addClass(element, '_mce_act_on');
742
+ });
743
+ nodes = dom.select('._mce_act_on');
744
+ while (nodes.length > 0) {
745
+ element = nodes.shift();
746
+ dom.removeClass(element, '_mce_act_on');
747
+ f(element);
748
+ nodes = dom.select('._mce_act_on');
749
+ }
750
+ },
751
+
752
+ adjustPaddingFunction: function(isIndent) {
753
+ var indentAmount, indentUnits, ed = this.ed;
754
+ indentAmount = ed.settings.indentation;
755
+ indentUnits = /[a-z%]+/i.exec(indentAmount);
756
+ indentAmount = parseInt(indentAmount, 10);
757
+ return function(element) {
758
+ var currentIndent, newIndentAmount;
759
+ currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
760
+ if (isIndent) {
761
+ newIndentAmount = currentIndent + indentAmount;
762
+ } else {
763
+ newIndentAmount = currentIndent - indentAmount;
764
+ }
765
+ ed.dom.setStyle(element, 'padding-left', '');
766
+ ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
767
+ };
768
+ },
769
+
770
+ getInfo: function() {
771
+ return {
772
+ longname : 'Lists',
773
+ author : 'Moxiecode Systems AB',
774
+ authorurl : 'http://tinymce.moxiecode.com',
775
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
776
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
777
+ };
778
+ }
779
+ });
780
+ tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
781
+ }());