Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redmine 5.0 support & zeitwerk compatibility #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ I bare no responsibility in case of misuse of this plugin.

## Compatibility

Redmine 2.1.x ~ 3.4.x stable
Redmine 3.4.x - 5.0.2 stable

Tested on:
* 5.0.2
* 4.2.2
* 3.4.5
* 2.5.0

## Downloading and installing the plugin

First download the plugin using git, open a terminal in your Redmine installation directory:

<tt>git clone git@github.com:martin-denizet/redmine_custom_js.git ./plugins/</tt>
<tt>git clone https://github.com/m3rtl/redmine_custom_js.git</tt>

The installation is now finished and you will be able to use the plugin after you restart your Redmine instance.

Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_dependency 'redmine_custom_js/hooks'
require File.expand_path 'lib/redmine_custom_js/hook_listener', __dir__

Redmine::Plugin.register :redmine_custom_js do
name 'Redmine Custom JS plugin'
Expand Down
2 changes: 2 additions & 0 deletions lib/redmine_custom_js.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module RedmineCustomJs
end
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module RedmineCustomJs
class RedmineCustomJsHookListener < Redmine::Hook::ViewListener
class HookListener < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context)
js = Setting.plugin_redmine_custom_js['js']
"<script type=\"text/javascript\">#{javascript_cdata_section(js)}</script>" unless js.nil? or js.empty?

end
end
end
end