Skip to content

Commit

Permalink
22.1.19 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Jan 16, 2024
1 parent ce8063b commit 1d6d5d0
Show file tree
Hide file tree
Showing 21 changed files with 4,440 additions and 4,348 deletions.
11 changes: 9 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
09-JAN-2023: 21.1.18
16-JAN-2024: 21.1.19

- Scrolls page tab to visible after moving page
- Fixes possible timeout when entering commit message
- Removes line jumps at branching points [drawio-3965]
- Fixes ignored text direction style [drawio-4104]

09-JAN-2024: 21.1.18

- Fixes overridden configurations [drawio-desktop-1564]
- Removes multiple javascript protocol prefixes
Expand All @@ -8,7 +15,7 @@
- Experimental support for vertical writing mode [drawio-4068]
- Fixes relative links in SVG export

04-JAN-2023: 21.1.17
04-JAN-2024: 21.1.17

- Adds copyAsText in Edit drop down [drawio-3949]
- Replaces clearWaypoints button with drop down
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.1.18
22.1.19
2 changes: 1 addition & 1 deletion src/main/mxgraph/util/mxSvgCanvas2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ mxSvgCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, fo
// Ignores invalid XHTML labels
if (div != null)
{
if (dir != null && dir.substring(0, 9) == 'vertical-')
if (dir != null && dir.substring(0, 9) != 'vertical-')
{
div.setAttribute('dir', dir);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/mxgraph/util/mxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,7 @@ var mxUtils =
*
* Returns the distance between a line defined by two points and a point.
* To get the distance between a point and a segment (with a specific
* length) use <mxUtils.ptSeqDistSq>.
* length) use <mxUtils.ptSegDistSq>.
*
* Parameters:
*
Expand Down
2,451 changes: 1,227 additions & 1,224 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1839,8 +1839,6 @@ App.prototype.init = function()

App.logAncestorFrames = function()
{
return;

try
{
if (window.location.ancestorOrigins && window.location.hostname &&
Expand Down
79 changes: 71 additions & 8 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,13 +660,29 @@

// Extends spin method to include an optional label
var oldSpin = spinner.spin;
var thread = null;
var retry = null;

spinner.spin = function(container, label)
spinner.spin = function(container, label, error, timeout)
{
var result = false;

if (!this.active)
{
var start = Date.now();

if (error != null)
{
thread = window.setTimeout(function()
{
spinner.stop();
thread = null;
error({code: App.ERROR_TIMEOUT,
message: mxResources.get('timeout'),
retry: retry});
}, (timeout != null) ? timeout : this.timeout);
}

oldSpin.call(this, container);
this.active = true;

Expand Down Expand Up @@ -718,9 +734,46 @@

if (this.active)
{
fn = mxUtils.bind(this, function()
// Reduces timeout by used time
timeout = Math.max(0, timeout - (Date.now() - start));

fn = mxUtils.bind(this, function(continueFn)
{
this.spin(container, label);
this.spin(container, label, error, timeout);

// Continue is called after spinner was paused and is
// used as the new retry function from here on
if (continueFn != null)
{
try
{
continueFn();

retry = mxUtils.bind(this, function()
{
this.spin(container, label, error, timeout);

try
{
continueFn();
}
catch (e)
{
if (error != null)
{
error(e);
}
}
});
}
catch (e)
{
if (error != null)
{
error(e);
}
}
}
});
}

Expand All @@ -741,14 +794,24 @@
spinner.stop = function()
{
oldStop.call(this);
this.active = false;

if (spinner.status != null && spinner.status.parentNode != null)
if (this.active)
{
spinner.status.parentNode.removeChild(spinner.status);
}
this.active = false;

spinner.status = null;
if (thread != null)
{
window.clearTimeout(thread);
thread = null;
}

if (spinner.status != null && spinner.status.parentNode != null)
{
spinner.status.parentNode.removeChild(spinner.status);
}

spinner.status = null;
}
};

spinner.pause = function()
Expand Down
6 changes: 4 additions & 2 deletions src/main/webapp/js/diagramly/GitHubClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,10 @@ GitHubClient.prototype.showCommitDialog = function(filename, isNew, success, can
var dlg = new FilenameDialog(this.ui, mxResources.get((isNew) ? 'addedFile' : 'updateFile',
[filename]), mxResources.get('ok'), mxUtils.bind(this, function(message)
{
resume();
success(message);
resume(function()
{
success(message);
});
}), mxResources.get('commitMessage'), null, null, null, null, mxUtils.bind(this, function()
{
cancel();
Expand Down
4 changes: 1 addition & 3 deletions src/main/webapp/js/diagramly/GraphViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2356,8 +2356,6 @@ GraphViewer.createViewerForElement = function(element, callback)

GraphViewer.logAncestorFrames = function()
{
return;

try
{
if (window.location.ancestorOrigins && window.location.hostname &&
Expand All @@ -2377,7 +2375,7 @@ GraphViewer.logAncestorFrames = function()
message += ' -> ' + window.location.ancestorOrigins[i];
}

if (hostname.endsWith('.draw.io') && window.location.ancestorOrigins.length == 1 &&
if ((hostname.endsWith('ac.draw.io') || hostname.endsWith('aj.draw.io')) && window.location.ancestorOrigins.length == 1 &&
window.location.ancestorOrigins[0] && window.location.ancestorOrigins[0].endsWith('.atlassian.net'))
{
// do not log *.draw.io domains embedded directly into atlassian.net
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/js/diagramly/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4834,7 +4834,8 @@

this.put('movePage', new Menu(mxUtils.bind(this, function(menu, parent)
{
var current = editorUi.getSelectedPageIndex();
var currentPage = editorUi.currentPage;
var current = editorUi.getPageIndex(currentPage);

if (editorUi.pages != null)
{
Expand All @@ -4847,6 +4848,7 @@
menu.addItem(editorUi.getShortPageName(editorUi.pages[index]), null, function()
{
editorUi.movePage(current, index);
editorUi.scrollToPage(currentPage, true);
}, parent);
})(i);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/diagramly/Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ EditorUi.prototype.initPages = function()
/**
* Adds the listener for automatically saving the diagram for local changes.
*/
EditorUi.prototype.scrollToPage = function(page)
EditorUi.prototype.scrollToPage = function(page, force)
{
var index = (page != null) ? this.getPageIndex(page) :
this.getSelectedPageIndex();
Expand All @@ -648,7 +648,7 @@ EditorUi.prototype.scrollToPage = function(page)
if (index != null && this.tabScroller != null &&
this.tabScroller.children.length > index &&
this.tabScroller.children[index] != null &&
scrollPage != this.lastScrollPage)
(scrollPage != this.lastScrollPage || force))
{
this.tabScroller.children[index].scrollIntoView(
{block: 'nearest', inline: (page != null) ?
Expand Down
18 changes: 14 additions & 4 deletions src/main/webapp/js/grapheditor/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -8095,7 +8095,7 @@ TableLayout.prototype.execute = function(parent)

return curr == null || curr.type != type || curr.x != x || curr.y != y;
};

for (var i = 0; i < pts.length - 1; i++)
{
var p1 = pts[i + 1];
Expand All @@ -8121,9 +8121,11 @@ TableLayout.prototype.execute = function(parent)
{
var state2 = this.validEdges[e];
var pts2 = state2.absolutePoints;

if (pts2 != null && mxUtils.intersects(state, state2) && state2.style['noJump'] != '1')
{
var pl = null;

// Compares each segment of the edge with the current segment
for (var j = 0; j < pts2.length - 1; j++)
{
Expand All @@ -8143,12 +8145,18 @@ TableLayout.prototype.execute = function(parent)
}

var pt = mxUtils.intersection(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);

// Handles intersection between two segments
if (pt != null && (Math.abs(pt.x - p0.x) > thresh ||
Math.abs(pt.y - p0.y) > thresh) &&
(Math.abs(pt.x - p1.x) > thresh ||
Math.abs(pt.y - p1.y) > thresh))
Math.abs(pt.y - p1.y) > thresh) &&
// Removes jumps on overlapping incoming segments
(pl == null || mxUtils.ptLineDist(p0.x, p0.y, p1.x, p1.y, pl.x, pl.y) > thresh ||
mxUtils.ptLineDist(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y) > thresh) &&
// Removes jumps on overlapping outgoing segments
(pn == null || mxUtils.ptLineDist(p0.x, p0.y, p1.x, p1.y, pn.x, pn.y) > thresh ||
mxUtils.ptLineDist(p0.x, p0.y, p1.x, p1.y, p3.x, p3.y) > thresh))
{
var dx = pt.x - p0.x;
var dy = pt.y - p0.y;
Expand All @@ -8174,6 +8182,8 @@ TableLayout.prototype.execute = function(parent)
list.push(temp);
}
}

pl = p2;
}
}
}
Expand Down
Loading

0 comments on commit 1d6d5d0

Please sign in to comment.