Better deprecation messages for Pretty Text

This commit is contained in:
Robin Ward 2016-07-06 12:39:34 -04:00
parent c1d4ca4031
commit cda58511ac
1 changed files with 12 additions and 12 deletions

View File

@ -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;