Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
21.2.8 release
  • Loading branch information
davidjgraph committed May 4, 2023
1 parent 5ad0454 commit c7ac634
Show file tree
Hide file tree
Showing 13 changed files with 5,768 additions and 5,731 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
04-MAY-2023: 21.2.8

- [jira cloud] Uses issueContext instead of the deprecated issueGlance
- Fixes invalidation for filenames, sanitized labels [CSP-1852]

03-MAY-2023: 21.2.7

- Fixes possible NPE in validate
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
21.2.7
21.2.8
2,563 changes: 1,282 additions & 1,281 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions src/main/webapp/js/diagramly/EditorUi.js
Expand Up @@ -10523,20 +10523,24 @@

// Forces update of filename placeholder
var lastFilename = null;
var lastFile = null;

this.addListener('fileDescriptorChanged', function()
this.addListener('fileDescriptorChanged', mxUtils.bind(this, function()
{
var file = this.getCurrentFile();

if (file != null && lastFilename != file.getTitle())
var filename = (file != null && file.getTitle() != null) ?
file.getTitle() : this.defaultFilename;

if (lastFilename != filename && file == lastFile)
{
var filename = (file.getTitle() != null) ?
file.getTitle() : this.defaultFilename;
lastFilename = filename;
graph.invalidateDescendantsWithPlaceholders(graph.model.getRoot());
graph.invalidateDescendantsWithPlaceholders(
graph.model.getRoot());
graph.view.validate();
}
});

lastFilename = filename;
lastFile = file;
}));

var graphLabelLinkClicked = graph.labelLinkClicked;

Expand Down
46 changes: 34 additions & 12 deletions src/main/webapp/js/diagramly/GraphViewer.js
Expand Up @@ -1885,7 +1885,7 @@ GraphViewer.prototype.showLightbox = function(editable, closable, target)
/**
* Adds the given array of stencils to avoid dynamic loading of shapes.
*/
GraphViewer.prototype.showLocalLightbox = function()
GraphViewer.prototype.showLocalLightbox = function(container)
{
var backdrop = document.createElement('div');

Expand Down Expand Up @@ -1921,6 +1921,17 @@ GraphViewer.prototype.showLocalLightbox = function()
urlParams['tags'] = '{}';
}

if (container != null)
{
try
{
var toolbarConfig = JSON.parse(decodeURIComponent(urlParams['toolbar-config'] || '{}'));
toolbarConfig.noCloseBtn = true;
urlParams['toolbar-config'] = encodeURIComponent(JSON.stringify(toolbarConfig));
}
catch (e) {}
}

// PostMessage not working and Permission denied for opened access in IE9-
if (document.documentMode == null || document.documentMode >= 10)
{
Expand Down Expand Up @@ -1961,20 +1972,23 @@ GraphViewer.prototype.showLocalLightbox = function()

ui.destroy = function()
{
mxEvent.removeListener(document.documentElement, 'keydown', keydownHandler);
document.body.removeChild(backdrop);
document.body.removeChild(closeImg);
document.body.style.overflow = overflow;
GraphViewer.resizeSensorEnabled = true;

destroy.apply(this, arguments);
if (container == null)
{
mxEvent.removeListener(document.documentElement, 'keydown', keydownHandler);
document.body.removeChild(backdrop);
document.body.removeChild(closeImg);
document.body.style.overflow = overflow;
GraphViewer.resizeSensorEnabled = true;

destroy.apply(this, arguments);
}
};

var graph = ui.editor.graph;
var lightbox = graph.container;
lightbox.style.overflow = 'hidden';

if (this.lightboxChrome)
if (this.lightboxChrome && container == null)
{
lightbox.style.border = '1px solid #c0c0c0';
lightbox.style.margin = '40px';
Expand Down Expand Up @@ -2049,8 +2063,16 @@ GraphViewer.prototype.showLocalLightbox = function()
lightbox.style.zIndex = this.lightboxZIndex;
closeImg.style.zIndex = this.lightboxZIndex;

document.body.appendChild(lightbox);
document.body.appendChild(closeImg);
if (container != null)
{
container.innerHTML = '';
container.appendChild(lightbox);
}
else
{
document.body.appendChild(lightbox);
document.body.appendChild(closeImg);
}

ui.setFileData(this.xml);

Expand All @@ -2059,7 +2081,7 @@ GraphViewer.prototype.showLocalLightbox = function()
ui.chromelessToolbar.style.zIndex = this.lightboxZIndex;

// Workaround for clipping in IE11-
document.body.appendChild(ui.chromelessToolbar);
(container || document.body).appendChild(ui.chromelessToolbar);

ui.getEditBlankXml = mxUtils.bind(this, function()
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/grapheditor/EditorUi.js
Expand Up @@ -3185,8 +3185,8 @@ EditorUi.prototype.initCanvas = function()
}), Editor.fullscreenImage, mxResources.get('openInNewWindow', null, 'Open in New Window'));
}

if ((toolbarConfig.closeBtn && window.self === window.top) ||
(graph.lightbox && (urlParams['close'] == '1' || this.container != document.body)))
if (!toolbarConfig.noCloseBtn && ((toolbarConfig.closeBtn && window.self === window.top) ||
(graph.lightbox && (urlParams['close'] == '1' || this.container != document.body))))
{
addButton(mxUtils.bind(this, function(evt)
{
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/js/grapheditor/Graph.js
Expand Up @@ -768,8 +768,10 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
if (state.lastLabelValue != result)
{
state.lastLabelValue = result;
result = Graph.sanitizeHtml(result);
state.lastSanitizedLabelValue = Graph.sanitizeHtml(result);
}

result = state.lastSanitizedLabelValue;
}
}

Expand Down

0 comments on commit c7ac634

Please sign in to comment.