redmine1.2.0集成ckeditor
来源:互联网 发布:平安银行网络支付限额 编辑:程序博客网 时间:2024/05/22 00:06
gem list可以查看redmine安装版本信息(本机安装环境rails 2.3.11,redmine-1.2.0)
redmine集成ckeditor
redmine安装CKEDITOR出错(undefined method 'reply' for class 'IssuesController')
解决办法:
下载redmine_ckeditor(https://github.com/a-ono/redmine_ckeditor)
解压文件,修改文件夹名称为redmine_ckeditor
进入redmine_ckeditor/lib,将issues_controller_patch.rb文件重名为journals_controller_patch.rb
采用文本编辑器打开journals_controller_patch.rb,修改文件内容为:
require_dependency 'journals_controller'
module RedmineCkeditor
module JournalsControllerPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
alias_method_chain :new, :ckeditor
end
end
module InstanceMethods
def new_with_ckeditor
unless Setting.text_formatting == "CKEditor"
reply_without_ckeditor
return
end
journal = Journal.find(params[:journal_id]) if params[:journal_id]
if journal
user = journal.user
text = journal.notes
else
user = @issue.author
text = @issue.description
end
content = "<p>#{ll(Setting.default_language, :text_user_wrote, user)}</p>"
content << "<blockquote>#{ActionView::Base.full_sanitizer.sanitize(text)}</blockquote><p/>"
render(:update) {|page|
page.<< "CKEDITOR.instances['notes'].setData(#{content.inspect});"
page << "showAndScrollTo('update', 'notes');"
}
end
end
end
end
修改redmine_ckeditor/lib/redmine_ckeditor.rb,文件内容为
require 'redmine_ckeditor/journals_controller_patch'
require 'redmine_ckeditor/toolbar_helper'
module RedmineCkeditor
include ToolbarHelper
PLUGIN_DIR = File.expand_path(File.dirname(File.dirname(__FILE__)))
ALLOWED_TAGS = %w[
a abbr acronym address blockquote b big br caption cite code dd del dfn
div dt em h1 h2 h3 h4 h5 h6 hr i img ins kbd li ol p pre samp small span
strike strong sub sup table tbody td tfoot th thead tr tt u ul var
]
ALLOWED_ATTRIBUTES = %w[
href src width height alt cite datetime title class name xml:lang abbr
style align valign border cellpadding cellspacing colspan rowspan nowrap
]
DEFAULT_TOOLBAR = [
%w[Source - Preview - Maximize ShowBlocks - Template - PasteFromWord -
Undo Redo - Find Replace
], '/',
%w[Bold Italic Underline Strike - Subscript Superscript -
NumberedList BulletedList - Outdent Indent Blockquote -
JustifyLeft JustifyCenter JustifyRight JustifyBlock -
Link Unlink Anchor - Image Table HorizontalRule SpecialChar
], '/',
%w[Styles Format Font FontSize - TextColor BGColor]
]
def self.apply_patch
JournalsController.send(:include, JournalsControllerPatch)
end
end
安装
拷贝redmine_ckeditor到vendor/plugins目录下
启动Redmine
管理员登陆redmine,进入管理-->配置-->文本格式,选择CKEDITOR
修改CKEDITOR配置可以进入 管理-->插件--配置
https://github.com/a-ono/redmine_ckeditor/issues/2#issuecomment-384929
- redmine1.2.0集成ckeditor
- CKEditor和KCFinder集成
- ADF集成Ckeditor
- CKEditor Java集成指南
- CI框架集成CkEditor编辑器
- java中集成CKEditor和CKFinder
- liferay6.2 集成CKEditor和ckfinder
- Flask项目集成富文本编辑器CKeditor
- angular2 集成ckeditor 提示 ”Unexpected token <“
- Redmine1.2.1 安装指南
- windowxp 安装 redmine1.41
- CKeditor
- CKEditor
- CKEditor
- CKEditor
- ckeditor
- CKeditor
- ckeditor
- 程序员的路
- 如何提高数据库性能,减少数据库服务器压力瓶颈一两个小方法
- eval 在ie ff下运行 出现的form为定义情况
- Enovia MatrixOne Expression Objects
- Json学习
- redmine1.2.0集成ckeditor
- gfsrg
- 一个比较实用的国内IT公司研发部技术管理规范
- [android学习笔记]学习jni编程
- SoCallbackAction
- 计算机存储单位
- 解决ubuntu内核更新后VMware的share文件夹无法使用并消失
- PHP对于时间的圆整
- 带滚动条的下拉表格