2019-11-20 13:08:04 +01:00
|
|
|
import { buildResolver } from "discourse-common/resolver";
|
2017-09-29 13:27:03 +02:00
|
|
|
|
2019-11-20 13:08:04 +01:00
|
|
|
export default Ember.Application.extend({
|
2021-03-28 11:06:49 +02:00
|
|
|
rootElement: "#custom-wizard-main",
|
2019-11-20 13:08:04 +01:00
|
|
|
Resolver: buildResolver("wizard"),
|
|
|
|
|
2021-06-16 05:55:10 +02:00
|
|
|
customEvents: {
|
2021-06-16 06:26:28 +02:00
|
|
|
paste: "paste",
|
2021-06-16 05:55:10 +02:00
|
|
|
},
|
|
|
|
|
2019-11-20 13:08:04 +01:00
|
|
|
start() {
|
|
|
|
Object.keys(requirejs._eak_seen).forEach((key) => {
|
|
|
|
if (/\/pre\-initializers\//.test(key)) {
|
|
|
|
const module = requirejs(key, null, null, true);
|
|
|
|
if (!module) {
|
|
|
|
throw new Error(key + " must export an initializer.");
|
|
|
|
}
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2019-11-20 13:08:04 +01:00
|
|
|
const init = module.default;
|
|
|
|
const oldInitialize = init.initialize;
|
|
|
|
init.initialize = () => {
|
|
|
|
oldInitialize.call(this, this.__container__, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
this.initializer(init);
|
|
|
|
}
|
|
|
|
});
|
2021-03-28 11:06:49 +02:00
|
|
|
|
|
|
|
Object.keys(requirejs._eak_seen).forEach((key) => {
|
2020-10-02 06:40:10 +02:00
|
|
|
if (/\/initializers\//.test(key)) {
|
|
|
|
const module = requirejs(key, null, null, true);
|
|
|
|
if (!module) {
|
|
|
|
throw new Error(key + " must export an initializer.");
|
|
|
|
}
|
|
|
|
this.initializer(module.default);
|
|
|
|
}
|
|
|
|
});
|
2021-03-28 11:06:49 +02:00
|
|
|
},
|
2017-09-29 13:27:03 +02:00
|
|
|
});
|