0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 12:22:54 +01:00
discourse-custom-wizard/assets/javascripts/wizard/lib/initialize/register-files.js.es6
2022-03-16 12:46:16 +01:00

30 Zeilen
952 B
JavaScript

export default {
run(app, container) {
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars")
.default;
const Handlebars = requirejs("handlebars").default;
const registerRawHelpers = requirejs(
"discourse-common/lib/raw-handlebars-helpers"
).registerRawHelpers;
const { registerHelpers } = requirejs("discourse-common/lib/helpers");
const jqueryPlugins = requirejs("discourse/initializers/jquery-plugins")
.default;
Object.keys(Ember.TEMPLATES).forEach((k) => {
if (k.indexOf("select-kit") === 0) {
let template = Ember.TEMPLATES[k];
define(k, () => template);
}
});
Object.keys(requirejs.entries).forEach((entry) => {
if (/\/helpers\//.test(entry)) {
requirejs(entry, null, null, true);
}
});
registerRawHelpers(RawHandlebars, Handlebars);
registerHelpers(app);
jqueryPlugins.initialize(container, app);
},
};