mirror of
https://github.com/discourse/discourse.git
synced 2025-02-27 16:06:10 +00:00
Remove a bunch of old deprecated code
This commit is contained in:
parent
b05f6ddbe1
commit
f85d848649
@ -81,14 +81,7 @@ function findOutlets(collection, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const dashedName = outletName.replace(/_/g, '-');
|
callback(outletName, res, uniqueName);
|
||||||
if (dashedName !== outletName) {
|
|
||||||
Ember.warn("DEPRECATION: You need to use dashes in outlet names, not underscores");
|
|
||||||
callback(dashedName, res, uniqueName);
|
|
||||||
} else {
|
|
||||||
callback(outletName, res, uniqueName);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
@ -11,14 +11,6 @@ export default {
|
|||||||
user = container.lookup('current-user:main'),
|
user = container.lookup('current-user:main'),
|
||||||
siteSettings = container.lookup('site-settings:main');
|
siteSettings = container.lookup('site-settings:main');
|
||||||
|
|
||||||
const deprecatedBus = {};
|
|
||||||
deprecatedBus.prototype = messageBus;
|
|
||||||
deprecatedBus.subscribe = function() {
|
|
||||||
Ember.warn("Discourse.MessageBus is deprecated. Use `this.messageBus` instead");
|
|
||||||
messageBus.subscribe.apply(messageBus, Array.prototype.slice(arguments));
|
|
||||||
};
|
|
||||||
Discourse.MessageBus = deprecatedBus;
|
|
||||||
|
|
||||||
messageBus.alwaysLongPoll = Discourse.Environment === "development";
|
messageBus.alwaysLongPoll = Discourse.Environment === "development";
|
||||||
messageBus.start();
|
messageBus.start();
|
||||||
|
|
||||||
|
@ -4,14 +4,6 @@ export default {
|
|||||||
name: 'sharing-sources',
|
name: 'sharing-sources',
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
// Backwards compatibility
|
|
||||||
Discourse.ShareLink = {};
|
|
||||||
Discourse.ShareLink.addTarget = function(id, source) {
|
|
||||||
Ember.warn('Discourse.ShareLink.addTarget is deprecated. Import `Sharing` and call `addSource` instead.');
|
|
||||||
source.id = id;
|
|
||||||
Sharing.addSource(source);
|
|
||||||
};
|
|
||||||
|
|
||||||
Sharing.addSource({
|
Sharing.addSource({
|
||||||
id: 'twitter',
|
id: 'twitter',
|
||||||
faIcon: 'fa-twitter-square',
|
faIcon: 'fa-twitter-square',
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
export default function(name, opts) {
|
export default function(name, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
if (opts.__type) {
|
|
||||||
Ember.warn("showModal now takes `opts` as a second param instead of a model");
|
|
||||||
opts = {model: opts};
|
|
||||||
}
|
|
||||||
|
|
||||||
const container = Discourse.__container__;
|
const container = Discourse.__container__;
|
||||||
|
|
||||||
// We use the container here because modals are like singletons
|
// We use the container here because modals are like singletons
|
||||||
|
@ -35,11 +35,8 @@ Discourse.Ajax = Em.Mixin.create({
|
|||||||
args = arguments[1];
|
args = arguments[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.success) {
|
if (args.success || args.error) {
|
||||||
throw "Discourse.ajax should use promises, received 'success' callback";
|
throw "Discourse.ajax should use promises";
|
||||||
}
|
|
||||||
if (args.error) {
|
|
||||||
throw "DEPRECATION: Discourse.ajax should use promises, received 'error' callback";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var performAjax = function(resolve, reject) {
|
var performAjax = function(resolve, reject) {
|
||||||
|
@ -135,11 +135,6 @@ TopicList.reopenClass({
|
|||||||
return store.findFiltered('topicList', {filter, params});
|
return store.findFiltered('topicList', {filter, params});
|
||||||
},
|
},
|
||||||
|
|
||||||
list(filter) {
|
|
||||||
Ember.warn('`Discourse.TopicList.list` is deprecated. Use the store instead');
|
|
||||||
return this.find(filter);
|
|
||||||
},
|
|
||||||
|
|
||||||
// hide the category when it has no children
|
// hide the category when it has no children
|
||||||
hideUniformCategory(list, category) {
|
hideUniformCategory(list, category) {
|
||||||
list.set('hideCategory', category && !category.get("has_children"));
|
list.set('hideCategory', category && !category.get("has_children"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user