From 5d1a3c2d05ed42e342f0fc79d77e01b10a60e39a Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Wed, 26 Sep 2007 19:44:11 +0000 Subject: [PATCH] ActionItem64: installing fckeditor plugin for Rails --- app/helpers/application_helper.rb | 4 ++++ app/views/layouts/application.rhtml | 2 ++ public/javascripts/fckcustom.js | 30 ++++++++++++++++++++++++++++++ public/javascripts/fckeditor | 1 + 4 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 public/javascripts/fckcustom.js create mode 120000 public/javascripts/fckeditor diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b84840f..a316749 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -195,4 +195,8 @@ module ApplicationHelper end end + def rich_text_editor(object, method, options = {}) + fckeditor_textarea(object, method, options.merge({:toolbarSet => 'Simple', :height => '300px'})) + end + end diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 510918a..6c8f842 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -6,6 +6,8 @@ <%= javascript_include_tag 'cms' %> <% if params[:controller] == 'cms' %> <%= stylesheet_link_tag 'cms' %> + <%= javascript_include_tag 'fckeditor/fckeditor.js' %> + <%= javascript_include_tag 'fckcustom' %> <% end %> <%= stylesheet_link_tag 'common' %> diff --git a/public/javascripts/fckcustom.js b/public/javascripts/fckcustom.js new file mode 100644 index 0000000..2c6e0ee --- /dev/null +++ b/public/javascripts/fckcustom.js @@ -0,0 +1,30 @@ +// CHANGE FOR APPS HOSTED IN SUBDIRECTORY +FCKRelativePath = ''; + +// DON'T CHANGE THESE +FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector='+FCKRelativePath+'/fckeditor/command'; +FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector='+FCKRelativePath+'/fckeditor/command'; +FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector='+FCKRelativePath+'/fckeditor/command'; + +FCKConfig.LinkUploadURL = FCKRelativePath+'/fckeditor/upload'; +FCKConfig.ImageUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Image'; +FCKConfig.FlashUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Flash'; +FCKConfig.AllowQueryStringDebug = false; +FCKConfig.SpellChecker = 'SpellerPages'; + +// ONLY CHANGE BELOW HERE +FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/'; + +FCKConfig.ToolbarSets["Simple"] = [ + ['Source','-','-','Templates'], + ['Cut','Copy','Paste','PasteWord','-','Print','SpellCheck'], + ['Undo','Redo','-','Find','Replace','-','SelectAll'], + '/', + ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], + ['OrderedList','UnorderedList','-','Outdent','Indent'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], + ['Link','Unlink'], + '/', + ['Image','Table','Rule','Smiley'], + ['-','About'] +] ; diff --git a/public/javascripts/fckeditor b/public/javascripts/fckeditor new file mode 120000 index 0000000..ad81d9c --- /dev/null +++ b/public/javascripts/fckeditor @@ -0,0 +1 @@ +../../vendor/plugins/fckeditor/public/javascripts/fckeditor \ No newline at end of file -- libgit2 0.21.2