mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
FEATURE: allow plugins to overwrite handlebars templates
This commit is contained in:
@ -7,6 +7,7 @@ class DiscoursePluginRegistry
|
||||
attr_accessor :javascripts
|
||||
attr_accessor :server_side_javascripts
|
||||
attr_accessor :stylesheets
|
||||
attr_accessor :handlebars
|
||||
|
||||
# Default accessor values
|
||||
def javascripts
|
||||
@ -20,6 +21,10 @@ class DiscoursePluginRegistry
|
||||
def stylesheets
|
||||
@stylesheets ||= Set.new
|
||||
end
|
||||
|
||||
def handlebars
|
||||
@handlebars ||= Set.new
|
||||
end
|
||||
end
|
||||
|
||||
def register_js(filename, options={})
|
||||
@ -48,10 +53,15 @@ class DiscoursePluginRegistry
|
||||
self.class.stylesheets
|
||||
end
|
||||
|
||||
def handlebars
|
||||
self.class.handlebars
|
||||
end
|
||||
|
||||
def self.clear
|
||||
self.javascripts = nil
|
||||
self.server_side_javascripts = nil
|
||||
self.stylesheets = nil
|
||||
self.handlebars = nil
|
||||
end
|
||||
|
||||
def self.setup(plugin_class)
|
||||
|
Reference in New Issue
Block a user