Skip to content

Commit

Permalink
24.2.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Apr 3, 2024
1 parent b5e5693 commit 9c78a73
Show file tree
Hide file tree
Showing 19 changed files with 387 additions and 418 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
03-APR-2024: 24.2.2

- [conf cloud] Fixes timeout error fetching custom libraries when libraries page not found [DID-11193]
- Fixes iphone shape in small sizes [DID-11188]
- Writes warning for unknown object type, ignored value [DID-11225]
- Removes internalCompression feature flag

28-MAR-2024: 24.2.1

- Adds menu item for high contrast mode
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
24.2.1
24.2.2
28 changes: 23 additions & 5 deletions src/main/mxgraph/io/mxCodec.js
Expand Up @@ -458,6 +458,22 @@ mxCodec.prototype.decode = function(node, into)
return obj;
};

/**
* Function: isConstructorAllowed
*
* Returns true if the given constructor name is allowed to be
* instantiated.
*
* Parameters:
*
* name - Name of the constructor to be checked.
*/
mxCodec.prototype.isConstructorAllowed = function(name)
{
return mxCodec.allowlist == null || mxUtils.indexOf(
mxCodec.allowlist, name) >= 0;
};

/**
* Function: getConstructor
*
Expand All @@ -471,14 +487,16 @@ mxCodec.prototype.getConstructor = function(name)
{
var ctor = null;

if (mxCodec.allowlist == null || mxUtils.indexOf(
mxCodec.allowlist, name) >= 0)
try
{
ctor = window[name];
if (this.isConstructorAllowed(name))
{
ctor = window[name];
}
}
else
catch (err)
{
throw new Error('Unknown object type \"' + name + '\"');
// ignore
}

return ctor;
Expand Down
6 changes: 5 additions & 1 deletion src/main/mxgraph/io/mxObjectCodec.js
Expand Up @@ -1006,10 +1006,14 @@ mxObjectCodec.prototype.addObjectValue = function(obj, fieldname, value, templat
{
obj[fieldname] = value;
}
else
else if (obj.constructor === Array)
{
obj.push(value);
}
else
{
throw new Error('Could not add object');
}
//mxLog.debug('Decoded '+mxUtils.getFunctionName(obj.constructor)+'.'+fieldname+': '+value);
}
};
Expand Down
137 changes: 67 additions & 70 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

11 changes: 1 addition & 10 deletions src/main/webapp/js/diagramly/DiffSync.js
Expand Up @@ -733,16 +733,7 @@ EditorUi.prototype.getPagesForNode = function(node, nodeName)
{
var page = new DiagramPage(node.ownerDocument.createElement('diagram'));
page.setName(mxResources.get('pageWithNumber', [1]));

if (Editor.internalCompression)
{
mxUtils.setTextContent(page.node, Graph.compressNode(node, true));
}
else
{
page.node.appendChild(node.cloneNode(true));
}

page.node.appendChild(node.cloneNode(true));
pages.push(page);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/DrawioFile.js
Expand Up @@ -2373,7 +2373,7 @@ DrawioFile.prototype.compressionChanged = function(compressed)
// Changes the internal compressed data in the pages to the current state
var pages = (this.ownPages != null) ? this.ownPages : this.ui.pages;

if (!Editor.internalCompression && pages != null)
if (pages != null)
{
for (var i = 0; i < pages.length; i++)
{
Expand Down
7 changes: 1 addition & 6 deletions src/main/webapp/js/diagramly/Editor.js
Expand Up @@ -242,12 +242,7 @@
* Specifies if XML files should be compressed by default. Default is false.
*/
Editor.defaultCompressed = false;

/**
* Specifies if data should be compressed internally. Default is false.
*/
Editor.internalCompression = urlParams['internal-compression'] == '1';


/**
* Specifies if XML files should be compressed. Default is true.
*/
Expand Down
30 changes: 3 additions & 27 deletions src/main/webapp/js/diagramly/EditorUi.js
Expand Up @@ -1344,15 +1344,7 @@
{
// Updates current page XML if selection is ignored
EditorUi.removeChildNodes(this.currentPage.node);

if (Editor.internalCompression)
{
mxUtils.setTextContent(this.currentPage.node, Graph.compressNode(node));
}
else
{
this.currentPage.node.appendChild(node);
}
this.currentPage.node.appendChild(node);

// Creates a clone of the file node for processing
node = this.fileNode.cloneNode(false);
Expand Down Expand Up @@ -1413,15 +1405,7 @@
this.editor.graph.saveViewState(page.viewState,
temp, null, resolveReferences);
EditorUi.removeChildNodes(currNode);

if (Editor.internalCompression)
{
mxUtils.setTextContent(currNode, Graph.compressNode(temp));
}
else
{
currNode.appendChild(temp);
}
currNode.appendChild(temp);

// Marks the page as up-to-date
delete page.needsUpdate;
Expand Down Expand Up @@ -1454,15 +1438,7 @@
this.editor.graph.saveViewState(page.viewState,
temp, null, resolveReferences);
currNode = currNode.cloneNode(false);

if (Editor.internalCompression)
{
mxUtils.setTextContent(currNode, Graph.compressNode(temp));
}
else
{
currNode.appendChild(temp);
}
currNode.appendChild(temp);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/Menus.js
Expand Up @@ -1596,7 +1596,7 @@
{
if (!mxClient.IS_CHROMEAPP && editorUi.isOffline())
{
this.addMenuItems(menu, ['about'], parent);
this.addMenuItems(menu, ['keyboardShortcuts', '-', 'about'], parent);
}
else
{
Expand Down
21 changes: 2 additions & 19 deletions src/main/webapp/js/diagramly/Pages.js
Expand Up @@ -166,15 +166,7 @@ SelectPage.prototype.execute = function()
EditorUi.removeChildNodes(page.node);

// Stores current diagram state in the page
if (Editor.internalCompression)
{
mxUtils.setTextContent(page.node, Graph.compressNode(temp));
}
else
{
page.node.appendChild(temp);
}

page.node.appendChild(temp);
page.viewState = graph.getViewState();
page.root = graph.model.root;

Expand Down Expand Up @@ -1426,16 +1418,7 @@ EditorUi.prototype.initDiagramNode = function(page, node)

this.editor.graph.saveViewState(page.viewState, node);
EditorUi.removeChildNodes(this.currentPage.node);

if (Editor.internalCompression)
{
mxUtils.setTextContent(page.node, Graph.compressNode(node));
}
else
{
page.node.appendChild(node);
}

page.node.appendChild(node);
};

/**
Expand Down

0 comments on commit 9c78a73

Please sign in to comment.