Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e05cb24
Add support for rails 3
galetahub Apr 15, 2010
4e76ded
Rails 3.0.0.beta3 support
galetahub Apr 16, 2010
a681a0c
Remove init.rb and install.rb
galetahub Apr 16, 2010
180989b
Add models generators and middleware for swfupload
galetahub May 18, 2010
726093c
Fix asset thumb preview in views
galetahub May 18, 2010
42a59c6
Update ckeditor work with ajax
galetahub May 18, 2010
0fafdc6
Update readme
galetahub May 18, 2010
2c34e4b
Fix readme errors
galetahub May 18, 2010
c5c5db4
Escape session key with Rack::Utils
galetahub Jun 1, 2010
fad8075
Escape session key
galetahub Jun 1, 2010
7c06e57
Fix issue with ruby 1.9, make formtastic autoload
galetahub Jun 9, 2010
b236a95
Update ckeditor base to 3.3.1 version
galetahub Jun 15, 2010
4b4841a
Reorganize ckeditor generators (add namespace)
galetahub Jun 15, 2010
3882007
Add support to index fields, and reorganize options
galetahub Jun 15, 2010
98ba4a4
Bump plugin version to 3.2.5
galetahub Jun 15, 2010
48d8d06
Fix issue: CKEditor instance already exists
galetahub Jun 15, 2010
6b2f646
Add root element in json callback
galetahub Jun 15, 2010
595973d
Fix issue #16
galetahub Jul 21, 2010
b3fe3d0
Fix wrong url call
chipiga Jul 17, 2010
6740ad8
Fixed US-ASCII error in gemspec description
Jul 27, 2010
7acf783
Set to autoload ckeditor Middleware class
galetahub Aug 4, 2010
409154a
Merge branch 'rails3' of github.com:galetahub/rails-ckeditor into rails3
galetahub Aug 4, 2010
bb8ed24
Update ckeditor to version 3.4
galetahub Aug 20, 2010
2c7bcd1
Bump version pre
galetahub Aug 20, 2010
71347cd
The map block argument is redundant and triggers deprecation warnings…
threedaymonk Aug 31, 2010
be3d951
Load classes by ActiveSupport::Dependencies.ref
galetahub Aug 31, 2010
3113241
Add dependency on mime-types gem
galetahub Sep 2, 2010
b4465a7
Require mime/types in asset model
galetahub Sep 2, 2010
9fb3c74
Update readme
galetahub Sep 2, 2010
8e4c84d
Fix for "uninitialized constant ActiveSupport::Dependencies" bug.
Sep 25, 2010
86a5ed5
Upgrade ckeditor to version 3.4.1
galetahub Sep 28, 2010
51b7a75
Merge branch 'rails3' of github.com:galetahub/rails-ckeditor into rails3
galetahub Sep 28, 2010
ffb4026
Bump version
galetahub Sep 28, 2010
7ec2c8d
Autoload Utils module, thanks to
galetahub Oct 11, 2010
3ccf813
Autoload Utils module
galetahub Oct 18, 2010
6d5340a
Upgrade ckeditor to 3.4.2 version
galetahub Nov 5, 2010
68ca94d
Bump version to 3.4.3.pre
galetahub Nov 5, 2010
49cb3b6
Replace symbol to string during model_ref check to force it work in p…
chipiga Nov 19, 2010
2226125
New routes structure and parameterize assets file name
galetahub Dec 20, 2010
232d69e
Upgrade ckeditor core to version 3.5
galetahub Dec 20, 2010
ea46a8a
Bump plugin version
galetahub Dec 20, 2010
1fe333b
Move base_controller into ckeditor controllers folder
galetahub Dec 20, 2010
3a13792
Fix asset partial path
galetahub Dec 20, 2010
8c9f625
Fix type issue
galetahub Dec 20, 2010
d01be03
Require mime/types in asset model
galetahub Jan 10, 2011
9cacf3f
Fix IE8 addEvents bug
galetahub Jan 11, 2011
5d8dfe7
Merge branch 'rails3' of github.com:galetahub/rails-ckeditor into rails3
galetahub Mar 9, 2011
9aa99a6
Download and extract ckeditor
galetahub Mar 10, 2011
8a8fd23
Fix formtastic integration
galetahub Mar 10, 2011
d9ca2bb
Fix type error
galetahub Mar 10, 2011
784cb36
Add attachment and embed plugins
galetahub Mar 21, 2011
3ab7579
Fix file download for ruby 1.9.2 and bump version
galetahub Mar 21, 2011
3167c83
Do not include whole ActionView::Helpers module into CkEditor::ViewHe…
cryo28 Apr 16, 2011
384c885
Fix class variable existence for Ruby 1.9
Apr 23, 2011
4933f14
Merged pull request #66 from oruen/rails3.
galetahub Apr 25, 2011
a572f6f
Merged pull request #62 from cryo28/rails3.
galetahub Apr 25, 2011
59ea16b
Fixed issue undefined method 'ckeditor_attachment_file_path'
galetahub May 1, 2011
38158b5
Rename view folder
galetahub May 1, 2011
bd1ab52
Regenerate gemspec
galetahub May 1, 2011
31aad79
Unencode session key in middleware
galetahub May 25, 2011
927dbce
Bump version
galetahub May 25, 2011
f93cb47
Bump version
galetahub May 25, 2011
9b855cd
* value is stripped from options. that's not correct. this patch kee…
May 30, 2011
de45846
* new options feature: ckeditor_options, to override much more optio…
May 30, 2011
f83d1bb
* documentation for ckeditor_options feature
May 30, 2011
c2fbcca
Merge pull request #75 from acesuares/rails3
galetahub Jun 2, 2011
2d71efe
Allow filebrowser urls to be overwritten.
oruen Jun 24, 2011
8d955f2
Merge pull request #83 from oruen/rails3_filebrowser_override
galetahub Jul 2, 2011
601ba78
Add locale pt-BR
jacksonpires Jul 10, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
pkg
16 changes: 0 additions & 16 deletions LICENSE

This file was deleted.

166 changes: 166 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
= Rails CKEditor integration plugin with SWFUpload support

CKEditor is a text editor to be used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to
the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice.

Because CKEditor is licensed under flexible Open Source and commercial licenses, you'll be able to integrate and use it inside any kind of application.
This is the ideal editor for developers, created to provide easy and powerful solutions to their users.

CKEditor version: any (http://ckeditor.com/download/releases)

SWFUpload version: 2.2.0.1 Core (http://swfupload.org)

Rails version: 3.x

Demo appication (Rails 2.3.8):
http://github.com/galetahub/rails-ckeditor-demo-app

Demo appication (Rails 3.x):
http://github.com/galetahub/ckeditor-demo-app

== Install

=== Rails 3

In your appication "Gemfile":

gem 'ckeditor'

or
gem 'ckeditor', :git => 'git://github.com/galetahub/rails-ckeditor.git', :branch => 'rails3'

Next step is download ckeditor core files and generate configuration file
Check "config/initializers/ckeditor.rb" for more configuration options:

rails generate ckeditor:base

You can pass version of ckeditor to download (http://ckeditor.com/download/releases):

rails generate ckeditor:base --version=3.5.4

Generate ckeditor models for file upload support:
For paperclip:

rails generate ckeditor:migration

For attachment_fu:

rails generate ckeditor:migration --backend=attachment_fu

Don't forget about migration:

rake db:migrate

== Usage

Basically include this in the page you wish to use the editor in:

<%= javascript_include_tag :ckeditor %>

Then instead of the normal textarea helper from Rails use this one:

<%= ckeditor_textarea("object", "field", :width => '100%', :height => '200px') %>

FormBuilder helper for more usefully:

<%= form_for @page do |form| -%>
...
<%= form.cktext_area :notes, :toolbar=>'Full', :width=>'400px', :height=>'200px' %>
...
<%= form.cktext_area :content, :swf_params=>{:assetable_type=>'User', :assetable_id=>current_user.id} %>
...
<% end -%>

=== Support options

:cols # Textarea cols (default: 70)
:rows # Textarea rows (default: 20)
:width # Editor width (default: 100%)
:height # Editor height (default: 100%)
:class # Textarea css class name
:toolbar # Toolbar name
:skin # Editor skin
:language # Editor language (default: I18n.locale)
:swf_params # SWFUpload additional params (Hash)
:id # textarea DOM element id
:index # element id index
:ckeditor_options => {} # all configurable options for ckeditor, check the ckeditor API.
# these will override width, height, toolbar, skin, and language if you define them here.

For configure ckeditor default options check:

public/javascripts/ckeditor/config.js

This stylesheet use editor for displaying edit area:

public/javascripts/ckeditor/contents.css

=== AJAX

To use a remote form you need to call "ckeditor_ajax_script" helper method:

<%= form_for @page, :remote => true do |form| -%>
<%= form.cktext_area("note", "content") %>
...
<%= form.cktext_area("note", "about") %>
...
<%= ckeditor_ajax_script %>
...
<%= form.submit "Save" %>
<% end %>

Helper "ckeditor_ajax_script" generate next script (jquery):

<script type='text/javascript' charset='UTF-8'>
$(document).ready(function(){
$('form[data-remote]').bind("ajax:before", function(){
for (instance in CKEDITOR.instances){
CKEDITOR.instances[instance].updateElement();
}
});
});
</script>

== File uploads

We recommend using a paperclip plugin for file storage and processing images. Controller @../rails-ckeditor/app/controllers/ckeditor_controller.rb@ has actions
for displaying and uploading files. It uses classes Picture and AttachmentFile, who are descendants of the Asset class. So, your project must have these classes.

http://github.com/thoughtbot/paperclip

For S3 storage look at "../ckeditor/examples/s3"

== Formtastic integration

<%= form.input :content, :as => :ckeditor %>
<%= form.input :content, :as => :ckeditor, :input_html => { :height => 400, :swf_params => { ... } } %>

== SimpleForm integration

<%= form.ckeditor :content, :label => false, :input_html => { :height => 400, :toolbar=>'Full' } %>

== Middleware

Ckeditor appends middleware ("Ckeditor::Middleware") before session store to
support swf upload with AuthenticityToken.

rake middleware

== I18n

en:
ckeditor:
page_title: "CKEditor Files Manager"
upload_files: "Upload New Files"
buttons:
cancel: "Cancel"
refresh:
title: "Refresh"
hint: "Refresh page"
upload:
title: "Upload"
hint: "Upload New File"

== TODOs

1. HTML5 File uploads
Loading