Skip to content
This repository has been archived by the owner on Jul 7, 2019. It is now read-only.

Commit

Permalink
Adding plugins section to tiny_mce readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieran Pilkington committed Jun 3, 2010
1 parent 757fa97 commit ede4612
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.rdoc
@@ -1,6 +1,6 @@
= TinyMCE for Rails

This plugin provides for the installation and utilization of TinyMCE in Ruby on Rails applications of version 2.3.5 and onward.
This gem/plugin provides for the installation and utilization of TinyMCE in Ruby on Rails applications of version 2.3.5 and onward.

TinyMCE is a WYSIWYG HTML editing component released under the GNU Lesser General Public License 2.1 (LGPL 2.1) by Moxiecode Systems (http://tinymce.moxiecode.com/).

Expand Down Expand Up @@ -141,6 +141,29 @@ See SPELLCHECKING_PLUGIN.rdoc . Note: Spell checking is not tested o regularly m
http://github.com/kete/tiny_mce/tree/master/SPELLCHECKING_PLUGIN.rdoc


== Plugins

Plugins allow you to insert or change files of the TinyMCE editor, such as installing TinyMCE Editor plugins.

There is an example plugin at http://github.com/kete/tiny_mce_plugin_example

A tiny_mce plugin is very simple. http://github.com/kete/tiny_mce_plugin_example/blob/master/lib/tiny_mce-paste.rb

It requires tiny_mce, installs the TinyMCE sources if they aren't already, creates a subclass of TinyMCE::Plugin, and calls install on it.

TinyMCE::Plugin provides a default self.install method, which copies files from self.assets_path to the tiny_mce directory under public/javascripts

You can overwrite the install method to something more complex, like remove plugins, or swap plugins. Example:

class SwapPasteForPastePlus < TinyMCE::Plugin
def self.install
require 'fileutils'
FileUtils.rm(Rails.public.join('javascripts/tiny_mce/plugins/paste'))
FileUtils.cp_r(self.assets_path, Rails.public.join('javascripts/tiny_mce'))
end
end


== Testing

The plugin comes with a test suite that can be run once the plugin is installed in an application.
Expand Down

0 comments on commit ede4612

Please sign in to comment.