Skip to content

Commit edb8cd9

Browse files
committed
24.4.15 release
1 parent 728d214 commit edb8cd9

22 files changed

+4251
-4124
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
06-JUN-2024: 24.4.15
2+
3+
- Fixes possible clipping in sidebar popup
4+
- Enables saveAs for read-only files
5+
- Fixes text editing position for insert layout dialog [drawio-4449]
6+
- Adds start-/endFillColor styles for connectors [drawio-4438]
7+
18
05-JUN-2024: 24.4.14
29

310
- Adds support for adaptive polling

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.4.14
1+
24.4.15

src/main/webapp/js/app.min.js

Lines changed: 1825 additions & 1822 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/diagramly/App.js

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,8 +2471,9 @@ App.prototype.updateDocumentTitle = function()
24712471
/**
24722472
* Returns a thumbnail of the current file.
24732473
*/
2474-
App.prototype.getThumbnail = function(width, fn)
2474+
App.prototype.getThumbnail = function(width, fn, border)
24752475
{
2476+
border = (border != null) ? border : 0;
24762477
var result = false;
24772478

24782479
try
@@ -2567,7 +2568,7 @@ App.prototype.getThumbnail = function(width, fn)
25672568
{
25682569
// Continues with null in error case
25692570
success();
2570-
}, null, null, null, null, null, null, graph, null, null, null,
2571+
}, null, null, null, null, null, null, graph, border, null, null,
25712572
null, 'diagram', null);
25722573

25732574
result = true;
@@ -3927,28 +3928,39 @@ App.prototype.loadFileSystemEntry = function(fileHandle, success, error)
39273928

39283929
reader.onload = mxUtils.bind(this, function(e)
39293930
{
3930-
try
3931+
var doSuccess = mxUtils.bind(this, function(editable)
39313932
{
3932-
if (success != null)
3933+
try
39333934
{
3934-
var data = e.target.result;
3935-
3936-
if (file.type == 'image/png')
3935+
if (success != null)
3936+
{
3937+
var data = e.target.result;
3938+
3939+
if (file.type == 'image/png')
3940+
{
3941+
data = this.extractGraphModelFromPng(data);
3942+
}
3943+
3944+
success(new LocalFile(this, data, file.name, null, fileHandle, file, editable));
3945+
}
3946+
else
39373947
{
3938-
data = this.extractGraphModelFromPng(data);
3948+
this.openFileHandle(e.target.result, file.name, file, false, fileHandle, editable);
39393949
}
3940-
3941-
success(new LocalFile(this, data, file.name, null, fileHandle, file));
39423950
}
3943-
else
3951+
catch(e)
39443952
{
3945-
this.openFileHandle(e.target.result, file.name, file, false, fileHandle);
3953+
error(e);
39463954
}
3947-
}
3948-
catch(e)
3955+
});
3956+
3957+
fileHandle.createWritable().then(mxUtils.bind(this, function(writable)
39493958
{
3950-
error(e);
3951-
}
3959+
doSuccess(true);
3960+
}), mxUtils.bind(this, function(e)
3961+
{
3962+
doSuccess(false);
3963+
}));
39523964
});
39533965

39543966
reader.onerror = error;
@@ -4566,6 +4578,7 @@ App.prototype.saveFile = function(forceDialog, success)
45664578
file.fileHandle = fileHandle;
45674579
file.title = desc.name;
45684580
file.desc = desc;
4581+
file.editable = null;
45694582
this.save(desc.name, done);
45704583
}), null, this.createFileSystemOptions(file.getTitle()));
45714584
}

src/main/webapp/js/diagramly/Dialogs.js

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,13 +1273,23 @@ var CreateGraphDialog = function(editorUi, title, type)
12731273
graph.view.setTranslate(20, 20);
12741274
graph.border = 20;
12751275
graph.panningHandler.useLeftButtonForPanning = true;
1276+
1277+
// Fixes in-place editor position
1278+
if (mxClient.IS_SVG && graph.view.getDrawPane() != null)
1279+
{
1280+
var root = graph.view.getDrawPane().ownerSVGElement;
1281+
1282+
if (root != null)
1283+
{
1284+
root.style.position = 'absolute';
1285+
}
1286+
}
12761287

12771288
var vertexStyle = 'rounded=1;';
12781289
var edgeStyle = 'curved=1;';
12791290
var startStyle = 'ellipse';
12801291

12811292
// FIXME: Does not work in iPad
1282-
var mxCellRendererInstallCellOverlayListeners = mxCellRenderer.prototype.installCellOverlayListeners;
12831293
graph.cellRenderer.installCellOverlayListeners = function(state, overlay, shape)
12841294
{
12851295
mxCellRenderer.prototype.installCellOverlayListeners.apply(this, arguments);
@@ -1338,7 +1348,7 @@ var CreateGraphDialog = function(editorUi, title, type)
13381348
v2 = graph.insertVertex(parent, null, 'Entry', geo.x, geo.y, 80, 30, vertexStyle);
13391349
addOverlay(v2);
13401350
graph.view.refresh(v2);
1341-
var e1 = graph.insertEdge(parent, null, '', cell, v2, edgeStyle);
1351+
graph.insertEdge(parent, null, '', cell, v2, edgeStyle);
13421352
}, function()
13431353
{
13441354
graph.scrollCellToVisible(v2);
@@ -3485,10 +3495,10 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
34853495

34863496
function create()
34873497
{
3488-
if (templateXml == lastAiXml)
3498+
if (templateXml != null && templateXml == lastAiXml)
34893499
{
34903500
EditorUi.logEvent({category: 'OPENAI-DIAGRAM',
3491-
action: 'templateUsed',
3501+
action: 'templateGenerated',
34923502
label: lastAiTitle});
34933503
}
34943504

@@ -3834,7 +3844,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
38343844
editorUi.generateOpenAiMermaidDiagram(prompt,
38353845
function(mermaidData, imageData, w, h)
38363846
{
3837-
if (selectedElt == generateElt)
3847+
if (selectedElt == generateElt && generateInput.style.visibility == 'hidden')
38383848
{
38393849
generateBackground = 'url(' + 'data:image/svg+xml;base64,' +
38403850
imageData.substring(imageData.indexOf(',') + 1) + ')';
@@ -13310,63 +13320,58 @@ var FilePropertiesDialog = function(editorUi, publicLink)
1331013320
}
1331113321
};
1331213322
};
13323+
13324+
var initialLocked = (file != null) ? file.isLocked() : false;
1331313325

13314-
if (urlParams['test'] == '1')
13315-
{
13316-
var initialLocked = (file != null) ? file.isLocked() : false;
13317-
13318-
row = document.createElement('tr');
13319-
td = document.createElement('td');
13320-
td.style.whiteSpace = 'nowrap';
13321-
td.style.overflow = 'hidden';
13322-
td.style.textOverflow = 'ellipsis';
13323-
td.style.fontSize = '10pt';
13326+
row = document.createElement('tr');
13327+
td = document.createElement('td');
13328+
td.style.whiteSpace = 'nowrap';
13329+
td.style.overflow = 'hidden';
13330+
td.style.textOverflow = 'ellipsis';
13331+
td.style.fontSize = '10pt';
1332413332

13325-
// TODO: Use mxResources.get('locked')
13326-
mxUtils.write(td, 'Locked' + ':');
13327-
13328-
row.appendChild(td);
13333+
mxUtils.write(td, mxResources.get('locked') + ':');
13334+
row.appendChild(td);
1332913335

13330-
var lockedInput = document.createElement('input');
13331-
lockedInput.setAttribute('type', 'checkbox');
13332-
13333-
if (initialLocked)
13334-
{
13335-
lockedInput.setAttribute('checked', 'checked');
13336-
lockedInput.defaultChecked = true;
13337-
}
13338-
13339-
td = document.createElement('td');
13340-
td.style.whiteSpace = 'nowrap';
13341-
td.appendChild(lockedInput);
13342-
row.appendChild(td);
13343-
tbody.appendChild(row);
13336+
var lockedInput = document.createElement('input');
13337+
lockedInput.setAttribute('type', 'checkbox');
13338+
13339+
if (initialLocked)
13340+
{
13341+
lockedInput.setAttribute('checked', 'checked');
13342+
lockedInput.defaultChecked = true;
13343+
}
13344+
13345+
td = document.createElement('td');
13346+
td.style.whiteSpace = 'nowrap';
13347+
td.appendChild(lockedInput);
13348+
row.appendChild(td);
13349+
tbody.appendChild(row);
1334413350

13345-
this.init = function()
13346-
{
13347-
lockedInput.focus();
13348-
};
13351+
this.init = function()
13352+
{
13353+
lockedInput.focus();
13354+
};
1334913355

13350-
addApply(function(success, error)
13356+
addApply(function(success, error)
13357+
{
13358+
if (editorUi.fileNode != null && initialLocked != lockedInput.checked)
1335113359
{
13352-
if (editorUi.fileNode != null && initialLocked != lockedInput.checked)
13360+
window.setTimeout(function()
1335313361
{
13354-
window.setTimeout(function()
13362+
if (file != null)
1335513363
{
13356-
if (file != null)
13357-
{
13358-
file.setLocked(lockedInput.checked);
13359-
}
13364+
file.setLocked(lockedInput.checked);
13365+
}
1336013366

13361-
success();
13362-
}, 0);
13363-
}
13364-
else
13365-
{
1336613367
success();
13367-
}
13368-
});
13369-
}
13368+
}, 0);
13369+
}
13370+
else
13371+
{
13372+
success();
13373+
}
13374+
});
1337013375

1337113376
if (isPng || isSvg)
1337213377
{

src/main/webapp/js/diagramly/DrawioFile.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,9 +1839,8 @@ DrawioFile.prototype.addAllSavedStatus = function(status)
18391839
var rev = (this.isRevisionHistorySupported() && status != mxUtils.htmlEntities(
18401840
mxResources.get(this.savingStatusKey)) + '...') ? 'data-action="revisionHistory" ' : '';
18411841
this.ui.editor.setStatus('<div ' + rev + 'title="'+ status + '">' + status +
1842-
(this.isLocked() && Editor.lockedImage != null ?
1843-
' <img class="geAdaptiveAsset" data-action="properties" style="margin-left:4px;" src="' +
1844-
Editor.lockedImage + '"/>' : '') + '</div>');
1842+
(this.isLocked() ? ' <img class="geToolbarButton geAdaptiveAsset" data-action="properties" ' +
1843+
'style="margin-left:4px;flex-shrink:0;" src="' + Editor.lockedImage + '"/>' : '') + '</div>');
18451844
}
18461845
};
18471846

src/main/webapp/js/diagramly/DrawioFileSync.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,8 @@ DrawioFileSync.prototype.updateStatus = function()
592592
(!this.file.isEditable() ? '<div class="geStatusBox" title="' +
593593
mxUtils.htmlEntities(mxResources.get('readOnly')) + '">' +
594594
mxUtils.htmlEntities(mxResources.get('readOnly')) + '</div>' :
595-
(this.file.isLocked() && Editor.lockedImage != null ?
596-
' <img class="geAdaptiveAsset" data-action="properties" style="margin-left:4px;" src="' +
597-
Editor.lockedImage + '"/>' : '')) +
595+
(this.file.isLocked() ? ' <img class="geToolbarButton geAdaptiveAsset" data-action="properties" ' +
596+
'style="margin-left:4px;flex-shrink:0;" src="' + Editor.lockedImage + '"/>' : '')) +
598597
(status != null ? '<div class="geStatusBox" title="' + mxUtils.htmlEntities(status) + '">' +
599598
mxUtils.htmlEntities(status) + '</div>' : '') +
600599
((msg != null) ? ' <div class="geStatusBox" data-effect="fade" title="' + mxUtils.htmlEntities(msg) + '">' +

src/main/webapp/js/diagramly/DriveClient.js

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,39 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
13051305
}
13061306
};
13071307

1308+
/**
1309+
* Returns the checksum stored in the properties of the given file.
1310+
*/
1311+
DriveClient.prototype.getStoredChecksum = function(file)
1312+
{
1313+
var checksum = null;
1314+
1315+
if (file.desc != null && file.desc.properties != null)
1316+
{
1317+
for (var i = 0; i < file.desc.properties.length; i++)
1318+
{
1319+
if (file.desc.properties[i].key == 'checksum')
1320+
{
1321+
var temp = file.desc.properties[i].value;
1322+
1323+
if (temp != null && temp.length > 0)
1324+
{
1325+
var tokens = temp.split(':');
1326+
1327+
if (tokens.length == 2)
1328+
{
1329+
checksum = tokens[1];
1330+
}
1331+
}
1332+
1333+
break;
1334+
}
1335+
}
1336+
}
1337+
1338+
return checksum;
1339+
};
1340+
13081341
/**
13091342
* Translates this point by the given vector.
13101343
*
@@ -1649,6 +1682,11 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
16491682
etag = resp.etag;
16501683
}
16511684

1685+
if (reasons.length == 0)
1686+
{
1687+
reasons.push(mxResources.get('unknownError'));
1688+
}
1689+
16521690
var temp = reasons.join(', ');
16531691

16541692
if (retryCount < this.staleEtagMaxRetries)
@@ -1674,11 +1712,16 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
16741712
// Logs failed save
16751713
try
16761714
{
1715+
var oldChecksum = this.getStoredChecksum(file);
1716+
16771717
EditorUi.logError('Saving to Google Drive failed',
1678-
null, 'id-' + file.desc.id +
1718+
null, 'id-' + file.desc.id +
16791719
'-from-' + head0 + '.' + mod0 + '-' + this.ui.hashValue(etag0) +
16801720
'-to-' + resp.headRevisionId + '.' + resp.modifiedDate + '-' +
1681-
this.ui.hashValue(resp.etag) + ((temp.length > 0) ? '-errors-' + temp : ''),
1721+
this.ui.hashValue(resp.etag) +
1722+
((oldChecksum != null) ? '-old-checksum_' + oldChecksum : '') +
1723+
((checksum != null) ? '-new-checksum_' + checksum : '') +
1724+
((temp.length > 0) ? '-errors-' + temp : ''),
16821725
'user-' + ((this.user != null) ? this.user.id : 'nouser') +
16831726
((file.sync != null) ? '-client_' + file.sync.clientId : '-nosync') +
16841727
'-retries-' + retryCount);
@@ -2003,7 +2046,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
20032046
{
20042047
criticalError(e);
20052048
}
2006-
})))
2049+
}), 20))
20072050
{
20082051
// If-branch
20092052
doSave(null, null, file.constructor != DriveLibrary);

src/main/webapp/js/diagramly/Editor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@
468468
{name: 'fillOpacity', dispName: 'Fill Opacity', type: 'int', min: 0, max: 100, defVal: 100},
469469
{name: 'strokeOpacity', dispName: 'Stroke Opacity', type: 'int', min: 0, max: 100, defVal: 100},
470470
{name: 'startFill', dispName: 'Start Fill', type: 'bool', defVal: true},
471+
{name: 'startFillColor', dispName: 'Start Fill Color', type: 'color', defVal: null},
471472
{name: 'endFill', dispName: 'End Fill', type: 'bool', defVal: true},
473+
{name: 'endFillColor', dispName: 'End Fill Color', type: 'color', defVal: null},
472474
{name: 'perimeterSpacing', dispName: 'Terminal Spacing', type: 'float', defVal: 0},
473475
{name: 'anchorPointDirection', dispName: 'Anchor Direction', type: 'bool', defVal: true},
474476
{name: 'snapToPoint', dispName: 'Snap to Point', type: 'bool', defVal: false},

0 commit comments

Comments
 (0)