Skip to content

Commit

Permalink
10.1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alderg committed Jan 18, 2019
1 parent 336e02c commit a121c48
Show file tree
Hide file tree
Showing 16 changed files with 1,819 additions and 1,816 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
18-JAN-2019: 10.1.2

- Adds debug output

18-JAN-2019: 10.1.1

- Fixes possible NPEs

17-JAN-2019: 10.1.0

- Adds auth token refresh for OneDrive
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.1.0
10.1.2
2 changes: 1 addition & 1 deletion src/main/webapp/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CACHE MANIFEST

# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 01/17/2019 04:16 PM
# 01/18/2019 11:34 AM

app.html
index.html?offline=1
Expand Down
630 changes: 314 additions & 316 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

813 changes: 405 additions & 408 deletions src/main/webapp/js/atlas-viewer.min.js

Large diffs are not rendered by default.

1,150 changes: 574 additions & 576 deletions src/main/webapp/js/atlas.min.js

Large diffs are not rendered by default.

59 changes: 38 additions & 21 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
}
else if (list.length == 0)
{
div.innerHTML = mxResources.get('noDiagrams', null, 'No Diagrams Found');
div.innerHTML = mxUtils.htmlEntities(mxResources.get('noDiagrams', null, 'No Diagrams Found'));
}
else
{
Expand Down Expand Up @@ -2936,7 +2936,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
{
var searchTab = document.createElement('span');
searchTab.style.marginLeft = '10px';
searchTab.innerHTML = mxResources.get('search') + ":";
searchTab.innerHTML = mxUtils.htmlEntities(mxResources.get('search') + ':');
tabs.appendChild(searchTab);

var searchInput = document.createElement('input');
Expand Down Expand Up @@ -5492,10 +5492,19 @@ var RevisionDialog = function(editorUi, revs, restoreFn)

pageSelectFunction = function()
{
currentPage = parseInt(pageSelect.value);
realPage = currentPage;
parseDiagram(diagrams[currentPage]);
}
try
{
var temp = parseInt(pageSelect.value);
parseDiagram(diagrams[temp]);
currentPage = temp;
realPage = currentPage;
}
catch (e)
{
pageSelect.value = currentPage;
editorUi.handleError(e);
}
};
}
else
{
Expand Down Expand Up @@ -5564,7 +5573,7 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
currentXml = null;

fileInfo.removeAttribute('title');
fileInfo.innerHTML = mxResources.get('loading') + '...';
fileInfo.innerHTML = mxUtils.htmlEntities(mxResources.get('loading') + '...');
container.style.backgroundColor = '#ffffff';
graph.getModel().clear();

Expand All @@ -5589,7 +5598,15 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
{
if (currentRev == item)
{
updateGraph(xml);
try
{
updateGraph(xml);
}
catch (e)
{
fileInfo.innerHTML = mxUtils.htmlEntities(
mxResources.get('error') + ': ' + e.message);
}
}
}, function(err)
{
Expand Down Expand Up @@ -6932,7 +6949,7 @@ var PluginsDialog = function(editorUi)
{
if (plugins.length == 0)
{
inner.innerHTML = mxResources.get('noPlugins');
inner.innerHTML = mxUtils.htmlEntities(mxResources.get('noPlugins'));
}
else
{
Expand Down Expand Up @@ -8910,11 +8927,11 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
{
if (isTemplate)
{
createBtn.innerHTML = mxResources.get('create');
createBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('create'));
}
else
{
createBtn.innerHTML = mxResources.get('copy');
createBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('copy'));
}

showLinkToDiagram (!isTemplate);
Expand All @@ -8933,15 +8950,15 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
var hrow = document.createElement('tr');
var th = document.createElement('th');
th.style.width = "50%";
th.innerHTML = mxResources.get('diagram', null, 'Diagram');
th.innerHTML = mxUtils.htmlEntities(mxResources.get('diagram', null, 'Diagram'));
hrow.appendChild(th);
th = document.createElement('th');
th.style.width = "25%";
th.innerHTML = mxResources.get('changedBy', null, 'Changed By');
th.innerHTML = mxUtils.htmlEntities(mxResources.get('changedBy', null, 'Changed By'));
hrow.appendChild(th);
th = document.createElement('th');
th.style.width = "25%";
th.innerHTML = mxResources.get('lastModifiedOn', null, 'Last modified on');
th.innerHTML = mxUtils.htmlEntities(mxResources.get('lastModifiedOn', null, 'Last modified on'));
hrow.appendChild(th);
grid.appendChild(hrow);
diagramsTiles.appendChild(grid);
Expand Down Expand Up @@ -9117,7 +9134,7 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,

if (currentItem == null)
{
createBtn.innerHTML = mxResources.get('create');
createBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('create'));
showLinkToDiagram();
swapActiveItem(entry, "geTempDlgNewDiagramCatItemActive", cat);
}
Expand All @@ -9142,7 +9159,7 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
{
if (currentItem != entry2)
{
createBtn.innerHTML = mxResources.get('create');
createBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('create'));
showLinkToDiagram();
swapActiveItem(entry2, "geTempDlgNewDiagramCatItemActive", cat2);
}
Expand All @@ -9161,14 +9178,14 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
{
newDiagramCat.style.height = "280px";
newDiagramCatList.style.height = "190px";
showAllBtn.innerHTML = mxResources.get('showAll', null, '+ Show all');
showAllBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('showAll', null, '+ Show all'));
fillNewDiagramCats(newDiagramCats);
}
else
{
newDiagramCat.style.height = "440px";
newDiagramCatList.style.height = "355px";
showAllBtn.innerHTML = mxResources.get('showLess', null, '- Show less');
showAllBtn.innerHTML = mxUtils.htmlEntities(mxResources.get('showLess', null, '- Show less'));
fillNewDiagramCats(newDiagramCats, true);
}

Expand Down Expand Up @@ -9335,7 +9352,7 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
}
else if (list.length == 0)
{
diagramsTiles.innerHTML = mxResources.get('noDiagrams', null, 'No Diagrams Found');
diagramsTiles.innerHTML = mxUtils.htmlEntities(mxResources.get('noDiagrams', null, 'No Diagrams Found'));
}
else
{
Expand All @@ -9352,7 +9369,7 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
spinner.spin(diagramsTiles);
cancelPendingCall = false;
callInitiated = true;
diagramsListTitle.innerHTML = mxResources.get('recentDiag', null, 'Recent Diagrams');
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('recentDiag', null, 'Recent Diagrams'));
lastSearchStr = null;
recentDocsCallback(extDiagramsCallback, getAll? null : username);
}
Expand All @@ -9371,7 +9388,7 @@ TemplatesDialog.prototype.init = function(editorUi, callback, cancelCallback,
cancelPendingCall = false;
callInitiated = true;
delayTimer = null;
diagramsListTitle.innerHTML = mxResources.get('searchResults', null, 'Search Results') +
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults', null, 'Search Results')) +
' "' + mxUtils.htmlEntities(searchStr) + '"';
searchDocsCallback(searchStr, extDiagramsCallback, isGetAll? null : username);
lastSearchStr = searchStr;
Expand Down
18 changes: 15 additions & 3 deletions src/main/webapp/js/diagramly/DiffSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,22 @@ EditorUi.prototype.getPagesForNode = function(node, nodeName)
var diagrams = node.getElementsByTagName(nodeName || 'diagram');
var pages = [];

for (var i = 0; i < diagrams.length; i++)
if (diagrams.length > 0)
{
var page = new DiagramPage(diagrams[i]);
this.updatePageRoot(page);
for (var i = 0; i < diagrams.length; i++)
{
var page = new DiagramPage(diagrams[i]);
this.updatePageRoot(page);
pages.push(page);
}
}
else if (node.nodeName == 'mxGraphModel')
{
var graph = this.editor.graph;
var page = new DiagramPage(node.ownerDocument.createElement('diagram'));
page.setName(mxResources.get('pageWithNumber', [1]));
mxUtils.setTextContent(page.node, graph.compress(
graph.zapGremlins(mxUtils.getXml(node))));
pages.push(page);
}

Expand Down
51 changes: 4 additions & 47 deletions src/main/webapp/js/diagramly/DrawioFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DrawioFile = function(ui, data)
lastMerge: 0, /* details of the last successful merge */
lastMergeTime: 0, /* timestamp of the last call to merge */
lastOpenTime: 0, /* timestamp of the last call to open */
lastIgnored: 0, /* timestamp of the last ignored mergeFile */
emptyPrefix: false, /* timestamp of the last call to open */
shadowState: 0, /* current etag hash for shadow */
opened: 0, /* number of calls to open */
closed: 0, /* number of calls to close */
Expand Down Expand Up @@ -243,7 +243,6 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
var shadow = (this.shadowPages != null) ? this.shadowPages :
this.ui.getPagesForNode(mxUtils.parseXml(
this.shadowData).documentElement);
this.checkPages(shadow, 'mergeFile init');

// Loads new document as shadow document
var pages = this.ui.getPagesForNode(
Expand All @@ -268,7 +267,6 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
// Patching previous shadow to verify checksum
var patched = this.ui.patchPages(shadow, patches[0]);
this.stats.shadowState = this.ui.hashValue(file.getCurrentEtag());
this.checkPages(patched, 'mergeFile patched');

var patchedDetails = {};
var checksum = this.ui.getHashValueForPages(patched, patchedDetails);
Expand Down Expand Up @@ -304,7 +302,6 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
this.patch(patches,
(DrawioFile.LAST_WRITE_WINS) ?
this.backupPatch : null);
this.checkPages(this.ui.pages, 'mergeFile done');
}
}
else
Expand All @@ -314,23 +311,7 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
}
else
{
try
{
// Report only once per session
if (this.stats.lastIgnored == 0)
{
this.sendErrorReport('Ignored empty pages in mergeFile',
'File Data: ' + this.compressReportData(
this.ui.anonymizeString(file.data),
null, 500));
}

this.stats.lastIgnored = new Date().toISOString();
}
catch (e2)
{
// ignore
}
throw new Error(mxResources.get('notADiagramFile'));
}

this.invalidChecksum = false;
Expand Down Expand Up @@ -399,29 +380,6 @@ DrawioFile.prototype.getAnonymizedXmlForPages = function(pages)
return mxUtils.getPrettyXml(file);
};

/**
* Checks if the given shadow is valid.
*/
DrawioFile.prototype.checkPages = function(pages, info)
{
if (this.ui.getCurrentFile() == this && (pages == null || pages.length == 0))
{
var data = (this.shadowData == null) ? 'null' :
this.compressReportData(
this.ui.anonymizeString(
this.shadowData),
null, 5000);

this.sendErrorReport(
'Pages is null or empty',
'Shadow: ' + ((pages != null) ? pages.length : 'null') +
'\nShadowPages: ' + ((this.shadowPages != null) ?
this.shadowPages.length : 'null') +
((info != null) ? ('\nInfo: ' + info) : '') +
'\nShadowData: ' + data);
}
};

/**
* Adds the listener for automatically saving the diagram for local changes.
*/
Expand Down Expand Up @@ -1683,8 +1641,7 @@ DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error)
this.stats.fileSaved++;
this.inConflictState = false;
this.invalidChecksum = false;
this.checkPages(this.ui.pages, 'fileSaved');


if (this.sync == null)
{
this.shadowData = savedData;
Expand Down Expand Up @@ -1717,7 +1674,7 @@ DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error)
{
this.sendErrorReport('Error in fileSaved',
'Saved Data:\n' + this.compressReportData(
this.ui.anonymizeString(savedData), null, 500), e);
this.ui.anonymizeString(savedData), null, 1000), e);
}
catch (e2)
{
Expand Down
7 changes: 3 additions & 4 deletions src/main/webapp/js/diagramly/DrawioFileSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,7 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
this.file.shadowPages = (this.file.shadowPages != null) ?
this.file.shadowPages : this.ui.getPagesForNode(
mxUtils.parseXml(this.file.shadowData).documentElement)
this.file.checkPages(this.file.shadowPages, 'merge init');


// Creates a patch for backup if the checksum fails
this.file.backupPatch = (this.file.isModified()) ?
this.ui.diffPages(this.file.shadowPages,
Expand All @@ -930,7 +929,6 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
}

this.file.stats.shadowState = this.ui.hashValue(etag);
this.file.checkPages(this.file.shadowPages, 'merge patched');
var currentDetails = {};
var current = (checksum != null) ? this.ui.getHashValueForPages(
this.file.shadowPages, currentDetails) : null;
Expand Down Expand Up @@ -992,7 +990,6 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
this.file.inConflictState = false;
this.file.setCurrentEtag(etag);
this.file.backupPatch = null;
this.file.checkPages(this.ui.pages, 'merge done');

if (success != null)
{
Expand Down Expand Up @@ -1143,6 +1140,8 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
}

this.file.shadowPages = pages;
this.file.stats.emptyPrefix = this.file.stats.emptyPrefix ||
this.ui.editor.graph.model.prefix.length == 0;

if (success != null)
{
Expand Down
Loading

0 comments on commit a121c48

Please sign in to comment.