1
0
Fork 0

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

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

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
@ -65,6 +68,14 @@ export default {
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/')
});