canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,093
edits
No edit summary |
|||
Line 76: | Line 76: | ||
// referred to by name | // referred to by name | ||
name: "luaHighlighter", | name: "luaHighlighter", | ||
// up to the first "." would be used as the short description. Everything | // up to the first "." would be used as the short description. Everything | ||
// else is viewed in a long description context. | // else is viewed in a long description context. | ||
description: "Syntax highlighter for the Lua programming language.", | description: "Syntax highlighter for the Lua programming language.", | ||
// version numbers will be good for automatic updates. | // version numbers will be good for automatic updates. | ||
version: "1.0", | version: "1.0", | ||
// core parts of Bespin (and even plugins) can query for metadata | // core parts of Bespin (and even plugins) can query for metadata | ||
// and request that a plugin is loaded. In this case, | // and request that a plugin is loaded. In this case, | ||
Line 90: | Line 90: | ||
// If it's a lua file, it will see that this plugin can handle | // If it's a lua file, it will see that this plugin can handle | ||
// lua. | // lua. | ||
provides: [ | |||
"bespin.syntax.simple" | ["bespin.syntax.simple", { | ||
extensions: ["lua"] | extensions: ["lua"], | ||
// in the single file version of a plugin, you just refer to the | |||
// functions in the plugin itself | |||
load: "luaHighlighter" | |||
] | |||
], | |||
subscribes: [ | |||
["file:savefile", "savehandler"] | |||
] | |||
} | } | ||
exports.luaHighlighter = function() { | |||
// return a lua highlighter instance | |||
exports. | |||
// | |||
} | } | ||
exports.savehandler = function(event) { | |||
// do whatever it is we do on save | |||
exports. | |||
// do | |||
} | } | ||
Plugin modules are implemented not as Dojo modules, but rather as [https://wiki.mozilla.org/ServerJS/Modules/SecurableModules ServerJS Securable Modules]. This would allow seamless interop for plugins that have both client and server side JS components. | Plugin modules are implemented not as Dojo modules, but rather as [https://wiki.mozilla.org/ServerJS/Modules/SecurableModules ServerJS Securable Modules]. This would allow seamless interop for plugins that have both client and server side JS components. |