2016-07-04 01:33:05 +08:00
|
|
|
(function() {
|
|
|
|
var Discourse = require('discourse').default;
|
|
|
|
|
2016-07-07 00:39:34 +08:00
|
|
|
function deprecate(module, methods) {
|
|
|
|
const result = {};
|
2016-07-04 01:33:05 +08:00
|
|
|
|
2016-07-07 04:30:41 +08:00
|
|
|
methods.forEach(function(m) {
|
|
|
|
result[m] = function() {
|
|
|
|
Ember.warn("Discourse." + module + "." + m + " is deprecated. Export a setup() function instead");
|
|
|
|
};
|
2016-07-07 00:39:34 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Discourse[module] = result;
|
|
|
|
}
|
|
|
|
|
|
|
|
deprecate('Markdown', ['whiteListTag', 'whiteListIframe']);
|
|
|
|
deprecate('Dialect', ['inlineRegexp', 'inlineBetween', 'addPreProcessor', 'replaceBlock',
|
2016-07-07 04:30:41 +08:00
|
|
|
'inlineReplace', 'registerInline', 'registerEmoji']);
|
2016-07-04 01:33:05 +08:00
|
|
|
|
2016-07-14 02:05:35 +08:00
|
|
|
deprecate('BBCode', ['replaceBBCode', 'register', 'rawBBCode', 'replaceBBCodeParamsRaw']);
|
|
|
|
|
2016-07-07 00:46:07 +08:00
|
|
|
Discourse.dialect_deprecated = true;
|
|
|
|
|
2016-07-04 01:33:05 +08: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;
|
|
|
|
})();
|