Skip to content

Commit

Permalink
CKEditor support
Browse files Browse the repository at this point in the history
  • Loading branch information
bob-frost authored and Jeff Dutil committed Mar 25, 2013
1 parent 9ad47a1 commit 5a56690
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions app/views/shared/editor_engines/_ck_editor.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%= javascript_include_tag('ckeditor/init') %>

<script type="text/javascript">
$(function() {
var ids = [<%= raw ids.map{|id| "'#{id}'"}.join(', ') %>];
for(var key in ids){
if($('#' + ids[key]).length > 0){
CKEDITOR.replace(ids[key]);
}
}
});
</script>

2 changes: 1 addition & 1 deletion lib/spree_editor/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def self.activate
config.to_prepare &method(:activate).to_proc
end

EditorEngines = %w(WYMEditor TinyMCE)
EditorEngines = %w(CKEditor TinyMCE)
end
1 change: 1 addition & 0 deletions spree_editor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Gem::Specification.new do |s|

s.add_dependency('tinymce-rails', '>= 3.4.7.0.1')
s.add_dependency('spree_core', '>= 2.0.0.beta')
s.add_dependency('ckeditor')

s.add_development_dependency 'rspec-rails'
end

0 comments on commit 5a56690

Please sign in to comment.