Skip to content

Instantly share code, notes, and snippets.

@mirkomorati
Last active February 21, 2018 16:19
Show Gist options
  • Save mirkomorati/7a6334b5610f2ea9fc60304e5f5ff66d to your computer and use it in GitHub Desktop.
Save mirkomorati/7a6334b5610f2ea9fc60304e5f5ff66d to your computer and use it in GitHub Desktop.
Draw.loadPlugin(function(ui) {
// Adds action
ui.actions.addAction('helloWorldAction', function() {
var ran = Math.floor((Math.random() * 100) + 1);
mxUtils.alert('A random number is ' + ran);
});
ui.actions.addAction('debugShapesAction', function() {
mxLog.show();
mxLog.debug("DEBUG");
for (var i in mxGraph.prototype.getSelectionCells())
{
mxLog.debug(i);
}
});
// Adds menu
ui.menubar.addMenu('Hello, World Menu', function(menu, parent) {
ui.menus.addMenuItem(menu, 'helloWorldAction');
ui.menus.addMenuItem(menu, 'debugShapesAction');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment