Skip to content

Commit

Permalink
10.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alderg committed Dec 19, 2018
1 parent 4743eba commit 19ca5f8
Show file tree
Hide file tree
Showing 14 changed files with 1,379 additions and 1,092 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,7 @@
19-DEC-2018: 10.0.5

- Fixes for collaborative editing

19-DEC-2018: 10.0.4 19-DEC-2018: 10.0.4


- Fixes for night mode and responsive UI - Fixes for night mode and responsive UI
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
10.0.4 10.0.5
2 changes: 1 addition & 1 deletion src/main/webapp/cache.manifest
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
CACHE MANIFEST CACHE MANIFEST


# THIS FILE WAS GENERATED. DO NOT MODIFY! # THIS FILE WAS GENERATED. DO NOT MODIFY!
# 12/19/2018 11:31 AM # 12/19/2018 05:08 PM


app.html app.html
index.html?offline=1 index.html?offline=1
Expand Down
721 changes: 361 additions & 360 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions src/main/webapp/js/atlas-viewer.min.js

Large diffs are not rendered by default.

1,287 changes: 644 additions & 643 deletions src/main/webapp/js/atlas.min.js

Large diffs are not rendered by default.

85 changes: 62 additions & 23 deletions src/main/webapp/js/diagramly/DiffSync.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EditorUi.prototype.viewStateWhitelist = ['background', 'backgroundImage', 'foldi
/** /**
* Removes all labels, user objects and styles from the given node in-place. * Removes all labels, user objects and styles from the given node in-place.
*/ */
EditorUi.prototype.patchPages = function(pages, diff, markPages, shadow) EditorUi.prototype.patchPages = function(pages, diff, markPages, shadow, updateEdgeParents)
{ {
var shadowLookup = {}; var shadowLookup = {};
var newPages = []; var newPages = [];
Expand All @@ -48,11 +48,6 @@ EditorUi.prototype.patchPages = function(pages, diff, markPages, shadow)
} }
} }


for (var i = 0; i < pages.length; i++)
{
lookup[pages[i].getId()] = pages[i];
}

if (diff[EditorUi.DIFF_REMOVE] != null) if (diff[EditorUi.DIFF_REMOVE] != null)
{ {
for (var i = 0; i < diff[EditorUi.DIFF_REMOVE].length; i++) for (var i = 0; i < diff[EditorUi.DIFF_REMOVE].length; i++)
Expand Down Expand Up @@ -82,30 +77,38 @@ EditorUi.prototype.patchPages = function(pages, diff, markPages, shadow)
} }
} }


// Restores existing order // Restores existing order and creates lookup
var prev = ''; if (pages != null)

{
for (var i = 0; i < pages.length; i++) var prev = '';
{
var pageId = pages[i].getId();


if (moved[prev] == null && !removed[pages[i].getId()] && for (var i = 0; i < pages.length; i++)
(diff[EditorUi.DIFF_UPDATE] == null ||
diff[EditorUi.DIFF_UPDATE][pageId] == null ||
diff[EditorUi.DIFF_UPDATE][pageId].previous == null))
{ {
moved[prev] = pageId; var pageId = pages[i].getId();
lookup[pageId] = pages[i];

if (moved[prev] == null && !removed[pageId] &&
(diff[EditorUi.DIFF_UPDATE] == null ||
diff[EditorUi.DIFF_UPDATE][pageId] == null ||
diff[EditorUi.DIFF_UPDATE][pageId].previous == null))
{
moved[prev] = pageId;
}

prev = pageId;
} }

}
prev = pageId;
} // FIXME: Workaround for possible duplicate pages
var added = {};


var addPage = mxUtils.bind(this, function(page) var addPage = mxUtils.bind(this, function(page)
{ {
var id = (page != null) ? page.getId() : ''; var id = (page != null) ? page.getId() : '';


if (page != null) if (page != null && !added[id])
{ {
added[id] = true;
newPages.push(page); newPages.push(page);
var pageDiff = (diff[EditorUi.DIFF_UPDATE] != null) ? var pageDiff = (diff[EditorUi.DIFF_UPDATE] != null) ?
diff[EditorUi.DIFF_UPDATE][id] : null; diff[EditorUi.DIFF_UPDATE][id] : null;
Expand All @@ -126,7 +129,7 @@ EditorUi.prototype.patchPages = function(pages, diff, markPages, shadow)


if (pageDiff.cells != null) if (pageDiff.cells != null)
{ {
this.patchPage(page, pageDiff.cells, shadowLookup[page.getId()]); this.patchPage(page, pageDiff.cells, shadowLookup[page.getId()], updateEdgeParents);
} }


if (markPages && (pageDiff.cells != null || if (markPages && (pageDiff.cells != null ||
Expand Down Expand Up @@ -300,7 +303,7 @@ EditorUi.prototype.createParentLookup = function(model, diff)
/** /**
* Removes all labels, user objects and styles from the given node in-place. * Removes all labels, user objects and styles from the given node in-place.
*/ */
EditorUi.prototype.patchPage = function(page, diff, shadowPage) EditorUi.prototype.patchPage = function(page, diff, shadowPage, updateEdgeParents)
{ {
var model = (page == this.currentPage) ? this.editor.graph.model : new mxGraphModel(page.root); var model = (page == this.currentPage) ? this.editor.graph.model : new mxGraphModel(page.root);
var shadowModel = (shadowPage != null) ? new mxGraphModel(shadowPage.root) : null; var shadowModel = (shadowPage != null) ? new mxGraphModel(shadowPage.root) : null;
Expand All @@ -309,6 +312,11 @@ EditorUi.prototype.patchPage = function(page, diff, shadowPage)
model.beginUpdate(); model.beginUpdate();
try try
{ {
// Disables update of edge parents during update to avoid interference with
// remote updated edge parents
var prev = model.maintainEdgeParent;
model.maintainEdgeParent = false;

// Handles new root cells // Handles new root cells
var temp = parentLookup['']; var temp = parentLookup[''];
var cellDiff = (temp != null && temp.inserted != null) ? temp.inserted[''] : null; var cellDiff = (temp != null && temp.inserted != null) ? temp.inserted[''] : null;
Expand Down Expand Up @@ -378,6 +386,15 @@ EditorUi.prototype.patchPage = function(page, diff, shadowPage)
} }
} }
} }

// Only updates edge parents if there are possible changes which is the case
// for patching the local pages in the case where the file was modified
model.maintainEdgeParent = prev;

if (updateEdgeParents)
{
model.updateEdgeParents(model.root);
}
} }
finally finally
{ {
Expand Down Expand Up @@ -527,6 +544,18 @@ EditorUi.prototype.patchCell = function(model, cell, diff, shadowCell)
model.setCollapsed(cell, diff.collapsed == 1); model.setCollapsed(cell, diff.collapsed == 1);
} }


if (diff.vertex != null)
{
// Changes vertex state in-place
cell.vertex = diff.vertex == 1;
}

if (diff.edge != null)
{
// Changes edge state in-place
cell.edge = diff.edge == 1;
}

if (diff.connectable != null) if (diff.connectable != null)
{ {
// Changes connectable state in-place // Changes connectable state in-place
Expand Down Expand Up @@ -991,6 +1020,16 @@ EditorUi.prototype.diffCell = function(oldCell, newCell)
diff['collapsed'] = (newCell.collapsed) ? 1 : 0; diff['collapsed'] = (newCell.collapsed) ? 1 : 0;
} }


if (oldCell.vertex != newCell.vertex)
{
diff['vertex'] = (newCell.vertex) ? 1 : 0;
}

if (oldCell.edge != newCell.edge)
{
diff['edge'] = (newCell.edge) ? 1 : 0;
}

if (oldCell.connectable != newCell.connectable) if (oldCell.connectable != newCell.connectable)
{ {
diff['connectable'] = (newCell.connectable) ? 1 : 0; diff['connectable'] = (newCell.connectable) ? 1 : 0;
Expand Down
25 changes: 20 additions & 5 deletions src/main/webapp/js/diagramly/DrawioFile.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -337,16 +337,31 @@ DrawioFile.prototype.checksumError = function(error, patches)
this.stats.uptime = Math.round((new Date().getTime() - this.stats.uptime = Math.round((new Date().getTime() -
new Date(this.stats.start).getTime()) / 1000); new Date(this.stats.start).getTime()) / 1000);
} }


var data = mxUtils.getPrettyXml(file);

if (data != null && data.length > 10000)
{
data = this.ui.editor.graph.compress(data) + '\n';
}

var json = JSON.stringify(patches, null, 2);

if (json != null && json.length > 10000)
{
json = this.ui.editor.graph.compress(json);
}

EditorUi.sendReport('Checksum Error ' + new Date().toISOString() + ':\n\n' + EditorUi.sendReport('Checksum Error ' + new Date().toISOString() + ':\n\n' +
'File=' + this.getId() + ' (' + this.getMode() + ')\n' + 'File=' + this.getId() + ' (' + this.getMode() + ')\n' +
((this.sync != null) ? ('Client=' + this.sync.clientId + '\n') : '') + ((this.sync != null) ? ('Client=' + this.sync.clientId + '\n') : '') +
'User=' + uid + '\n' + 'User=' + uid + '\n' +
'Size=' + this.getSize() + '\n' + 'Size=' + this.getSize() + '\n' +
'Sync=' + DrawioFile.SYNC + '\n\n' + 'Sync=' + DrawioFile.SYNC + '\n\n' +
'Stats:\n' + JSON.stringify(this.stats, null, 2) + '\n' + 'Stats:\n' + JSON.stringify(this.stats, null, 2) + '\n\n' +
'Data:\n' + mxUtils.getPrettyXml(file) + '\n' + 'Data:\n' + data + '\n' +
'Patches:\n' + JSON.stringify(patches, null, 2)); 'Patches:\n' + json + '\n\n' +
'Stack:\n' + new Error().stack);
} }
catch (e) catch (e)
{ {
Expand Down Expand Up @@ -507,7 +522,7 @@ DrawioFile.prototype.patch = function(patches, shadow)
for (var i = 0; i < patches.length; i++) for (var i = 0; i < patches.length; i++)
{ {
this.ui.pages = this.ui.patchPages(this.ui.pages, this.ui.pages = this.ui.patchPages(this.ui.pages,
patches[i], true, shadow); patches[i], true, shadow, this.isModified());
} }
} }
finally finally
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@


if ((/^https?:\/\//.test(realUrl)) && !this.isCorsEnabledForUrl(realUrl)) if ((/^https?:\/\//.test(realUrl)) && !this.isCorsEnabledForUrl(realUrl))
{ {
realUrl = PROXY_URL + '?url=' + encodeURIComponent(desc.url); realUrl = PROXY_URL + '?url=' + encodeURIComponent(realUrl);
} }


// LATER: Remove cache-control header // LATER: Remove cache-control header
Expand Down Expand Up @@ -3405,11 +3405,12 @@
div.style.position = 'absolute'; div.style.position = 'absolute';
div.style.overflow = 'hidden'; div.style.overflow = 'hidden';
div.style.borderWidth = '3px'; div.style.borderWidth = '3px';

var elt2 = document.createElement('a'); var elt2 = document.createElement('a');
elt2.className = 'geTitle'; elt2.className = 'geTitle';
elt2.style.height = '100%'; elt2.style.height = '100%';
elt2.style.paddingTop = '9px'; elt2.style.paddingTop = '9px';
elt2.innerHTML = '<span style="font-size:18px;margin-right:5px;">+</span>';


mxUtils.write(elt2, mxResources.get('moreShapes') + '...'); mxUtils.write(elt2, mxResources.get('moreShapes') + '...');


Expand Down
34 changes: 16 additions & 18 deletions src/main/webapp/js/diagramly/Pages.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -848,30 +848,28 @@ EditorUi.prototype.removePage = function(page)
{ {
var next = this.currentPage; var next = this.currentPage;


if (next == page) if (next == page && this.pages.length > 1)
{ {
if (this.pages.length > 1) var tmp = mxUtils.indexOf(this.pages, page);

if (tmp == this.pages.length - 1)
{ {
var tmp = mxUtils.indexOf(this.pages, page); tmp--;

if (tmp == this.pages.length - 1)
{
tmp--;
}
else
{
tmp++;
}

next = this.pages[tmp];
} }
else else
{ {
// Removes label with incorrect page number to force tmp++;
// default page name which is OK for a single page
next = this.insertPage();
graph.model.execute(new RenamePage(this, next, mxResources.get('pageWithNumber', [1])));
} }

next = this.pages[tmp];
}
else if (this.pages.length <= 1)
{
// Removes label with incorrect page number to force
// default page name which is OK for a single page
next = this.insertPage();
graph.model.execute(new RenamePage(this, next,
mxResources.get('pageWithNumber', [1])));
} }


// Uses model to fire event to trigger autosave // Uses model to fire event to trigger autosave
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/embed-static.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main/webapp/js/reader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 19ca5f8

Please sign in to comment.