Last active
February 21, 2018 16:19
-
-
Save mirkomorati/7a6334b5610f2ea9fc60304e5f5ff66d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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