Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Plugin system #35

Closed
chylex opened this issue May 28, 2016 · 0 comments
Closed

Plugin system #35

chylex opened this issue May 28, 2016 · 0 comments
Assignees
Milestone

Comments

@chylex
Copy link
Owner

chylex commented May 28, 2016

Plugins will be folders placed in the /plugins/user/ (with official plugins in /plugins/official/).

Each plugin consists of a .meta file which contains information about the plugin, and at least one of browser.js and notification.js files, which contain the actual script that is ran either in the browser or notification window.

Browser plugins have access to the full library set of TweetDeck (such as jQuery or TD's custom front-end functions), notification plugins can only use vanilla JS. All plugins have access to global variables, including $TD for communication with the C# end.

Here is a rough base of a plugin. All overridden functions except for constructor are empty and do not require a super call.

.meta

[name]
Example Plugin

[description]
This is an example plugin.
It does stuff.

[author]
chylex

[version]
1.0

[requires]
1.2.3

(only name tag is required; the value of requires defaults to wildcard (*) but the program will not load the plugin if an invalid version is provided)

browser.js

constructor(){
  super({
    requiresPageReload: true // reloads page when manually enabled or disabled
  });
}

enabled(){
  // prepare variables, modify global variables, update stylesheets
}

ready(){
  // modify the contents as the page has finished loading, add event listeners
}

disabled(){
  // remove event listeners and revert everything to original state
}

notification.js

constructor(){
  super({
    // currently no options
  });
}

run(){
  // setup everything, ran for every notification
}

This is a very basic plugin system that will be expanded in the future if there is any interest in it. Ideas and feedback appreciated.

@chylex chylex added this to the Release 1.3 milestone May 28, 2016
@chylex chylex self-assigned this May 28, 2016
@chylex chylex closed this as completed Jul 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant