ckeditor_rails 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +19 -0
- data/README.md +68 -0
- data/Rakefile +12 -0
- data/ckeditor-rails.gemspec +22 -0
- data/lib/ckeditor-rails.rb +11 -0
- data/lib/ckeditor-rails/engine.rb +9 -0
- data/lib/ckeditor-rails/railtie.rb +9 -0
- data/lib/ckeditor-rails/source_file.rb +128 -0
- data/lib/ckeditor-rails/version.rb +6 -0
- data/vendor/assets/images/ckeditor/images/spacer.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/icons.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/mini.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/noimage.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/sprites.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/vendor/assets/images/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/icons.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/icons_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/mini.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/noimage.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/sprites.png +0 -0
- data/vendor/assets/images/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/icons.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/icons_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/mini.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/noimage.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/sprites.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
- data/vendor/assets/images/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
- data/vendor/assets/javascripts/ckeditor-jquery.js +3 -0
- data/vendor/assets/javascripts/ckeditor/LICENSE.html +1327 -0
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +6 -0
- data/vendor/assets/javascripts/ckeditor/basepath.js +1 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +149 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +8 -0
- data/vendor/assets/javascripts/ckeditor/config.js +11 -0
- data/vendor/assets/javascripts/ckeditor/lang/_languages.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +61 -0
- data/vendor/assets/javascripts/ckeditor/lang/af.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/da.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/el.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/es.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/et.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/he.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/is.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/km.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/th.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +76 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +7 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +6 -0
- data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +8 -0
- data/vendor/assets/stylesheets/ckeditor/contents.css +25 -0
- data/vendor/assets/stylesheets/ckeditor/skins/kama/dialog.css +10 -0
- data/vendor/assets/stylesheets/ckeditor/skins/kama/editor.css +13 -0
- data/vendor/assets/stylesheets/ckeditor/skins/kama/templates.css +6 -0
- data/vendor/assets/stylesheets/ckeditor/skins/office2003/dialog.css +9 -0
- data/vendor/assets/stylesheets/ckeditor/skins/office2003/editor.css +14 -0
- data/vendor/assets/stylesheets/ckeditor/skins/office2003/templates.css +6 -0
- data/vendor/assets/stylesheets/ckeditor/skins/v2/dialog.css +9 -0
- data/vendor/assets/stylesheets/ckeditor/skins/v2/editor.css +13 -0
- data/vendor/assets/stylesheets/ckeditor/skins/v2/templates.css +6 -0
- metadata +357 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
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.
|
data/README.md
ADDED
@@ -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.
|
data/Rakefile
ADDED
@@ -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,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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|