ckeditor_rails 3.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +19 -0
  4. data/README.md +68 -0
  5. data/Rakefile +12 -0
  6. data/ckeditor-rails.gemspec +22 -0
  7. data/lib/ckeditor-rails.rb +11 -0
  8. data/lib/ckeditor-rails/engine.rb +9 -0
  9. data/lib/ckeditor-rails/railtie.rb +9 -0
  10. data/lib/ckeditor-rails/source_file.rb +128 -0
  11. data/lib/ckeditor-rails/version.rb +6 -0
  12. data/vendor/assets/images/ckeditor/images/spacer.gif +0 -0
  13. data/vendor/assets/images/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  14. data/vendor/assets/images/ckeditor/plugins/flash/images/placeholder.png +0 -0
  15. data/vendor/assets/images/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
  16. data/vendor/assets/images/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  17. data/vendor/assets/images/ckeditor/plugins/link/images/anchor.gif +0 -0
  18. data/vendor/assets/images/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  19. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  20. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  21. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  22. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  23. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  24. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  25. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  26. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  27. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  28. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  29. data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  30. data/vendor/assets/images/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  31. data/vendor/assets/images/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  32. data/vendor/assets/images/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  33. data/vendor/assets/images/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  34. data/vendor/assets/images/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  35. data/vendor/assets/images/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  36. data/vendor/assets/images/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  37. data/vendor/assets/images/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  38. data/vendor/assets/images/ckeditor/plugins/smiley/images/heart.gif +0 -0
  39. data/vendor/assets/images/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  40. data/vendor/assets/images/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  41. data/vendor/assets/images/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  42. data/vendor/assets/images/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  43. data/vendor/assets/images/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  44. data/vendor/assets/images/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  45. data/vendor/assets/images/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  46. data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  47. data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  48. data/vendor/assets/images/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  49. data/vendor/assets/images/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  50. data/vendor/assets/images/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  51. data/vendor/assets/images/ckeditor/skins/kama/icons.png +0 -0
  52. data/vendor/assets/images/ckeditor/skins/kama/icons_rtl.png +0 -0
  53. data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  54. data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  55. data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  56. data/vendor/assets/images/ckeditor/skins/kama/images/mini.gif +0 -0
  57. data/vendor/assets/images/ckeditor/skins/kama/images/noimage.png +0 -0
  58. data/vendor/assets/images/ckeditor/skins/kama/images/sprites.png +0 -0
  59. data/vendor/assets/images/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  60. data/vendor/assets/images/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  61. data/vendor/assets/images/ckeditor/skins/office2003/icons.png +0 -0
  62. data/vendor/assets/images/ckeditor/skins/office2003/icons_rtl.png +0 -0
  63. data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  64. data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  65. data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  66. data/vendor/assets/images/ckeditor/skins/office2003/images/mini.gif +0 -0
  67. data/vendor/assets/images/ckeditor/skins/office2003/images/noimage.png +0 -0
  68. data/vendor/assets/images/ckeditor/skins/office2003/images/sprites.png +0 -0
  69. data/vendor/assets/images/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  70. data/vendor/assets/images/ckeditor/skins/v2/icons.png +0 -0
  71. data/vendor/assets/images/ckeditor/skins/v2/icons_rtl.png +0 -0
  72. data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  73. data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  74. data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  75. data/vendor/assets/images/ckeditor/skins/v2/images/mini.gif +0 -0
  76. data/vendor/assets/images/ckeditor/skins/v2/images/noimage.png +0 -0
  77. data/vendor/assets/images/ckeditor/skins/v2/images/sprites.png +0 -0
  78. data/vendor/assets/images/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  79. data/vendor/assets/images/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  80. data/vendor/assets/javascripts/ckeditor-jquery.js +3 -0
  81. data/vendor/assets/javascripts/ckeditor/LICENSE.html +1327 -0
  82. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +6 -0
  83. data/vendor/assets/javascripts/ckeditor/basepath.js +1 -0
  84. data/vendor/assets/javascripts/ckeditor/ckeditor.js +149 -0
  85. data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +8 -0
  86. data/vendor/assets/javascripts/ckeditor/config.js +11 -0
  87. data/vendor/assets/javascripts/ckeditor/lang/_languages.js +6 -0
  88. data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +61 -0
  89. data/vendor/assets/javascripts/ckeditor/lang/af.js +6 -0
  90. data/vendor/assets/javascripts/ckeditor/lang/ar.js +6 -0
  91. data/vendor/assets/javascripts/ckeditor/lang/bg.js +6 -0
  92. data/vendor/assets/javascripts/ckeditor/lang/bn.js +6 -0
  93. data/vendor/assets/javascripts/ckeditor/lang/bs.js +6 -0
  94. data/vendor/assets/javascripts/ckeditor/lang/ca.js +6 -0
  95. data/vendor/assets/javascripts/ckeditor/lang/cs.js +6 -0
  96. data/vendor/assets/javascripts/ckeditor/lang/cy.js +6 -0
  97. data/vendor/assets/javascripts/ckeditor/lang/da.js +6 -0
  98. data/vendor/assets/javascripts/ckeditor/lang/de.js +6 -0
  99. data/vendor/assets/javascripts/ckeditor/lang/el.js +6 -0
  100. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +6 -0
  101. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +6 -0
  102. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +6 -0
  103. data/vendor/assets/javascripts/ckeditor/lang/en.js +6 -0
  104. data/vendor/assets/javascripts/ckeditor/lang/eo.js +6 -0
  105. data/vendor/assets/javascripts/ckeditor/lang/es.js +6 -0
  106. data/vendor/assets/javascripts/ckeditor/lang/et.js +6 -0
  107. data/vendor/assets/javascripts/ckeditor/lang/eu.js +6 -0
  108. data/vendor/assets/javascripts/ckeditor/lang/fa.js +6 -0
  109. data/vendor/assets/javascripts/ckeditor/lang/fi.js +6 -0
  110. data/vendor/assets/javascripts/ckeditor/lang/fo.js +6 -0
  111. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +6 -0
  112. data/vendor/assets/javascripts/ckeditor/lang/fr.js +6 -0
  113. data/vendor/assets/javascripts/ckeditor/lang/gl.js +6 -0
  114. data/vendor/assets/javascripts/ckeditor/lang/gu.js +6 -0
  115. data/vendor/assets/javascripts/ckeditor/lang/he.js +6 -0
  116. data/vendor/assets/javascripts/ckeditor/lang/hi.js +6 -0
  117. data/vendor/assets/javascripts/ckeditor/lang/hr.js +6 -0
  118. data/vendor/assets/javascripts/ckeditor/lang/hu.js +6 -0
  119. data/vendor/assets/javascripts/ckeditor/lang/is.js +6 -0
  120. data/vendor/assets/javascripts/ckeditor/lang/it.js +6 -0
  121. data/vendor/assets/javascripts/ckeditor/lang/ja.js +6 -0
  122. data/vendor/assets/javascripts/ckeditor/lang/ka.js +6 -0
  123. data/vendor/assets/javascripts/ckeditor/lang/km.js +6 -0
  124. data/vendor/assets/javascripts/ckeditor/lang/ko.js +6 -0
  125. data/vendor/assets/javascripts/ckeditor/lang/lt.js +6 -0
  126. data/vendor/assets/javascripts/ckeditor/lang/lv.js +6 -0
  127. data/vendor/assets/javascripts/ckeditor/lang/mn.js +6 -0
  128. data/vendor/assets/javascripts/ckeditor/lang/ms.js +6 -0
  129. data/vendor/assets/javascripts/ckeditor/lang/nb.js +6 -0
  130. data/vendor/assets/javascripts/ckeditor/lang/nl.js +6 -0
  131. data/vendor/assets/javascripts/ckeditor/lang/no.js +6 -0
  132. data/vendor/assets/javascripts/ckeditor/lang/pl.js +6 -0
  133. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +6 -0
  134. data/vendor/assets/javascripts/ckeditor/lang/pt.js +6 -0
  135. data/vendor/assets/javascripts/ckeditor/lang/ro.js +6 -0
  136. data/vendor/assets/javascripts/ckeditor/lang/ru.js +6 -0
  137. data/vendor/assets/javascripts/ckeditor/lang/sk.js +6 -0
  138. data/vendor/assets/javascripts/ckeditor/lang/sl.js +6 -0
  139. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +6 -0
  140. data/vendor/assets/javascripts/ckeditor/lang/sr.js +6 -0
  141. data/vendor/assets/javascripts/ckeditor/lang/sv.js +6 -0
  142. data/vendor/assets/javascripts/ckeditor/lang/th.js +6 -0
  143. data/vendor/assets/javascripts/ckeditor/lang/tr.js +6 -0
  144. data/vendor/assets/javascripts/ckeditor/lang/uk.js +6 -0
  145. data/vendor/assets/javascripts/ckeditor/lang/vi.js +6 -0
  146. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +6 -0
  147. data/vendor/assets/javascripts/ckeditor/lang/zh.js +6 -0
  148. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
  149. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
  150. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +6 -0
  151. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
  152. data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +6 -0
  153. data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +6 -0
  154. data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +6 -0
  155. data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +9 -0
  156. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
  157. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +7 -0
  158. data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +6 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +6 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  161. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +8 -0
  162. data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +6 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +10 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +9 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +6 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +6 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +6 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +9 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +6 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +6 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +13 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +6 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +12 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +11 -0
  181. data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
  182. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +6 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +6 -0
  184. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +6 -0
  185. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
  186. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +6 -0
  187. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +8 -0
  188. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
  189. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
  190. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
  191. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +6 -0
  192. data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +6 -0
  193. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
  194. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +9 -0
  195. data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +7 -0
  196. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
  197. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +7 -0
  198. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
  199. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  200. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  201. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  202. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
  203. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +6 -0
  204. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +6 -0
  205. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +6 -0
  206. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  207. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  208. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  209. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  210. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  211. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
  212. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +76 -0
  213. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  214. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  215. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
  216. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
  217. data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +6 -0
  218. data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +7 -0
  219. data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +6 -0
  220. data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +6 -0
  221. data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +8 -0
  222. data/vendor/assets/stylesheets/ckeditor/contents.css +25 -0
  223. data/vendor/assets/stylesheets/ckeditor/skins/kama/dialog.css +10 -0
  224. data/vendor/assets/stylesheets/ckeditor/skins/kama/editor.css +13 -0
  225. data/vendor/assets/stylesheets/ckeditor/skins/kama/templates.css +6 -0
  226. data/vendor/assets/stylesheets/ckeditor/skins/office2003/dialog.css +9 -0
  227. data/vendor/assets/stylesheets/ckeditor/skins/office2003/editor.css +14 -0
  228. data/vendor/assets/stylesheets/ckeditor/skins/office2003/templates.css +6 -0
  229. data/vendor/assets/stylesheets/ckeditor/skins/v2/dialog.css +9 -0
  230. data/vendor/assets/stylesheets/ckeditor/skins/v2/editor.css +13 -0
  231. data/vendor/assets/stylesheets/ckeditor/skins/v2/templates.css +6 -0
  232. metadata +357 -0
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ckeditor-rails.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 by Tse-Ching Ho
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,68 @@
1
+ # Chosen for rails asset pipeline
2
+
3
+ [CKEditor](http://ckeditor.com/) is a library for WYSIWYG editor to be used inside web pages.
4
+
5
+ The `ckeditor-rails` gem integrates the `CKEditor` with the Rails asset pipeline.
6
+
7
+ ## Usage
8
+
9
+ ### Install ckeditor-rails gem
10
+
11
+ Include `ckeditor-rails` in Gemefile
12
+
13
+ gem 'ckeditor-rails'
14
+
15
+ Then run `bundle install`
16
+
17
+ ### Include CKEditor javascript assets
18
+
19
+ Add to your `app/assets/stylesheets/application.js` after `//= require jquery_ujs` to work with jQuery
20
+
21
+ //= require ckeditor-jquery
22
+
23
+ ### Modify form field for CKEditor
24
+
25
+ Add `ckeditor` class to text area tag
26
+
27
+ <%= f.text_area :content, :class => 'ckeditor' %>
28
+
29
+ ### Include customized configuration javascript for CKEditor
30
+
31
+ Add your `app/assets/javascripts/ckeditor/config.js.coffee` like
32
+
33
+ CKEDITOR.editorConfig = (config) ->
34
+ config.language = "zh"
35
+ config.uiColor = "#AADC6E"
36
+ true
37
+
38
+ ### Include customized stylesheet for contents of CKEditor
39
+
40
+ Add your `app/assets/stylesheets/ckeditor/contents.css.scss` like
41
+
42
+ body {
43
+ font-size: 14px;
44
+ color: gray;
45
+ background-color: yellow;
46
+ }
47
+ ol,ul,dl {
48
+ *margin-right:0px;
49
+ padding:4 20px;
50
+ }
51
+
52
+ ## Gem maintainance
53
+
54
+ Maintain `ckeditor-rails` gem with `Rake` commands.
55
+
56
+ Update origin CKEditor source files.
57
+
58
+ rake update-ckeditor
59
+
60
+ Publish gem.
61
+
62
+ rake release
63
+
64
+ ## License
65
+
66
+ CKEditor use [CKEditor license](http://ckeditor.com/license).
67
+
68
+ Other parts of gem use MIT license.
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require File.expand_path('../lib/ckeditor-rails/source_file', __FILE__)
4
+
5
+ desc "Update CKEditor Library, VERSION is required."
6
+ task "update-ckeditor" do
7
+ files = SourceFile.new
8
+ files.fetch ENV['VERSION']
9
+ files.move
10
+ files.fix
11
+ files.cleanup
12
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/ckeditor-rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Tse-Ching Ho"]
6
+ gem.email = ["tsechingho@gmail.com"]
7
+ gem.description = %q{CKEditor is a javascript library of the WYSIWYG rich-text editor. This gem integrates CKEditor with Rails asset pipeline for easy of use.}
8
+ gem.summary = %q{Integrate CKEditor javascript library with Rails asset pipeline}
9
+ gem.homepage = "https://github.com/tsechingho/ckeditor-rails"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "ckeditor_rails"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Ckeditor::Rails::VERSION
17
+
18
+ gem.add_dependency "railties", "~> 3.0"
19
+ gem.add_dependency "thor", "~> 0.14"
20
+ gem.add_development_dependency "bundler", "~> 1.0"
21
+ gem.add_development_dependency "rails", "~> 3.0"
22
+ end
@@ -0,0 +1,11 @@
1
+ require "ckeditor-rails/version"
2
+
3
+ module Ckeditor
4
+ module Rails
5
+ if ::Rails.version < "3.1"
6
+ require "ckeditor-rails/railtie"
7
+ else
8
+ require "ckeditor-rails/engine"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Ckeditor
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ initializer "configure assets of ckeditor", :group => :all do |app|
5
+ app.config.assets.precompile += %w( ckeditor/*.js ckeditor/*.css )
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Ckeditor
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie
4
+ initializer "configure assets of ckeditor", :group => :all do |app|
5
+ app.config.assets.precompile += %w( ckeditor/*.js ckeditor/*.css )
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,128 @@
1
+ require "thor"
2
+
3
+ class SourceFile < Thor
4
+ include Thor::Actions
5
+ source_root 'tmp'
6
+
7
+ desc "fetch VERSION", "fetch source files from http://ckeditor.com/"
8
+ def fetch(version)
9
+ download_url = file_url(version)
10
+ extract_path = self.class.source_root
11
+ archive_file = "#{extract_path}/#{filename(version)}"
12
+
13
+ in_root do
14
+ say_status(" fetch", archive_file, :green)
15
+ get(download_url, archive_file)
16
+ if File.exist?(archive_file)
17
+ FileUtils.mkdir_p(extract_path)
18
+ extract(archive_file, extract_path)
19
+ FileUtils.rm_rf(archive_file)
20
+ end
21
+ end
22
+
23
+ inside "lib" do
24
+ gsub_file "ckeditor-rails/version.rb", /VERSION\s=\s"(\d|\.)+"$/ do |match|
25
+ %Q{VERSION = "#{version}"}
26
+ end
27
+ end if File.exist?(extract_path)
28
+ end
29
+
30
+ desc "move", "move source files to vendor/assets"
31
+ def move
32
+ self.destination_root = "vendor/assets"
33
+
34
+ copy_file "ckeditor/adapters/jquery.js", "javascripts/ckeditor/adapters/jquery.js"
35
+ copy_file "ckeditor/ckeditor.js", "javascripts/ckeditor/ckeditor.js"
36
+ copy_file "ckeditor/ckeditor_basic.js", "javascripts/ckeditor/ckeditor_basic.js"
37
+ copy_file "ckeditor/config.js", "javascripts/ckeditor/config.js"
38
+ copy_file "ckeditor/contents.css", "stylesheets/ckeditor/contents.css"
39
+
40
+ directory "ckeditor/images", "images/ckeditor/images"
41
+ directory "ckeditor/lang", "javascripts/ckeditor/lang"
42
+
43
+ copy_file "ckeditor/LICENSE.html", "javascripts/ckeditor/LICENSE.html"
44
+
45
+ directory "ckeditor/plugins", "javascripts/ckeditor/plugins"
46
+ move_image_files_of_plugins
47
+
48
+ copy_image_files_of_skin(%w{kama office2003 v2})
49
+
50
+ directory "ckeditor/themes", "javascripts/ckeditor/themes"
51
+ end
52
+
53
+ desc "fix", "fix some css caused precompile error"
54
+ def fix
55
+ self.destination_root = "vendor/assets"
56
+ inside destination_root do
57
+ skin_names = %w{kama office2003 v2}
58
+ skin_names.each do |name|
59
+ gsub_file "stylesheets/ckeditor/skins/#{name}/dialog.css", /\+margin/, "margin"
60
+ gsub_file "stylesheets/ckeditor/skins/#{name}/editor.css", /filter\:\;/, ""
61
+ end
62
+ gsub_file "stylesheets/ckeditor/skins/office2003/editor.css", /\!height\:28px\;\!line-height\:28px\;/, ""
63
+ end
64
+ end
65
+
66
+ desc "convert", "convert css to sass file by sass-convert"
67
+ def convert
68
+ self.destination_root = "vendor/assets"
69
+ inside destination_root do
70
+ skin_names = %w{kama office2003 v2}
71
+ skin_names.each do |name|
72
+ path = "stylesheets/ckeditor/skins/#{name}"
73
+ run("sass-convert -F css -T sass #{path}/dialog.css #{path}/dialog.css.sass")
74
+ run("sass-convert -F css -T sass #{path}/editor.css #{path}/editor.css.sass")
75
+ run("sass-convert -F css -T sass #{path}/templates.css #{path}/templates.css.sass")
76
+ remove_file "#{path}/dialog.css"
77
+ remove_file "#{path}/editor.css"
78
+ remove_file "#{path}/templates.css"
79
+ end
80
+ end
81
+ end
82
+
83
+ desc "clean", "clean up useless files"
84
+ def cleanup
85
+ self.destination_root = "vendor/assets"
86
+ FileUtils.rm_rf(self.class.source_root)
87
+ end
88
+
89
+ protected
90
+
91
+ def file_url(version)
92
+ "http://download.cksource.com/CKEditor/CKEditor/CKEditor%20#{version}/#{filename(version)}"
93
+ end
94
+
95
+ def filename(version)
96
+ "ckeditor_#{version}.tar.gz"
97
+ end
98
+
99
+ def extract(file_path, output_path)
100
+ system("tar --exclude=*.php --exclude=*.asp -C '#{output_path}' -xzf '#{file_path}' ckeditor")
101
+ end
102
+
103
+ def move_image_files_of_plugins
104
+ files = Dir.glob("#{destination_root}/javascripts/ckeditor/plugins/*/*/*")
105
+ files.each do |file|
106
+ if file =~ /\.(png|gif)$/
107
+ filename = file.sub("#{destination_root}/javascripts/", '')
108
+ destination_path = filename.sub(/\/\w+\.\w+$/, '')
109
+ in_root do
110
+ FileUtils.mkdir_p("#{destination_root}/images/#{destination_path}")
111
+ FileUtils.mv(file, "#{destination_root}/images/#{filename}")
112
+ end
113
+ end
114
+ end
115
+ end
116
+
117
+ def copy_image_files_of_skin(skin_names = %w{kama office2003 v2})
118
+ skin_names.each do |name|
119
+ copy_file "ckeditor/skins/#{name}/dialog.css", "stylesheets/ckeditor/skins/#{name}/dialog.css"
120
+ copy_file "ckeditor/skins/#{name}/editor.css", "stylesheets/ckeditor/skins/#{name}/editor.css"
121
+ copy_file "ckeditor/skins/#{name}/icons.png", "images/ckeditor/skins/#{name}/icons.png"
122
+ copy_file "ckeditor/skins/#{name}/icons_rtl.png", "images/ckeditor/skins/#{name}/icons_rtl.png"
123
+ directory "ckeditor/skins/#{name}/images", "images/ckeditor/skins/#{name}/images"
124
+ copy_file "ckeditor/skins/#{name}/skin.js", "javascripts/ckeditor/skins/#{name}/skin.js"
125
+ copy_file "ckeditor/skins/#{name}/templates.css", "stylesheets/ckeditor/skins/#{name}/templates.css"
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,6 @@
1
+ module Ckeditor
2
+ module Rails
3
+ VERSION = "3.6.2"
4
+ EDITOR_VERSION = "3.6.2"
5
+ end
6
+ end