Skip to content

Commit

Permalink
21.6.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Aug 10, 2023
1 parent d784c73 commit f82f89e
Show file tree
Hide file tree
Showing 84 changed files with 2,958 additions and 2,828 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Examples of unacceptable behavior by participants include:
* Public or private harassment, including focusing on individual developers when a topic should be broadly addressed.
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Not respecting other people's time, this is an open source project
* Not respecting other people's time
* Being impatient or rude
* Pressing developers for priority fixes or ETAs
* Guilting the developers into focusing on your issue(s)
Expand Down
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
10-AUG-2023: 21.6.8

- Fixes possible background image error [DID-9099]

07-AUG-2023: 21.6.7

- Fixes offset after page selection [drawio-desktop-1411]

28-JUL-2023: 21.6.6

- Adds improve contrast, fixes CSS for old dark mode
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ draw.io supports Chrome 70+, Firefox 70+, Safari 11+, Opera 50+, Native Android
Open-source, not open-contribution
----------------------------------

[Similar to SQLite](https://www.sqlite.org/copyright.html), draw.io is closed to contributions.
draw.io is not open source software. The complete source code required to build the app from scratch is not available.
draw.io is also closed to contributions.

The level of complexity of this project means that even simple changes
can break a _lot_ of other moving parts. The amount of testing required
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.6.6
21.6.8
1 change: 1 addition & 0 deletions etc/dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dompurify": "3.0.5",
"spin.js": "2.0.0",
"roughjs": "4.4.1",
"mathjax": "3.2.2",
"jscolor": "^3.8.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/connect/common/js/mxReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ DrawioViewer.prototype.init = function()
{
// Test if it's an absolute URL, but on the same domain (i.e. open in same window)
// There's a security setting (unknown which) that seems to stop the IE hack below working in
// IE 11, https://desk.draw.io/browse/DS-175, https://desk.draw.io/browse/DFCS-52
// IE 11, https://drawio.atlassian.net/browse/DS-175, https://drawio.atlassian.net/browse/DFCS-52
// Worst case is these users will open an absolute same domain link in a window

var link = document.createElement('a');
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* URL Parameters and protocol description are here:
*
* https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported
* https://www.drawio.com/doc/faq/supported-url-parameters
*
* Parameters for developers:
*
Expand Down
471 changes: 234 additions & 237 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ App = function(editor, container, lightbox)
'-mime_' + file.desc.mimeType;
}

EditorUi.logEvent(evt);
// EditorUi.logEvent(evt);
}
});
}
Expand Down Expand Up @@ -710,7 +710,7 @@ App.main = function(callback, createUi)
{
var content = mxUtils.getTextContent(scripts[0]);

if (CryptoJS.MD5(content).toString() != '3428184eed5811f9c1458f703cb2806b')
if (CryptoJS.MD5(content).toString() != '1051f781b3ff28064a0d5d65ec513a37')
{
console.log('Change bootstrap script MD5 in the previous line:', CryptoJS.MD5(content).toString());
alert('[Dev] Bootstrap script change requires update of CSP');
Expand Down Expand Up @@ -1633,7 +1633,7 @@ App.prototype.init = function()
{
this.updateUserElement();
this.restoreLibraries();
this.checkLicense();
// this.checkLicense();
}))

// Notifies listeners of new client
Expand Down Expand Up @@ -1832,6 +1832,8 @@ App.prototype.init = function()

App.logAncestorFrames = function()
{
return;

try
{
if (window.location.ancestorOrigins && window.location.hostname &&
Expand Down Expand Up @@ -1923,7 +1925,7 @@ App.prototype.sanityCheck = function()
'-mime_' + file.desc.mimeType;
}

EditorUi.logEvent(evt);
// EditorUi.logEvent(evt);

var msg = mxResources.get('ensureDataSaved');

Expand Down Expand Up @@ -7148,9 +7150,6 @@ App.prototype.updateHeader = function()

mxEvent.addListener(this.toggleFormatElement, 'click', mxUtils.bind(this, function(evt)
{
EditorUi.logEvent({category: 'TOOLBAR-ACTION-',
action: 'format'});

this.actions.get('format').funct();
mxEvent.consume(evt);
}));
Expand Down Expand Up @@ -7188,9 +7187,6 @@ App.prototype.updateHeader = function()
{
var visible = this.fullscreenMode;

EditorUi.logEvent({category: 'TOOLBAR-ACTION-',
action: 'fullscreen' , currentstate: visible});

if (Editor.currentTheme != 'atlas' && urlParams['embed'] != '1')
{
this.toggleCompactMode(visible);
Expand Down Expand Up @@ -7246,8 +7242,6 @@ App.prototype.updateHeader = function()
// Toggles compact mode
mxEvent.addListener(this.toggleElement, 'click', mxUtils.bind(this, function(evt)
{
EditorUi.logEvent({category: 'TOOLBAR-ACTION-',
action: 'toggleUI'});
this.toggleCompactMode();
mxEvent.consume(evt);
}));
Expand Down
9 changes: 3 additions & 6 deletions src/main/webapp/js/diagramly/Devel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ if (!mxIsElectron && location.protocol !== 'http:')
'script-src %script-src% \'self\' https://viewer.diagrams.net https://apis.google.com https://*.pusher.com ' +
// Below are the SHAs of the two script blocks in index.html.
// These must be updated here and in the CDN after changes.
// Note: Desktop app uses only the newest hashes (replace it in electron.js [The one in index.html needs to be changed only if the second script block changes])
//----------------------------------------------------------//
//------------- Bootstrap script in index.html -------------//
//----------------------------------------------------------//
// Version 21.6.7
'\'sha256-PDJOTCOfwIg8Ri7U2PH1pIpx+haCyKsJEbFxlW6hdSI=\' ' +
// Version 21.5.0
'\'sha256-6zAB96lsBZREqf0sT44BhH1T69sm7HrN34rpMOcWbNo=\' ' +
// Version 21.4.1
Expand All @@ -25,12 +28,6 @@ if (!mxIsElectron && location.protocol !== 'http:')
'\'sha256-vrEVJkYyBW9H4tt1lYZtK5fDowIeRwUgYZfFTT36YpE=\' ' +
// Version 20.8.12
'\'sha256-6g514VrT/cZFZltSaKxIVNFF46+MFaTSDTPB8WfYK+c=\' ' +
// Version 16.4.4
'\'sha256-AVuOIxynOo/05KDLjyp0AoBE+Gt/KE1/vh2pS+yfqes=\' ' +
// Version 15.8.3
'\'sha256-r/ILW7KMSJxeo9EYqCTzZyCT0PZ9gHN1BLgki7vpR+A=\' ' +
// Version 14.6.5
'\'sha256-5DtSB5mj34lxcEf+HFWbBLEF49xxJaKnWGDWa/utwQA=\' ' +
//---------------------------------------------------------//
//------------- App.main script in index.html -------------//
//---------------------------------------------------------//
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
p3.style.fontSize = '9pt';
p3.style.marginTop = '-14px';
p3.innerHTML = '<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" ' +
'href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank">' +
'href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank">' +
'<img border="0" src="' + mxGraph.prototype.warningImage.src + '" align="absmiddle" ' +
'style="margin-top:-4px"> ' + mxResources.get('googleDriveMissingClickHere') + '</a>';
div.appendChild(p3);
Expand Down Expand Up @@ -6353,7 +6353,7 @@ var LinkDialog = function(editorUi, initialValue, btnLabel, fn, showPages, showN

if (typeof(google) != 'undefined' && typeof(google.picker) != 'undefined' && editorUi.drive != null)
{
addButton(IMAGE_PATH + '/google-drive-logo.svg', mxResources.get('googlePlus'), function()
addButton(IMAGE_PATH + '/google-drive-logo.svg', mxResources.get('googleDrive'), function()
{
if (editorUi.spinner.spin(document.body, mxResources.get('authorizing')))
{
Expand Down
18 changes: 9 additions & 9 deletions src/main/webapp/js/diagramly/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6523,13 +6523,13 @@
*/
Graph.prototype.adaptBackgroundPage = function(image, theme)
{
if (image != null && image.src != null)
if (image != null && image.src != null && Graph.isPageLink(image.originalSrc))
{
var svg = Graph.getSvgFromDataUri(image.src);

if (svg != null)
try
{
try
var svg = Graph.getSvgFromDataUri(image.src);

if (svg != null)
{
var doc = new DOMParser().parseFromString(svg, 'text/xml');

Expand All @@ -6556,10 +6556,10 @@
doc.documentElement)), image.width, image.height,
image.x, image.y)
}
catch (e)
{
// ignore
}
}
catch (e)
{
// ignore
}
}

Expand Down
18 changes: 9 additions & 9 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2948,9 +2948,9 @@
theme += Editor.isDarkMode() ? '-dark' : '-light';
}

EditorUi.logEvent({category: file.getMode().toUpperCase() + '-OPEN-FILE-' + file.getHash(),
action: 'size_' + file.getSize(),
label: 'autosave_' + ((this.editor.autosave) ? 'on' : 'off') + '_theme_' + theme});
// EditorUi.logEvent({category: file.getMode().toUpperCase() + '-OPEN-FILE-' + file.getHash(),
// action: 'size_' + file.getSize(),
// label: 'autosave_' + ((this.editor.autosave) ? 'on' : 'off') + '_theme_' + theme});
}

EditorUi.debug('File.opened', [file]);
Expand Down Expand Up @@ -7844,9 +7844,9 @@
}
}

EditorUi.logEvent({category: ext + '-MS-IMPORT-FILE',
action: 'filename_' + filename,
label: (remote) ? 'remote' : 'local'});
// EditorUi.logEvent({category: ext + '-MS-IMPORT-FILE',
// action: 'filename_' + filename,
// label: (remote) ? 'remote' : 'local'});
}
catch (e)
{
Expand Down Expand Up @@ -8277,9 +8277,9 @@
{
this.createTimeout(40000, mxUtils.bind(this, function(timeout)
{
EditorUi.logEvent({category: 'OPENAI-DIAGRAM',
action: 'generateOpenAiMermaidDiagram',
label: prompt});
// EditorUi.logEvent({category: 'OPENAI-DIAGRAM',
// action: 'generateOpenAiMermaidDiagram',
// label: prompt});
var url = 'https://www.draw.io/generate/v1';

var req = new mxXmlRequest(url, prompt, 'POST');
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/js/diagramly/GraphViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,8 @@ GraphViewer.createViewerForElement = function(element, callback)

GraphViewer.logAncestorFrames = function()
{
return;

try
{
if (window.location.ancestorOrigins && window.location.hostname &&
Expand Down
16 changes: 13 additions & 3 deletions src/main/webapp/js/diagramly/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
icon.setAttribute('valign', 'bottom');
icon.setAttribute('src', Editor.helpImage);
link.appendChild(icon);
icon.className = 'geAdaptiveAsset';

if (Editor.cssDarkMode)
{
icon.className = 'geAdaptiveAsset';
}

mxEvent.addGestureListeners(link, mxUtils.bind(this, function(evt)
{
Expand Down Expand Up @@ -3282,8 +3286,14 @@
'dark' : 'light') + ')');
}
}

this.addMenuItems(menu, ['-', 'improveContrast'], parent);

menu.addSeparator(parent);
var item = editorUi.menus.addMenuItem(menu, 'improveContrast', parent);

if (!editorUi.isOffline() || mxClient.IS_CHROMEAPP || EditorUi.isElectronApp)
{
editorUi.menus.addLinkToItem(item, 'https://github.com/jgraph/drawio/discussions/3701');
}
})));

editorUi.actions.addAction('addToScratchpad', function(evt)
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/grapheditor/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ EditorUi.prototype.initCanvas = function()
// Sets initial translate based on geometries
// to avoid revalidation in sizeDidChange
var bbox = graph.getBoundingBoxFromGeometry(
graph.model.getCells(), true);
graph.model.getCells(), true, null, true);

// Handles blank diagrams
if (bbox == null)
Expand Down
12 changes: 10 additions & 2 deletions src/main/webapp/js/grapheditor/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,16 @@ Graph.createSvgDarkModeStyle = function(svgDoc, theme)
*/
Graph.getSvgFromDataUri = function(uri)
{
return Graph.xmlDeclaration + '\n' + Graph.svgDoctype + '\n' +
decodeURIComponent(escape(atob(uri.substring(uri.indexOf(',') + 1))));
if (uri != null && uri.substring(0, 14) == 'data:image/svg')
{
return Graph.xmlDeclaration + '\n' + Graph.svgDoctype + '\n' +
decodeURIComponent(escape(atob(uri.substring(
uri.indexOf(',') + 1))));
}
else
{
return null;
}
};

/**
Expand Down
Loading

0 comments on commit f82f89e

Please sign in to comment.