Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Baidu ueditor for rails

License

NotificationsYou must be signed in to change notification settings

doabit/baidu_ueditor_rails

Repository files navigation

baidu ueditor for rails, precompile codes fromtinymce-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

//=requirebaidu_ueditor//=requireueditor_custom_config

configroutes.rb

mountBaiduUeditorRails::Engine=>"/ueditor"

Custom config

In ueditor_custom_config.js, it looks like:

//ueditorcustomconfig(function(){window.CUSTOM_CONFIG={//Insertyourconfigcode      // 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

<scripttype="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

About

Baidu ueditor for rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp