diff --git a/deluge/plugins/example/example/data/example.js b/deluge/plugins/example/example/data/example.js new file mode 100644 index 000000000..c4c5e4c79 --- /dev/null +++ b/deluge/plugins/example/example/data/example.js @@ -0,0 +1,18 @@ +ExamplePlugin = Ext.extend(Deluge.Plugin, { + constructor: function(config) { + config = Ext.apply({ + name: "Example" + }, config); + ExamplePlugin.superclass.constructor.call(this, config); + }, + + onDisable: function() { + Deluge.Preferences.removePage(this.prefsPage); + }, + + onEnable: function() { + this.prefsPage = new ExamplePreferencesPanel(); + this.prefsPage = Deluge.Preferences.addPage(this.prefsPage); + } +}); +new ExamplePlugin(); \ No newline at end of file diff --git a/deluge/plugins/example/example/webui.py b/deluge/plugins/example/example/webui.py index 01c8661c6..df2efadd5 100644 --- a/deluge/plugins/example/example/webui.py +++ b/deluge/plugins/example/example/webui.py @@ -33,13 +33,20 @@ # # - from deluge.log import LOG as log from deluge.ui.client import client from deluge import component from deluge.plugins.pluginbase import WebPluginBase +from common import get_resource + class WebUI(WebPluginBase): + + scripts = [get_resource("example.js")] + + # The enable and disable methods are not scrictly required on the WebUI + # plugins. They are only here if you need to register images/stylesheets + # with the webserver. def enable(self): log.debug("Example Web plugin enabled!")