ckeditor 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/app/assets/javascripts/ckeditor/config.js +1 -1
  4. data/app/assets/stylesheets/ckeditor/filebrowser/uploader.scss +42 -2
  5. data/app/controllers/ckeditor/attachment_files_controller.rb +1 -1
  6. data/app/controllers/ckeditor/pictures_controller.rb +1 -1
  7. data/app/helpers/ckeditor/application_helper.rb +1 -10
  8. data/app/views/ckeditor/attachment_files/index.html.erb +1 -1
  9. data/app/views/ckeditor/pictures/index.html.erb +1 -1
  10. data/app/views/layouts/ckeditor/application.html.erb +1 -1
  11. data/lib/ckeditor.rb +15 -9
  12. data/lib/ckeditor/asset_response.rb +2 -1
  13. data/lib/ckeditor/backend/dragonfly.rb +2 -2
  14. data/lib/ckeditor/backend/paperclip.rb +2 -9
  15. data/lib/ckeditor/backend/refile.rb +1 -1
  16. data/lib/ckeditor/helpers/controllers.rb +1 -1
  17. data/lib/ckeditor/orm/base.rb +1 -1
  18. data/lib/ckeditor/utils.rb +13 -11
  19. data/lib/ckeditor/version.rb +2 -2
  20. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
  21. data/test/dummy/public/ckeditor_assets/attachments/1/rails.tar.gz +0 -0
  22. data/test/dummy/public/ckeditor_assets/pictures/1/content_rails.png +0 -0
  23. data/test/dummy/public/ckeditor_assets/pictures/1/original_rails.png +0 -0
  24. data/test/dummy/public/ckeditor_assets/pictures/1/thumb_rails.png +0 -0
  25. data/test/dummy/public/uploads/ckeditor/attachments/1/rails.tar.gz +0 -0
  26. data/test/dummy/public/uploads/ckeditor/pictures/1/content_rails.png +0 -0
  27. data/test/dummy/public/uploads/ckeditor/pictures/1/rails.png +0 -0
  28. data/test/dummy/public/uploads/ckeditor/pictures/1/thumb_rails.png +0 -0
  29. data/test/models/attachment_file_test.rb +2 -7
  30. data/test/tmp/app/models/ckeditor/asset.rb +5 -0
  31. data/test/tmp/app/models/ckeditor/attachment_file.rb +13 -0
  32. data/test/tmp/app/models/ckeditor/picture.rb +14 -0
  33. data/test/tmp/config/initializers/ckeditor.rb +58 -0
  34. data/test/tmp/config/routes.rb +5 -0
  35. data/vendor/assets/javascripts/ckeditor/CHANGES.md +86 -1
  36. data/vendor/assets/javascripts/ckeditor/ckeditor.js +619 -570
  37. data/vendor/assets/javascripts/ckeditor/lang/af.js +1 -1
  38. data/vendor/assets/javascripts/ckeditor/lang/ar.js +1 -1
  39. data/vendor/assets/javascripts/ckeditor/lang/az.js +1 -1
  40. data/vendor/assets/javascripts/ckeditor/lang/bg.js +1 -1
  41. data/vendor/assets/javascripts/ckeditor/lang/bn.js +1 -1
  42. data/vendor/assets/javascripts/ckeditor/lang/bs.js +1 -1
  43. data/vendor/assets/javascripts/ckeditor/lang/ca.js +1 -1
  44. data/vendor/assets/javascripts/ckeditor/lang/cs.js +1 -1
  45. data/vendor/assets/javascripts/ckeditor/lang/cy.js +1 -1
  46. data/vendor/assets/javascripts/ckeditor/lang/da.js +1 -1
  47. data/vendor/assets/javascripts/ckeditor/lang/de-ch.js +1 -1
  48. data/vendor/assets/javascripts/ckeditor/lang/de.js +1 -1
  49. data/vendor/assets/javascripts/ckeditor/lang/el.js +1 -1
  50. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +1 -1
  51. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +1 -1
  52. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +1 -1
  53. data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
  54. data/vendor/assets/javascripts/ckeditor/lang/eo.js +1 -1
  55. data/vendor/assets/javascripts/ckeditor/lang/es-mx.js +5 -0
  56. data/vendor/assets/javascripts/ckeditor/lang/es.js +1 -1
  57. data/vendor/assets/javascripts/ckeditor/lang/et.js +1 -1
  58. data/vendor/assets/javascripts/ckeditor/lang/eu.js +1 -1
  59. data/vendor/assets/javascripts/ckeditor/lang/fa.js +1 -1
  60. data/vendor/assets/javascripts/ckeditor/lang/fi.js +1 -1
  61. data/vendor/assets/javascripts/ckeditor/lang/fo.js +1 -1
  62. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +1 -1
  63. data/vendor/assets/javascripts/ckeditor/lang/fr.js +1 -1
  64. data/vendor/assets/javascripts/ckeditor/lang/gl.js +1 -1
  65. data/vendor/assets/javascripts/ckeditor/lang/gu.js +1 -1
  66. data/vendor/assets/javascripts/ckeditor/lang/he.js +1 -1
  67. data/vendor/assets/javascripts/ckeditor/lang/hi.js +1 -1
  68. data/vendor/assets/javascripts/ckeditor/lang/hr.js +1 -1
  69. data/vendor/assets/javascripts/ckeditor/lang/hu.js +1 -1
  70. data/vendor/assets/javascripts/ckeditor/lang/id.js +1 -1
  71. data/vendor/assets/javascripts/ckeditor/lang/is.js +1 -1
  72. data/vendor/assets/javascripts/ckeditor/lang/it.js +1 -1
  73. data/vendor/assets/javascripts/ckeditor/lang/ja.js +1 -1
  74. data/vendor/assets/javascripts/ckeditor/lang/ka.js +1 -1
  75. data/vendor/assets/javascripts/ckeditor/lang/km.js +1 -1
  76. data/vendor/assets/javascripts/ckeditor/lang/ko.js +1 -1
  77. data/vendor/assets/javascripts/ckeditor/lang/ku.js +1 -1
  78. data/vendor/assets/javascripts/ckeditor/lang/lt.js +1 -1
  79. data/vendor/assets/javascripts/ckeditor/lang/lv.js +1 -1
  80. data/vendor/assets/javascripts/ckeditor/lang/mk.js +1 -1
  81. data/vendor/assets/javascripts/ckeditor/lang/mn.js +1 -1
  82. data/vendor/assets/javascripts/ckeditor/lang/ms.js +1 -1
  83. data/vendor/assets/javascripts/ckeditor/lang/nb.js +1 -1
  84. data/vendor/assets/javascripts/ckeditor/lang/nl.js +1 -1
  85. data/vendor/assets/javascripts/ckeditor/lang/no.js +1 -1
  86. data/vendor/assets/javascripts/ckeditor/lang/oc.js +1 -1
  87. data/vendor/assets/javascripts/ckeditor/lang/pl.js +1 -1
  88. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +1 -1
  89. data/vendor/assets/javascripts/ckeditor/lang/pt.js +1 -1
  90. data/vendor/assets/javascripts/ckeditor/lang/ro.js +1 -1
  91. data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
  92. data/vendor/assets/javascripts/ckeditor/lang/si.js +1 -1
  93. data/vendor/assets/javascripts/ckeditor/lang/sk.js +1 -1
  94. data/vendor/assets/javascripts/ckeditor/lang/sl.js +1 -1
  95. data/vendor/assets/javascripts/ckeditor/lang/sq.js +1 -1
  96. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +1 -1
  97. data/vendor/assets/javascripts/ckeditor/lang/sr.js +1 -1
  98. data/vendor/assets/javascripts/ckeditor/lang/sv.js +1 -1
  99. data/vendor/assets/javascripts/ckeditor/lang/th.js +1 -1
  100. data/vendor/assets/javascripts/ckeditor/lang/tr.js +1 -1
  101. data/vendor/assets/javascripts/ckeditor/lang/tt.js +1 -1
  102. data/vendor/assets/javascripts/ckeditor/lang/ug.js +1 -1
  103. data/vendor/assets/javascripts/ckeditor/lang/uk.js +1 -1
  104. data/vendor/assets/javascripts/ckeditor/lang/vi.js +1 -1
  105. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +1 -1
  106. data/vendor/assets/javascripts/ckeditor/lang/zh.js +1 -1
  107. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
  108. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/af.js +3 -3
  109. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +3 -2
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/az.js +3 -3
  111. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +3 -2
  112. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +4 -3
  113. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +4 -4
  114. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +3 -3
  115. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +3 -3
  116. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de-ch.js +4 -3
  117. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +4 -3
  118. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +4 -3
  119. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +3 -2
  120. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
  121. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +3 -3
  122. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es-mx.js +13 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +4 -4
  124. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +3 -2
  125. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eu.js +3 -3
  126. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +3 -3
  127. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +3 -3
  128. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fo.js +3 -2
  129. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +3 -3
  130. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +3 -3
  131. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +7 -6
  132. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +3 -2
  133. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +3 -2
  134. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +3 -2
  135. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +5 -5
  136. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +5 -4
  137. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +3 -3
  138. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +4 -4
  139. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +3 -3
  140. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +3 -2
  141. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +3 -3
  142. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +3 -3
  143. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +3 -2
  144. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +3 -2
  145. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +3 -3
  146. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +3 -2
  147. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +4 -3
  148. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +3 -3
  149. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +3 -3
  150. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/oc.js +3 -3
  151. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +5 -5
  152. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +4 -3
  153. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +4 -4
  154. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +3 -3
  155. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  156. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +3 -3
  157. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +3 -3
  158. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +3 -3
  159. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +3 -3
  160. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +3 -2
  161. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +3 -2
  162. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +3 -3
  163. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +3 -2
  164. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +3 -3
  165. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +3 -3
  166. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +4 -3
  167. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +3 -3
  168. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +3 -3
  169. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +3 -3
  170. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +3 -3
  171. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +2 -2
  172. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
  173. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
  174. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -3
  175. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +23 -23
  176. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +48 -39
  177. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +32 -19
  179. data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +6 -1
  180. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +1 -1
  181. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/da.js +1 -1
  182. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-au.js +13 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-ca.js +13 -0
  184. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-gb.js +1 -1
  185. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/es-mx.js +13 -0
  186. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +9 -9
  187. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ko.js +6 -6
  188. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +1 -1
  189. data/vendor/assets/javascripts/ckeditor/plugins/tableselection/styles/tableselection.css +32 -0
  190. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +80 -80
  191. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +1 -1
  192. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +1 -1
  193. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +1 -1
  194. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +1 -1
  195. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +1 -1
  196. data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
  197. metadata +36 -4
  198. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f01d39fd69d31cd2d055978561b4bcbe3f1777b
4
- data.tar.gz: 80a0c2fc15842b9ff6403f6d213c58f306726f7d
3
+ metadata.gz: 8322d6cb4547b48c4919776004ded1a350c05545
4
+ data.tar.gz: 9ab657aaca72e69a847357666e1da8eb46684295
5
5
  SHA512:
6
- metadata.gz: 3dcd349b482553c6cbe7a3dccfaf61934c9a4c3b1b8bdcd9949dd6831d03252e23aa633b084cca7a74a6e23369d8a0416eb5e28d148f8f88d36c4ab736e21894
7
- data.tar.gz: bada24f9807287455e3d5c208abf5e7c2cf2cdf0d64da638a68cea8d78bf9bab1b0525e1d50223151da6def6d94b6bde47b719c238aac4e5a69737ff63d134e1
6
+ metadata.gz: c0434a28caf6681dc5a769a12f75019e05042611d62b5ceb0d3f3b5703c07bb10de4ed7b254cfa5cf87ba4dd7e42f0659314acc70de7b319951acf0ed615e19a
7
+ data.tar.gz: 1842897fba7ae53915db54f91104fa73c71ac1fd2a4390b9fdb72779fa87d858f330ef153c57fbac6a129346c2c1fd3f41d2580222f37c40da05c240457966a1
data/README.md CHANGED
@@ -8,8 +8,8 @@ CKEditor is a WYSIWYG text editor designed to simplify web content creation. It
8
8
 
9
9
  ## Features
10
10
 
11
- * CKEditor version 4.6.2 full (12 Jan 2017)
12
- * Rails 5.0.x, 4.2.x integration
11
+ * CKEditor version 4.7.1 full (28 Jun 2017)
12
+ * Rails 5.0.x, 5.1.x, 4.2.x integration
13
13
  * Files browser
14
14
  * HTML5 file uploader
15
15
  * Hooks for formtastic and simple_form forms generators
@@ -194,7 +194,7 @@ When overriding the default `config.js` file, you must set all configuration opt
194
194
 
195
195
  ### Deployment (only if you use ckeditor from gem vendor)
196
196
 
197
- For Rails 4, add the following to `config/initializers/assets.rb`:
197
+ For Rails 4 and 5, add the following to `config/initializers/assets.rb`:
198
198
 
199
199
  ```ruby
200
200
  Rails.application.config.assets.precompile += %w( ckeditor/* )
@@ -267,10 +267,10 @@ Create a file app/assets/javascripts/init_ckeditor.coffee
267
267
  ```coffee
268
268
  ready = ->
269
269
  $('.ckeditor').each ->
270
- CKEDITOR.replace $(this).attr('id')
270
+ CKEDITOR.replace $(this).attr('id')
271
271
 
272
272
  $(document).ready(ready)
273
- $(document).on('page:load', ready) } }
273
+ $(document).on('page:load', ready)
274
274
  ```
275
275
  Make sure the file is loaded from your app/assets/javascripts/application.js
276
276
 
@@ -26,7 +26,7 @@ CKEDITOR.editorConfig = function( config )
26
26
  config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
27
27
 
28
28
  // The location of a script that handles file uploads in the Image dialog.
29
- config.filebrowserImageUploadUrl = "/ckeditor/pictures";
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";
@@ -127,6 +127,46 @@ img {
127
127
  text-decoration: underline;
128
128
  }
129
129
 
130
- .pagination, .pagination a {
131
- text-decoration: none;
130
+ .pagination {
131
+ margin: 0;
132
+ padding: 0;
133
+ border: 0;
134
+ font-weight: inherit;
135
+ font-style: inherit;
136
+ height: 40px;
137
+ text-align: center;
138
+ vertical-align: middle;
139
+ }
140
+
141
+ .pagination a {
142
+ height: 40px;
143
+ width: 50%;
144
+ padding-right: 5px;
145
+ padding-left: 5px;
146
+ text-decoration: none;
147
+
148
+ background: #f8f8f8;
149
+ border-color: #f5c002;
150
+ color: #000;
151
+
152
+ position: relative;
153
+ display: inline-block;
154
+ vertical-align: middle;
155
+ line-height: 40px;
156
+ font-weight: 400;
157
+ font-size: 13px;
158
+
159
+ padding: 0 20px;
160
+
161
+ box-sizing: border-box;
162
+ border: 1px solid #bcbcbc;
163
+ -webkit-border-radius: 2px;
164
+ -moz-border-radius: 2px;
165
+ -ms-border-radius: 2px;
166
+ -o-border-radius: 2px;
167
+ border-radius: 2px;
168
+ }
169
+
170
+ .pagination a:hover {
171
+ background: #fff;
132
172
  }
@@ -1,5 +1,5 @@
1
1
  class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
2
- skip_before_action :verify_authenticity_token, only: :create
2
+ skip_before_action :verify_authenticity_token, only: :create, raise: false
3
3
 
4
4
  def index
5
5
  @attachments = Ckeditor.attachment_file_adapter.find_all(ckeditor_attachment_files_scope)
@@ -1,5 +1,5 @@
1
1
  class Ckeditor::PicturesController < Ckeditor::ApplicationController
2
- skip_before_action :verify_authenticity_token, only: :create
2
+ skip_before_action :verify_authenticity_token, only: :create, raise: false
3
3
 
4
4
  def index
5
5
  @pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope)
@@ -1,11 +1,2 @@
1
1
  module Ckeditor::ApplicationHelper
2
- def assets_pipeline_enabled?
3
- if Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('4.0.0')
4
- defined?(Sprockets::Rails)
5
- elsif Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('3.0.0')
6
- Rails.application.config.assets.enabled
7
- else
8
- false
9
- end
10
- end
11
- end
2
+ end
@@ -11,7 +11,7 @@
11
11
 
12
12
  <% unless @attachments.last_page? %>
13
13
  <div class="pagination">
14
- <%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.attachment_files_path(params.merge(page: @attachments.next_page)), class: "next", rel: "next" %>
14
+ <%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.attachment_files_path(page: @attachments.next_page), class: "next", rel: "next" %>
15
15
  </div>
16
16
  <% end -%>
17
17
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  <% unless @pictures.last_page? %>
13
13
  <div class="pagination">
14
- <%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.pictures_path(params.merge(page: @pictures.next_page)), class: "next", rel: "next" %>
14
+ <%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.pictures_path(page: @pictures.next_page), class: "next", rel: "next" %>
15
15
  </div>
16
16
  <% end -%>
17
17
 
@@ -7,7 +7,7 @@
7
7
  <title><%= I18n.t('page_title', scope: [:ckeditor]) %></title>
8
8
  <script src="//code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
9
9
 
10
- <% if assets_pipeline_enabled? -%>
10
+ <% if Ckeditor.assets_pipeline_enabled? -%>
11
11
  <%= stylesheet_link_tag "ckeditor/application" %>
12
12
  <%= javascript_include_tag "ckeditor/application" %>
13
13
  <% else -%>
@@ -28,7 +28,7 @@ module Ckeditor
28
28
  autoload :Refile, 'ckeditor/backend/refile'
29
29
  end
30
30
 
31
- IMAGE_TYPES = %w(image/jpeg image/png image/gif image/jpg image/pjpeg image/tiff image/x-png).freeze
31
+ IMAGE_TYPES = %w[image/jpeg image/png image/gif image/jpg image/pjpeg image/tiff image/x-png].freeze
32
32
 
33
33
  DEFAULT_AUTHORIZE = -> {}
34
34
 
@@ -41,17 +41,17 @@ module Ckeditor
41
41
  # Allowed image file types for upload.
42
42
  # Set to nil or [] (empty array) for all file types
43
43
  mattr_accessor :image_file_types
44
- @@image_file_types = %w(jpg jpeg png gif tiff)
44
+ @@image_file_types = %w[jpg jpeg png gif tiff]
45
45
 
46
46
  # Allowed flash file types for upload.
47
47
  # Set to nil or [] (empty array) for all file types
48
48
  mattr_accessor :flash_file_types
49
- @@flash_file_types = %w(swf)
49
+ @@flash_file_types = %w[swf]
50
50
 
51
51
  # Allowed attachment file types for upload.
52
52
  # Set to nil or [] (empty array) for all file types
53
53
  mattr_accessor :attachment_file_types
54
- @@attachment_file_types = %w(doc docx xls odt ods pdf rar zip tar tar.gz swf)
54
+ @@attachment_file_types = %w[doc docx xls odt ods pdf rar zip tar tar.gz swf]
55
55
 
56
56
  # Ckeditor files destination path
57
57
  mattr_accessor :relative_path
@@ -65,10 +65,6 @@ module Ckeditor
65
65
  mattr_accessor :run_on_precompile
66
66
  @@run_on_precompile = true
67
67
 
68
- # Turn on/off filename parameterize
69
- mattr_accessor :parameterize_filenames
70
- @@parameterize_filenames = true
71
-
72
68
  # Paginate assets
73
69
  mattr_accessor :default_per_page
74
70
  @@default_per_page = 24
@@ -99,12 +95,17 @@ module Ckeditor
99
95
  mattr_accessor :controller_layout
100
96
  @@controller_layout = 'ckeditor/application'
101
97
 
98
+ # Turn on/off assets pipeline
99
+ # By default ckeditor will check assets pipeline
100
+ mattr_accessor :assets_pipeline_enabled
101
+ @@assets_pipeline_enabled = nil
102
+
102
103
  # Default way to setup Ckeditor. Run rails generate ckeditor to create
103
104
  # a fresh initializer with all configuration values.
104
105
  #
105
106
  # @example
106
107
  # Ckeditor.setup do |config|
107
- # config.parameterize_filenames = false
108
+ # config.default_per_page = 30
108
109
  # config.attachment_file_types += ["xml"]
109
110
  # end
110
111
  #
@@ -237,6 +238,11 @@ module Ckeditor
237
238
  @current_user = block if block_given?
238
239
  @current_user || DEFAULT_CURRENT_USER
239
240
  end
241
+
242
+ def self.assets_pipeline_enabled?
243
+ @@assets_pipeline_enabled = Utils.assets_pipeline_enabled? if @@assets_pipeline_enabled.nil?
244
+ @@assets_pipeline_enabled
245
+ end
240
246
  end
241
247
 
242
248
  require 'ckeditor/rails'
@@ -7,6 +7,7 @@ module Ckeditor
7
7
  include ActionView::Helpers::JavaScriptHelper
8
8
 
9
9
  FUNCTION = 'window.parent.CKEDITOR.tools.callFunction'.freeze
10
+ JSON_TYPE = 'json'.freeze
10
11
 
11
12
  attr_reader :asset, :params
12
13
 
@@ -19,7 +20,7 @@ module Ckeditor
19
20
  end
20
21
 
21
22
  def json?
22
- params[:responseType] == 'json'
23
+ params[:responseType] == JSON_TYPE
23
24
  end
24
25
 
25
26
  def ckeditor?
@@ -1,7 +1,7 @@
1
1
  module Ckeditor
2
2
  module Backend
3
3
  module Dragonfly
4
- FORMATS = %w(bz2 gz lzma xz).freeze
4
+ FORMATS = %w[bz2 gz lzma xz].freeze
5
5
 
6
6
  def self.included(base)
7
7
  base.send(:extend, ::Dragonfly::Model)
@@ -28,7 +28,7 @@ module Ckeditor
28
28
  end
29
29
 
30
30
  module InstanceMethods
31
- delegate :url, :path, :size, :image?, :width, :height, to: :data
31
+ delegate :url, :path, :image?, :width, :height, to: :data
32
32
 
33
33
  alias_attribute :data_file_name, :data_name
34
34
  alias_attribute :data_content_type, :"data.mime_type"
@@ -10,9 +10,9 @@ module Ckeditor
10
10
  def self.extended(base)
11
11
  base.class_eval do
12
12
  before_validation :extract_content_type
13
- before_create :extract_dimensions, :parameterize_filename
13
+ before_create :extract_dimensions
14
14
 
15
- delegate :url, :path, :styles, :size, :content_type, to: :data
15
+ delegate :url, :path, :styles, :content_type, to: :data
16
16
  end
17
17
  end
18
18
  end
@@ -28,13 +28,6 @@ module Ckeditor
28
28
  @file ||= data.respond_to?(:queued_for_write) ? data.queued_for_write[:original] : data.to_file
29
29
  end
30
30
 
31
- def parameterize_filename
32
- unless data_file_name.blank?
33
- filename = Ckeditor::Utils.parameterize_filename(data_file_name)
34
- data.instance_write(:file_name, filename)
35
- end
36
- end
37
-
38
31
  def extract_dimensions
39
32
  if image? && has_dimensions?
40
33
  self.width = geometry.width
@@ -5,7 +5,7 @@ module Ckeditor
5
5
 
6
6
  included do
7
7
  validates :data, presence: true
8
- delegate :rewind, :download, :to_io, :exists?, :delete, :size, :close, :eof?, :read, to: :data
8
+ delegate :rewind, :download, :to_io, :exists?, :delete, :close, :eof?, :read, to: :data
9
9
  alias_attribute :data_file_name, :data_filename
10
10
  alias_attribute :data_file_size, :data_size
11
11
  end
@@ -22,7 +22,7 @@ module Ckeditor
22
22
  end
23
23
 
24
24
  def ckeditor_filebrowser_scope(options = {})
25
- { order: [:id, :desc] }.merge(options)
25
+ { order: [:id, :desc] }.merge!(options)
26
26
  end
27
27
  end
28
28
  end
@@ -39,7 +39,7 @@ module Ckeditor
39
39
  options = {
40
40
  methods: as_json_methods,
41
41
  root: 'asset'
42
- }.merge(options || {})
42
+ }.merge!(options || {})
43
43
 
44
44
  super(options)
45
45
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+
2
3
  require 'active_support/json/encoding'
3
4
 
4
5
  module Ckeditor
@@ -8,16 +9,7 @@ module Ckeditor
8
9
 
9
10
  class << self
10
11
  def escape_single_quotes(str)
11
- str.gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
12
- end
13
-
14
- def parameterize_filename(filename)
15
- return filename unless Ckeditor.parameterize_filenames
16
-
17
- extension = File.extname(filename)
18
- basename = filename.gsub(/#{extension}$/, '')
19
-
20
- [basename.parameterize('_'), extension].join.downcase
12
+ str.gsub('\\', '\0\0').gsub('</', '<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
21
13
  end
22
14
 
23
15
  def js_replace(dom_id, options = nil)
@@ -41,7 +33,7 @@ module Ckeditor
41
33
  end
42
34
 
43
35
  def js_fileuploader(uploader_type, options = {})
44
- options = { multiple: true, element: 'fileupload' }.merge(options)
36
+ options = { multiple: true, element: 'fileupload' }.merge!(options)
45
37
 
46
38
  case uploader_type.to_s.downcase
47
39
  when 'image' then
@@ -71,6 +63,16 @@ module Ckeditor
71
63
  File.join(Ckeditor.relative_path, 'filebrowser/thumbs', image)
72
64
  end
73
65
 
66
+ def assets_pipeline_enabled?
67
+ if Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('4.0.0')
68
+ defined?(Sprockets::Rails)
69
+ elsif Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('3.0.0')
70
+ Rails.application.config.assets.enabled
71
+ else
72
+ false
73
+ end
74
+ end
75
+
74
76
  def select_assets(path, relative_path)
75
77
  relative_folder = Ckeditor.root_path.join(relative_path)
76
78
  folder = relative_folder.join(path)
@@ -1,6 +1,6 @@
1
1
  module Ckeditor
2
2
  module Version
3
- GEM = '4.2.3'.freeze
4
- EDITOR = '4.6.2'.freeze
3
+ GEM = '4.2.4'.freeze
4
+ EDITOR = '4.7.1'.freeze
5
5
  end
6
6
  end
@@ -1,7 +1,7 @@
1
1
  class Ckeditor::Asset
2
2
  include Ckeditor::Orm::Mongoid::AssetBase
3
3
 
4
- delegate :url, :current_path, :size, :content_type, :filename, to: :data
4
+ delegate :url, :current_path, :content_type, to: :data
5
5
 
6
6
  validates :data, presence: true
7
7
  end
@@ -5,15 +5,10 @@ class AttachmentFileTest < ActiveSupport::TestCase
5
5
  @attachment.destroy rescue nil
6
6
  end
7
7
 
8
- test "Set file content_type and size" do
8
+ test 'Set file content_type and size' do
9
9
  @attachment = create_attachment
10
10
 
11
- # TODO: fix filename parameterization
12
- if CKEDITOR_BACKEND == :paperclip
13
- assert_equal "rails_tar.gz", @attachment.data_file_name
14
- else
15
- assert_equal "rails.tar.gz", @attachment.data_file_name
16
- end
11
+ assert_equal "rails.tar.gz", @attachment.data_file_name
17
12
 
18
13
  assert_match /application\/(x-)?gzip/, @attachment.data_content_type
19
14
  assert_equal 6823, @attachment.data_file_size
@@ -0,0 +1,5 @@
1
+ class Ckeditor::Asset
2
+ include Ckeditor::Orm::Mongoid::AssetBase
3
+ include Mongoid::Paperclip
4
+ include Ckeditor::Backend::Paperclip
5
+ end
@@ -0,0 +1,13 @@
1
+ class Ckeditor::AttachmentFile < Ckeditor::Asset
2
+ has_mongoid_attached_file :data,
3
+ url: '/ckeditor_assets/attachments/:id/:filename',
4
+ path: ':rails_root/public/ckeditor_assets/attachments/:id/:filename'
5
+
6
+ validates_attachment_presence :data
7
+ validates_attachment_size :data, less_than: 100.megabytes
8
+ do_not_validate_attachment_file_type :data
9
+
10
+ def url_thumb
11
+ @url_thumb ||= Ckeditor::Utils.filethumb(filename)
12
+ end
13
+ end