You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
719 B
32 lines
719 B
/**
|
|
* Text extraction plugin.
|
|
*/
|
|
Draw.loadPlugin(function(ui)
|
|
{
|
|
// Adds resource for action
|
|
mxResources.parse('extractText=Extract Text...');
|
|
|
|
// Adds action
|
|
ui.actions.addAction('extractText', function()
|
|
{
|
|
var graph = ui.editor.graph;
|
|
var text = graph.getIndexableText(
|
|
(graph.isSelectionEmpty()) ? null :
|
|
graph.getSelectionCells());
|
|
var dlg = new EmbedDialog(ui, text, null,
|
|
null, null, 'Extracted Text:');
|
|
ui.showDialog(dlg.container, 450, 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);
|
|
};
|
|
});
|