mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:51:05 +08:00
Allow plugins to add vendored files for the text pipeline
This commit is contained in:
@ -63,6 +63,11 @@ class DiscoursePluginRegistry
|
||||
def html_builders
|
||||
@html_builders ||= {}
|
||||
end
|
||||
|
||||
def vendored_pretty_text
|
||||
@vendored_pretty_text ||= Set.new
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def register_js(filename, options={})
|
||||
@ -107,6 +112,8 @@ class DiscoursePluginRegistry
|
||||
if asset =~ JS_REGEX
|
||||
if opts == :admin
|
||||
self.admin_javascripts << asset
|
||||
elsif opts == :vendored_pretty_text
|
||||
self.vendored_pretty_text << asset
|
||||
else
|
||||
self.javascripts << asset
|
||||
end
|
||||
@ -120,7 +127,6 @@ class DiscoursePluginRegistry
|
||||
else
|
||||
self.stylesheets << asset
|
||||
end
|
||||
|
||||
elsif asset =~ HANDLEBARS_REGEX
|
||||
self.handlebars << asset
|
||||
end
|
||||
@ -181,6 +187,7 @@ class DiscoursePluginRegistry
|
||||
serialized_current_user_fields
|
||||
asset_globs.clear
|
||||
html_builders.clear
|
||||
vendored_pretty_text.clear
|
||||
end
|
||||
|
||||
def self.setup(plugin_class)
|
||||
|
Reference in New Issue
Block a user