mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
Revert plugin js changes (#5139)
* Revert "Add disabled_plugins to preloadstore for login_required anonymous users (#5134)" This reverts commit b840170f8da3c2fb841d55e1192a3522cbe5ae87. * Revert "Do not load javascripts for disabled plugins (#5103)" This reverts commit a14ab488294215063a08448c29a819edf1b633d8.
This commit is contained in:

committed by
Régis Hanol

parent
a0daa7cad0
commit
7d350d0d75
@ -1,9 +1,7 @@
|
||||
import { buildResolver } from 'discourse-common/resolver';
|
||||
import { default as computed, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import PreloadStore from 'preload-store';
|
||||
|
||||
const _pluginCallbacks = [];
|
||||
const _pluginDefinitions = {};
|
||||
|
||||
const Discourse = Ember.Application.extend({
|
||||
rootElement: '#main',
|
||||
@ -103,16 +101,6 @@ const Discourse = Ember.Application.extend({
|
||||
|
||||
$('noscript').remove();
|
||||
|
||||
// Load plugin definions.
|
||||
const disabledPlugins = PreloadStore.get('site').disabled_plugins;
|
||||
Object.keys(_pluginDefinitions).forEach((key) => {
|
||||
if(!(disabledPlugins.includes(key))){ // Not disabled, so load it
|
||||
_pluginDefinitions[key].forEach((func) => {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
if (/\/pre\-initializers\//.test(key)) {
|
||||
const module = requirejs(key, null, null, true);
|
||||
@ -166,13 +154,6 @@ const Discourse = Ember.Application.extend({
|
||||
_pluginCallbacks.push({ version, code });
|
||||
},
|
||||
|
||||
_registerPluginScriptDefinition(pluginName, definition) {
|
||||
if(!(pluginName in _pluginDefinitions)){
|
||||
_pluginDefinitions[pluginName] = [];
|
||||
}
|
||||
_pluginDefinitions[pluginName].push(definition);
|
||||
},
|
||||
|
||||
assetVersion: Ember.computed({
|
||||
get() {
|
||||
return this.get("currentAssetVersion");
|
||||
|
Reference in New Issue
Block a user