Last active
March 18, 2020 02:10
-
-
Save IlyaPavlik/20fae7d635ba1d341fc343cd6e5dc607 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
/** | |
* Text extraction plugin. | |
*/ | |
Draw.loadPlugin(function(ui) | |
{ | |
// Adds resource for action | |
mxResources.parse('extractText=Extract Text...'); | |
// Adds action | |
ui.actions.addAction('extractText', function() | |
{ | |
var dlg = new EmbedDialog(ui, ui.editor.graph.getIndexableText(), | |
null, null, null, 'Extracted Text:'); | |
ui.showDialog(dlg.container, 440, 240, true, true); | |
dlg.init(); | |
}); | |
var menu = ui.menus.get('extras'); | |
var oldFunct = menu.funct; | |
menu.funct = function(menu, parent) | |
{ | |
oldFunct.apply(this, arguments); | |
ui.menus.addMenuItems(menu, ['-', 'extractText'], parent); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment