forked from a-ono/redmine_ckeditor
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinit.rb
34 lines (27 loc) · 997 Bytes
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'redmine'
plugin_name = :redmine_ckeditor
plugin_root = File.dirname(__FILE__)
unless defined?(SmileTools)
require plugin_root + '/lib/redmine_ckeditor'
end
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
Rails.application.config.after_initialize do
RedmineCkeditor.apply_patch
end
else
Rails.configuration.to_prepare do
RedmineCkeditor.apply_patch
end
end
Redmine::Plugin.register :redmine_ckeditor do
name 'Redmine CKEditor plugin'
author 'Akihiro Ono'
description 'This is a CKEditor plugin for Redmine'
version '1.2.4'
requires_redmine :version_or_higher => '5.0.0'
url 'https://github.com/nomadli/redmine_ckeditor'
settings(:partial => 'settings/ckeditor')
wiki_format_provider 'CKEditor', RedmineCkeditor::WikiFormatting::Formatter,
RedmineCkeditor::WikiFormatting::Helper
end
(Loofah::VERSION >= "2.3.0" ? Loofah::HTML5::SafeList : Loofah::HTML5::WhiteList)::ALLOWED_PROTOCOLS.replace RedmineCkeditor.allowed_protocols