tinymce-rails 3.5.11.1 → 4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (336) hide show
  1. data/LICENSE +1 -1
  2. data/README.md +40 -103
  3. data/Rakefile +10 -15
  4. data/app/assets/javascripts/tinymce-jquery.js +1 -1
  5. data/app/assets/javascripts/tinymce.js +1 -1
  6. data/app/assets/javascripts/tinymce/preinit.js.erb +1 -2
  7. data/lib/tasks/tinymce-assets.rake +3 -6
  8. data/lib/tinymce/rails.rb +1 -1
  9. data/lib/tinymce/rails/asset_installer.rb +36 -34
  10. data/lib/tinymce/rails/asset_manifest.rb +89 -108
  11. data/lib/tinymce/rails/configuration.rb +36 -29
  12. data/lib/tinymce/rails/engine.rb +1 -40
  13. data/lib/tinymce/rails/helper.rb +5 -9
  14. data/lib/tinymce/rails/version.rb +2 -2
  15. data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/langs/readme.md +3 -0
  17. data/vendor/assets/javascripts/tinymce/license.txt +504 -504
  18. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -0
  19. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -0
  20. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -0
  21. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -0
  22. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -0
  23. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -0
  24. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -0
  25. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -0
  26. data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/editable_selects.js +70 -70
  27. data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/form_utils.js +210 -210
  28. data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/mctabs.js +161 -161
  29. data/vendor/assets/javascripts/tinymce/plugins/compat3x/tiny_mce_popup.js +435 -0
  30. data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/validate.js +252 -252
  31. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -0
  32. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -0
  33. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-cool.gif +0 -0
  34. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-cry.gif +0 -0
  35. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-embarassed.gif +0 -0
  36. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-foot-in-mouth.gif +0 -0
  37. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-frown.gif +0 -0
  38. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-innocent.gif +0 -0
  39. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-kiss.gif +0 -0
  40. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-laughing.gif +0 -0
  41. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-money-mouth.gif +0 -0
  42. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-sealed.gif +0 -0
  43. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-smile.gif +0 -0
  44. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-surprised.gif +0 -0
  45. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-tongue-out.gif +0 -0
  46. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-undecided.gif +0 -0
  47. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-wink.gif +0 -0
  48. data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-yell.gif +0 -0
  49. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -0
  50. data/vendor/assets/javascripts/tinymce/plugins/example/plugin.js +1 -0
  51. data/vendor/assets/javascripts/tinymce/plugins/example_dependency/plugin.js +1 -0
  52. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -0
  53. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -0
  54. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -0
  55. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -0
  56. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -0
  57. data/vendor/assets/javascripts/tinymce/plugins/layer/plugin.js +1 -0
  58. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -0
  59. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -0
  60. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -0
  61. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -0
  62. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -0
  63. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -0
  64. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -0
  65. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -0
  66. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -0
  67. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -0
  68. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -0
  69. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -0
  70. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -0
  71. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -0
  72. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -0
  73. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -0
  74. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -0
  75. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/css/visualblocks.css +114 -21
  76. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -0
  77. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -0
  78. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -0
  79. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +1 -0
  80. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +1 -0
  81. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.eot +0 -0
  82. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.svg +166 -0
  83. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.ttf +0 -0
  84. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.woff +0 -0
  85. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.eot +0 -0
  86. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.svg +150 -0
  87. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.ttf +0 -0
  88. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.woff +0 -0
  89. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/readme.md +1 -0
  90. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/anchor.gif +0 -0
  91. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/loader.gif +0 -0
  92. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/object.gif +0 -0
  93. data/vendor/assets/javascripts/tinymce/{themes/advanced → skins/lightgray}/img/trans.gif +0 -0
  94. data/vendor/assets/javascripts/tinymce/{plugins/spellchecker → skins/lightgray}/img/wline.gif +0 -0
  95. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  96. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +1 -0
  97. data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -0
  98. data/vendor/assets/javascripts/tinymce/tinymce.js +10 -0
  99. data/vendor/assets/javascripts/tinymce/tinymce_jquery.js +9 -0
  100. metadata +100 -272
  101. checksums.yaml +0 -7
  102. data/lib/tinymce/rails/asset_installer/compile.rb +0 -44
  103. data/lib/tinymce/rails/asset_installer/copy.rb +0 -52
  104. data/vendor/assets/javascripts/tinymce/langs/en.js +0 -1
  105. data/vendor/assets/javascripts/tinymce/plugins/advhr/css/advhr.css +0 -5
  106. data/vendor/assets/javascripts/tinymce/plugins/advhr/editor_plugin.js +0 -1
  107. data/vendor/assets/javascripts/tinymce/plugins/advhr/editor_plugin_src.js +0 -57
  108. data/vendor/assets/javascripts/tinymce/plugins/advhr/js/rule.js +0 -43
  109. data/vendor/assets/javascripts/tinymce/plugins/advhr/langs/en_dlg.js +0 -1
  110. data/vendor/assets/javascripts/tinymce/plugins/advhr/rule.htm +0 -58
  111. data/vendor/assets/javascripts/tinymce/plugins/advimage/css/advimage.css +0 -13
  112. data/vendor/assets/javascripts/tinymce/plugins/advimage/editor_plugin.js +0 -1
  113. data/vendor/assets/javascripts/tinymce/plugins/advimage/editor_plugin_src.js +0 -50
  114. data/vendor/assets/javascripts/tinymce/plugins/advimage/image.htm +0 -235
  115. data/vendor/assets/javascripts/tinymce/plugins/advimage/img/sample.gif +0 -0
  116. data/vendor/assets/javascripts/tinymce/plugins/advimage/js/image.js +0 -464
  117. data/vendor/assets/javascripts/tinymce/plugins/advimage/langs/en_dlg.js +0 -1
  118. data/vendor/assets/javascripts/tinymce/plugins/advlink/css/advlink.css +0 -8
  119. data/vendor/assets/javascripts/tinymce/plugins/advlink/editor_plugin.js +0 -1
  120. data/vendor/assets/javascripts/tinymce/plugins/advlink/editor_plugin_src.js +0 -61
  121. data/vendor/assets/javascripts/tinymce/plugins/advlink/js/advlink.js +0 -543
  122. data/vendor/assets/javascripts/tinymce/plugins/advlink/langs/en_dlg.js +0 -1
  123. data/vendor/assets/javascripts/tinymce/plugins/advlink/link.htm +0 -338
  124. data/vendor/assets/javascripts/tinymce/plugins/advlist/editor_plugin.js +0 -1
  125. data/vendor/assets/javascripts/tinymce/plugins/advlist/editor_plugin_src.js +0 -176
  126. data/vendor/assets/javascripts/tinymce/plugins/autolink/editor_plugin.js +0 -1
  127. data/vendor/assets/javascripts/tinymce/plugins/autolink/editor_plugin_src.js +0 -184
  128. data/vendor/assets/javascripts/tinymce/plugins/autoresize/editor_plugin.js +0 -1
  129. data/vendor/assets/javascripts/tinymce/plugins/autoresize/editor_plugin_src.js +0 -119
  130. data/vendor/assets/javascripts/tinymce/plugins/autosave/editor_plugin.js +0 -1
  131. data/vendor/assets/javascripts/tinymce/plugins/autosave/editor_plugin_src.js +0 -433
  132. data/vendor/assets/javascripts/tinymce/plugins/bbcode/editor_plugin.js +0 -1
  133. data/vendor/assets/javascripts/tinymce/plugins/bbcode/editor_plugin_src.js +0 -120
  134. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/editor_plugin.js +0 -1
  135. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/editor_plugin_src.js +0 -163
  136. data/vendor/assets/javascripts/tinymce/plugins/directionality/editor_plugin.js +0 -1
  137. data/vendor/assets/javascripts/tinymce/plugins/directionality/editor_plugin_src.js +0 -85
  138. data/vendor/assets/javascripts/tinymce/plugins/emotions/editor_plugin.js +0 -1
  139. data/vendor/assets/javascripts/tinymce/plugins/emotions/editor_plugin_src.js +0 -43
  140. data/vendor/assets/javascripts/tinymce/plugins/emotions/emotions.htm +0 -42
  141. data/vendor/assets/javascripts/tinymce/plugins/emotions/js/emotions.js +0 -43
  142. data/vendor/assets/javascripts/tinymce/plugins/emotions/langs/en_dlg.js +0 -1
  143. data/vendor/assets/javascripts/tinymce/plugins/example/dialog.htm +0 -22
  144. data/vendor/assets/javascripts/tinymce/plugins/example/editor_plugin.js +0 -1
  145. data/vendor/assets/javascripts/tinymce/plugins/example/editor_plugin_src.js +0 -84
  146. data/vendor/assets/javascripts/tinymce/plugins/example/img/example.gif +0 -0
  147. data/vendor/assets/javascripts/tinymce/plugins/example/js/dialog.js +0 -19
  148. data/vendor/assets/javascripts/tinymce/plugins/example/langs/en.js +0 -3
  149. data/vendor/assets/javascripts/tinymce/plugins/example/langs/en_dlg.js +0 -3
  150. data/vendor/assets/javascripts/tinymce/plugins/example_dependency/editor_plugin.js +0 -1
  151. data/vendor/assets/javascripts/tinymce/plugins/example_dependency/editor_plugin_src.js +0 -50
  152. data/vendor/assets/javascripts/tinymce/plugins/fullpage/css/fullpage.css +0 -143
  153. data/vendor/assets/javascripts/tinymce/plugins/fullpage/editor_plugin.js +0 -1
  154. data/vendor/assets/javascripts/tinymce/plugins/fullpage/editor_plugin_src.js +0 -405
  155. data/vendor/assets/javascripts/tinymce/plugins/fullpage/fullpage.htm +0 -259
  156. data/vendor/assets/javascripts/tinymce/plugins/fullpage/js/fullpage.js +0 -232
  157. data/vendor/assets/javascripts/tinymce/plugins/fullpage/langs/en_dlg.js +0 -1
  158. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/editor_plugin.js +0 -1
  159. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/editor_plugin_src.js +0 -234
  160. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/fullscreen.htm +0 -117
  161. data/vendor/assets/javascripts/tinymce/plugins/iespell/editor_plugin.js +0 -1
  162. data/vendor/assets/javascripts/tinymce/plugins/iespell/editor_plugin_src.js +0 -54
  163. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/editor_plugin.js +0 -1
  164. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/editor_plugin_src.js +0 -699
  165. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  166. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  167. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  168. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  169. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  170. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  171. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  172. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
  173. data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/template.htm +0 -387
  174. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/editor_plugin.js +0 -1
  175. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/editor_plugin_src.js +0 -83
  176. data/vendor/assets/javascripts/tinymce/plugins/layer/editor_plugin.js +0 -1
  177. data/vendor/assets/javascripts/tinymce/plugins/layer/editor_plugin_src.js +0 -262
  178. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/editor_plugin.js +0 -1
  179. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/editor_plugin_src.js +0 -139
  180. data/vendor/assets/javascripts/tinymce/plugins/lists/editor_plugin.js +0 -1
  181. data/vendor/assets/javascripts/tinymce/plugins/lists/editor_plugin_src.js +0 -955
  182. data/vendor/assets/javascripts/tinymce/plugins/media/css/media.css +0 -17
  183. data/vendor/assets/javascripts/tinymce/plugins/media/editor_plugin.js +0 -1
  184. data/vendor/assets/javascripts/tinymce/plugins/media/editor_plugin_src.js +0 -898
  185. data/vendor/assets/javascripts/tinymce/plugins/media/js/embed.js +0 -73
  186. data/vendor/assets/javascripts/tinymce/plugins/media/js/media.js +0 -513
  187. data/vendor/assets/javascripts/tinymce/plugins/media/langs/en_dlg.js +0 -1
  188. data/vendor/assets/javascripts/tinymce/plugins/media/media.htm +0 -922
  189. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/editor_plugin.js +0 -1
  190. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/editor_plugin_src.js +0 -54
  191. data/vendor/assets/javascripts/tinymce/plugins/noneditable/editor_plugin.js +0 -1
  192. data/vendor/assets/javascripts/tinymce/plugins/noneditable/editor_plugin_src.js +0 -537
  193. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/editor_plugin.js +0 -1
  194. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/editor_plugin_src.js +0 -74
  195. data/vendor/assets/javascripts/tinymce/plugins/paste/editor_plugin.js +0 -1
  196. data/vendor/assets/javascripts/tinymce/plugins/paste/editor_plugin_src.js +0 -887
  197. data/vendor/assets/javascripts/tinymce/plugins/paste/js/pastetext.js +0 -36
  198. data/vendor/assets/javascripts/tinymce/plugins/paste/js/pasteword.js +0 -51
  199. data/vendor/assets/javascripts/tinymce/plugins/paste/langs/en_dlg.js +0 -1
  200. data/vendor/assets/javascripts/tinymce/plugins/paste/pastetext.htm +0 -27
  201. data/vendor/assets/javascripts/tinymce/plugins/paste/pasteword.htm +0 -21
  202. data/vendor/assets/javascripts/tinymce/plugins/preview/editor_plugin.js +0 -1
  203. data/vendor/assets/javascripts/tinymce/plugins/preview/editor_plugin_src.js +0 -53
  204. data/vendor/assets/javascripts/tinymce/plugins/preview/example.html +0 -28
  205. data/vendor/assets/javascripts/tinymce/plugins/preview/jscripts/embed.js +0 -73
  206. data/vendor/assets/javascripts/tinymce/plugins/preview/preview.html +0 -17
  207. data/vendor/assets/javascripts/tinymce/plugins/print/editor_plugin.js +0 -1
  208. data/vendor/assets/javascripts/tinymce/plugins/print/editor_plugin_src.js +0 -34
  209. data/vendor/assets/javascripts/tinymce/plugins/save/editor_plugin.js +0 -1
  210. data/vendor/assets/javascripts/tinymce/plugins/save/editor_plugin_src.js +0 -101
  211. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/css/searchreplace.css +0 -6
  212. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/editor_plugin.js +0 -1
  213. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/editor_plugin_src.js +0 -61
  214. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/js/searchreplace.js +0 -152
  215. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/langs/en_dlg.js +0 -1
  216. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/searchreplace.htm +0 -100
  217. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/css/content.css +0 -1
  218. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/editor_plugin.js +0 -1
  219. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/editor_plugin_src.js +0 -471
  220. data/vendor/assets/javascripts/tinymce/plugins/style/css/props.css +0 -14
  221. data/vendor/assets/javascripts/tinymce/plugins/style/editor_plugin.js +0 -1
  222. data/vendor/assets/javascripts/tinymce/plugins/style/editor_plugin_src.js +0 -71
  223. data/vendor/assets/javascripts/tinymce/plugins/style/js/props.js +0 -709
  224. data/vendor/assets/javascripts/tinymce/plugins/style/langs/en_dlg.js +0 -1
  225. data/vendor/assets/javascripts/tinymce/plugins/style/props.htm +0 -845
  226. data/vendor/assets/javascripts/tinymce/plugins/style/readme.txt +0 -19
  227. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/editor_plugin.js +0 -1
  228. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/editor_plugin_src.js +0 -122
  229. data/vendor/assets/javascripts/tinymce/plugins/table/cell.htm +0 -180
  230. data/vendor/assets/javascripts/tinymce/plugins/table/css/cell.css +0 -17
  231. data/vendor/assets/javascripts/tinymce/plugins/table/css/row.css +0 -25
  232. data/vendor/assets/javascripts/tinymce/plugins/table/css/table.css +0 -13
  233. data/vendor/assets/javascripts/tinymce/plugins/table/editor_plugin.js +0 -1
  234. data/vendor/assets/javascripts/tinymce/plugins/table/editor_plugin_src.js +0 -1456
  235. data/vendor/assets/javascripts/tinymce/plugins/table/js/cell.js +0 -319
  236. data/vendor/assets/javascripts/tinymce/plugins/table/js/merge_cells.js +0 -27
  237. data/vendor/assets/javascripts/tinymce/plugins/table/js/row.js +0 -254
  238. data/vendor/assets/javascripts/tinymce/plugins/table/js/table.js +0 -501
  239. data/vendor/assets/javascripts/tinymce/plugins/table/langs/en_dlg.js +0 -1
  240. data/vendor/assets/javascripts/tinymce/plugins/table/merge_cells.htm +0 -32
  241. data/vendor/assets/javascripts/tinymce/plugins/table/row.htm +0 -158
  242. data/vendor/assets/javascripts/tinymce/plugins/table/table.htm +0 -188
  243. data/vendor/assets/javascripts/tinymce/plugins/template/blank.htm +0 -12
  244. data/vendor/assets/javascripts/tinymce/plugins/template/css/template.css +0 -23
  245. data/vendor/assets/javascripts/tinymce/plugins/template/editor_plugin.js +0 -1
  246. data/vendor/assets/javascripts/tinymce/plugins/template/editor_plugin_src.js +0 -159
  247. data/vendor/assets/javascripts/tinymce/plugins/template/js/template.js +0 -106
  248. data/vendor/assets/javascripts/tinymce/plugins/template/langs/en_dlg.js +0 -1
  249. data/vendor/assets/javascripts/tinymce/plugins/template/template.htm +0 -31
  250. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/editor_plugin.js +0 -1
  251. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/editor_plugin_src.js +0 -63
  252. data/vendor/assets/javascripts/tinymce/plugins/visualchars/editor_plugin.js +0 -1
  253. data/vendor/assets/javascripts/tinymce/plugins/visualchars/editor_plugin_src.js +0 -83
  254. data/vendor/assets/javascripts/tinymce/plugins/wordcount/editor_plugin.js +0 -1
  255. data/vendor/assets/javascripts/tinymce/plugins/wordcount/editor_plugin_src.js +0 -122
  256. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/abbr.htm +0 -142
  257. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/acronym.htm +0 -142
  258. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/attributes.htm +0 -149
  259. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/cite.htm +0 -142
  260. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/css/attributes.css +0 -11
  261. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/css/popup.css +0 -9
  262. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/del.htm +0 -162
  263. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin.js +0 -1
  264. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +0 -132
  265. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/ins.htm +0 -162
  266. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/abbr.js +0 -28
  267. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/acronym.js +0 -28
  268. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/attributes.js +0 -111
  269. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/cite.js +0 -28
  270. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/del.js +0 -53
  271. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/element_common.js +0 -229
  272. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/ins.js +0 -53
  273. data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +0 -1
  274. data/vendor/assets/javascripts/tinymce/themes/advanced/about.htm +0 -52
  275. data/vendor/assets/javascripts/tinymce/themes/advanced/anchor.htm +0 -26
  276. data/vendor/assets/javascripts/tinymce/themes/advanced/charmap.htm +0 -55
  277. data/vendor/assets/javascripts/tinymce/themes/advanced/color_picker.htm +0 -70
  278. data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template.js +0 -1
  279. data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template_src.js +0 -1490
  280. data/vendor/assets/javascripts/tinymce/themes/advanced/image.htm +0 -80
  281. data/vendor/assets/javascripts/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
  282. data/vendor/assets/javascripts/tinymce/themes/advanced/img/flash.gif +0 -0
  283. data/vendor/assets/javascripts/tinymce/themes/advanced/img/icons.gif +0 -0
  284. data/vendor/assets/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
  285. data/vendor/assets/javascripts/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  286. data/vendor/assets/javascripts/tinymce/themes/advanced/img/quicktime.gif +0 -0
  287. data/vendor/assets/javascripts/tinymce/themes/advanced/img/realmedia.gif +0 -0
  288. data/vendor/assets/javascripts/tinymce/themes/advanced/img/shockwave.gif +0 -0
  289. data/vendor/assets/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
  290. data/vendor/assets/javascripts/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  291. data/vendor/assets/javascripts/tinymce/themes/advanced/js/about.js +0 -73
  292. data/vendor/assets/javascripts/tinymce/themes/advanced/js/anchor.js +0 -56
  293. data/vendor/assets/javascripts/tinymce/themes/advanced/js/charmap.js +0 -363
  294. data/vendor/assets/javascripts/tinymce/themes/advanced/js/color_picker.js +0 -345
  295. data/vendor/assets/javascripts/tinymce/themes/advanced/js/image.js +0 -253
  296. data/vendor/assets/javascripts/tinymce/themes/advanced/js/link.js +0 -159
  297. data/vendor/assets/javascripts/tinymce/themes/advanced/js/source_editor.js +0 -78
  298. data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en.js +0 -1
  299. data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en_dlg.js +0 -1
  300. data/vendor/assets/javascripts/tinymce/themes/advanced/link.htm +0 -57
  301. data/vendor/assets/javascripts/tinymce/themes/advanced/shortcuts.htm +0 -47
  302. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/content.css +0 -50
  303. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/dialog.css +0 -118
  304. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
  305. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
  306. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  307. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  308. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
  309. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
  310. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/ui.css +0 -219
  311. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/content.css +0 -24
  312. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/dialog.css +0 -106
  313. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/ui.css +0 -106
  314. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/content.css +0 -48
  315. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/dialog.css +0 -118
  316. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  317. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  318. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  319. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui.css +0 -222
  320. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui_black.css +0 -8
  321. data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
  322. data/vendor/assets/javascripts/tinymce/themes/advanced/source_editor.htm +0 -25
  323. data/vendor/assets/javascripts/tinymce/themes/simple/editor_template.js +0 -1
  324. data/vendor/assets/javascripts/tinymce/themes/simple/editor_template_src.js +0 -84
  325. data/vendor/assets/javascripts/tinymce/themes/simple/img/icons.gif +0 -0
  326. data/vendor/assets/javascripts/tinymce/themes/simple/langs/en.js +0 -1
  327. data/vendor/assets/javascripts/tinymce/themes/simple/skins/default/content.css +0 -25
  328. data/vendor/assets/javascripts/tinymce/themes/simple/skins/default/ui.css +0 -32
  329. data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/content.css +0 -17
  330. data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  331. data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/ui.css +0 -35
  332. data/vendor/assets/javascripts/tinymce/tiny_mce.js +0 -1
  333. data/vendor/assets/javascripts/tinymce/tiny_mce_jquery.js +0 -1
  334. data/vendor/assets/javascripts/tinymce/tiny_mce_jquery_src.js +0 -17942
  335. data/vendor/assets/javascripts/tinymce/tiny_mce_popup.js +0 -5
  336. data/vendor/assets/javascripts/tinymce/tiny_mce_src.js +0 -19156
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-14 by Sam Pohlenz
1
+ Copyright (C) 2011-13 by Sam Pohlenz
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -5,60 +5,45 @@ The `tinymce-rails` gem integrates the [TinyMCE](http://www.tinymce.com/) editor
5
5
 
6
6
  This gem is compatible with Rails 3.1.1 and higher (including Rails 4).
7
7
 
8
- This is the branch for TinyMCE 3.5.x. For TinyMCE 4, please see the [master branch](https://github.com/spohlenz/tinymce-rails).
8
+ This is the branch for TinyMCE 4. TinyMCE 3.5.x is currently available in the [master branch](https://github.com/spohlenz/tinymce-rails). For the time being, parallel versions of TinyMCE (3.5.x and 4.x) will be maintained. However TinyMCE 4 will eventually be promoted to the master branch.
9
9
 
10
- [![Build Status](https://travis-ci.org/spohlenz/tinymce-rails.png?branch=tinymce-3)](https://travis-ci.org/spohlenz/tinymce-rails)
10
+ [![Build Status](https://travis-ci.org/spohlenz/tinymce-rails.png?branch=tinymce-4)](https://travis-ci.org/spohlenz/tinymce-rails)
11
11
 
12
- **New in 3.5.11, 4.1.10 and 4.2.1:** Alternative asset installation methods (copy vs compile/symlink). See the [Asset Compilation](#asset-compilation) section below for details.
13
12
 
14
13
  Instructions
15
14
  ------------
16
15
 
17
16
  **1. Add `tinymce-rails` to your Gemfile**
18
17
 
19
- ```ruby
20
- gem 'tinymce-rails'
21
- ```
18
+ gem 'tinymce-rails'
22
19
 
23
20
  Be sure to add to the global group, not the `assets` group. Then run `bundle install`.
24
21
 
25
22
 
26
23
  **2. Create a `config/tinymce.yml` file with your global configuration options:**
27
24
 
28
- ```yml
29
- theme_advanced_toolbar_location: top
30
- theme_advanced_toolbar_align: left
31
- theme_advanced_statusbar_location: bottom
32
- theme_advanced_buttons3_add:
33
- - tablecontrols
34
- - fullscreen
35
- plugins:
36
- - table
37
- - fullscreen
38
- ```
39
-
25
+ toolbar1: styleselect | bold italic | link image | undo redo
26
+ toolbar2: table | fullscreen
27
+ plugins:
28
+ - table
29
+ - fullscreen
30
+
40
31
  The Rails server no longer needs to be restarted when this file is updated in development mode.
41
32
 
42
33
  To define multiple configuration sets, follow this syntax (a default configuration must be specified):
43
34
 
44
- ```yml
45
- default:
46
- theme_advanced_toolbar_align: left
47
- theme_advanced_buttons3_add:
48
- - tablecontrols
49
- plugins:
50
- - table
51
-
52
- alternate:
53
- theme_advanced_toolbar_location: top
54
- theme_advanced_toolbar_align: left
55
- theme_advanced_buttons3_add:
56
- - tablecontrols
57
- plugins:
58
- - table
59
- ```
35
+ default:
36
+ plugins:
37
+ - image
38
+ - link
39
+
40
+ alternate:
41
+ selector: textarea.table-editor
42
+ toolbar: styleselect | bold italic | link image | undo redo | table
43
+ plugins:
44
+ - table
60
45
 
61
- See the [TinyMCE 3 Documentation](http://archive.tinymce.com/wiki.php/Configuration3x) for a full list of configuration options.
46
+ See the [TinyMCE 4 Documentation](http://www.tinymce.com/wiki.php/Configuration) for a full list of configuration options.
62
47
 
63
48
 
64
49
  **3. Include the TinyMCE assets**
@@ -67,70 +52,36 @@ Use *one* of the following options to include TinyMCE assets.
67
52
 
68
53
  (1) Add to your application.js:
69
54
 
70
- ```js
71
- //= require tinymce
72
- ```
55
+ //= require tinymce
73
56
 
74
57
  or (2) with jQuery integration:
75
58
 
76
- ```js
77
- //= require tinymce-jquery
78
- ```
59
+ //= require tinymce-jquery
79
60
 
80
61
  (3) The TinyMCE assets can be included on a per-page basis using the `tinymce_assets` helper:
81
62
 
82
- ```erb
83
- <%= tinymce_assets %>
84
- #=> <script type="text/javascript" src="/assets/tinymce.js">
85
- ```
63
+ <%= tinymce_assets %>
64
+ #=> <script type="text/javascript" src="/assets/tinymce.js">
65
+
86
66
 
87
67
  **4. Initialize TinyMCE**
88
68
 
89
69
  For each textarea that you want to use with TinyMCE, add the "tinymce" class and ensure it has a unique ID:
90
70
 
91
- ```erb
92
- <%= text_area_tag :content, "", :class => "tinymce", :rows => 40, :cols => 120 %>
93
- ```
94
-
95
- or if you are using Rails' form builders:
96
-
97
- ```erb
98
- <%= f.text_area :content, :class => "tinymce", :rows => 40, :cols => 120 %>
99
- ```
71
+ <%= text_area_tag :editor, "", :class => "tinymce", :rows => 40, :cols => 120 %>
100
72
 
101
73
  Then invoke the `tinymce` helper to initialize TinyMCE:
102
74
 
103
- ```erb
104
- <%= tinymce %>
105
- ```
75
+ <%= tinymce %>
106
76
 
107
77
  Custom options can be passed to `tinymce` to override the global options specified in `config/tinymce.yml`:
108
78
 
109
- ```erb
110
- <%= tinymce :theme => "simple", :language => "de", :plugins => ["inlinepopups", "paste"] %>
111
- ```
79
+ <%= tinymce :theme => "simple", :language => "de", :plugins => ["wordcount", "paste"] %>
112
80
 
113
81
  Alternate configurations defined in 'config/tinymce.yml' can be used with:
114
82
 
115
- ```erb
116
- <%= tinymce :alternate %>
117
- ```
118
-
119
- Manual Initialization
120
- ---------------------
121
-
122
- Using the `tinymce` helper and global configuration file is entirely optional. The `tinyMCE.init` function can be invoked manually if desired.
123
-
124
- ```erb
125
- <%= text_area_tag :editor, "", :rows => 40, :cols => 120 %>
83
+ <%= tinymce :alternate %>
126
84
 
127
- <script type="text/javascript">
128
- tinyMCE.init({
129
- mode: 'textareas',
130
- theme: 'advanced'
131
- });
132
- </script>
133
- ```
134
85
 
135
86
  Language Packs
136
87
  --------------
@@ -138,40 +89,26 @@ Language Packs
138
89
  See the [tinymce-rails-langs](https://github.com/spohlenz/tinymce-rails-langs) gem for additional language packs for TinyMCE. The `tinymce` helper will use the current locale as the language if available, falling back to English if the core language files are missing.
139
90
 
140
91
 
141
- Asset Compilation
142
- -----------------
143
-
144
- Since TinyMCE loads most of its files dynamically, some workarounds are required to ensure that the TinyMCE asset files are accessible using non-digested filenames.
145
-
146
- As of tinymce-rails 3.5.11, 4.1.10 and 4.2.1, two alternative asset installation methods are available, which can be changed by setting `config.tinymce.install` within your `config/application.rb` file. Both methods are called when you run `rake asset:precompile` (via `Rake::Task#enhance`) after the regular application assets are compiled.
147
-
148
- The default method, `copy`, copies the TinyMCE assets directly into `public/assets` and appends the file information into the asset manifest.
149
-
150
- ```ruby
151
- config.tinymce.install = :copy
152
- ```
153
-
154
- The new method, `compile`, adds the TinyMCE paths to the Sprockets precompilation paths and then creates symlinks from the non-digested filenames to their digested versions.
155
-
156
- ```ruby
157
- config.tinymce.install = :compile
158
- ```
92
+ Manual Initialization
93
+ ---------------------
159
94
 
160
- Due to compilation times, this method is only recommended using Rails 4 and up. This method is intended to eventually become the default, so please try it if it suits your environment and report any issues.
95
+ Using the `tinymce` helper and global configuration file is entirely optional. The `tinyMCE.init` function can be invoked manually if desired.
161
96
 
162
- If you are including TinyMCE via `application.js` or using the `tinymce_assets` helper, you do not need to manually alter the precompile paths. However if you wish to include `tinymce-jquery.js` independently (i.e. using `javascript_include_tag`), you will need to add it to the precompile list in `config/environments/production.rb`:
97
+ <%= text_area_tag :editor, "", :rows => 40, :cols => 120 %>
163
98
 
164
- ```ruby
165
- config.assets.precompile << "tinymce-jquery.js"
166
- ```
99
+ <script type="text/javascript">
100
+ tinyMCE.init({
101
+ selector: 'textarea.editor'
102
+ });
103
+ </script>
167
104
 
168
105
 
169
106
  Custom Plugins & Skins
170
107
  ----------------------
171
108
 
172
- To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath `tinymce/plugins/` or `tinymce/themes/advanced/skins/`.
109
+ To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath `tinymce/plugins/` or `tinymce/skins/`.
173
110
 
174
- For example, a plugin called `mycustomplugin` could have its main JS file at `app/assets/javascripts/tinymce/plugins/mycustomplugin/editor_plugin.js`.
111
+ For example, a plugin called `mycustomplugin` could have its main JS file at `app/assets/javascripts/tinymce/plugins/mycustomplugin/plugin.js`.
175
112
 
176
113
  You should also ensure that your custom paths are added to the asset precompile paths.
177
114
 
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ def download(url, filename)
13
13
  end
14
14
 
15
15
  desc "Update TinyMCE to version #{TinyMCE::Rails::TINYMCE_VERSION}"
16
- task :update => [ :fetch, :extract, :process ]
16
+ task :update => [ :fetch, :extract, :rename ]
17
17
 
18
18
  task :fetch do
19
19
  download("http://download.moxiecode.com/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}.zip", "tinymce.zip")
@@ -26,26 +26,21 @@ task :extract do
26
26
  `unzip -u tmp/tinymce.zip -d tmp`
27
27
  `rm -rf vendor/assets/javascripts/tinymce`
28
28
  `mkdir -p vendor/assets/javascripts/tinymce`
29
- `mv tmp/tinymce/jscripts/tiny_mce/* vendor/assets/javascripts/tinymce/`
29
+ `mv tmp/tinymce/js/tinymce/* vendor/assets/javascripts/tinymce/`
30
30
  end
31
31
 
32
32
  step "Extracting jQuery files" do
33
- `rm -rf tmp/tinymce`
34
- `unzip -u tmp/tinymce.jquery.zip -d tmp`
35
- `mv tmp/tinymce/jscripts/tiny_mce/jquery.tinymce.js vendor/assets/javascripts/tinymce/jquery.tinymce.js`
36
- `mv tmp/tinymce/jscripts/tiny_mce/tiny_mce.js vendor/assets/javascripts/tinymce/tiny_mce_jquery.js`
37
- `mv tmp/tinymce/jscripts/tiny_mce/tiny_mce_src.js vendor/assets/javascripts/tinymce/tiny_mce_jquery_src.js`
33
+ `rm -rf tmp/tinymce`
34
+ `unzip -u tmp/tinymce.jquery.zip -d tmp`
35
+ `mv tmp/tinymce/js/tinymce/jquery.tinymce.min.js vendor/assets/javascripts/tinymce/jquery.tinymce.js`
36
+ `mv tmp/tinymce/js/tinymce/tinymce.min.js vendor/assets/javascripts/tinymce/tinymce_jquery.js`
38
37
  end
39
38
  end
40
39
 
41
- task :process do
42
- step "Fixing file encoding" do
43
- require 'iconv'
44
- converter = Iconv.new('UTF-8', 'ISO-8859-1')
45
- Dir["vendor/assets/javascripts/tinymce/**/*.js"].each do |file|
46
- contents = converter.iconv(File.read(file))
47
- contents = contents.force_encoding('UTF-8') if contents.respond_to?(:force_encoding)
48
- File.open(file, 'w') { |f| f.write(contents) }
40
+ task :rename do
41
+ step "Renaming files" do
42
+ Dir["vendor/assets/javascripts/tinymce/**/*.min.js"].each do |file|
43
+ FileUtils.mv(file, file.sub(/\.min\.js$/, '.js'))
49
44
  end
50
45
  end
51
46
  end
@@ -1,3 +1,3 @@
1
1
  //= require tinymce/preinit.js
2
- //= require tinymce/tiny_mce_jquery_src.js
2
+ //= require tinymce/tinymce_jquery.js
3
3
  //= require tinymce/jquery.tinymce.js
@@ -1,2 +1,2 @@
1
1
  //= require tinymce/preinit.js
2
- //= require tinymce/tiny_mce_src.js
2
+ //= require tinymce/tinymce.js
@@ -1,5 +1,4 @@
1
- window.tinyMCEPreInit = window.tinyMCEPreInit || {
1
+ window.tinymce = window.tinymce || {
2
2
  base: '<%= TinyMCE::Rails::Engine.base %>',
3
- query: '<%= TinyMCE::Rails::VERSION %>',
4
3
  suffix: ''
5
4
  };
@@ -2,15 +2,12 @@ assets_task = Rake::Task.task_defined?('assets:precompile:primary') ? 'assets:pr
2
2
 
3
3
  Rake::Task[assets_task].enhance do
4
4
  require "tinymce/rails/asset_installer"
5
-
6
- assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/tinymce"))
7
5
 
6
+ assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/tinymce"))
7
+
8
8
  config = Rails.application.config
9
9
  target = File.join(Rails.public_path, config.assets.prefix)
10
10
  manifest = config.assets.manifest
11
11
 
12
- installer = TinyMCE::Rails::AssetInstaller.new(assets, target, manifest)
13
- installer.log_level = Logger::INFO
14
- installer.strategy = config.tinymce.install
15
- installer.install
12
+ TinyMCE::Rails::AssetInstaller.new(assets, target, manifest).install
16
13
  end
data/lib/tinymce/rails.rb CHANGED
@@ -7,7 +7,7 @@ module TinyMCE
7
7
  require "tinymce/rails/helper"
8
8
 
9
9
  def self.configuration
10
- @configuration ||= ConfigurationFile.new(Engine.config_path)
10
+ @configuration ||= ConfigurationFile.new(::Rails.root.join("config/tinymce.yml"))
11
11
  @configuration.respond_to?(:configuration) ? @configuration.configuration : @configuration
12
12
  end
13
13
 
@@ -1,62 +1,64 @@
1
1
  require "tinymce/rails/asset_manifest"
2
2
 
3
- require "tinymce/rails/asset_installer/copy"
4
- require "tinymce/rails/asset_installer/compile"
5
-
6
3
  module TinyMCE
7
4
  module Rails
8
5
  class AssetInstaller
9
- attr_reader :assets, :target, :strategy
10
- attr_accessor :logger
11
-
12
6
  def initialize(assets, target, manifest_path)
13
7
  @assets = assets
14
8
  @target = target
15
9
  @manifest_path = manifest_path || target
16
-
17
- @logger = Logger.new($stderr)
18
- @logger.level = Logger::INFO
19
10
  end
20
11
 
21
12
  def install
22
- (strategy || Copy).new(self).call
13
+ cleanup_assets
14
+ copy_assets
15
+ append_to_manifest
16
+
17
+ manifest.write
23
18
  end
24
-
25
- def log_level
26
- @logger.level
19
+
20
+ private
21
+ def manifest
22
+ @manifest ||= AssetManifest.load(@manifest_path)
27
23
  end
28
-
29
- def log_level=(level)
30
- if level.is_a?(Integer)
31
- @logger.level = level
32
- else
33
- @logger.level = Logger.const_get(level.to_s.upcase)
24
+
25
+ def cleanup_assets
26
+ manifest.each(/^tinymce\//) do |asset|
27
+ manifest.remove(asset) if index_asset?(asset)
28
+
29
+ manifest.remove_digest(asset) do |src, dest|
30
+ move_asset(src, dest)
31
+ end
34
32
  end
35
33
  end
36
34
 
37
- def strategy=(strategy)
38
- if strategy.is_a?(Class)
39
- @strategy = strategy
40
- else
41
- @strategy = self.class.const_get(strategy.to_s.titlecase)
35
+ def copy_assets
36
+ FileUtils.cp_r(@assets, @target, :preserve => true)
37
+ end
38
+
39
+ def append_to_manifest
40
+ asset_files.each do |file|
41
+ manifest.append(logical_path(file), file)
42
42
  end
43
43
  end
44
44
 
45
- def manifest
46
- @manifest ||= AssetManifest.load(@manifest_path)
45
+ def asset_files
46
+ Pathname.glob("#{@assets}/**/*").select(&:file?)
47
47
  end
48
-
48
+
49
49
  def logical_path(file)
50
50
  file.relative_path_from(@assets.parent).to_s
51
51
  end
52
52
 
53
- def with_asset(src, dest)
54
- if src != dest
55
- src = File.join(@target, src)
56
- dest = File.join(@target, dest)
57
-
58
- yield src, dest if File.exists?(src)
59
- end
53
+ def move_asset(src, dest)
54
+ src = File.join(@target, src)
55
+ dest = File.join(@target, dest)
56
+
57
+ FileUtils.mv(src, dest, :force => true) if src != dest && File.exists?(src)
58
+ end
59
+
60
+ def index_asset?(asset)
61
+ asset =~ /\/index\.js$/
60
62
  end
61
63
  end
62
64
  end
@@ -1,141 +1,122 @@
1
+ require "multi_json"
2
+
1
3
  module TinyMCE
2
4
  module Rails
3
5
  class AssetManifest
4
- attr_reader :file
5
-
6
6
  def self.load(manifest_path)
7
- JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
8
- JsonManifest.try(manifest_path, "manifest*.json") ||
9
- YamlManifest.try(manifest_path) ||
7
+ YamlManifest.try(manifest_path) ||
8
+ JsonManifest.try(manifest_path) ||
10
9
  NullManifest.new
11
10
  end
12
-
13
- def each(pattern)
14
- assets.each_key do |asset|
15
- if asset =~ pattern && !index_asset?(asset)
16
- yield asset
17
- end
18
- end
19
- end
20
-
21
- def asset_path(logical_path)
22
- if digested = assets[logical_path]
23
- yield digested, logical_path if block_given?
24
- end
25
- end
26
-
27
- def to_s
28
- dump
29
- end
30
-
31
- protected
32
- def index_asset?(asset)
33
- asset =~ /\/index[^\/]*\.\w+$/
34
- end
35
11
  end
12
+ end
36
13
 
37
- class YamlManifest < AssetManifest
38
- def self.try(manifest_path)
39
- yaml_file = File.join(manifest_path, "manifest.yml")
40
- new(yaml_file) if File.exists?(yaml_file)
41
- end
14
+ class YamlManifest
15
+ def self.try(manifest_path)
16
+ yaml_file = File.join(manifest_path, "manifest.yml")
17
+ new(yaml_file) if File.exists?(yaml_file)
18
+ end
42
19
 
43
- def initialize(file)
44
- @file = file
45
- @manifest = YAML.load_file(file)
46
- end
20
+ def initialize(file)
21
+ @file = file
22
+ @manifest = YAML.load_file(file)
23
+ end
47
24
 
48
- def append(logical_path, file)
49
- assets[logical_path] = logical_path
50
- end
25
+ def append(logical_path, file)
26
+ @manifest[logical_path] = logical_path
27
+ end
51
28
 
52
- def remove(logical_path)
53
- assets.delete(logical_path)
54
- end
29
+ def remove(logical_path)
30
+ @manifest.delete(logical_path)
31
+ end
55
32
 
56
- def remove_digest(logical_path)
57
- asset_path(logical_path) do |digested, logical_path|
58
- assets[logical_path] = logical_path
59
-
60
- yield digested, logical_path if block_given?
61
- end
33
+ def remove_digest(logical_path)
34
+ if digested = @manifest[logical_path]
35
+ @manifest[logical_path] = logical_path
36
+ yield digested, logical_path if block_given?
62
37
  end
38
+ end
63
39
 
64
- def assets
65
- @manifest
40
+ def each(pattern)
41
+ @manifest.each_key do |asset|
42
+ yield asset if asset =~ pattern
66
43
  end
44
+ end
67
45
 
68
- def dump(io=nil)
69
- YAML.dump(@manifest, io)
70
- end
46
+ def to_s
47
+ dump
48
+ end
71
49
 
72
- def write
73
- File.open(@file, "wb") { |f| dump(f) }
74
- end
50
+ def dump(io=nil)
51
+ YAML.dump(@manifest, io)
75
52
  end
53
+
54
+ def write
55
+ File.open(@file, "wb") { |f| dump(f) }
56
+ end
57
+ end
76
58
 
77
- class JsonManifest < AssetManifest
78
- def self.try(manifest_path, pattern)
79
- paths = Dir[File.join(manifest_path, pattern)]
80
- new(paths.first) if paths.any?
81
- end
59
+ class JsonManifest
60
+ def self.try(manifest_path)
61
+ paths = Dir[File.join(manifest_path, "manifest*.json")]
62
+ new(paths.first) if paths.any?
63
+ end
82
64
 
83
- def initialize(file)
84
- @file = file
85
- @manifest = JSON.parse(File.read(file))
86
- end
65
+ def initialize(file)
66
+ @file = file
67
+ @manifest = MultiJson.load(File.read(file))
68
+ end
87
69
 
88
- def append(logical_path, file)
89
- stat = File.stat(file)
70
+ def append(logical_path, file)
71
+ stat = File.stat(file)
90
72
 
91
- assets[logical_path] = logical_path
92
- files[logical_path] = {
93
- "logical_path" => logical_path,
94
- "mtime" => stat.mtime.iso8601,
95
- "size" => stat.size,
96
- "digest" => nil
97
- }
98
- end
73
+ @manifest["assets"][logical_path] = logical_path
74
+ @manifest["files"][logical_path] = {
75
+ "logical_path" => logical_path,
76
+ "mtime" => stat.mtime.iso8601,
77
+ "size" => stat.size,
78
+ "digest" => nil
79
+ }
80
+ end
99
81
 
100
- def remove(logical_path)
101
- if digested = assets.delete(logical_path)
102
- files.delete(digested)
103
- end
82
+ def remove(logical_path)
83
+ if digested = @manifest["assets"].delete(logical_path)
84
+ @manifest["files"].delete(digested)
104
85
  end
86
+ end
105
87
 
106
- def remove_digest(logical_path)
107
- asset_path(logical_path) do |digested, logical_path|
108
- assets[logical_path] = logical_path
109
- files[logical_path] = files.delete(digested).tap { |f| f["digest"] = nil }
110
-
111
- yield digested, logical_path if block_given?
112
- end
113
- end
114
-
115
- def assets
116
- @manifest["assets"]
117
- end
118
-
119
- def files
120
- @manifest["files"]
88
+ def remove_digest(logical_path)
89
+ if digested = @manifest["assets"][logical_path]
90
+ @manifest["assets"][logical_path] = logical_path
91
+ @manifest["files"][logical_path] = @manifest["files"].delete(digested).tap { |f| f["digest"] = nil }
92
+ yield digested, logical_path if block_given?
121
93
  end
94
+ end
122
95
 
123
- def dump
124
- JSON.generate(@manifest)
96
+ def each(pattern)
97
+ @manifest["assets"].each_key do |asset|
98
+ yield asset if asset =~ pattern
125
99
  end
100
+ end
126
101
 
127
- def write
128
- File.open(@file, "wb") { |f| f.write(dump) }
129
- end
102
+ def to_s
103
+ dump
130
104
  end
131
-
132
- class NullManifest < AssetManifest
133
- def append(*); end
134
- def remove(*); end
135
- def remove_digest(*); end
136
- def assets; {}; end
137
- def each(*); end
138
- def write; end
105
+
106
+ def dump
107
+ MultiJson.dump(@manifest)
108
+ end
109
+
110
+ def write
111
+ File.open(@file, "wb") { |f| f.write(dump) }
139
112
  end
140
113
  end
114
+
115
+ class NullManifest
116
+ def append(*); end
117
+ def remove(*); end
118
+ def remove_digest(*); end
119
+ def each(*); end
120
+ def write; end
121
+ end
141
122
  end