Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-29 12:20:27 +01:00
22 Zeilen
654 B
Text
22 Zeilen
654 B
Text
<%=
|
|
result = ''
|
|
Discourse.unofficial_plugins.each do |plugin|
|
|
plugin_name = plugin.metadata.name
|
|
if require_plugin_assets = CustomWizard::Field.require_assets[plugin_name]
|
|
plugin.each_globbed_asset do |f, is_dir|
|
|
if f.include? "raw.hbs"
|
|
name = File.basename(f, ".raw.hbs")
|
|
compiled = Barber::Precompiler.new().compile(File.read(f))
|
|
result << "
|
|
(function() {
|
|
if ('Wizard' in window) {
|
|
Wizard.RAW_TEMPLATES['javascripts/#{name}'] = requirejs('discourse-common/lib/raw-handlebars').template(#{compiled});
|
|
}
|
|
})();
|
|
"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
result
|
|
%>
|