mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: support registration of custom html by plugins
This commit is contained in:
@@ -12,6 +12,7 @@ class DiscoursePluginRegistry
|
||||
attr_accessor :desktop_stylesheets
|
||||
attr_accessor :sass_variables
|
||||
attr_accessor :handlebars
|
||||
attr_accessor :custom_html
|
||||
|
||||
# Default accessor values
|
||||
def javascripts
|
||||
|
||||
@@ -108,6 +108,11 @@ class Plugin::Instance
|
||||
@javascripts << js
|
||||
end
|
||||
|
||||
def register_custom_html(hash)
|
||||
DiscoursePluginRegistry.custom_html ||= {}
|
||||
DiscoursePluginRegistry.custom_html.merge!(hash)
|
||||
end
|
||||
|
||||
def register_asset(file, opts=nil)
|
||||
full_path = File.dirname(path) << "/assets/" << file
|
||||
assets << [full_path, opts]
|
||||
|
||||
Reference in New Issue
Block a user