Better deprecation messages for Pretty Text
This commit is contained in:
parent
c1d4ca4031
commit
cda58511ac
|
@ -1,19 +1,19 @@
|
||||||
(function() {
|
(function() {
|
||||||
var Discourse = require('discourse').default;
|
var Discourse = require('discourse').default;
|
||||||
|
|
||||||
Discourse.Markdown = {
|
function deprecate(module, methods) {
|
||||||
whiteListTag: Ember.K,
|
const result = {};
|
||||||
whiteListIframe: Ember.K
|
|
||||||
};
|
|
||||||
|
|
||||||
Discourse.Dialect = {
|
methods.forEach(m => {
|
||||||
inlineRegexp: Ember.K,
|
result[m] = () => Ember.warn(`Discourse.${module}.${m} is deprecated. Export a setup() function instead`);
|
||||||
addPreProcessor: Ember.K,
|
});
|
||||||
replaceBlock: Ember.K,
|
|
||||||
inlineReplace: Ember.K,
|
Discourse[module] = result;
|
||||||
registerInline: Ember.K,
|
}
|
||||||
registerEmoji: Ember.K
|
|
||||||
};
|
deprecate('Markdown', ['whiteListTag', 'whiteListIframe']);
|
||||||
|
deprecate('Dialect', ['inlineRegexp', 'inlineBetween', 'addPreProcessor', 'replaceBlock',
|
||||||
|
'inlineReplace', 'registerInline', 'registerEmoji']);
|
||||||
|
|
||||||
Discourse.ajax = function() {
|
Discourse.ajax = function() {
|
||||||
var ajax = require('discourse/lib/ajax').ajax;
|
var ajax = require('discourse/lib/ajax').ajax;
|
||||||
|
|
Loading…
Reference in New Issue