
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
baidu ueditor for rails, precompile codes from tinymce-rails
ueditor 1.4.3.3
Add this line to your application's Gemfile:
gem 'baidu_ueditor_rails'
And then execute:
$ bundle
Usage:
rails g baidu_ueditor_rails:install
Then add codes in application.js
//= require baidu_ueditor
//= require ueditor_custom_config
In ueditor_custom_config.js, it looks like:
//ueditor custom config
(function () {
window.CUSTOM_CONFIG = {
// Insert your config code
imageUrl: "/ueditor_images"
,imagePath: ""
,maxImageSideLength: 600
,elementPathEnabled: false
,wordCount:0 //是否开启字数统计
,maximumWords:5000 //允许的最大字符数
,savePath: ['upload']
// 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']
// ]
};
jQuery.extend(window.UEDITOR_CONFIG, window.CUSTOM_CONFIG);
})();
you can write your custom config in
window.CUSTOM_CONFIG = {
//.........
};
class UeditorImagesController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:create]
def create
@ueditor_image = UeditorImage.new(image: params[:upfile])
respond_to do |format|
if @ueditor_image.save
data = {:url=> @ueditor_image.image.url, :title => params[:title], :original => params[:upfile].original_filename, :state => 'SUCCESS'}
else
data = {:title => params[:title], :original => params[:upfile].original_filename, :state => 'FAIL'}
end
format.js {render :json => data.to_json}
end
end
end
<script type="text/javascript">
var editor = new UE.ui.Editor();
editor.render("your_textarea_id");
</script>
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that baidu_ueditor_rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.