mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:43:38 +08:00
Adds a deprecation for $LAB usage in case plugins use it
Previously it was just removed which broke MathJax.
This commit is contained in:
parent
fb85d3c8a6
commit
5f3176dfd4
|
@ -0,0 +1,19 @@
|
||||||
|
import loadScript from 'discourse/lib/load-script';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'lab-deprecation',
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
if (window.$LAB) { return; }
|
||||||
|
|
||||||
|
window.$LAB = {
|
||||||
|
script(path) {
|
||||||
|
Ember.warn('$LAB is not included with Discouse anymore. Use `loadScript` instead.');
|
||||||
|
|
||||||
|
const promise = loadScript(path);
|
||||||
|
promise.wait = promise.then;
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user