cgcmart / open_editor

Adds support for WYSIWYG editor to Open

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Editor

This extension provides an inline rich-text editor for Open. It implements a rich text editor like TinyMCE.

Please note that this extension is just a simple integration of some pretty complex gem: tinymce-rails, if you have issues, please check their issues trackers first.

It's best to use with Open Essential Content.


  1. Add Open Editor gem to your Gemfile with this line:
gem 'open_editor', github: '99cm/open_editor', branch: 'master'
  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g open_editor:install
  1. Restart your server

If your server was running, restart it so that it can find the assets properly.


Configuration

Preferences can be updated within the admin panel under "configuration" then "rich editor".

Or you may set them with an initializer within your application:

SpreeEditor::Config.tap do |config|
  config.ids = 'product_description page_body event_body'

  # change the editor to CKEditor
  config.current_editor = 'CKEditor'
end

The default preference is:

{
  enabled: true,
  current_editor: 'TinyMCE',
  ids: 'product_description page_body'
}

Language-Support

To obtain support for multiple languages with TinyMCE add tinymce-rails-langs to your Gemfile:

gem 'tinymce-rails-langs'

TinyMCE will not be loaded unless it finds a language package matching your Spree::Config.default_locale.


Copyright (c) 2019 Leo Wang and other contributors, released under the New BSD License

About

Adds support for WYSIWYG editor to Open

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Ruby 87.2%Language:HTML 11.2%Language:CSS 1.3%Language:JavaScript 0.3%