forked from snowyu/redmine_js_syntax_highlighter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
executable file
·28 lines (24 loc) · 1 KB
/
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
require 'redmine'
require 'js_syntax_patch'
Redmine::Plugin.register :redmine_js_syntax_highlighter do
name "Redmine Syntax highlighting Render on Browser plugin"
author "Riceball LEE"
author_url "https://github.com/snowyu"
url "https://github.com/snowyu/redmine_js_syntax_highlighter"
description "Uses javascript to highlight files in the source code repository and wiki."
version "0.1"
# Create a dropdown list in the UI so the user can pick a theme.
if UserCustomField.table_exists?
unless UserCustomField.find_by_name('JSHighter Theme')
UserCustomField.create(
:name => 'JSHighter Theme',
:default_value => Redmine::SyntaxHighlighting::JSHighter::DEFAULT_THEME,
:possible_values => Redmine::SyntaxHighlighting::JSHighter::THEMES,
:field_format => 'list',
:is_required => true
)
end
end
end
require 'redmine/syntax_highlighting'
Redmine::SyntaxHighlighting.highlighter = Redmine::SyntaxHighlighting::JSHighter