spud_core 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. data/app/assets/libs/tiny_mce/jquery.tinymce.js +1 -0
  2. data/app/assets/libs/tiny_mce/langs/en.js +1 -0
  3. data/app/assets/libs/tiny_mce/license.txt +504 -0
  4. data/app/assets/libs/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  5. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  6. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  7. data/app/assets/libs/tiny_mce/plugins/advhr/js/rule.js +43 -0
  8. data/app/assets/libs/tiny_mce/plugins/advhr/langs/en_dlg.js +1 -0
  9. data/app/assets/libs/tiny_mce/plugins/advhr/rule.htm +58 -0
  10. data/app/assets/libs/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  11. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  12. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  13. data/app/assets/libs/tiny_mce/plugins/advimage/image.htm +235 -0
  14. data/app/assets/libs/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  15. data/app/assets/libs/tiny_mce/plugins/advimage/js/image.js +462 -0
  16. data/app/assets/libs/tiny_mce/plugins/advimage/langs/en_dlg.js +1 -0
  17. data/app/assets/libs/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  18. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  19. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  20. data/app/assets/libs/tiny_mce/plugins/advlink/js/advlink.js +539 -0
  21. data/app/assets/libs/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -0
  22. data/app/assets/libs/tiny_mce/plugins/advlink/link.htm +338 -0
  23. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  24. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin_src.js +176 -0
  25. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
  26. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin_src.js +172 -0
  27. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  28. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -0
  29. data/app/assets/libs/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  30. data/app/assets/libs/tiny_mce/plugins/autosave/editor_plugin_src.js +431 -0
  31. data/app/assets/libs/tiny_mce/plugins/autosave/langs/en.js +4 -0
  32. data/app/assets/libs/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  33. data/app/assets/libs/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  34. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  35. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin_src.js +161 -0
  36. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  37. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  38. data/app/assets/libs/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  39. data/app/assets/libs/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  40. data/app/assets/libs/tiny_mce/plugins/emotions/emotions.htm +42 -0
  41. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  42. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  43. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  44. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  45. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  46. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  47. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  48. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  49. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  50. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  51. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  52. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  53. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  54. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  55. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  56. data/app/assets/libs/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  57. data/app/assets/libs/tiny_mce/plugins/emotions/js/emotions.js +43 -0
  58. data/app/assets/libs/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -0
  59. data/app/assets/libs/tiny_mce/plugins/example/dialog.htm +22 -0
  60. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin.js +1 -0
  61. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  62. data/app/assets/libs/tiny_mce/plugins/example/img/example.gif +0 -0
  63. data/app/assets/libs/tiny_mce/plugins/example/js/dialog.js +19 -0
  64. data/app/assets/libs/tiny_mce/plugins/example/langs/en.js +3 -0
  65. data/app/assets/libs/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  66. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin.js +1 -0
  67. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -0
  68. data/app/assets/libs/tiny_mce/plugins/fullpage/css/fullpage.css +143 -0
  69. data/app/assets/libs/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  70. data/app/assets/libs/tiny_mce/plugins/fullpage/editor_plugin_src.js +405 -0
  71. data/app/assets/libs/tiny_mce/plugins/fullpage/fullpage.htm +259 -0
  72. data/app/assets/libs/tiny_mce/plugins/fullpage/js/fullpage.js +232 -0
  73. data/app/assets/libs/tiny_mce/plugins/fullpage/langs/en_dlg.js +1 -0
  74. data/app/assets/libs/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  75. data/app/assets/libs/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -0
  76. data/app/assets/libs/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -0
  77. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  78. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  79. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  80. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +699 -0
  81. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  82. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  83. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  84. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  85. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  86. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  87. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  88. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  89. data/app/assets/libs/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  90. data/app/assets/libs/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  91. data/app/assets/libs/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  92. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  93. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin_src.js +262 -0
  94. data/app/assets/libs/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  95. data/app/assets/libs/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  96. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin.js +1 -0
  97. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin_src.js +946 -0
  98. data/app/assets/libs/tiny_mce/plugins/media/css/media.css +17 -0
  99. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin.js +1 -0
  100. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin_src.js +890 -0
  101. data/app/assets/libs/tiny_mce/plugins/media/js/embed.js +73 -0
  102. data/app/assets/libs/tiny_mce/plugins/media/js/media.js +464 -0
  103. data/app/assets/libs/tiny_mce/plugins/media/langs/en_dlg.js +1 -0
  104. data/app/assets/libs/tiny_mce/plugins/media/media.htm +922 -0
  105. data/app/assets/libs/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  106. data/app/assets/libs/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  107. data/app/assets/libs/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +54 -0
  108. data/app/assets/libs/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  109. data/app/assets/libs/tiny_mce/plugins/noneditable/editor_plugin_src.js +95 -0
  110. data/app/assets/libs/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  111. data/app/assets/libs/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  112. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  113. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin_src.js +871 -0
  114. data/app/assets/libs/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  115. data/app/assets/libs/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  116. data/app/assets/libs/tiny_mce/plugins/paste/langs/en_dlg.js +1 -0
  117. data/app/assets/libs/tiny_mce/plugins/paste/pastetext.htm +27 -0
  118. data/app/assets/libs/tiny_mce/plugins/paste/pasteword.htm +21 -0
  119. data/app/assets/libs/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  120. data/app/assets/libs/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  121. data/app/assets/libs/tiny_mce/plugins/preview/example.html +28 -0
  122. data/app/assets/libs/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  123. data/app/assets/libs/tiny_mce/plugins/preview/preview.html +17 -0
  124. data/app/assets/libs/tiny_mce/plugins/print/editor_plugin.js +1 -0
  125. data/app/assets/libs/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  126. data/app/assets/libs/tiny_mce/plugins/save/editor_plugin.js +1 -0
  127. data/app/assets/libs/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  128. data/app/assets/libs/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  129. data/app/assets/libs/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  130. data/app/assets/libs/tiny_mce/plugins/searchreplace/editor_plugin_src.js +61 -0
  131. data/app/assets/libs/tiny_mce/plugins/searchreplace/js/searchreplace.js +142 -0
  132. data/app/assets/libs/tiny_mce/plugins/searchreplace/langs/en_dlg.js +1 -0
  133. data/app/assets/libs/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
  134. data/app/assets/libs/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  135. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  136. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin_src.js +436 -0
  137. data/app/assets/libs/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  138. data/app/assets/libs/tiny_mce/plugins/style/css/props.css +13 -0
  139. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin.js +1 -0
  140. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  141. data/app/assets/libs/tiny_mce/plugins/style/js/props.js +635 -0
  142. data/app/assets/libs/tiny_mce/plugins/style/langs/en_dlg.js +1 -0
  143. data/app/assets/libs/tiny_mce/plugins/style/props.htm +840 -0
  144. data/app/assets/libs/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  145. data/app/assets/libs/tiny_mce/plugins/tabfocus/editor_plugin_src.js +122 -0
  146. data/app/assets/libs/tiny_mce/plugins/table/cell.htm +180 -0
  147. data/app/assets/libs/tiny_mce/plugins/table/css/cell.css +17 -0
  148. data/app/assets/libs/tiny_mce/plugins/table/css/row.css +25 -0
  149. data/app/assets/libs/tiny_mce/plugins/table/css/table.css +13 -0
  150. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin.js +1 -0
  151. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin_src.js +1408 -0
  152. data/app/assets/libs/tiny_mce/plugins/table/js/cell.js +319 -0
  153. data/app/assets/libs/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  154. data/app/assets/libs/tiny_mce/plugins/table/js/row.js +237 -0
  155. data/app/assets/libs/tiny_mce/plugins/table/js/table.js +488 -0
  156. data/app/assets/libs/tiny_mce/plugins/table/langs/en_dlg.js +1 -0
  157. data/app/assets/libs/tiny_mce/plugins/table/merge_cells.htm +32 -0
  158. data/app/assets/libs/tiny_mce/plugins/table/row.htm +158 -0
  159. data/app/assets/libs/tiny_mce/plugins/table/table.htm +188 -0
  160. data/app/assets/libs/tiny_mce/plugins/template/blank.htm +12 -0
  161. data/app/assets/libs/tiny_mce/plugins/template/css/template.css +23 -0
  162. data/app/assets/libs/tiny_mce/plugins/template/editor_plugin.js +1 -0
  163. data/app/assets/libs/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  164. data/app/assets/libs/tiny_mce/plugins/template/js/template.js +106 -0
  165. data/app/assets/libs/tiny_mce/plugins/template/langs/en_dlg.js +1 -0
  166. data/app/assets/libs/tiny_mce/plugins/template/template.htm +31 -0
  167. data/app/assets/libs/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  168. data/app/assets/libs/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
  169. data/app/assets/libs/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  170. data/app/assets/libs/tiny_mce/plugins/wordcount/editor_plugin_src.js +114 -0
  171. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  172. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  173. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  174. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  175. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  176. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  177. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  178. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  179. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  180. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  181. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  182. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  183. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/attributes.js +111 -0
  184. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  185. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  186. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  187. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  188. data/app/assets/libs/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +1 -0
  189. data/app/assets/libs/tiny_mce/themes/advanced/about.htm +52 -0
  190. data/app/assets/libs/tiny_mce/themes/advanced/anchor.htm +26 -0
  191. data/app/assets/libs/tiny_mce/themes/advanced/charmap.htm +55 -0
  192. data/app/assets/libs/tiny_mce/themes/advanced/color_picker.htm +74 -0
  193. data/app/assets/libs/tiny_mce/themes/advanced/editor_template.js +1 -0
  194. data/app/assets/libs/tiny_mce/themes/advanced/editor_template_src.js +1362 -0
  195. data/app/assets/libs/tiny_mce/themes/advanced/image.htm +80 -0
  196. data/app/assets/libs/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  197. data/app/assets/libs/tiny_mce/themes/advanced/img/flash.gif +0 -0
  198. data/app/assets/libs/tiny_mce/themes/advanced/img/icons.gif +0 -0
  199. data/app/assets/libs/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  200. data/app/assets/libs/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  201. data/app/assets/libs/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  202. data/app/assets/libs/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  203. data/app/assets/libs/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  204. data/app/assets/libs/tiny_mce/themes/advanced/img/trans.gif +0 -0
  205. data/app/assets/libs/tiny_mce/themes/advanced/img/video.gif +0 -0
  206. data/app/assets/libs/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  207. data/app/assets/libs/tiny_mce/themes/advanced/js/about.js +73 -0
  208. data/app/assets/libs/tiny_mce/themes/advanced/js/anchor.js +43 -0
  209. data/app/assets/libs/tiny_mce/themes/advanced/js/charmap.js +363 -0
  210. data/app/assets/libs/tiny_mce/themes/advanced/js/color_picker.js +329 -0
  211. data/app/assets/libs/tiny_mce/themes/advanced/js/image.js +251 -0
  212. data/app/assets/libs/tiny_mce/themes/advanced/js/link.js +153 -0
  213. data/app/assets/libs/tiny_mce/themes/advanced/js/source_editor.js +56 -0
  214. data/app/assets/libs/tiny_mce/themes/advanced/langs/en.js +1 -0
  215. data/app/assets/libs/tiny_mce/themes/advanced/langs/en_dlg.js +1 -0
  216. data/app/assets/libs/tiny_mce/themes/advanced/link.htm +57 -0
  217. data/app/assets/libs/tiny_mce/themes/advanced/shortcuts.htm +47 -0
  218. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/content.css +50 -0
  219. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  220. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  221. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  222. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  223. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  224. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  225. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  226. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/ui.css +214 -0
  227. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/content.css +24 -0
  228. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  229. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/ui.css +102 -0
  230. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/content.css +48 -0
  231. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -0
  232. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  233. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  234. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  235. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui.css +217 -0
  236. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  237. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  238. data/app/assets/libs/tiny_mce/themes/advanced/source_editor.htm +25 -0
  239. data/app/assets/libs/tiny_mce/themes/simple/editor_template.js +1 -0
  240. data/app/assets/libs/tiny_mce/themes/simple/editor_template_src.js +84 -0
  241. data/app/assets/libs/tiny_mce/themes/simple/img/icons.gif +0 -0
  242. data/app/assets/libs/tiny_mce/themes/simple/langs/en.js +1 -0
  243. data/app/assets/libs/tiny_mce/themes/simple/skins/default/content.css +25 -0
  244. data/app/assets/libs/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  245. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  246. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  247. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  248. data/app/assets/libs/tiny_mce/tiny_mce.js +1 -0
  249. data/app/assets/libs/tiny_mce/tiny_mce_popup.js +5 -0
  250. data/app/assets/libs/tiny_mce/tiny_mce_src.js +15979 -0
  251. data/app/assets/libs/tiny_mce/utils/editable_selects.js +70 -0
  252. data/app/assets/libs/tiny_mce/utils/form_utils.js +210 -0
  253. data/app/assets/libs/tiny_mce/utils/mctabs.js +162 -0
  254. data/app/assets/libs/tiny_mce/utils/validate.js +252 -0
  255. data/app/views/spud/sitemaps/show.xml.builder +1 -1
  256. metadata +268 -14
@@ -0,0 +1,946 @@
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 return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
103
+ }
104
+
105
+ function isListForIndent(e) {
106
+ var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
107
+ return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
108
+ }
109
+
110
+ function containsOnlyAList(e) {
111
+ var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
112
+ return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
113
+ }
114
+
115
+ function merge(e1, e2, masterElement) {
116
+ var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
117
+ if (e1.tagName === 'P') {
118
+ e1.appendChild(e1.ownerDocument.createElement('br'));
119
+ }
120
+ while (e2.firstChild) {
121
+ e1.appendChild(e2.firstChild);
122
+ }
123
+ if (masterElement) {
124
+ e1.style.listStyleType = masterElement.style.listStyleType;
125
+ }
126
+ e2.parentNode.removeChild(e2);
127
+ attemptMerge(lastOriginal, firstNew, false);
128
+ return e1;
129
+ }
130
+
131
+ function findItemToOperateOn(e, dom) {
132
+ var item;
133
+ if (!dom.is(e, 'li,ol,ul')) {
134
+ item = dom.getParent(e, 'li');
135
+ if (item) {
136
+ e = item;
137
+ }
138
+ }
139
+ return e;
140
+ }
141
+
142
+ tinymce.create('tinymce.plugins.Lists', {
143
+ init: function(ed) {
144
+ var LIST_TABBING = 'TABBING';
145
+ var LIST_EMPTY_ITEM = 'EMPTY';
146
+ var LIST_ESCAPE = 'ESCAPE';
147
+ var LIST_PARAGRAPH = 'PARAGRAPH';
148
+ var LIST_UNKNOWN = 'UNKNOWN';
149
+ var state = LIST_UNKNOWN;
150
+
151
+ function isTabInList(e) {
152
+ // Don't indent on Ctrl+Tab or Alt+Tab
153
+ return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
154
+ (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
155
+ }
156
+
157
+ function isCursorAtEndOfContainer() {
158
+ var range = ed.selection.getRng();
159
+ var startContainer = range.startContainer;
160
+ if (startContainer.nodeType == 3) {
161
+ return (range.endOffset == startContainer.nodeValue.length);
162
+ } else if (startContainer.nodeType == 1) {
163
+ return range.endOffset == startContainer.childNodes.length;
164
+ }
165
+ return false;
166
+ }
167
+
168
+ // If we are at the end of a paragraph in a list item, pressing enter should create a new list item instead of a new paragraph.
169
+ function isEndOfParagraph() {
170
+ var node = ed.selection.getNode();
171
+ var isLastParagraphOfLi = node.tagName === 'P' && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
172
+ return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
173
+ }
174
+
175
+ function isOnLastListItem() {
176
+ var li = getLi();
177
+ var grandParent = li.parentNode.parentNode;
178
+ var isLastItem = li.parentNode.lastChild === li;
179
+ return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
180
+ }
181
+
182
+ function isNestedList(grandParent) {
183
+ if (isList(grandParent)) {
184
+ return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
185
+ } else {
186
+ return grandParent.tagName === 'LI';
187
+ }
188
+ }
189
+
190
+ function isInEmptyListItem() {
191
+ return ed.selection.isCollapsed() && isEmptyListItem(getLi());
192
+ }
193
+
194
+ function getLi() {
195
+ var n = ed.selection.getStart();
196
+ // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
197
+ return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
198
+ }
199
+
200
+ function isEmptyListItem(li) {
201
+ var numChildren = li.childNodes.length;
202
+ if (li.tagName === 'LI') {
203
+ return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
204
+ }
205
+ return false;
206
+ }
207
+
208
+ function isEmptyIE9Li(li) {
209
+ // 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
210
+ var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
211
+ var isLastLi = li == lis[lis.length - 1];
212
+ var child = li.firstChild;
213
+ return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
214
+ }
215
+
216
+ function isEnter(e) {
217
+ return e.keyCode === tinymce.VK.ENTER;
218
+ }
219
+
220
+ function isEnterWithoutShift(e) {
221
+ return isEnter(e) && !e.shiftKey;
222
+ }
223
+
224
+ function getListKeyState(e) {
225
+ if (isTabInList(e)) {
226
+ return LIST_TABBING;
227
+ } else if (isEnterWithoutShift(e) && isOnLastListItem()) {
228
+ return LIST_ESCAPE;
229
+ } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
230
+ return LIST_EMPTY_ITEM;
231
+ } else if (isEnterWithoutShift(e) && isEndOfParagraph()) {
232
+ return LIST_PARAGRAPH;
233
+ } else {
234
+ return LIST_UNKNOWN;
235
+ }
236
+ }
237
+
238
+ function cancelDefaultEvents(ed, e) {
239
+ // list escape is done manually using outdent as it does not create paragraphs correctly in td's
240
+ if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
241
+ Event.cancel(e);
242
+ }
243
+ }
244
+
245
+ // Creates a new list item after the current selection's list item parent
246
+ function createNewLi(ed, e) {
247
+ if (state == LIST_PARAGRAPH) {
248
+ var node = ed.selection.getNode();
249
+ var li = ed.dom.create("li");
250
+ var parentLi = ed.dom.getParent(node, 'li');
251
+ ed.dom.insertAfter(li, parentLi);
252
+
253
+ // Move caret to new list element.
254
+ if (tinyMCE.isIE8) {
255
+ li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
256
+ ed.selection.setCursorLocation(li, 1);
257
+ } else if (tinyMCE.isGecko) {
258
+ // This setTimeout is a hack as FF behaves badly if there is no content after the bullet point
259
+ setTimeout(function () {
260
+ var n = ed.getDoc().createTextNode('\uFEFF');
261
+ li.appendChild(n);
262
+ ed.selection.setCursorLocation(li, 0);
263
+ }, 0);
264
+ } else {
265
+ ed.selection.setCursorLocation(li, 0);
266
+ }
267
+ Event.cancel(e);
268
+ }
269
+ }
270
+
271
+ function imageJoiningListItem(ed, e) {
272
+ var prevSibling;
273
+
274
+ if (!tinymce.isGecko)
275
+ return;
276
+
277
+ var n = ed.selection.getStart();
278
+ if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
279
+ return;
280
+
281
+ function lastLI(node) {
282
+ var child = node.firstChild;
283
+ var li = null;
284
+ do {
285
+ if (!child)
286
+ break;
287
+
288
+ if (child.tagName === 'LI')
289
+ li = child;
290
+ } while (child = child.nextSibling);
291
+
292
+ return li;
293
+ }
294
+
295
+ function addChildren(parentNode, destination) {
296
+ while (parentNode.childNodes.length > 0)
297
+ destination.appendChild(parentNode.childNodes[0]);
298
+ }
299
+
300
+ // Check if there is a previous sibling
301
+ prevSibling = n.parentNode.previousSibling;
302
+ if (!prevSibling)
303
+ return;
304
+
305
+ var ul;
306
+ if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
307
+ ul = prevSibling;
308
+ else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
309
+ ul = prevSibling.previousSibling;
310
+ else
311
+ return;
312
+
313
+ var li = lastLI(ul);
314
+
315
+ // move the caret to the end of the list item
316
+ var rng = ed.dom.createRng();
317
+ rng.setStart(li, 1);
318
+ rng.setEnd(li, 1);
319
+ ed.selection.setRng(rng);
320
+ ed.selection.collapse(true);
321
+
322
+ // save a bookmark at the end of the list item
323
+ var bookmark = ed.selection.getBookmark();
324
+
325
+ // copy the image an its text to the list item
326
+ var clone = n.parentNode.cloneNode(true);
327
+ if (clone.tagName === 'P' || clone.tagName === 'DIV')
328
+ addChildren(clone, li);
329
+ else
330
+ li.appendChild(clone);
331
+
332
+ // remove the old copy of the image
333
+ n.parentNode.parentNode.removeChild(n.parentNode);
334
+
335
+ // move the caret where we saved the bookmark
336
+ ed.selection.moveToBookmark(bookmark);
337
+ }
338
+
339
+ // fix the cursor position to ensure it is correct in IE
340
+ function setCursorPositionToOriginalLi(li) {
341
+ var list = ed.dom.getParent(li, 'ol,ul');
342
+ if (list != null) {
343
+ var lastLi = list.lastChild;
344
+ lastLi.appendChild(ed.getDoc().createElement(''));
345
+ ed.selection.setCursorLocation(lastLi, 0);
346
+ }
347
+ }
348
+
349
+ this.ed = ed;
350
+ ed.addCommand('Indent', this.indent, this);
351
+ ed.addCommand('Outdent', this.outdent, this);
352
+ ed.addCommand('InsertUnorderedList', function() {
353
+ this.applyList('UL', 'OL');
354
+ }, this);
355
+ ed.addCommand('InsertOrderedList', function() {
356
+ this.applyList('OL', 'UL');
357
+ }, this);
358
+
359
+ ed.onInit.add(function() {
360
+ ed.editorCommands.addCommands({
361
+ 'outdent': function() {
362
+ var sel = ed.selection, dom = ed.dom;
363
+
364
+ function hasStyleIndent(n) {
365
+ n = dom.getParent(n, dom.isBlock);
366
+ return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
367
+ }
368
+
369
+ return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
370
+ }
371
+ }, 'state');
372
+ });
373
+
374
+ ed.onKeyUp.add(function(ed, e) {
375
+ if (state == LIST_TABBING) {
376
+ ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
377
+ state = LIST_UNKNOWN;
378
+ return Event.cancel(e);
379
+ } else if (state == LIST_EMPTY_ITEM) {
380
+ var li = getLi();
381
+ var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
382
+ ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
383
+ if (tinymce.isIE) {
384
+ setCursorPositionToOriginalLi(li);
385
+ }
386
+
387
+ return Event.cancel(e);
388
+ } else if (state == LIST_ESCAPE) {
389
+ if (tinymce.isIE8) {
390
+ // append a zero sized nbsp so that caret is positioned correctly in IE8 after escaping and applying formatting.
391
+ // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
392
+ // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
393
+ var n = ed.getDoc().createTextNode('\uFEFF');
394
+ ed.selection.getNode().appendChild(n);
395
+ } else if (tinymce.isIE9 || tinymce.isGecko) {
396
+ // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
397
+ // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
398
+ ed.execCommand('Outdent');
399
+ return Event.cancel(e);
400
+ }
401
+ }
402
+ });
403
+
404
+ function fixListItem(parent, reference) {
405
+ // a zero-sized non-breaking space is placed in the empty list item so that the nested list is
406
+ // displayed on the below line instead of next to it
407
+ var n = ed.getDoc().createTextNode('\uFEFF');
408
+ parent.insertBefore(n, reference);
409
+ ed.selection.setCursorLocation(n, 0);
410
+ // repaint to remove rendering artifact. only visible when creating new list
411
+ ed.execCommand('mceRepaint');
412
+ }
413
+
414
+ function fixIndentedListItemForGecko(ed, e) {
415
+ if (isEnter(e)) {
416
+ var li = getLi();
417
+ if (li) {
418
+ var parent = li.parentNode;
419
+ var grandParent = parent && parent.parentNode;
420
+ if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
421
+ fixListItem(grandParent, parent);
422
+ }
423
+ }
424
+ }
425
+ }
426
+
427
+ function fixIndentedListItemForIE8(ed, e) {
428
+ if (isEnter(e)) {
429
+ var li = getLi();
430
+ if (ed.dom.select('ul li', li).length === 1) {
431
+ var list = li.firstChild;
432
+ fixListItem(li, list);
433
+ }
434
+ }
435
+ }
436
+
437
+ function fixDeletingFirstCharOfList(ed, e) {
438
+ function listElements(list, li) {
439
+ var elements = [];
440
+ var walker = new tinymce.dom.TreeWalker(li, list);
441
+ for (var node = walker.current(); node; node = walker.next()) {
442
+ if (ed.dom.is(node, 'ol,ul,li')) {
443
+ elements.push(node);
444
+ }
445
+ }
446
+ return elements;
447
+ }
448
+
449
+ if (e.keyCode == tinymce.VK.BACKSPACE) {
450
+ var li = getLi();
451
+ if (li) {
452
+ var list = ed.dom.getParent(li, 'ol,ul');
453
+ if (list && list.firstChild === li) {
454
+ var elements = listElements(list, li);
455
+ ed.execCommand("Outdent", false, elements);
456
+ ed.undoManager.add();
457
+ return Event.cancel(e);
458
+ }
459
+ }
460
+ }
461
+ }
462
+
463
+ function fixDeletingEmptyLiInWebkit(ed, e) {
464
+ var li = getLi();
465
+ if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
466
+ if (ed.dom.select('ul,ol', li).length === 1) {
467
+ var prevLi = li.previousSibling;
468
+ ed.dom.remove(ed.dom.select('br', li));
469
+ ed.dom.remove(li, true);
470
+ var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
471
+ if (textNodes.length === 1) {
472
+ var textNode = textNodes[0]
473
+ ed.selection.setCursorLocation(textNode, textNode.length);
474
+ }
475
+ ed.undoManager.add();
476
+ return Event.cancel(e);
477
+ }
478
+ }
479
+ }
480
+
481
+ ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
482
+ ed.onKeyDown.add(cancelDefaultEvents);
483
+ ed.onKeyDown.add(imageJoiningListItem);
484
+ ed.onKeyDown.add(createNewLi);
485
+
486
+ if (tinymce.isGecko) {
487
+ ed.onKeyUp.add(fixIndentedListItemForGecko);
488
+ }
489
+ if (tinymce.isIE8) {
490
+ ed.onKeyUp.add(fixIndentedListItemForIE8);
491
+ }
492
+ if (tinymce.isGecko || tinymce.isWebKit) {
493
+ ed.onKeyDown.add(fixDeletingFirstCharOfList);
494
+ }
495
+ if (tinymce.isWebKit) {
496
+ ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
497
+ }
498
+ },
499
+
500
+ applyList: function(targetListType, oppositeListType) {
501
+ var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
502
+ selectedBlocks = ed.selection.getSelectedBlocks();
503
+
504
+ function cleanupBr(e) {
505
+ if (e && e.tagName === 'BR') {
506
+ dom.remove(e);
507
+ }
508
+ }
509
+
510
+ function makeList(element) {
511
+ var list = dom.create(targetListType), li;
512
+
513
+ function adjustIndentForNewList(element) {
514
+ // If there's a margin-left, outdent one level to account for the extra list margin.
515
+ if (element.style.marginLeft || element.style.paddingLeft) {
516
+ t.adjustPaddingFunction(false)(element);
517
+ }
518
+ }
519
+
520
+ if (element.tagName === 'LI') {
521
+ // No change required.
522
+ } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
523
+ processBrs(element, function(startSection, br) {
524
+ doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
525
+ li = startSection.parentNode;
526
+ adjustIndentForNewList(li);
527
+ cleanupBr(br);
528
+ });
529
+ if (li) {
530
+ if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
531
+ dom.split(li.parentNode.parentNode, li.parentNode);
532
+ }
533
+ attemptMergeWithAdjacent(li.parentNode, true);
534
+ }
535
+ return;
536
+ } else {
537
+ // Put the list around the element.
538
+ li = dom.create('li');
539
+ dom.insertAfter(li, element);
540
+ li.appendChild(element);
541
+ adjustIndentForNewList(element);
542
+ element = li;
543
+ }
544
+ dom.insertAfter(list, element);
545
+ list.appendChild(element);
546
+ attemptMergeWithAdjacent(list, true);
547
+ applied.push(element);
548
+ }
549
+
550
+ function doWrapList(start, end, template) {
551
+ var li, n = start, tmp;
552
+ while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
553
+ start = dom.split(start.parentNode, start.previousSibling);
554
+ start = start.nextSibling;
555
+ n = start;
556
+ }
557
+ if (template) {
558
+ li = template.cloneNode(true);
559
+ start.parentNode.insertBefore(li, start);
560
+ while (li.firstChild) dom.remove(li.firstChild);
561
+ li = dom.rename(li, 'li');
562
+ } else {
563
+ li = dom.create('li');
564
+ start.parentNode.insertBefore(li, start);
565
+ }
566
+ while (n && n != end) {
567
+ tmp = n.nextSibling;
568
+ li.appendChild(n);
569
+ n = tmp;
570
+ }
571
+ if (li.childNodes.length === 0) {
572
+ li.innerHTML = '<br _mce_bogus="1" />';
573
+ }
574
+ makeList(li);
575
+ }
576
+
577
+ function processBrs(element, callback) {
578
+ var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
579
+ breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
580
+
581
+ function isAnyPartSelected(start, end) {
582
+ var r = dom.createRng(), sel;
583
+ bookmark.keep = true;
584
+ ed.selection.moveToBookmark(bookmark);
585
+ bookmark.keep = false;
586
+ sel = ed.selection.getRng(true);
587
+ if (!end) {
588
+ end = start.parentNode.lastChild;
589
+ }
590
+ r.setStartBefore(start);
591
+ r.setEndAfter(end);
592
+ return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
593
+ }
594
+
595
+ function nextLeaf(br) {
596
+ if (br.nextSibling)
597
+ return br.nextSibling;
598
+ if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
599
+ return nextLeaf(br.parentNode);
600
+ }
601
+
602
+ // Split on BRs within the range and process those.
603
+ startSection = element.firstChild;
604
+ // First mark the BRs that have any part of the previous section selected.
605
+ var trailingContentSelected = false;
606
+ each(dom.select(breakElements, element), function(br) {
607
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
608
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
609
+ }
610
+ if (isAnyPartSelected(startSection, br)) {
611
+ dom.addClass(br, '_mce_tagged_br');
612
+ startSection = nextLeaf(br);
613
+ }
614
+ });
615
+ trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
616
+ startSection = element.firstChild;
617
+ each(dom.select(breakElements, element), function(br) {
618
+ // Got a section from start to br.
619
+ var tmp = nextLeaf(br);
620
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
621
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
622
+ }
623
+ if (dom.hasClass(br, '_mce_tagged_br')) {
624
+ callback(startSection, br, previousBR);
625
+ previousBR = null;
626
+ } else {
627
+ previousBR = br;
628
+ }
629
+ startSection = tmp;
630
+ });
631
+ if (trailingContentSelected) {
632
+ callback(startSection, undefined, previousBR);
633
+ }
634
+ }
635
+
636
+ function wrapList(element) {
637
+ processBrs(element, function(startSection, br, previousBR) {
638
+ // Need to indent this part
639
+ doWrapList(startSection, br);
640
+ cleanupBr(br);
641
+ cleanupBr(previousBR);
642
+ });
643
+ }
644
+
645
+ function changeList(element) {
646
+ if (tinymce.inArray(applied, element) !== -1) {
647
+ return;
648
+ }
649
+ if (element.parentNode.tagName === oppositeListType) {
650
+ dom.split(element.parentNode, element);
651
+ makeList(element);
652
+ attemptMergeWithNext(element.parentNode, false);
653
+ }
654
+ applied.push(element);
655
+ }
656
+
657
+ function convertListItemToParagraph(element) {
658
+ var child, nextChild, mergedElement, splitLast;
659
+ if (tinymce.inArray(applied, element) !== -1) {
660
+ return;
661
+ }
662
+ element = splitNestedLists(element, dom);
663
+ while (dom.is(element.parentNode, 'ol,ul,li')) {
664
+ dom.split(element.parentNode, element);
665
+ }
666
+ // Push the original element we have from the selection, not the renamed one.
667
+ applied.push(element);
668
+ element = dom.rename(element, 'p');
669
+ mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
670
+ if (mergedElement === element) {
671
+ // Now split out any block elements that can't be contained within a P.
672
+ // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
673
+ child = element.firstChild;
674
+ while (child) {
675
+ if (dom.isBlock(child)) {
676
+ child = dom.split(child.parentNode, child);
677
+ splitLast = true;
678
+ nextChild = child.nextSibling && child.nextSibling.firstChild;
679
+ } else {
680
+ nextChild = child.nextSibling;
681
+ if (splitLast && child.tagName === 'BR') {
682
+ dom.remove(child);
683
+ }
684
+ splitLast = false;
685
+ }
686
+ child = nextChild;
687
+ }
688
+ }
689
+ }
690
+
691
+ each(selectedBlocks, function(e) {
692
+ e = findItemToOperateOn(e, dom);
693
+ if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
694
+ hasOppositeType = true;
695
+ } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
696
+ hasSameType = true;
697
+ } else {
698
+ hasNonList = true;
699
+ }
700
+ });
701
+
702
+ if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
703
+ actions = {
704
+ 'LI': changeList,
705
+ 'H1': makeList,
706
+ 'H2': makeList,
707
+ 'H3': makeList,
708
+ 'H4': makeList,
709
+ 'H5': makeList,
710
+ 'H6': makeList,
711
+ 'P': makeList,
712
+ 'BODY': makeList,
713
+ 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
714
+ defaultAction: wrapList,
715
+ elements: this.selectedBlocks()
716
+ };
717
+ } else {
718
+ actions = {
719
+ defaultAction: convertListItemToParagraph,
720
+ elements: this.selectedBlocks()
721
+ };
722
+ }
723
+ this.process(actions);
724
+ },
725
+
726
+ indent: function() {
727
+ var ed = this.ed, dom = ed.dom, indented = [];
728
+
729
+ function createWrapItem(element) {
730
+ var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
731
+ dom.insertAfter(wrapItem, element);
732
+ return wrapItem;
733
+ }
734
+
735
+ function createWrapList(element) {
736
+ var wrapItem = createWrapItem(element),
737
+ list = dom.getParent(element, 'ol,ul'),
738
+ listType = list.tagName,
739
+ listStyle = dom.getStyle(list, 'list-style-type'),
740
+ attrs = {},
741
+ wrapList;
742
+ if (listStyle !== '') {
743
+ attrs.style = 'list-style-type: ' + listStyle + ';';
744
+ }
745
+ wrapList = dom.create(listType, attrs);
746
+ wrapItem.appendChild(wrapList);
747
+ return wrapList;
748
+ }
749
+
750
+ function indentLI(element) {
751
+ if (!hasParentInList(ed, element, indented)) {
752
+ element = splitNestedLists(element, dom);
753
+ var wrapList = createWrapList(element);
754
+ wrapList.appendChild(element);
755
+ attemptMergeWithAdjacent(wrapList.parentNode, false);
756
+ attemptMergeWithAdjacent(wrapList, false);
757
+ indented.push(element);
758
+ }
759
+ }
760
+
761
+ this.process({
762
+ 'LI': indentLI,
763
+ defaultAction: this.adjustPaddingFunction(true),
764
+ elements: this.selectedBlocks()
765
+ });
766
+
767
+ },
768
+
769
+ outdent: function(ui, elements) {
770
+ var t = this, ed = t.ed, dom = ed.dom, outdented = [];
771
+
772
+ function outdentLI(element) {
773
+ var listElement, targetParent, align;
774
+ if (!hasParentInList(ed, element, outdented)) {
775
+ if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
776
+ return t.adjustPaddingFunction(false)(element);
777
+ }
778
+ align = dom.getStyle(element, 'text-align', true);
779
+ if (align === 'center' || align === 'right') {
780
+ dom.setStyle(element, 'text-align', 'left');
781
+ return;
782
+ }
783
+ element = splitNestedLists(element, dom);
784
+ listElement = element.parentNode;
785
+ targetParent = element.parentNode.parentNode;
786
+ if (targetParent.tagName === 'P') {
787
+ dom.split(targetParent, element.parentNode);
788
+ } else {
789
+ dom.split(listElement, element);
790
+ if (targetParent.tagName === 'LI') {
791
+ // Nested list, need to split the LI and go back out to the OL/UL element.
792
+ dom.split(targetParent, element);
793
+ } else if (!dom.is(targetParent, 'ol,ul')) {
794
+ dom.rename(element, 'p');
795
+ }
796
+ }
797
+ outdented.push(element);
798
+ }
799
+ }
800
+
801
+ var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
802
+ this.process({
803
+ 'LI': outdentLI,
804
+ defaultAction: this.adjustPaddingFunction(false),
805
+ elements: listElements
806
+ });
807
+
808
+ each(outdented, attemptMergeWithAdjacent);
809
+ },
810
+
811
+ process: function(actions) {
812
+ var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
813
+
814
+ function isEmptyElement(element) {
815
+ var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
816
+ return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
817
+ || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
818
+ });
819
+ return excludeBrsAndBookmarks.length === 0;
820
+ }
821
+
822
+ function processElement(element) {
823
+ dom.removeClass(element, '_mce_act_on');
824
+ if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) {
825
+ return;
826
+ }
827
+ element = findItemToOperateOn(element, dom);
828
+ var action = actions[element.tagName];
829
+ if (!action) {
830
+ action = actions.defaultAction;
831
+ }
832
+ action(element);
833
+ }
834
+
835
+ function recurse(element) {
836
+ t.splitSafeEach(element.childNodes, processElement);
837
+ }
838
+
839
+ function brAtEdgeOfSelection(container, offset) {
840
+ return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
841
+ container.childNodes[offset].tagName === 'BR';
842
+ }
843
+
844
+ function isInTable() {
845
+ var n = sel.getNode();
846
+ var p = dom.getParent(n, 'td');
847
+ return p !== null;
848
+ }
849
+
850
+ selectedBlocks = actions.elements;
851
+
852
+ r = sel.getRng(true);
853
+ if (!r.collapsed) {
854
+ if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
855
+ r.setEnd(r.endContainer, r.endOffset - 1);
856
+ sel.setRng(r);
857
+ }
858
+ if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
859
+ r.setStart(r.startContainer, r.startOffset + 1);
860
+ sel.setRng(r);
861
+ }
862
+ }
863
+
864
+
865
+ if (tinymce.isIE8) {
866
+ // append a zero sized nbsp so that caret is restored correctly using bookmark
867
+ var s = t.ed.selection.getNode();
868
+ if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
869
+ var i = t.ed.getDoc().createTextNode('\uFEFF');
870
+ s.appendChild(i);
871
+ }
872
+ }
873
+
874
+ bookmark = sel.getBookmark();
875
+ actions.OL = actions.UL = recurse;
876
+ t.splitSafeEach(selectedBlocks, processElement);
877
+ sel.moveToBookmark(bookmark);
878
+ bookmark = null;
879
+
880
+ // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
881
+ if (!isInTable()) {
882
+ // Avoids table or image handles being left behind in Firefox.
883
+ t.ed.execCommand('mceRepaint');
884
+ }
885
+ },
886
+
887
+ splitSafeEach: function(elements, f) {
888
+ if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
889
+ /Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
890
+ this.classBasedEach(elements, f);
891
+ } else {
892
+ each(elements, f);
893
+ }
894
+ },
895
+
896
+ classBasedEach: function(elements, f) {
897
+ var dom = this.ed.dom, nodes, element;
898
+ // Mark nodes
899
+ each(elements, function(element) {
900
+ dom.addClass(element, '_mce_act_on');
901
+ });
902
+ nodes = dom.select('._mce_act_on');
903
+ while (nodes.length > 0) {
904
+ element = nodes.shift();
905
+ dom.removeClass(element, '_mce_act_on');
906
+ f(element);
907
+ nodes = dom.select('._mce_act_on');
908
+ }
909
+ },
910
+
911
+ adjustPaddingFunction: function(isIndent) {
912
+ var indentAmount, indentUnits, ed = this.ed;
913
+ indentAmount = ed.settings.indentation;
914
+ indentUnits = /[a-z%]+/i.exec(indentAmount);
915
+ indentAmount = parseInt(indentAmount, 10);
916
+ return function(element) {
917
+ var currentIndent, newIndentAmount;
918
+ currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
919
+ if (isIndent) {
920
+ newIndentAmount = currentIndent + indentAmount;
921
+ } else {
922
+ newIndentAmount = currentIndent - indentAmount;
923
+ }
924
+ ed.dom.setStyle(element, 'padding-left', '');
925
+ ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
926
+ };
927
+ },
928
+
929
+ selectedBlocks: function() {
930
+ var ed = this.ed
931
+ var selectedBlocks = ed.selection.getSelectedBlocks();
932
+ return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
933
+ },
934
+
935
+ getInfo: function() {
936
+ return {
937
+ longname : 'Lists',
938
+ author : 'Moxiecode Systems AB',
939
+ authorurl : 'http://tinymce.moxiecode.com',
940
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
941
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
942
+ };
943
+ }
944
+ });
945
+ tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
946
+ }());