Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
FIX: get-url deprecation
Dieser Commit ist enthalten in:
Ursprung
c5ccd638f7
Commit
15c24b6098
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
|
@ -6,7 +6,7 @@ export default {
|
||||||
|
|
||||||
initialize(app) {
|
initialize(app) {
|
||||||
if (window.location.pathname.indexOf('/w/') < 0) return;
|
if (window.location.pathname.indexOf('/w/') < 0) return;
|
||||||
|
|
||||||
const EmberObject = requirejs('@ember/object').default;
|
const EmberObject = requirejs('@ember/object').default;
|
||||||
const Router = requirejs('wizard/router').default;
|
const Router = requirejs('wizard/router').default;
|
||||||
const ApplicationRoute = requirejs('wizard/routes/application').default;
|
const ApplicationRoute = requirejs('wizard/routes/application').default;
|
||||||
|
@ -25,12 +25,10 @@ export default {
|
||||||
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default;
|
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default;
|
||||||
const Site = requirejs("discourse/models/site").default;
|
const Site = requirejs("discourse/models/site").default;
|
||||||
const RestAdapter = requirejs("discourse/adapters/rest").default;
|
const RestAdapter = requirejs("discourse/adapters/rest").default;
|
||||||
|
|
||||||
Discourse.Model = EmberObject.extend();
|
Discourse.Model = EmberObject.extend();
|
||||||
Discourse.__container__ = app.__container__;
|
Discourse.__container__ = app.__container__;
|
||||||
Discourse.getURLWithCDN = getUrl;
|
|
||||||
Discourse.getURL = getUrl;
|
|
||||||
|
|
||||||
registerRawHelpers(RawHandlebars, Handlebars);
|
registerRawHelpers(RawHandlebars, Handlebars);
|
||||||
|
|
||||||
// IE11 Polyfill - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill
|
// IE11 Polyfill - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { ajax } from 'wizard/lib/ajax';
|
import { ajax } from 'wizard/lib/ajax';
|
||||||
|
import getURL from "discourse-common/lib/get-url";
|
||||||
|
|
||||||
const _loaded = {};
|
const _loaded = {};
|
||||||
const _loading = {};
|
const _loading = {};
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ export default function loadScript(url, opts) {
|
||||||
|
|
||||||
|
|
||||||
return new Ember.RSVP.Promise(function(resolve) {
|
return new Ember.RSVP.Promise(function(resolve) {
|
||||||
url = Discourse.getURL(url);
|
url = getURL(url);
|
||||||
|
|
||||||
// If we already loaded this url
|
// If we already loaded this url
|
||||||
if (_loaded[url]) { return resolve(); }
|
if (_loaded[url]) { return resolve(); }
|
||||||
|
|
Laden …
In neuem Issue referenzieren