mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
add some basic doc strings
This commit is contained in:
parent
454321614b
commit
dc764b2ad5
1 changed files with 61 additions and 31 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Script: Deluge.Plugin.js
|
Script: Deluge.Plugin.js
|
||||||
Contains a base class for plugins to extend.
|
Contains a base class for plugins to extend.
|
||||||
|
|
||||||
Copyright:
|
Copyright:
|
||||||
(C) Damien Churchill 2009 <damoxc@gmail.com>
|
(C) Damien Churchill 2009 <damoxc@gmail.com>
|
||||||
|
@ -20,36 +20,66 @@ Copyright:
|
||||||
51 Franklin Street, Fifth Floor
|
51 Franklin Street, Fifth Floor
|
||||||
Boston, MA 02110-1301, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
In addition, as a special exception, the copyright holders give
|
In addition, as a special exception, the copyright holders give
|
||||||
permission to link the code of portions of this program with the OpenSSL
|
permission to link the code of portions of this program with the OpenSSL
|
||||||
library.
|
library.
|
||||||
You must obey the GNU General Public License in all respects for all of
|
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
|
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),
|
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
|
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
|
this exception statement from your version. If you delete this exception
|
||||||
statement from all source files in the program, then also delete it here.
|
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, {
|
Deluge.Plugin = Ext.extend(Ext.util.Observable, {
|
||||||
constructor: function(config) {
|
|
||||||
this.name = config.name;
|
/**
|
||||||
this.addEvents({
|
* The plugins name
|
||||||
"enabled": true,
|
* @property name
|
||||||
"disabled": true
|
* @type {String}
|
||||||
});
|
*/
|
||||||
this.isDelugePlugin = true;
|
name: null,
|
||||||
Deluge.Plugins[this.name] = this;
|
|
||||||
Deluge.Plugin.superclass.constructor.call(this, config);
|
constructor: function(config) {
|
||||||
},
|
this.name = config.name;
|
||||||
|
this.addEvents({
|
||||||
disable: function() {
|
|
||||||
this.fireEvent("disabled", this);
|
/**
|
||||||
if (this.onDisable) this.onDisable();
|
* @event enabled
|
||||||
},
|
* @param {Plugin} plugin the plugin instance
|
||||||
|
*/
|
||||||
enable: function() {
|
"enabled": true,
|
||||||
this.fireEvent("enable", this);
|
|
||||||
if (this.onEnable) this.onEnable();
|
/**
|
||||||
}
|
* @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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue