ckeditor 4.0.6 → 4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. data/README.md +54 -6
  2. data/app/assets/javascripts/ckeditor/config.js +10 -10
  3. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js → application.js.erb} +1 -2
  4. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/{uploader.css → uploader.css.erb} +2 -2
  5. data/app/assets/javascripts/ckeditor/init.js.erb +2 -2
  6. data/app/assets/javascripts/ckeditor/override.js.erb +21 -0
  7. data/app/controllers/ckeditor/application_controller.rb +2 -1
  8. data/app/controllers/ckeditor/attachment_files_controller.rb +4 -4
  9. data/app/controllers/ckeditor/pictures_controller.rb +4 -4
  10. data/app/views/ckeditor/shared/_asset.html.erb +1 -1
  11. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +2 -2
  12. data/app/views/layouts/ckeditor/application.html.erb +0 -1
  13. data/lib/ckeditor.rb +49 -7
  14. data/lib/ckeditor/utils.rb +1 -1
  15. data/lib/ckeditor/version.rb +2 -2
  16. data/lib/generators/ckeditor/templates/ckeditor.rb +4 -0
  17. data/test/ckeditor_test.rb +53 -0
  18. data/test/support/helpers.rb +2 -2
  19. data/vendor/assets/javascripts/ckeditor/CHANGES.md +259 -102
  20. data/vendor/assets/javascripts/ckeditor/build-config.js +3 -2
  21. data/vendor/assets/javascripts/ckeditor/ckeditor.js +778 -732
  22. data/vendor/assets/javascripts/ckeditor/contents.css +20 -17
  23. data/vendor/assets/javascripts/ckeditor/lang/af.js +1 -1
  24. data/vendor/assets/javascripts/ckeditor/lang/ar.js +1 -1
  25. data/vendor/assets/javascripts/ckeditor/lang/bg.js +1 -1
  26. data/vendor/assets/javascripts/ckeditor/lang/bn.js +1 -1
  27. data/vendor/assets/javascripts/ckeditor/lang/bs.js +1 -1
  28. data/vendor/assets/javascripts/ckeditor/lang/ca.js +1 -1
  29. data/vendor/assets/javascripts/ckeditor/lang/cs.js +1 -1
  30. data/vendor/assets/javascripts/ckeditor/lang/cy.js +1 -1
  31. data/vendor/assets/javascripts/ckeditor/lang/da.js +1 -1
  32. data/vendor/assets/javascripts/ckeditor/lang/de.js +1 -1
  33. data/vendor/assets/javascripts/ckeditor/lang/el.js +1 -1
  34. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +1 -1
  35. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +1 -1
  36. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +1 -1
  37. data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
  38. data/vendor/assets/javascripts/ckeditor/lang/eo.js +1 -1
  39. data/vendor/assets/javascripts/ckeditor/lang/es.js +1 -1
  40. data/vendor/assets/javascripts/ckeditor/lang/et.js +1 -1
  41. data/vendor/assets/javascripts/ckeditor/lang/eu.js +1 -1
  42. data/vendor/assets/javascripts/ckeditor/lang/fa.js +1 -1
  43. data/vendor/assets/javascripts/ckeditor/lang/fi.js +1 -1
  44. data/vendor/assets/javascripts/ckeditor/lang/fo.js +1 -1
  45. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +1 -1
  46. data/vendor/assets/javascripts/ckeditor/lang/fr.js +1 -1
  47. data/vendor/assets/javascripts/ckeditor/lang/gl.js +1 -1
  48. data/vendor/assets/javascripts/ckeditor/lang/gu.js +1 -1
  49. data/vendor/assets/javascripts/ckeditor/lang/he.js +1 -1
  50. data/vendor/assets/javascripts/ckeditor/lang/hi.js +1 -1
  51. data/vendor/assets/javascripts/ckeditor/lang/hr.js +1 -1
  52. data/vendor/assets/javascripts/ckeditor/lang/hu.js +1 -1
  53. data/vendor/assets/javascripts/ckeditor/lang/id.js +1 -1
  54. data/vendor/assets/javascripts/ckeditor/lang/is.js +1 -1
  55. data/vendor/assets/javascripts/ckeditor/lang/it.js +1 -1
  56. data/vendor/assets/javascripts/ckeditor/lang/ja.js +1 -1
  57. data/vendor/assets/javascripts/ckeditor/lang/ka.js +1 -1
  58. data/vendor/assets/javascripts/ckeditor/lang/km.js +1 -1
  59. data/vendor/assets/javascripts/ckeditor/lang/ko.js +1 -1
  60. data/vendor/assets/javascripts/ckeditor/lang/ku.js +1 -1
  61. data/vendor/assets/javascripts/ckeditor/lang/lt.js +1 -1
  62. data/vendor/assets/javascripts/ckeditor/lang/lv.js +1 -1
  63. data/vendor/assets/javascripts/ckeditor/lang/mk.js +1 -1
  64. data/vendor/assets/javascripts/ckeditor/lang/mn.js +1 -1
  65. data/vendor/assets/javascripts/ckeditor/lang/ms.js +1 -1
  66. data/vendor/assets/javascripts/ckeditor/lang/nb.js +1 -1
  67. data/vendor/assets/javascripts/ckeditor/lang/nl.js +1 -1
  68. data/vendor/assets/javascripts/ckeditor/lang/no.js +1 -1
  69. data/vendor/assets/javascripts/ckeditor/lang/pl.js +1 -1
  70. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +1 -1
  71. data/vendor/assets/javascripts/ckeditor/lang/pt.js +1 -1
  72. data/vendor/assets/javascripts/ckeditor/lang/ro.js +1 -1
  73. data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
  74. data/vendor/assets/javascripts/ckeditor/lang/si.js +1 -1
  75. data/vendor/assets/javascripts/ckeditor/lang/sk.js +1 -1
  76. data/vendor/assets/javascripts/ckeditor/lang/sl.js +1 -1
  77. data/vendor/assets/javascripts/ckeditor/lang/sq.js +1 -1
  78. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +1 -1
  79. data/vendor/assets/javascripts/ckeditor/lang/sr.js +1 -1
  80. data/vendor/assets/javascripts/ckeditor/lang/sv.js +1 -1
  81. data/vendor/assets/javascripts/ckeditor/lang/th.js +1 -1
  82. data/vendor/assets/javascripts/ckeditor/lang/tr.js +1 -1
  83. data/vendor/assets/javascripts/ckeditor/lang/ug.js +1 -1
  84. data/vendor/assets/javascripts/ckeditor/lang/uk.js +1 -1
  85. data/vendor/assets/javascripts/ckeditor/lang/vi.js +1 -1
  86. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +1 -1
  87. data/vendor/assets/javascripts/ckeditor/lang/zh.js +1 -1
  88. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +6 -6
  89. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +1 -1
  90. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +1 -1
  91. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +1 -1
  92. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +3 -4
  93. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +9 -0
  94. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +2 -2
  95. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +6 -6
  96. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +1 -1
  97. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +1 -1
  98. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +1 -1
  99. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +4 -4
  100. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +3 -3
  101. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +5 -5
  102. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +1 -1
  103. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  104. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  105. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +21 -21
  106. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +7 -6
  107. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +20 -20
  108. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  109. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png +0 -0
  110. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  111. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png +0 -0
  112. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png +0 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png +0 -0
  116. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  117. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png +0 -0
  118. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  119. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png +0 -0
  120. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  121. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
  122. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png +0 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  124. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png +0 -0
  125. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
  126. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png +0 -0
  127. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  128. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png +0 -0
  129. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png +0 -0
  131. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  132. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png +0 -0
  133. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  134. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png +0 -0
  135. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png +0 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png +0 -0
  139. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  140. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png +0 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png +0 -0
  143. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  144. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png +0 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png +0 -0
  147. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  148. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  149. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png +0 -0
  150. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  151. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png +0 -0
  152. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ar.js +1 -1
  153. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +9 -9
  154. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +3 -3
  155. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +8 -9
  156. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/id.js +1 -1
  157. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ja.js +1 -1
  158. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/km.js +13 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +1 -1
  160. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt.js +4 -4
  161. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sl.js +1 -1
  162. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sq.js +2 -2
  163. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +3 -3
  164. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/uk.js +1 -1
  165. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/vi.js +11 -10
  166. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +3 -3
  167. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmp.html +5 -18
  168. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +62 -62
  169. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
  170. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
  171. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
  172. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
  173. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +1 -1
  174. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +1 -1
  175. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
  176. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
  177. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
  178. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
  179. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
  180. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +1 -1
  181. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  182. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  183. metadata +28 -41
  184. data/vendor/assets/javascripts/ckeditor/samples/ajax.html +0 -82
  185. data/vendor/assets/javascripts/ckeditor/samples/api.html +0 -207
  186. data/vendor/assets/javascripts/ckeditor/samples/appendto.html +0 -57
  187. data/vendor/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
  188. data/vendor/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +0 -204
  189. data/vendor/assets/javascripts/ckeditor/samples/assets/posteddata.php +0 -59
  190. data/vendor/assets/javascripts/ckeditor/samples/assets/sample.css +0 -3
  191. data/vendor/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
  192. data/vendor/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +0 -7
  193. data/vendor/assets/javascripts/ckeditor/samples/datafiltering.html +0 -401
  194. data/vendor/assets/javascripts/ckeditor/samples/divreplace.html +0 -141
  195. data/vendor/assets/javascripts/ckeditor/samples/index.html +0 -128
  196. data/vendor/assets/javascripts/ckeditor/samples/inlineall.html +0 -311
  197. data/vendor/assets/javascripts/ckeditor/samples/inlinebycode.html +0 -121
  198. data/vendor/assets/javascripts/ckeditor/samples/inlinetextarea.html +0 -110
  199. data/vendor/assets/javascripts/ckeditor/samples/jquery.html +0 -97
  200. data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +0 -48
  201. data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +0 -187
  202. data/vendor/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +0 -103
  203. data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  204. data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  205. data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +0 -18
  206. data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +0 -280
  207. data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +0 -221
  208. data/vendor/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +0 -207
  209. data/vendor/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +0 -232
  210. data/vendor/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +0 -77
  211. data/vendor/assets/javascripts/ckeditor/samples/readonly.html +0 -73
  212. data/vendor/assets/javascripts/ckeditor/samples/replacebyclass.html +0 -57
  213. data/vendor/assets/javascripts/ckeditor/samples/replacebycode.html +0 -56
  214. data/vendor/assets/javascripts/ckeditor/samples/sample.css +0 -339
  215. data/vendor/assets/javascripts/ckeditor/samples/sample.js +0 -33
  216. data/vendor/assets/javascripts/ckeditor/samples/sample_posteddata.php +0 -16
  217. data/vendor/assets/javascripts/ckeditor/samples/tabindex.html +0 -75
  218. data/vendor/assets/javascripts/ckeditor/samples/uicolor.html +0 -69
  219. data/vendor/assets/javascripts/ckeditor/samples/uilanguages.html +0 -119
  220. data/vendor/assets/javascripts/ckeditor/samples/xhtmlstyle.html +0 -231
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Ckeditor
2
2
 
3
- CKEditor is a ready-for-use HTML text editor designed to simplify web content creation. It's a WYSIWYG editor that brings common word processor features directly to your web pages. Enhance your website experience with our community maintained editor.
3
+ CKEditor is a ready-for-use HTML text editor designed to simplify web content creation. It's a WYSIWYG editor that brings common word processor features directly to your web pages. Enhance your website experience with our community maintained editor.
4
4
  [ckeditor.com](http://ckeditor.com/)
5
5
 
6
6
  ## Features
7
7
 
8
- * Ckeditor version 4.2 (full)
8
+ * Ckeditor version 4.3 (full)
9
9
  * Rails 4 integration
10
10
  * Files browser
11
11
  * HTML5 files uploader
@@ -36,7 +36,7 @@ gem "paperclip"
36
36
 
37
37
  rails generate ckeditor:install --orm=active_record --backend=paperclip
38
38
  ```
39
-
39
+
40
40
  #### ActiveRecord + carrierwave
41
41
 
42
42
  ```
@@ -110,13 +110,61 @@ app/assets/javascripts/ckeditor/config.js
110
110
  app/assets/javascripts/ckeditor/contents.css
111
111
  ```
112
112
 
113
+ ### Usage with Rails 4 assets
114
+
115
+ In order to use rails 4 assets with digest in production environment you need some preparing.
116
+
117
+ First, you need to include in `application.js` **before** `ckeditor/init`
118
+
119
+ ```
120
+ //= require ckeditor/override
121
+ ```
122
+
123
+ It forces ckeditor core to respect digested assets.
124
+
125
+ Next you need to check, that some non-core plugins and skins don't use core ckeditor functions
126
+ to determine path to assets. Therefore we have to create a rake task thats copies the original assets and creates a non-digest version of it. Some example of such rake task is:
127
+
128
+ ```ruby
129
+ namespace :ckeditor do
130
+ desc 'Create nondigest versions of some ckeditor assets (e.g. moono skin png)'
131
+ task :create_nondigest_assets do
132
+ fingerprint = /\-[0-9a-f]{32}\./
133
+ for file in Dir['public/assets/ckeditor/contents-*.css', 'public/assets/ckeditor/skins/moono/*.png']
134
+ next unless file =~ fingerprint
135
+ nondigest = file.sub fingerprint, '.' # contents-0d8ffa186a00f5063461bc0ba0d96087.css => contents.css
136
+ FileUtils.cp file, nondigest, verbose: true
137
+ end
138
+ end
139
+ end
140
+
141
+ # auto run ckeditor:create_nondigest_assets after assets:precompile
142
+ Rake::Task['assets:precompile'].enhance do
143
+ Rake::Task['ckeditor:create_nondigest_assets'].invoke
144
+ end
145
+ ```
146
+ This also works on heroku. Even after restarting dynos running on a cedar stack, the assets will remain.
147
+
148
+ You can include this rake task in a capistrano task (if you are deploying via capistrano):
149
+
150
+ ```ruby
151
+ desc 'copy ckeditor nondigest assets'
152
+ task :copy_nondigest_assets, roles: :app do
153
+ run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} ckeditor:copy_nondigest_assets"
154
+ end
155
+ after 'deploy:assets:precompile', 'copy_nondigest_assets'
156
+ ```
157
+
158
+ Periodically check your error monitoring tool, if you see some part of ckeditor try to load
159
+ unexisting non-digest asset - if so just add it in the ckeditor rake task.
160
+
113
161
  ### AJAX
114
162
 
115
163
  jQuery sample:
116
164
 
117
165
  ```html
118
166
  <script type='text/javascript' charset='UTF-8'>
119
- $(document).ready(function(){
167
+ $(document).ready(function(){
120
168
  $('form[data-remote]').bind("ajax:before", function(){
121
169
  for (instance in CKEDITOR.instances){
122
170
  CKEDITOR.instances[instance].updateElement();
@@ -182,11 +230,11 @@ en:
182
230
  $> rake test
183
231
  $> rake test CKEDITOR_ORM=mongoid
184
232
  $> rake test CKEDITOR_BACKEND=carrierwave
185
-
233
+
186
234
  $> rake test:controllers
187
235
  $> rake test:generators
188
236
  $> rake test:integration
189
237
  $> rake test:models
190
238
  ```
191
239
 
192
- This project rocks and uses MIT-LICENSE.
240
+ This project rocks and uses MIT-LICENSE.
@@ -8,7 +8,7 @@ CKEDITOR.editorConfig = function( config )
8
8
  // Define changes to default configuration here. For example:
9
9
  // config.language = 'fr';
10
10
  // config.uiColor = '#AADC6E';
11
-
11
+
12
12
  /* Filebrowser routes */
13
13
  // The location of an external file browser, that should be launched when "Browse Server" button is pressed.
14
14
  config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
@@ -18,7 +18,7 @@ CKEDITOR.editorConfig = function( config )
18
18
 
19
19
  // The location of a script that handles file uploads in the Flash dialog.
20
20
  config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
21
-
21
+
22
22
  // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
23
23
  config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
24
24
 
@@ -27,16 +27,16 @@ CKEDITOR.editorConfig = function( config )
27
27
 
28
28
  // The location of a script that handles file uploads in the Image dialog.
29
29
  config.filebrowserImageUploadUrl = "/ckeditor/pictures";
30
-
30
+
31
31
  // The location of a script that handles file uploads.
32
32
  config.filebrowserUploadUrl = "/ckeditor/attachment_files";
33
-
33
+
34
34
  // Rails CSRF token
35
35
  config.filebrowserParams = function(){
36
36
  var csrf_token, csrf_param, meta,
37
37
  metas = document.getElementsByTagName('meta'),
38
38
  params = new Object();
39
-
39
+
40
40
  for ( var i = 0 ; i < metas.length ; i++ ){
41
41
  meta = metas[i];
42
42
 
@@ -55,10 +55,10 @@ CKEDITOR.editorConfig = function( config )
55
55
  if (csrf_param !== undefined && csrf_token !== undefined) {
56
56
  params[csrf_param] = csrf_token;
57
57
  }
58
-
58
+
59
59
  return params;
60
60
  };
61
-
61
+
62
62
  config.addQueryString = function( url, params ){
63
63
  var queryString = [];
64
64
 
@@ -71,18 +71,18 @@ CKEDITOR.editorConfig = function( config )
71
71
 
72
72
  return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
73
73
  };
74
-
74
+
75
75
  // Integrate Rails CSRF token into file upload dialogs (link, image, attachment and flash)
76
76
  CKEDITOR.on( 'dialogDefinition', function( ev ){
77
77
  // Take the dialog name and its definition from the event data.
78
78
  var dialogName = ev.data.name;
79
79
  var dialogDefinition = ev.data.definition;
80
80
  var content, upload;
81
-
81
+
82
82
  if (CKEDITOR.tools.indexOf(['link', 'image', 'attachment', 'flash'], dialogName) > -1) {
83
83
  content = (dialogDefinition.getContents('Upload') || dialogDefinition.getContents('upload'));
84
84
  upload = (content == null ? null : content.get('upload'));
85
-
85
+
86
86
  if (upload && upload.filebrowser && upload.filebrowser['params'] === undefined) {
87
87
  upload.filebrowser['params'] = config.filebrowserParams();
88
88
  upload.action = config.addQueryString(upload.action, upload.filebrowser['params']);
@@ -76,7 +76,6 @@ qq.FileUploaderInput = function(o){
76
76
  this._classes = this._options.classes;
77
77
 
78
78
  this._button = this._createUploadButton(this._find(this._element, 'button'));
79
- this._path = $('meta[name="ckeditor-path"]').attr('content');
80
79
 
81
80
  //this._setupDragDrop();
82
81
 
@@ -188,7 +187,7 @@ qq.extend(qq.FileUploaderInput.prototype, {
188
187
  format_created_at: '',
189
188
  url_content: "#",
190
189
  controller: "assets",
191
- url_thumb: this._path + "/filebrowser/images/preloader.gif"
190
+ url_thumb: "<%= asset_path('ckeditor/filebrowser/images/preloader.gif') %>"
192
191
  };
193
192
 
194
193
  var item = $(this._options.template_id)
@@ -56,7 +56,7 @@ img {
56
56
  .gal-holder .gal-item .gal-upload-holder .add {
57
57
  display: block;
58
58
  color: #2e5aff;
59
- background: url(/assets/ckeditor/filebrowser/images/gal_add.png) no-repeat left center;
59
+ background: url(<%= asset_path('ckeditor/filebrowser/images/gal_add.png') %>) no-repeat left center;
60
60
  padding-left: 33px;
61
61
  line-height: 25px;
62
62
  text-decoration: none;
@@ -108,7 +108,7 @@ img {
108
108
  }
109
109
  .gal-more a {
110
110
  color: #2e5aff;
111
- background: url(/assets/ckeditor/filebrowser/images/gal_more.gif) no-repeat left center;
111
+ background: url(<%= asset_path('ckeditor/filebrowser/images/gal_more.gif') %>) no-repeat left center;
112
112
  padding-left: 15px;
113
113
  font-size: 14px;
114
114
  text-decoration: none;
@@ -3,7 +3,7 @@
3
3
 
4
4
  (function() {
5
5
  if (typeof window['CKEDITOR_BASEPATH'] === "undefined" || window['CKEDITOR_BASEPATH'] === null) {
6
- window['CKEDITOR_BASEPATH'] = "<%= config.relative_url_root %>/assets/ckeditor/";
6
+ window['CKEDITOR_BASEPATH'] = "<%= asset_path('ckeditor') %>/";
7
7
  }
8
8
  }).call(this);
9
9
 
@@ -13,4 +13,4 @@ function ck_load() {
13
13
  });
14
14
  }
15
15
 
16
- $(document).on('page:load', ck_load);
16
+ $(document).on('page:load', ck_load);
@@ -0,0 +1,21 @@
1
+ window['CKEDITOR_BASEPATH'] = "/assets/ckeditor/";
2
+
3
+ window.CKEDITOR_ASSETS_MAPPING = {
4
+ <% Rails.application.assets.each_logical_path(->(path){ path =~ /ckeditor/ && path != 'ckeditor/override.js' }) do |asset| %>
5
+ "<%= asset %>": "<%= asset_path(asset) %>",
6
+ <% end %>
7
+ }
8
+
9
+ window.CKEDITOR_GETURL = function( resource ) {
10
+ // If this is not a full or absolute path.
11
+ if ( resource.indexOf( ':/' ) == -1 && resource.indexOf( '/' ) !== 0 )
12
+ resource = this.basePath + resource;
13
+
14
+ // Add the timestamp, except for directories.
15
+ if ( resource.charAt( resource.length - 1 ) != '/' ){
16
+ var url = resource.match( /^(.*?:\/\/[^\/]*)\/assets\/(.+)/ );
17
+ if(url) resource = url[1] + (CKEDITOR_ASSETS_MAPPING[url[2]] || '/assets/' + url[2]);
18
+ }
19
+
20
+ return resource;
21
+ }
@@ -1,5 +1,6 @@
1
1
  class Ckeditor::ApplicationController < ::ApplicationController
2
2
  respond_to :html, :json
3
+ layout 'ckeditor/application'
3
4
 
4
5
  before_filter :find_asset, :only => [:destroy]
5
6
  before_filter :ckeditor_authorize!
@@ -15,7 +16,7 @@ class Ckeditor::ApplicationController < ::ApplicationController
15
16
 
16
17
  if callback && asset.save
17
18
  body = params[:CKEditor].blank? ? asset.to_json(:only=>[:id, :type]) : %Q"<script type='text/javascript'>
18
- window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, '#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}');
19
+ window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, '#{config.relative_url_root}#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}');
19
20
  </script>"
20
21
 
21
22
  render :text => body
@@ -1,12 +1,12 @@
1
1
  class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
2
2
 
3
3
  def index
4
- @attachments = Ckeditor.attachment_file_model.find_all(ckeditor_attachment_files_scope)
4
+ @attachments = Ckeditor.attachment_file_adapter.find_all(ckeditor_attachment_files_scope)
5
5
  respond_with(@attachments)
6
6
  end
7
7
 
8
8
  def create
9
- @attachment = Ckeditor::AttachmentFile.new
9
+ @attachment = Ckeditor.attachment_file_model.new
10
10
  respond_with_asset(@attachment)
11
11
  end
12
12
 
@@ -18,11 +18,11 @@ class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
18
18
  protected
19
19
 
20
20
  def find_asset
21
- @attachment = Ckeditor.attachment_file_model.get!(params[:id])
21
+ @attachment = Ckeditor.attachment_file_adapter.get!(params[:id])
22
22
  end
23
23
 
24
24
  def authorize_resource
25
- model = (@attachment || Ckeditor::AttachmentFile)
25
+ model = (@attachment || Ckeditor.attachment_file_model)
26
26
  @authorization_adapter.try(:authorize, params[:action], model)
27
27
  end
28
28
  end
@@ -1,12 +1,12 @@
1
1
  class Ckeditor::PicturesController < Ckeditor::ApplicationController
2
2
 
3
3
  def index
4
- @pictures = Ckeditor.picture_model.find_all(ckeditor_pictures_scope)
4
+ @pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope)
5
5
  respond_with(@pictures)
6
6
  end
7
7
 
8
8
  def create
9
- @picture = Ckeditor::Picture.new
9
+ @picture = Ckeditor.picture_model.new
10
10
  respond_with_asset(@picture)
11
11
  end
12
12
 
@@ -18,11 +18,11 @@ class Ckeditor::PicturesController < Ckeditor::ApplicationController
18
18
  protected
19
19
 
20
20
  def find_asset
21
- @picture = Ckeditor.picture_model.get!(params[:id])
21
+ @picture = Ckeditor.picture_adapter.get!(params[:id])
22
22
  end
23
23
 
24
24
  def authorize_resource
25
- model = (@picture || Ckeditor::Picture)
25
+ model = (@picture || Ckeditor.picture_model)
26
26
  @authorization_adapter.try(:authorize, params[:action], model)
27
27
  end
28
28
  end
@@ -1,5 +1,5 @@
1
1
  <%= content_tag(:div, :id => dom_id(asset), :class => "gal-item", :"data-url" => image_path(asset.url_content)) do %>
2
- <%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
2
+ <%= link_to image_tag('ckeditor/filebrowser/images/gal_del.png',
3
3
  :title => I18n.t('ckeditor.buttons.delete')),
4
4
  polymorphic_path(asset, :format => :json),
5
5
  :remote => true,
@@ -1,6 +1,6 @@
1
1
  <script id="fileupload_tmpl" type="text/x-jquery-tmpl">
2
2
  <div id="asset_${id}" class="gal-item" data-url="${url_content}">
3
- <%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
3
+ <%= link_to image_tag('ckeditor/filebrowser/images/gal_del.png',
4
4
  :title => I18n.t('ckeditor.buttons.delete')),
5
5
  "/ckeditor/${controller}/${id}.json",
6
6
  :remote => true,
@@ -9,7 +9,7 @@
9
9
  :class => "fileupload-cancel gal-del" %>
10
10
 
11
11
  <div class="fileupload-file gal-inner-holder">
12
- <div class="img"><img src="<%= Rails.configuration.action_controller.asset_host %>${url_thumb}" title="${filename}"></div>
12
+ <div class="img"><img src="${url_thumb}" title="${filename}"></div>
13
13
  <div class="img-data">
14
14
  <div class="img-name">${filename}</div>
15
15
  <div class="time-size">
@@ -4,7 +4,6 @@
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
5
  <meta name="robots" content="noindex, nofollow">
6
6
  <%= csrf_meta_tag %>
7
- <%= tag(:meta, :name => "ckeditor-path", :content => Ckeditor.relative_path) %>
8
7
  <title><%= I18n.t('page_title', :scope => [:ckeditor]) %></title>
9
8
 
10
9
  <% if assets_pipeline_enabled? -%>
@@ -55,7 +55,11 @@ module Ckeditor
55
55
  # Turn on/off filename parameterize
56
56
  mattr_accessor :parameterize_filenames
57
57
  @@parameterize_filenames = true
58
-
58
+
59
+ # Model classes
60
+ @@picture_model = nil
61
+ @@attachment_file_model = nil
62
+
59
63
  # Default way to setup Ckeditor. Run rails generate ckeditor to create
60
64
  # a fresh initializer with all configuration values.
61
65
  #
@@ -77,13 +81,51 @@ module Ckeditor
77
81
  def self.assets
78
82
  @@assets ||= Utils.select_assets("ckeditor", "vendor/assets/javascripts") << "ckeditor/init.js"
79
83
  end
80
-
81
- def self.picture_model
82
- Ckeditor::Picture.to_adapter
84
+
85
+ def self.picture_model(&block)
86
+ if block_given?
87
+ self.picture_model = block
88
+ else
89
+ @@picture_model_class ||= begin
90
+ if @@picture_model.respond_to? :call
91
+ @@picture_model.call
92
+ else
93
+ @@picture_model || Ckeditor::Picture
94
+ end
95
+ end
96
+ end
83
97
  end
84
-
85
- def self.attachment_file_model
86
- Ckeditor::AttachmentFile.to_adapter
98
+
99
+ def self.picture_model=(value)
100
+ @@picture_model_class = nil
101
+ @@picture_model = value
102
+ end
103
+
104
+ def self.picture_adapter
105
+ picture_model.to_adapter
106
+ end
107
+
108
+ def self.attachment_file_model(&block)
109
+ if block_given?
110
+ self.attachment_file_model = block
111
+ else
112
+ @@attachment_file_model_class ||= begin
113
+ if @@attachment_file_model.respond_to? :call
114
+ @@attachment_file_model.call
115
+ else
116
+ @@attachment_file_model || Ckeditor::AttachmentFile
117
+ end
118
+ end
119
+ end
120
+ end
121
+
122
+ def self.attachment_file_model=(value)
123
+ @@attachment_file_model_class = nil
124
+ @@attachment_file_model = value
125
+ end
126
+
127
+ def self.attachment_file_adapter
128
+ attachment_file_model.to_adapter
87
129
  end
88
130
 
89
131
  # Setup authorization to be run as a before filter
@@ -77,7 +77,7 @@ module Ckeditor
77
77
  folder = File.join(relative_path, path, '**')
78
78
  relative_folder = Ckeditor.root_path.join(relative_path)
79
79
 
80
- Dir[Ckeditor.root_path.join(folder, '*.{js,css}')].inject([]) do |list, file|
80
+ Dir[Ckeditor.root_path.join(folder, '*.{js,css,png,gif,jpg}')].inject([]) do |list, file|
81
81
  list << Pathname.new(file).relative_path_from(relative_folder).to_s
82
82
  list
83
83
  end
@@ -1,6 +1,6 @@
1
1
  module Ckeditor
2
2
  module Version
3
- GEM = "4.0.6".freeze
4
- EDITOR = "4.2".freeze
3
+ GEM = "4.0.7".freeze
4
+ EDITOR = "4.3".freeze
5
5
  end
6
6
  end
@@ -16,4 +16,8 @@ Ckeditor.setup do |config|
16
16
 
17
17
  # Setup authorization to be run as a before filter
18
18
  # config.authorize_with :cancan
19
+
20
+ # Asset model classes
21
+ # config.picture_model { Ckeditor::Picture }
22
+ # config.attachment_file_model { Ckeditor::AttachmentFile }
19
23
  end