Skip to content

Commit

Permalink
22.1.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Dec 15, 2023
1 parent 92ebd32 commit 35819dc
Show file tree
Hide file tree
Showing 20 changed files with 6,511 additions and 7,569 deletions.
4 changes: 2 additions & 2 deletions src/main/webapp/js/PostConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
* Copyright (c) 2006-2024, JGraph Ltd
* Copyright (c) 2006-2024, draw.io AG
*/
// null'ing of global vars need to be after init.js
window.VSD_CONVERT_URL = null;
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/js/PreConfig.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
* Copyright (c) 2006-2024, JGraph Ltd
* Copyright (c) 2006-2024, draw.io AG
*/
// Overrides of global vars need to be pre-loaded
window.DRAWIO_PUBLIC_BUILD = true;
window.EXPORT_URL = 'REPLACE_WITH_YOUR_IMAGE_SERVER';
window.PLANT_URL = 'REPLACE_WITH_YOUR_PLANTUML_SERVER';
window.DRAWIO_BASE_URL = null; // Replace with path to base of deployment, e.g. https://www.example.com/folder
Expand Down
4,132 changes: 2,046 additions & 2,086 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,14 @@ App.main = function(callback, createUi)
{
try
{
// Checks theme support
if (Editor.currentTheme != '' && Editor.currentTheme != 'kennedy' &&
Editor.currentTheme != 'dark' && mxUtils.indexOf(
Editor.themes, Editor.currentTheme) < 0)
{
Editor.currentTheme = 'kennedy';
}

var ui = (createUi != null) ? createUi() : new App(new Editor(
urlParams['chrome'] == '0' || uiTheme == 'min',
null, null, null, urlParams['chrome'] != '0'));
Expand Down Expand Up @@ -4660,9 +4668,8 @@ App.prototype.loadTemplate = function(url, onload, onerror, templateFilename, as
var base64 = false;
var realUrl = url;
var filterFn = (templateFilename != null) ? templateFilename : url;
var isVisioFilename = /(\.v(dx|sdx?))($|\?)/i.test(filterFn) ||
/(\.vs(x|sx?))($|\?)/i.test(filterFn);
var binary = /\.png$/i.test(filterFn) || /\.pdf$/i.test(filterFn);
var isVisioFilename = this.isVisioFilename(filterFn);

if (!this.editor.isCorsEnabledForUrl(realUrl))
{
Expand Down Expand Up @@ -4742,8 +4749,7 @@ App.prototype.loadTemplate = function(url, onload, onerror, templateFilename, as
{
onerror(e);
}
}), onerror, /(\.png)($|\?)/i.test(filterFn) || /(\.v(dx|sdx?))($|\?)/i.test(filterFn) ||
/(\.vs(x|sx?))($|\?)/i.test(filterFn), null, null, base64);
}), onerror, /(\.png)($|\?)/i.test(filterFn) || isVisioFilename, null, null, base64);
};

/**
Expand Down
9 changes: 6 additions & 3 deletions src/main/webapp/js/diagramly/Devel.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ mxscript(drawDevUrl + 'js/diagramly/mxFreehand.js');
mxscript(drawDevUrl + 'js/diagramly/P2PCollab.js');
mxscript(drawDevUrl + 'js/diagramly/DevTools.js');

if (!window.DRAWIO_PUBLIC_BUILD)
{
mxscript(drawDevUrl + 'js/diagramly/Simple.js');
mxscript(drawDevUrl + 'js/mermaid/mermaid2drawio.js');
}

// Vsdx/vssx support
mxscript(drawDevUrl + 'js/diagramly/vsdx/VsdxExport.js');
mxscript(drawDevUrl + 'js/diagramly/vsdx/mxVsdxCanvas2D.js');
Expand All @@ -290,6 +296,3 @@ if (urlParams['orgChartDev'] == '1')

// Miro Import
mxscript(drawDevUrl + 'js/diagramly/miro/MiroImporter.js');

// Mermaid to draw.io converter
mxscript(drawDevUrl + 'js/mermaid/mermaid2drawio.js');
35 changes: 22 additions & 13 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2147,9 +2147,9 @@ var ParseDialog = function(editorUi, title, defaultType)
var sp = diagramType.indexOf(' ');
diagramType = diagramType.substring(0, sp > 0 ? sp : diagramType.length);
var inDrawioFormat = typeof mxMermaidToDrawio !== 'undefined' &&
type == 'mermaid2drawio' && diagramType != 'gantt' &&
diagramType != 'pie' && diagramType != 'timeline' &&
diagramType != 'quadrantchart' && diagramType != 'c4context';
type == 'mermaid2drawio' && diagramType != 'gantt' &&
diagramType != 'pie' && diagramType != 'timeline' &&
diagramType != 'quadrantchart' && diagramType != 'c4context';

var graph = editorUi.editor.graph;

Expand Down Expand Up @@ -2568,22 +2568,29 @@ var ParseDialog = function(editorUi, title, defaultType)
typeSelect.appendChild(tableOption);
tableOption.setAttribute('selected', 'selected');
}

var mermaid2drawioOption = document.createElement('option');
mermaid2drawioOption.setAttribute('value', 'mermaid2drawio');
mxUtils.write(mermaid2drawioOption, mxResources.get('diagram'));

var mermaidOption = document.createElement('option');
mermaidOption.setAttribute('value', 'mermaid');
mxUtils.write(mermaidOption, mxResources.get('image'));

if (defaultType == 'mermaid')
{
typeSelect.appendChild(mermaid2drawioOption);
mermaid2drawioOption.setAttribute('selected', 'selected');
typeSelect.appendChild(mermaidOption);
if (typeof mxMermaidToDrawio !== 'undefined')
{
var mermaid2drawioOption = document.createElement('option');
mermaid2drawioOption.setAttribute('value', 'mermaid2drawio');
mermaid2drawioOption.setAttribute('selected', 'selected');
mxUtils.write(mermaid2drawioOption, mxResources.get('diagram'));
typeSelect.appendChild(mermaid2drawioOption);
}
else
{
typeSelect.style.display = 'none';
}
}

typeSelect.appendChild(mermaidOption);

var diagramOption = document.createElement('option');
diagramOption.setAttribute('value', 'diagram');
mxUtils.write(diagramOption, mxResources.get('diagram'));
Expand Down Expand Up @@ -3895,7 +3902,9 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
categories['basic'] = [{title: 'blankDiagram'}];
var templates = categories['basic'];

if (editorUi.isExternalDataComms() && editorUi.getServiceName() == 'draw.io')
if (editorUi.isExternalDataComms() &&
editorUi.getServiceName() == 'draw.io' &&
typeof mxMermaidToDrawio !== 'undefined')
{
categories['smartTemplate'] = {content: createSmartTemplateContent()};
}
Expand Down Expand Up @@ -11582,7 +11591,7 @@ var LibraryDialog = function(editorUi, name, library, initialImages, file, mode,
{
return function(data, mimeType, x, y, w, h, img, doneFn, file)
{
if (file != null && (/(\.v(dx|sdx?))($|\?)/i.test(file.name) || /(\.vs(x|sx?))($|\?)/i.test(file.name)))
if (file != null && editorUi.isVisioFilename(file.name))
{
editorUi.importVisio(file, mxUtils.bind(this, function(xml)
{
Expand Down
3 changes: 1 addition & 2 deletions src/main/webapp/js/diagramly/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,7 @@
/app\.diagrams\.net$/.test(window.location.hostname)) &&
!this.isCorsEnabledForUrl(url))
{
var isVisioFilename = /(\.v(dx|sdx?))($|\?)/i.test(url) ||
/(\.vs(x|sx?))($|\?)/i.test(url);
var isVisioFilename = this.isVisioFilename(url);
var binary = /\.png$/i.test(url) || /\.pdf$/i.test(url);
var base64 = binary || isVisioFilename;
var nocache = 't=' + new Date().getTime();
Expand Down
Loading

0 comments on commit 35819dc

Please sign in to comment.