Skip to content

Commit

Permalink
24.2.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Mar 28, 2024
1 parent 3dbd67a commit b5e5693
Show file tree
Hide file tree
Showing 80 changed files with 3,330 additions and 3,022 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
28-MAR-2024: 24.2.1

- Adds menu item for high contrast mode
- Adds shortcuts.svg to PWA [drawio-desktop-1130]
- [conf cloud] Fixes special XML characters in import services [DID-10752]
- Fixes C4 labels [drawio-4300]

26-MAR-2024: 24.2.0

- Naming fix for [draw-3336]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.2.0
24.2.1
1 change: 1 addition & 0 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
<link rel="icon" href="favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<link rel="stylesheet" media="(forced-colors: active)" href="styles/high-contrast.css" id="high-contrast-stylesheet">
<link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico">
Expand Down
2,569 changes: 1,298 additions & 1,271 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

96 changes: 49 additions & 47 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ App = function(editor, container, lightbox)

if (wnd == null || wnd === undefined)
{
this.showDialog(new PopupDialog(this, url, pre, fallback).container, 320, 140, true, true);
this.showDialog(new PopupDialog(this, url, pre, fallback).container, 320, 160, true, true);
}
else if (pre != null)
{
Expand Down Expand Up @@ -2902,54 +2902,61 @@ App.prototype.load = function()
// Checks if we're running in embedded mode
if (urlParams['embed'] != '1')
{
if (this.spinner.spin(document.body, mxResources.get('starting')))
try
{
try
{
this.stateArg = (urlParams['state'] != null && this.drive != null) ?
JSON.parse(decodeURIComponent(urlParams['state'])) : null;
}
catch (e)
{
// ignores invalid state args
}

this.editor.graph.setEnabled(this.getCurrentFile() != null);

// Passes the userId from the state parameter to the client
if ((window.location.hash == null || window.location.hash.length == 0) &&
this.drive != null && this.stateArg != null && this.stateArg.userId != null)
if (this.spinner.spin(document.body, mxResources.get('starting')))
{
this.drive.setUserId(this.stateArg.userId);
}
try
{
this.stateArg = (urlParams['state'] != null && this.drive != null) ?
JSON.parse(decodeURIComponent(urlParams['state'])) : null;
}
catch (e)
{
// ignores invalid state args
}

this.editor.graph.setEnabled(this.getCurrentFile() != null);

// Passes the userId from the state parameter to the client
if ((window.location.hash == null || window.location.hash.length == 0) &&
this.drive != null && this.stateArg != null && this.stateArg.userId != null)
{
this.drive.setUserId(this.stateArg.userId);
}

// Legacy support for fileId parameter which is moved to the hash tag
if (urlParams['fileId'] != null)
{
window.location.hash = 'G' + urlParams['fileId'];
window.location.search = this.getSearch(['fileId']);
}
else
{
// Asynchronous or disabled loading of client
if (this.drive == null)
// Legacy support for fileId parameter which is moved to the hash tag
if (urlParams['fileId'] != null)
{
if (this.mode == App.MODE_GOOGLE)
{
this.mode = null;
}

this.start();
window.location.hash = 'G' + urlParams['fileId'];
window.location.search = this.getSearch(['fileId']);
}
else
{
this.loadGapi(mxUtils.bind(this, function()
// Asynchronous or disabled loading of client
if (this.drive == null)
{
if (this.mode == App.MODE_GOOGLE)
{
this.mode = null;
}

this.start();
}));
}
else
{
this.loadGapi(mxUtils.bind(this, function()
{
this.start();
}));
}
}
}
}
catch (e)
{
this.handleError(e);
}
}
else
{
Expand Down Expand Up @@ -3659,17 +3666,12 @@ App.prototype.checkDrafts = function()
}), mxUtils.bind(this, function(index, success)
{
index = (index != '') ? index : 0;
this.removeDatabaseItem(drafts[index].key);

// Discard draft
this.confirm(mxResources.get('areYouSure'), null, mxUtils.bind(this, function()
if (success != null)
{
this.removeDatabaseItem(drafts[index].key);

if (success != null)
{
success();
}
}), mxResources.get('no'), mxResources.get('yes'));
success();
}
}), null, null, null, (drafts.length > 1) ? drafts : null);
this.showDialog(dlg.container, 640, 480, true, false, mxUtils.bind(this, function(cancel)
{
Expand Down Expand Up @@ -5573,7 +5575,7 @@ App.prototype.loadFile = function(id, sameWindow, file, success, force)
else if (currentFile != null && !sameWindow)
{
this.showDialog(new PopupDialog(this, this.getUrl() + '#' + id,
null, fn).container, 320, 140, true, true);
null, fn).container, 320, 160, true, true);
}
else
{
Expand Down
69 changes: 49 additions & 20 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7564,11 +7564,33 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d

var draftSelected = mxUtils.bind(this, function()
{
doc = mxUtils.parseXml(drafts[select.value].data);
node = editorUi.editor.extractGraphModel(doc.documentElement, true);
currentPage = 0;

this.init();
if (select.value == '-1')
{
select.value = select.options[0].value;
draftSelected();

// Discard all drafts
editorUi.confirm(mxResources.get('areYouSure'), null, mxUtils.bind(this, async function()
{
for (var i = 0; i < drafts.length; i++)
{
discardFn.apply(this, [i, mxUtils.bind(this, function()
{
// Do nothing
})]);
}

editorUi.hideDialog(true);
}), mxResources.get('no'), mxResources.get('yes'));
}
else
{
doc = mxUtils.parseXml(drafts[select.value].data);
node = editorUi.editor.extractGraphModel(doc.documentElement, true);
currentPage = 0;

this.init();
}
});

if (drafts != null)
Expand All @@ -7590,9 +7612,13 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d

select.appendChild(opt);
}


// Delete all option
var opt = document.createElement('option');
opt.setAttribute('value', '-1');
mxUtils.write(opt, mxResources.get('deleteAll'));
select.appendChild(opt);
titleDiv.appendChild(select);

mxEvent.addListener(select, 'change', draftSelected);
}

Expand Down Expand Up @@ -7682,23 +7708,26 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d

var restoreBtn = mxUtils.button(discardLabel || mxResources.get('discard'), function()
{
discardFn.apply(this, [select.value, mxUtils.bind(this, function()
editorUi.confirm(mxResources.get('areYouSure'), null, mxUtils.bind(this, async function()
{
if (select.parentNode != null)
discardFn.apply(this, [select.value, mxUtils.bind(this, function()
{
select.options[select.selectedIndex].parentNode.removeChild(select.options[select.selectedIndex]);

if (select.options.length > 0)
if (select.parentNode != null)
{
select.value = select.options[0].value;
draftSelected();
}
else
{
editorUi.hideDialog(true);
select.options[select.selectedIndex].parentNode.removeChild(select.options[select.selectedIndex]);

if (select.options.length > 1)
{
select.value = select.options[0].value;
draftSelected();
}
else
{
editorUi.hideDialog(true);
}
}
}
})]);
})]);
}), mxResources.get('no'), mxResources.get('yes'));
});
restoreBtn.className = 'geBtn';

Expand Down
Loading

0 comments on commit b5e5693

Please sign in to comment.