GithubHelp home page GithubHelp logo

cider-load-test / fckeditor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jfernandez/fckeditor

0.0 0.0 0.0 2.06 MB

Clone of SVN repository for Scott Rutherford's excellent fckeditor Rails plugin

Home Page: http://blog.caronsoftware.com/fckeditor-plugin

Ruby 0.55% Perl 1.49% Python 1.84% PHP 2.55% JavaScript 93.58%

fckeditor's Introduction

Fckeditor: Version 0.4.3
=========================

Scott Rutherford
[email protected]

Credits to:

"Integrate FCKEditor with your Ruby on Rails application" - http://www.joshuamcharles.com/xhtml/fckrails.php By Joshua M Charles
"Implementation details for FCKEditor integration with Ruby on Rails" - http://public.ok2life.com/welcome/index/49.html 
"FCKEditor On Rails" - http://www.underpantsgnome.com/projects/fckeditor-on-rails/

And for the spell checker, which Ken Pratt created a patch for:

Ken Pratt: www.kenpratt.net
http://softiesonrails.com/articles/2006/02/14/fckeditor-with-spell-check-on-rails

Hongli Lai: For numerous patches and some nice tiding and the upgrade to 2.4.3

David Jones: http://resolvedigital.com/ and http://www.d-jones.com for the update_fckeditor rake task

Nicola Piccinini: http://superfluo.org for various bits and pieces

-------

This plugin installs the FCKeditor editor into your rails app, along with some helpers to use in your views.

Install
-------

If you got this using:

ruby script/plugin install svn://rubyforge.org//var/svn/fckeditorp/trunk/fckeditor

Then the install should of copied all the appropriate files to their homes. If you download a tar then you can either do

rake fckeditor:install 

from the root of your app, or the file will be installed the first time you startup after untaring the plugin.

Files
-----

Basically the whole of the FCKeditor suite is copied to: public/javascripts/fckeditor

There is a separate config file copied to: public/javascripts/fckcustom.js, that you can use to customize the install. This file is never overriden by upgrades or reinstalls

IMPORTANT
---------

If you are hosting your rails app in a subdirectory you need to open:

public/javascripts/fckcustom.js

and modify the FCKRelativePath = ''; to suite your needs.

For example if I have an app at www.mydomain.com/app/

then the line should read:

FCKRelativePath = '/app';


Usage
-----

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

<%= javascript_include_tag :fckeditor %>

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

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

Thats it unless you are using AJAX

AJAX
----

To use a remote form you need to do something like this

<%= form_remote_tag :url => @options.merge(:controller => @scaffold_controller),
                    :before => fckeditor_before_js('note', 'text') %>

    <%= fckeditor_textarea( "note", "text", :ajax => true ) %> 

<%= end_form_tag %>

If you forget to put in the :before it won't work, you can also use the fckeditor_form_remote_tag described below

Multiple Editors in a form
--------------------------

To create a form using multiple editors use the fckeditor_form_remote_tag helper and pass the :editors option. This takes an hash of model symbol keys with each having 
an array as its value. The array should contain the list of fields that will have editors attached to them.

<%= fckeditor_form_remote_tag :url => @options.merge(:controller => @scaffold_controller),
                              :editors => { :multinote => ['text1', 'text2'] } %>

    <%= fckeditor_textarea( "multinote", "text1", :ajax => true ) %> 
    <%= fckeditor_textarea( "multinote", "text2", :ajax => true ) %> 

<%= end_form_tag %>

There is also a fckeditor_remote_form_for version.

Spell Check
-----------

Basically ensure you have aspell installed and available in your path. If running on Windows then the expected install path is:

'c:\program files\aspell\bin\aspell'

If you install elsewhere then you will need to update spell_check.rb in the plugin to mirror your path. Also make sure you have this line in your fckcustom.js file:

FCKConfig.SpellChecker = 'SpellerPages';


fckeditor's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.