|
@@ -620,6 +620,18 @@ mxStencilRegistry.allowEval = false;
|
|
|
|
|
|
editorUi.actions.addAction('plugins...', function()
|
|
|
{
|
|
|
+ var pluginsMap = {};
|
|
|
+ //Initialize it with plugins in settings
|
|
|
+ var plugins = (mxSettings.settings != null) ? mxSettings.getPlugins() : null;
|
|
|
+
|
|
|
+ if (plugins != null)
|
|
|
+ {
|
|
|
+ for (var i = 0; i < plugins.length; i++)
|
|
|
+ {
|
|
|
+ pluginsMap[plugins[i]] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
editorUi.showDialog(new PluginsDialog(editorUi, function(callback)
|
|
|
{
|
|
|
var div = document.createElement('div');
|
|
@@ -634,9 +646,13 @@ mxStencilRegistry.allowEval = false;
|
|
|
|
|
|
for (var i = 0; i < App.publicPlugin.length; i++)
|
|
|
{
|
|
|
+ var p = App.publicPlugin[i];
|
|
|
+
|
|
|
+ if (pluginsMap[App.pluginRegistry[p]]) continue;
|
|
|
+
|
|
|
var option = document.createElement('option');
|
|
|
- mxUtils.write(option, App.publicPlugin[i]);
|
|
|
- option.value = App.publicPlugin[i];
|
|
|
+ mxUtils.write(option, p);
|
|
|
+ option.value = p;
|
|
|
pluginsSelect.appendChild(option);
|
|
|
}
|
|
|
|
|
@@ -694,12 +710,16 @@ mxStencilRegistry.allowEval = false;
|
|
|
|
|
|
var dlg = new CustomDialog(editorUi, div, mxUtils.bind(this, function()
|
|
|
{
|
|
|
- callback(App.pluginRegistry[pluginsSelect.value]);
|
|
|
+ var newP = App.pluginRegistry[pluginsSelect.value];
|
|
|
+ pluginsMap[newP] = true;
|
|
|
+ callback(newP);
|
|
|
}));
|
|
|
editorUi.showDialog(dlg.container, 300, 125, true, true);
|
|
|
},
|
|
|
async function(plugin)
|
|
|
{
|
|
|
+ delete pluginsMap[plugin];
|
|
|
+
|
|
|
await requestSync({
|
|
|
action: 'uninstallPlugin',
|
|
|
plugin: plugin
|
|
@@ -1755,6 +1775,11 @@ mxStencilRegistry.allowEval = false;
|
|
|
electron.sendMessage('toggleSpellCheck');
|
|
|
}
|
|
|
|
|
|
+ App.prototype.openDevTools = function()
|
|
|
+ {
|
|
|
+ electron.sendMessage('openDevTools');
|
|
|
+ }
|
|
|
+
|
|
|
var origUpdateHeader = App.prototype.updateHeader;
|
|
|
|
|
|
App.prototype.updateHeader = function()
|