Commit 5d1a3c2d05ed42e342f0fc79d77e01b10a60e39a

Authored by AntonioTerceiro
1 parent 0844f79f

ActionItem64: installing fckeditor plugin for Rails



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@565 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -195,4 +195,8 @@ module ApplicationHelper
195 195 end
196 196 end
197 197  
  198 + def rich_text_editor(object, method, options = {})
  199 + fckeditor_textarea(object, method, options.merge({:toolbarSet => 'Simple', :height => '300px'}))
  200 + end
  201 +
198 202 end
... ...
app/views/layouts/application.rhtml
... ... @@ -6,6 +6,8 @@
6 6 <%= javascript_include_tag 'cms' %>
7 7 <% if params[:controller] == 'cms' %>
8 8 <%= stylesheet_link_tag 'cms' %>
  9 + <%= javascript_include_tag 'fckeditor/fckeditor.js' %>
  10 + <%= javascript_include_tag 'fckcustom' %>
9 11 <% end %>
10 12 <%= stylesheet_link_tag 'common' %>
11 13  
... ...
public/javascripts/fckcustom.js 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +// CHANGE FOR APPS HOSTED IN SUBDIRECTORY
  2 +FCKRelativePath = '';
  3 +
  4 +// DON'T CHANGE THESE
  5 +FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector='+FCKRelativePath+'/fckeditor/command';
  6 +FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector='+FCKRelativePath+'/fckeditor/command';
  7 +FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector='+FCKRelativePath+'/fckeditor/command';
  8 +
  9 +FCKConfig.LinkUploadURL = FCKRelativePath+'/fckeditor/upload';
  10 +FCKConfig.ImageUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Image';
  11 +FCKConfig.FlashUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Flash';
  12 +FCKConfig.AllowQueryStringDebug = false;
  13 +FCKConfig.SpellChecker = 'SpellerPages';
  14 +
  15 +// ONLY CHANGE BELOW HERE
  16 +FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/';
  17 +
  18 +FCKConfig.ToolbarSets["Simple"] = [
  19 + ['Source','-','-','Templates'],
  20 + ['Cut','Copy','Paste','PasteWord','-','Print','SpellCheck'],
  21 + ['Undo','Redo','-','Find','Replace','-','SelectAll'],
  22 + '/',
  23 + ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
  24 + ['OrderedList','UnorderedList','-','Outdent','Indent'],
  25 + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
  26 + ['Link','Unlink'],
  27 + '/',
  28 + ['Image','Table','Rule','Smiley'],
  29 + ['-','About']
  30 +] ;
... ...
public/javascripts/fckeditor 0 → 120000
... ... @@ -0,0 +1 @@
  1 +../../vendor/plugins/fckeditor/public/javascripts/fckeditor
0 2 \ No newline at end of file
... ...