Labs/Bespin/DesignDocs/PluginAPI: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 34: Line 34:
* plugin:deactivate
* plugin:deactivate
* plugin:load:complete
* plugin:load:complete
and once loaded a plugin can listen for:
* cmdline:loaded
* settings:loaded
* toolbar:loaded


The plugin will listen in on these and will then hook itself up.
The plugin will listen in on these and will then hook itself up.
Line 42: Line 48:


We also need to think about how data, or images, or JSON can be used from within a plugin (using its own resources). Furthermore, having a simple include() from within the config and plugin work would be nice. This could piggy back on dojo.require/provide.
We also need to think about how data, or images, or JSON can be used from within a plugin (using its own resources). Furthermore, having a simple include() from within the config and plugin work would be nice. This could piggy back on dojo.require/provide.
==== Plugin Directory ====
Plugins will be placed in either BespinSettings/plugins/yourplugin.js or BespinSettings/plugins/yourplugin/*.  You will use the directory version if your plugin packages up multiple files and resources such as CSS, images, etc.


==== Discovery ====
==== Discovery ====
Line 53: Line 63:
In your config file you will be able to fire an event to load a plugin:
In your config file you will be able to fire an event to load a plugin:


   bespin.publish("plugin:load", {
   bespin.plugin.load("http://foo.com/bespinPlugin.zip");
    url: "http://foo.com/bespinPlugin.zip"
  });


=== Server and Client Plugins ===
=== Server and Client Plugins ===
355

edits

Navigation menu