mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-16 06:31:42 +02:00
.github
.idea
bld
lib
linux
resources
Content
api
error
images
introduction
login
notification
plugins
notification
plugins.js
tweetdeck
base.js
setup.js
tweetdeck
update
.all.js
bootstrap.js
load.js
Design
Guide
Plugins
..code-workspace
windows
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
36 lines
669 B
JavaScript
36 lines
669 B
JavaScript
import setup from "../setup.js";
|
|
|
|
export default function() {
|
|
window.PluginBase = class {
|
|
constructor() {}
|
|
run() {}
|
|
};
|
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
window.TD_PLUGINS = new class {
|
|
constructor() {
|
|
this.waitingForModules = [];
|
|
this.areModulesLoaded = false;
|
|
}
|
|
|
|
install(plugin) {
|
|
if (this.areModulesLoaded) {
|
|
plugin.obj.run();
|
|
}
|
|
else {
|
|
this.waitingForModules.push(plugin);
|
|
}
|
|
}
|
|
|
|
onModulesLoaded(namespace) {
|
|
if (namespace === "plugins/notification") {
|
|
this.waitingForModules.forEach(plugin => plugin.obj.run());
|
|
this.waitingForModules = [];
|
|
this.areModulesLoaded = true;
|
|
}
|
|
}
|
|
};
|
|
|
|
setup();
|
|
};
|