opf/openproject — pull request #483 by tessi (2013-10-07 09:46:21+00:00)
Title: introduce plugin hook for global assets

OpenProject plugins may now register assets to be included globally
on every OpenProject page. This should be usefull for Tracking plugins, AB-Testing, and similar
things.

If you use the openproject-plugins gem, do the following to register
your asset:

module OpenProject::MyFancyPlugin
class Engine < ::Rails::Engine
engine_name :openproject_my_fancy_plugin

include OpenProject::Plugins::ActsAsOpEngine

register 'openproject-MyFancyPlugin',
:author_url => 'http://openproject.org',
:requires_openproject => '>= 3.0.0',
:register_global_assets => {js: 'fancy.js',
css: ['cool.css', 'another.css']}

initializer 'my_fancy_plugin.precompile_assets' do |app|
app.config.assets.precompile += ['fancy.js','cool.css','another.css']
end
end
end