No commit activity in last 3 years
No release in over 3 years
Baidu ueditor for rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 5.0.0
 Project Readme

Baidu ueditor for rails

baidu ueditor for rails, precompile codes from tinymce-rails

Notice: The project is unreleased.

Installation

Add this line to your application's Gemfile:

gem 'baidu_ueditor_rails5', github: 'doabit/baidu_ueditor_rails'

And then execute:

$ bundle

Generating custom config js

Usage:

rails g baidu_ueditor_rails:install

Then add codes in application.js

//= require baidu_ueditor
//= require ueditor_custom_config

config routes.rb

  mount BaiduUeditorRails::Engine => "/ueditor"

Custom config

In ueditor_custom_config.js, it looks like:

//ueditor custom config
(function () {
    window.CUSTOM_CONFIG = {
      // Insert your config code
      // toolbars: [
      //      ['Source','Undo','Redo','Cleardoc','SearchReplace','InsertImage','WordImage','Bold','ForeColor','JustifyLeft',
      //      'JustifyCenter','JustifyRight','JustifyJustify','RemoveFormat','FormatMatch','AutoTypeSet','PastePlain',
      //      'FontSize','Preview','Link','FullScreen', 'PageBreak', 'InsertTable','Attachment','InsertVideo']
      // ],
      serverUrl: '/ueditor',
      imageManagerUrlPrefix: ''
    };
    jQuery.extend(window.UEDITOR_CONFIG, window.CUSTOM_CONFIG);
})();

you can write your custom config in

window.CUSTOM_CONFIG = {
  //.........
};

Views

<script type="text/javascript">
  var editor = new UE.ui.Editor();
  editor.render("your_textarea_id");
</script>

TODO

  1. Add upload image and file.
  2. Add form helpers.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request