Author: damoxc
Revision: 6151
Log:
add some basic doc strings
Diff:
Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.Plugin.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.Plugin.js 2010-01-26 17:07:23 UTC
(rev 6150)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.Plugin.js 2010-01-26 17:26:53 UTC
(rev 6151)
@@ -1,6 +1,6 @@
/*
Script: Deluge.Plugin.js
- Contains a base class for plugins to extend.
+ Contains a base class for plugins to extend.
Copyright:
(C) Damien Churchill 2009 <[email protected]>
@@ -20,36 +20,66 @@
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA.
- In addition, as a special exception, the copyright holders give
- permission to link the code of portions of this program with the OpenSSL
- library.
- You must obey the GNU General Public License in all respects for all of
- the code used other than OpenSSL. If you modify file(s) with this
- exception, you may extend this exception to your version of the file(s),
- but you are not obligated to do so. If you do not wish to do so, delete
- this exception statement from your version. If you delete this exception
- statement from all source files in the program, then also delete it here.
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of portions of this program with the OpenSSL
+ library.
+ You must obey the GNU General Public License in all respects for all of
+ the code used other than OpenSSL. If you modify file(s) with this
+ exception, you may extend this exception to your version of the file(s),
+ but you are not obligated to do so. If you do not wish to do so, delete
+ this exception statement from your version. If you delete this exception
+ statement from all source files in the program, then also delete it
here.
*/
+/**
+ * @class Deluge.Plugin
+ * @extends Ext.util.Observable
+ */
Deluge.Plugin = Ext.extend(Ext.util.Observable, {
- constructor: function(config) {
- this.name = config.name;
- this.addEvents({
- "enabled": true,
- "disabled": true
- });
- this.isDelugePlugin = true;
- Deluge.Plugins[this.name] = this;
- Deluge.Plugin.superclass.constructor.call(this, config);
- },
-
- disable: function() {
- this.fireEvent("disabled", this);
- if (this.onDisable) this.onDisable();
- },
-
- enable: function() {
- this.fireEvent("enable", this);
- if (this.onEnable) this.onEnable();
- }
-});
\ No newline at end of file
+
+ /**
+ * The plugins name
+ * @property name
+ * @type {String}
+ */
+ name: null,
+
+ constructor: function(config) {
+ this.name = config.name;
+ this.addEvents({
+
+ /**
+ * @event enabled
+ * @param {Plugin} plugin the plugin instance
+ */
+ "enabled": true,
+
+ /**
+ * @event disabled
+ * @param {Plugin} plugin the plugin instance
+ */
+ "disabled": true
+ });
+ this.isDelugePlugin = true;
+ Deluge.Plugins[this.name] = this;
+ Deluge.Plugin.superclass.constructor.call(this, config);
+ },
+
+ /**
+ * Disables the plugin, firing the "{...@link #disabled}" event and
+ * then executing the plugins clean up method onDisabled.
+ */
+ disable: function() {
+ this.fireEvent("disabled", this);
+ if (this.onDisable) this.onDisable();
+ },
+
+ /**
+ * Enables the plugin, firing the "{...@link #enabled}" event and
+ * then executes the plugins setup method, onEnabled.
+ */
+ enable: function() {
+ this.fireEvent("enable", this);
+ if (this.onEnable) this.onEnable();
+ }
+});
--
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.