0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

Require and setup the new Discourse initialization objects

Dieser Commit ist enthalten in:
Angus McLeod 2020-09-01 11:01:46 +10:00
Ursprung dc66bbe936
Commit 48e3c385dc
3 geänderte Dateien mit 15 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -4,8 +4,4 @@ Wizard.SiteSettings = {};
Wizard.RAW_TEMPLATES = {};
Discourse.__widget_helpers = {};
window.__DISCOURSE_RAW_TEMPLATES = {};
Discourse.SiteSettings = Wizard.SiteSettings;
define("bootbox", ["exports"], function(__exports__) {
__exports__.default = window.bootbox;
});
Discourse.SiteSettings = Wizard.SiteSettings;

Datei anzeigen

@ -124,6 +124,7 @@
//= require caret_position.js
//= require popper.js
//= require bootbox.js
//= require discourse-shims
//= require ./wizard/custom-wizard
//= require_tree ./wizard/components

Datei anzeigen

@ -26,10 +26,13 @@ export default {
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default;
const Site = requirejs("discourse/plugins/discourse-custom-wizard/wizard/models/site").default;
const RestAdapter = requirejs("discourse/adapters/rest").default;
const Session = requirejs("discourse/models/session").default;
const setDefaultOwner = requirejs("discourse-common/lib/get-owner").setDefaultOwner;
const container = app.__container__;
Discourse.Model = EmberObject.extend();
Discourse.__container__ = app.__container__;
Discourse.__container__ = container;
setDefaultOwner(container);
registerRawHelpers(RawHandlebars, Handlebars);
// IE11 Polyfill - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill
@ -64,6 +67,14 @@ export default {
targets.forEach(t => app.inject(t, "site", "site:main"));
site.set('can_create_tag', false);
let context = {
siteSettings: container.lookup("site-settings:main"),
currentUser: container.lookup("current-user:main"),
site: container.lookup("site:main"),
session: container.lookup("session:main"),
};
createHelperContext(context);
Router.reopen({
rootURL: getUrl('/w/')