From 15c24b6098c4fd32c40daa4fc341e547d5fdc0ae Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 6 Jul 2020 15:05:15 -0400 Subject: [PATCH] FIX: get-url deprecation --- assets/javascripts/wizard/initializers/custom.js.es6 | 8 +++----- assets/javascripts/wizard/lib/load-script.js.es6 | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index af3d64eb..628548ce 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -6,7 +6,7 @@ export default { initialize(app) { if (window.location.pathname.indexOf('/w/') < 0) return; - + const EmberObject = requirejs('@ember/object').default; const Router = requirejs('wizard/router').default; const ApplicationRoute = requirejs('wizard/routes/application').default; @@ -25,12 +25,10 @@ export default { const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default; const Site = requirejs("discourse/models/site").default; const RestAdapter = requirejs("discourse/adapters/rest").default; - + Discourse.Model = EmberObject.extend(); Discourse.__container__ = app.__container__; - Discourse.getURLWithCDN = getUrl; - Discourse.getURL = getUrl; - + registerRawHelpers(RawHandlebars, Handlebars); // IE11 Polyfill - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill diff --git a/assets/javascripts/wizard/lib/load-script.js.es6 b/assets/javascripts/wizard/lib/load-script.js.es6 index 8eb21583..e6ceccd5 100644 --- a/assets/javascripts/wizard/lib/load-script.js.es6 +++ b/assets/javascripts/wizard/lib/load-script.js.es6 @@ -1,4 +1,6 @@ import { ajax } from 'wizard/lib/ajax'; +import getURL from "discourse-common/lib/get-url"; + const _loaded = {}; const _loading = {}; @@ -45,7 +47,7 @@ export default function loadScript(url, opts) { return new Ember.RSVP.Promise(function(resolve) { - url = Discourse.getURL(url); + url = getURL(url); // If we already loaded this url if (_loaded[url]) { return resolve(); }