FCKeditor plugin

  • Tags : ui, fck, wysiwyg
  • Latest : 0.9.5
  • Last Updated: 20 April 2010
  • Grails version : 1.0 > *
  • Authors : Stefano Gualdi
8 votes
Dependency :
compile ":fckeditor:0.9.5"

Source

Summary

Installation

The plugin can be installed with the following command:

grails install-plugin fckeditor

Description

FCKeditor Plugin

This plugin can be used to integrate rich web editing functionality in Grails applications.

The plugin is written in Groovy/Grails without any dependencies on external libraries.

The FCKeditor plugin is based on the great FCKeditor http://www.fckeditor.net Web Rich Text Editor.

Source code

The source code of the plugin is now hosted on github: http://github.com/stefanogualdi/grails-fckeditor

Current version

Current version is 0.9.5

Based on FCKeditor (http://www.fckeditor.net) version 2.6.6

This version is developed and tested with Grails 1.2.2

Tags reference

The plugin defines the following custom tags:

TagDescription
configConfigure the editor instance
editorRender the wysiwyg editor
fileBrowserCreate a link to open just the file browser

all the tags belongs to the namespace fckeditor

Tag config

This tag give full access to every configuration option exposed by FCKeditor.

The config tag must precede the editor tag.

<fckeditor:config OptionName="option_value"/>

Many options can be set in one time:

<fckeditor:config
    OptionOne="option_one_value"
    OptionTwo="option_two_value" />

Option names are case sentitive and must be written as indicated in the official documentation.

For a full reference of the available options please refer to the official documentation

Tag editor

This tag render the wysiwyg editor

<fckeditor:editor
    name="text"
    width="100%"
    height="400"
    toolbar="Standard"
    fileBrowser="default">
Initial text
</fckeditor:editor>

available attributes are:

AttributeDescription
nameField name (default: "editor")
widthWidth of the editing space (default: "100%")
heightHeight of the editing space (default: "200")
toolbarToolbar to use as defined in fckconfig.js (default: "Default")
fileBrowserName of the file browser to use. Possible values are default or extended. The extended file browser supports deletion and rename of files and folders (default: "default")
userSpaceName of the file user space to use for file browsing and uploads (default: "")

For security reasons the userSpace attribute cannot contain any special character. Any invalid character will be removed.

Tag fileBrowser

Render a link to open a stand alone file browser not associated with an editor instance

<fckeditor:fileBrowser browser="default">Open file browser</fckeditor:fileBrowser>

available attributes are:

AttributeDescription
typeType of resource (default: "")
browserName of the file browser to use. Possible values are default or extended. The extended file browser supports deletion and rename of files and folders (default: "default")
userSpaceName of the file user space to use for file browsing and uploads (default: "")
targetTarget attribute for the generated <A> tag (default: "")

if you just need the link to the file browser there is a fileBrowserLink tag:

<a href="${fckeditor.fileBrowserLink(type:'Image', browser:'extended', userSpace:'userone')}">Open file browser</a>

Configuration

The plugin can be configured with the standard Config.groovy file.

Actually are available the following options:

Config keyDefaultDescription
fckeditor.skipBrowserCheckfalseSkip browser detection. Always render the extented editor
fckeditor.upload.basedir/uploads/Base directory relative to webapp root if baseurl not defined, otherwise the absolute path where to store the uploaded files
fckeditor.upload.baseurlnoneThe base URL to access the uploaded files
fckeditor.upload.overwritefalseOverwite files on upload
fckeditor.upload.link.browserfalseEnable file browser for file objects
fckeditor.upload.link.uploadfalseEnable upload tab for file objects
fckeditor.upload.link.allowed[ ]Extensions allowed for file objects
fckeditor.upload.link.denied[ ]Extensions denied for file objects
fckeditor.upload.image.browserfalseEnable file browser for image objects
fckeditor.upload.image.uploadfalseEnable upload tab for image objects
fckeditor.upload.image.allowed[ ]Extensions allowed for image objects
fckeditor.upload.image.denied[ ]Extensions denied for image objects
fckeditor.upload.flash.browserfalseEnable file browser for flash objects
fckeditor.upload.flash.uploadfalseEnable upload tab for flash objects
fckeditor.upload.flash.allowed[ ]Extensions allowed for flash objects
fckeditor.upload.flash.denied[ ]Extensions denied for flash objects
fckeditor.upload.media.browserfalseEnable file browser for media objects
fckeditor.upload.media.uploadfalseEnable upload tab for media objects
fckeditor.upload.media.allowed[ ]Extensions allowed for media objects
fckeditor.upload.media.denied[ ]Extensions denied for media objects

Sample config

fckeditor {
    upload {
        basedir = "/tmp/storagearea/"
        baseurl = "/uploads/"
        overwrite = false
        link {
            browser = true
            upload = false
            allowed = []
            denied = ['html', 'htm', 'php', 'php2', 'php3', 'php4', 'php5',
                      'phtml', 'pwml', 'inc', 'asp', 'aspx', 'ascx', 'jsp',
                      'cfm', 'cfc', 'pl', 'bat', 'exe', 'com', 'dll', 'vbs', 'js', 'reg',
                      'cgi', 'htaccess', 'asis', 'sh', 'shtml', 'shtm', 'phtm']
        }
        image {
            browser = true
            upload = true
            allowed = ['jpg', 'gif', 'jpeg', 'png']
            denied = []
        }
        flash {
            browser = false
            upload = false
            allowed = ['swf']
            denied = []
        }
        media {
            browser = false
            upload = false
            allowed = ['mpg','mpeg','avi','wmv','asf','mov']
            denied = []
        }
    }
}

Security note

For security reasons it is important to define allowed/denied extensions.

Version history

0.9.5 (20/04/2010)

  • Upgrade to FCKeditor version 2.6.6 final
  • Resolved compatibility issue with Grails 1.2.x (Thanks to Luke Daley)

0.9.4 (12/07/2009)

  • Upgrade to FCKeditor version 2.6.4.1 final
  • Resolved jira issue GRAILSPLUGINS-1260 (thanks to Marc Palmer)
  • Optimized HTML rendering (thanks to Marc Palmer)

0.9.3 (23/06/2009)

  • No changes, just re-released due to a problem in zip file under linux (thanks to Scott Burch)

0.9.2 (21/05/2009)

  • Added Iceweasel to browser detection code (thanks to Sergej Dechand for notifying and testing)
  • Added new configuration flag skipBrowserCheck

0.9.1 (16/05/2009)

  • Corrected typo
  • Upgrade to Grails 1.1.1

0.9 (15/04/2009)

  • Upgrade to FCKeditor version 2.6.4 final
  • Added the config tag
  • Added the fileBrowser tag
  • Added user space handling for file browsing and uploading
  • Added configuration setting for handling uploads outside the application context

0.8 (26/08/2008)

  • Upgrade to FCKeditor version 2.6.3 final

0.7

  • Upgrade to FCKeditor version 2.6.0 final

0.6

  • This version correct an installation problem on windows XP (and maybe on other platforms) due to a missing respect of plugins naming conventions. Many thanks to Markus Samuelsson that first pointed out the problem and to Brian Bonner who sent me a patch.
  • This version include a modified file browser with the support for delete/rename files and folders. To use it simple add fileBrowser="extended" to the editor tag attributes.
  • Added youtube FCKeditor plugin http://sourceforge.net/projects/youtubepluginfo/
  • Added embedmovies FCKeditor plugin http://sourceforge.net/tracker/download.php?group_id=75348&atid=737639&file_id=182612&aid=1510783
  • Added two toolbars ('Standard' and 'Multimedia', the last one with the above plugins included)

0.5

  • First public release

Development

For issues, improvements or new features go to the plugin's JIRA page