c9-core/plugins/c9.ide.plugins/mock/c9.ide.example2/example.js

64 wiersze
1.4 KiB
JavaScript

2016-06-26 11:53:19 +00:00
define(function(require, exports, module) {
main.consumes = [
"Plugin", "commands"
];
main.provides = ["example2"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
var commands = imports.commands;
/***** Initialization *****/
var plugin = new Plugin("Ajax.org", main.consumes);
var emit = plugin.getEmitter();
2017-01-30 11:32:54 +00:00
var api = plugin.setAPIKey(options.apikey);
2016-06-26 11:53:19 +00:00
var loaded = false;
function load() {
if (loaded) return false;
loaded = true;
// alert(1);
console.error(commands, options.color);
}
/***** Methods *****/
/***** Lifecycle *****/
plugin.on("load", function() {
load();
});
plugin.on("enable", function() {
});
plugin.on("disable", function() {
});
plugin.on("unload", function() {
loaded = false;
});
/***** Register and define API *****/
/**
*
**/
plugin.freezePublicAPI({
_events: [
/**
* @event draw
*/
"draw"
]
});
register(null, {
example2: plugin
});
}
});