diff --git a/assets/javascripts/wizard-custom.js b/assets/javascripts/wizard-custom.js index 068f48c2..ccc339d4 100644 --- a/assets/javascripts/wizard-custom.js +++ b/assets/javascripts/wizard-custom.js @@ -11,12 +11,15 @@ //= require discourse/lib/page-visible //= require discourse/lib/logout //= require discourse/lib/render-tag -//= require discourse/lib/notification-levels +//= require discourse/lib/notification-levels +//= require discourse/lib/computed //= require markdown-it-bundle //= require pretty-text/engines/discourse-markdown-it //= require pretty-text/engines/discourse-markdown/helpers //= require pretty-text/pretty-text +//= require ember-addons/fmt +//= require preload-store //= require ./wizard/custom-wizard //= require_tree ./wizard/components @@ -29,9 +32,15 @@ //= require_tree ./wizard/templates //= require discourse/models/permission-type +//= require discourse/models/archetype //= require discourse/models/rest +//= require discourse/models/site //= require discourse/models/category //= require discourse/models/session +//= require discourse/models/post-action-type +//= require discourse/models/trust-level +//= require discourse/models/store +//= require discourse/models/result-set //= require discourse/helpers/category-link //= require discourse/mixins/singleton diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 7e9d2b69..5c019f32 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -19,6 +19,11 @@ export default { const cook = requirejs('discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite').cook; const Singleton = requirejs("discourse/mixins/singleton").default; const WizardFieldDropdown = requirejs('wizard/components/wizard-field-dropdown').default; + const Store = requirejs("discourse/models/store").default; + + Discourse.__container__ = app.__container__; + Discourse.getURLWithCDN = getUrl; + Discourse.getURL = getUrl; WizardFieldDropdown.reopen({ tagName: 'span', @@ -52,19 +57,17 @@ export default { const siteSettings = Wizard.SiteSettings; app.register("site-settings:main", siteSettings, { instantiate: false }); targets.forEach(t => app.inject(t, "siteSettings", "site-settings:main")); - + + app.register("service:store", Store); + targets.forEach(t => app.inject(t, "store", "service:store")); + const site = Discourse.Site; app.register("site:main", site); targets.forEach(t => app.inject(t, "site", "site:main")); - + site.reopenClass(Singleton); site.currentProp('can_create_tag', false); - - // this is for discourse/lib/utilities.avatarImg; - Discourse.__container__ = app.__container__; - Discourse.getURLWithCDN = getUrl; - Discourse.getURL = getUrl; - + Router.reopen({ rootURL: getUrl('/w/') });