Author: damoxc
Revision: 5762
Log:
update the example plugin with the new webui plugin stuff
Diff:
Added: trunk/deluge/plugins/example/example/data/example.js
===================================================================
--- trunk/deluge/plugins/example/example/data/example.js
(rev 0)
+++ trunk/deluge/plugins/example/example/data/example.js 2009-09-17
07:27:33 UTC (rev 5762)
@@ -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
Modified: trunk/deluge/plugins/example/example/webui.py
===================================================================
--- trunk/deluge/plugins/example/example/webui.py 2009-09-16 09:53:49 UTC
(rev 5761)
+++ trunk/deluge/plugins/example/example/webui.py 2009-09-17 07:27:33 UTC
(rev 5762)
@@ -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!")
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---