discourse/app/assets/javascripts/deprecated.js

32 lines
976 B
JavaScript
Raw Normal View History

2016-07-03 13:33:05 -04:00
(function() {
var Discourse = require('discourse').default;
function deprecate(module, methods) {
const result = {};
2016-07-03 13:33:05 -04:00
2016-07-06 16:30:41 -04:00
methods.forEach(function(m) {
result[m] = function() {
Ember.warn("Discourse." + module + "." + m + " is deprecated. Export a setup() function instead");
};
});
Discourse[module] = result;
}
deprecate('Markdown', ['whiteListTag', 'whiteListIframe']);
deprecate('Dialect', ['inlineRegexp', 'inlineBetween', 'addPreProcessor', 'replaceBlock',
2016-07-06 16:30:41 -04:00
'inlineReplace', 'registerInline', 'registerEmoji']);
2016-07-03 13:33:05 -04:00
deprecate('BBCode', ['replaceBBCode', 'register', 'rawBBCode', 'replaceBBCodeParamsRaw']);
Discourse.dialect_deprecated = true;
2016-07-03 13:33:05 -04:00
Discourse.ajax = function() {
var ajax = require('discourse/lib/ajax').ajax;
Ember.warn("Discourse.ajax is deprecated. Import the module and use it instead");
return ajax.apply(this, arguments);
};
window.Discourse = Discourse;
})();