Skip to content

Commit 55d983c

Browse files
committed
9.5.5 release
1 parent 2172052 commit 55d983c

17 files changed

+955
-892
lines changed

ChangeLog

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
03-DEC-2018: 9.5.5
2+
3+
- Adds unsaved status for new files in Desktop
4+
- Fixes minor CSS issues
5+
16
03-DEC-2018: 9.5.4
27

3-
- Fixes possible NPE in Desktop app
8+
- Fixes possible NPE in Desktop
49

510
03-DEC-2018: 9.5.3
611

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.5.4
1+
9.5.5

src/main/webapp/cache.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CACHE MANIFEST
22

33
# THIS FILE WAS GENERATED. DO NOT MODIFY!
4-
# 12/03/2018 07:26 PM
4+
# 12/03/2018 10:08 PM
55

66
app.html
77
index.html?offline=1

src/main/webapp/js/app.min.js

+435-434
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/atlas-viewer.min.js

+127-126
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/atlas.min.js

+140-139
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/diagramly/App.js

+2
Original file line numberDiff line numberDiff line change
@@ -4530,6 +4530,8 @@ App.prototype.descriptorChanged = function()
45304530
}
45314531
}
45324532
}
4533+
4534+
this.updateUi();
45334535
};
45344536

45354537
/**

src/main/webapp/js/diagramly/DrawioFile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ DrawioFile.prototype.reloadFile = function(success)
318318
{
319319
this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
320320
{
321-
this.handleFileError();
321+
this.handleFileSuccess(DrawioFile.SYNC == 'manual');
322322
}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
323323
}
324324
else
@@ -1315,7 +1315,7 @@ DrawioFile.prototype.fileChanged = function()
13151315
else if ((!this.isAutosaveOptional() || !this.ui.editor.autosave) &&
13161316
!this.inConflictState)
13171317
{
1318-
this.handleFileError();
1318+
this.addUnsavedStatus();
13191319
}
13201320
};
13211321

src/main/webapp/js/diagramly/DriveClient.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,18 @@ DriveClient.prototype.updateUser = function(success, error, remember)
566566
// Requests more information about the user (email address is sometimes not in info)
567567
this.executeRequest(gapi.client.drive.about.get(), mxUtils.bind(this, function(resp)
568568
{
569-
this.setUser(new DrawioUser(info.id, resp.user.emailAddress, resp.user.displayName,
570-
(resp.user.picture != null) ? resp.user.picture.url : null, info.locale));
569+
var email = mxResources.get('notAvailable');
570+
var name = email;
571+
var pic = null;
572+
573+
if (resp != null && resp.user != null)
574+
{
575+
email = resp.user.emailAddress;
576+
name = resp.user.displayName;
577+
pic = (resp.user.picture != null) ? resp.user.picture.url : null;
578+
}
579+
580+
this.setUser(new DrawioUser(info.id, email, name, pic, info.locale));
571581
this.setUserId(info.id, remember);
572582

573583
if (success != null)

src/main/webapp/js/diagramly/Editor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@
13371337
}
13381338
});
13391339

1340-
option.style.paddingTop = '0px';
1340+
option.style.paddingTop = '5px';
13411341
div.appendChild(option);
13421342

13431343
var help = ui.menus.createHelpLink('https://desk.draw.io/support/solutions/articles/16000032875');

src/main/webapp/js/diagramly/EditorUi.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,10 @@
927927

928928
if (forceReload)
929929
{
930-
currentFile.reloadFile();
930+
currentFile.reloadFile(mxUtils.bind(this, function()
931+
{
932+
currentFile.handleFileSuccess(DrawioFile.SYNC == 'manual');
933+
}));
931934
}
932935
else
933936
{
@@ -4111,7 +4114,7 @@
41114114
cb.style.marginRight = '8px';
41124115
cb.style.marginTop = '16px';
41134116
cb.setAttribute('type', asRadio? 'radio' : 'checkbox');
4114-
var id = 'cb' + Math.random();
4117+
var id = 'geCheckbox-' + Editor.guid();
41154118
cb.id = id;
41164119

41174120
if (radioGroupName != null)

src/main/webapp/js/diagramly/ElectronApp.js

+74-44
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,22 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
540540

541541
LocalFile.prototype.getLatestVersion = function(success, error)
542542
{
543-
this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
543+
if (this.fileObject == null)
544544
{
545-
var file = new LocalFile(this, data, '');
546-
file.stat = stat;
547-
success(file);
548-
}), error, this.fileObject.path);
545+
if (error != null)
546+
{
547+
error({message: mxResources.get('fileNotFound')});
548+
}
549+
}
550+
else
551+
{
552+
this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
553+
{
554+
var file = new LocalFile(this, data, '');
555+
file.stat = stat;
556+
success(file);
557+
}), error, this.fileObject.path);
558+
}
549559
};
550560

551561
// Call save as for copy
@@ -570,54 +580,61 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
570580

571581
LocalFile.prototype.reloadFile = function(success)
572582
{
573-
this.ui.spinner.stop();
574-
575-
var fn = mxUtils.bind(this, function()
583+
if (this.fileObject == null)
584+
{
585+
this.ui.handleError({message: mxResources.get('fileNotFound')});
586+
}
587+
else
576588
{
577-
this.setModified(false);
578-
var page = this.ui.currentPage;
579-
var viewState = this.ui.editor.graph.getViewState();
580-
var selection = this.ui.editor.graph.getSelectionCells();
589+
this.ui.spinner.stop();
581590

582-
if (this.ui.spinner.spin(document.body, mxResources.get('loading')))
591+
var fn = mxUtils.bind(this, function()
583592
{
584-
this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
593+
this.setModified(false);
594+
var page = this.ui.currentPage;
595+
var viewState = this.ui.editor.graph.getViewState();
596+
var selection = this.ui.editor.graph.getSelectionCells();
597+
598+
if (this.ui.spinner.spin(document.body, mxResources.get('loading')))
585599
{
586-
this.ui.spinner.stop();
587-
588-
var file = new LocalFile(this.ui, data, '');
589-
file.fileObject = fileEntry;
590-
file.stat = stat;
591-
592-
this.ui.fileLoaded(file);
593-
this.ui.restoreViewState(page, viewState, selection);
594-
595-
if (this.backupPatch != null)
600+
this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
596601
{
597-
this.patch([this.backupPatch]);
598-
}
599-
600-
if (success != null)
602+
this.ui.spinner.stop();
603+
604+
var file = new LocalFile(this.ui, data, '');
605+
file.fileObject = fileEntry;
606+
file.stat = stat;
607+
608+
this.ui.fileLoaded(file);
609+
this.ui.restoreViewState(page, viewState, selection);
610+
611+
if (this.backupPatch != null)
612+
{
613+
this.patch([this.backupPatch]);
614+
}
615+
616+
if (success != null)
617+
{
618+
success();
619+
}
620+
}), mxUtils.bind(this, function(err)
601621
{
602-
success();
603-
}
604-
}), mxUtils.bind(this, function(err)
622+
this.ui.handleFileError(err);
623+
}), this.fileObject.path);
624+
}
625+
});
626+
627+
if (this.isModified() && this.backupPatch == null)
628+
{
629+
this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
605630
{
606-
this.ui.handleFileError(err);
607-
}), this.fileObject.path);
631+
this.handleFileSuccess(DrawioFile.SYNC == 'manual');
632+
}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
608633
}
609-
});
610-
611-
if (this.isModified() && this.backupPatch == null)
612-
{
613-
this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
634+
else
614635
{
615-
this.handleFileError();
616-
}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
617-
}
618-
else
619-
{
620-
fn();
636+
fn();
637+
}
621638
}
622639
};
623640

@@ -936,6 +953,19 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
936953
}
937954
};
938955

956+
957+
/**
958+
* Updates action states depending on the selection.
959+
*/
960+
var editorUiUpdateActionStates = EditorUi.prototype.updateActionStates;
961+
EditorUi.prototype.updateActionStates = function()
962+
{
963+
editorUiUpdateActionStates.apply(this, arguments);
964+
965+
var file = this.getCurrentFile();
966+
this.actions.get('synchronize').setEnabled(file != null && file.fileObject != null);
967+
};
968+
939969
EditorUi.prototype.saveLocalFile = function(data, filename, mimeType, base64Encoded, format, allowBrowser)
940970
{
941971
this.saveData(filename, format, data, mimeType, base64Encoded);

src/main/webapp/js/diagramly/Minimal.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ EditorUi.initMinimalTheme = function()
1818
var style = document.createElement('style')
1919
style.type = 'text/css';
2020
style.innerHTML = '* { -webkit-font-smoothing: antialiased; }' +
21-
'html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}' +
21+
'html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }' +
22+
'html body table.mxWindow td.mxWindowPane div.mxWindowPane * { font-size:9pt; }' +
2223
'html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }' +
2324
'html body button.geBtn:active { opacity: 0.6; }' +
24-
'.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }' +
25+
'html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }' +
2526
'div.geDialog { border-radius: 5px; }' +
2627
'html body div.geDialog button.geBigButton { color: #fff !important; }' +
2728
'.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }' +
2829
'html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }' +
29-
'html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }' +
30+
'html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }' +
31+
'html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }' +
32+
'html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }' +
3033
'div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }' +
31-
'div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }' +
3234
'div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }' +
3335
'html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }' +
3436
'html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }' +
@@ -118,7 +120,7 @@ EditorUi.initMinimalTheme = function()
118120
{
119121
ui.formatWindow = new WrapperWindow(ui, mxResources.get('format'),
120122
Math.max(20, ui.diagramContainer.clientWidth - 240 - 12), 56,
121-
240, Math.min(550, graph.container.clientHeight - 10), function(container)
123+
240, Math.min(560, graph.container.clientHeight - 10), function(container)
122124
{
123125
var format = ui.createFormat(container);
124126
format.init();

src/main/webapp/js/embed-static.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/mxgraph/Format.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ Format.prototype.refresh = function()
363363
label.style.paddingTop = '8px';
364364
label.style.height = (mxClient.IS_QUIRKS) ? '34px' : '25px';
365365
label.style.width = '100%';
366+
label.style.cursor = 'pointer';
366367
this.container.appendChild(div);
367368

368369
if (graph.isSelectionEmpty())
@@ -450,6 +451,10 @@ Format.prototype.refresh = function()
450451
});
451452

452453
mxEvent.addListener(elt, 'click', clickHandler);
454+
mxEvent.addListener(elt, 'mousedown', function(evt)
455+
{
456+
mxEvent.consume(evt);
457+
});
453458

454459
if (index == ((containsLabel) ? this.labelIndex : this.currentIndex))
455460
{
@@ -3565,7 +3570,7 @@ TextFormatPanel.prototype.addFont = function(container)
35653570

35663571
function getRelativeLineHeight(fontSize, css, elt)
35673572
{
3568-
if (css != null)
3573+
if (elt.style != null && css != null)
35693574
{
35703575
var lineHeight = css.lineHeight
35713576

@@ -3585,20 +3590,22 @@ TextFormatPanel.prototype.addFont = function(container)
35853590
}
35863591
};
35873592

3588-
function getAbsoluteFontSize(fontSize)
3593+
function getAbsoluteFontSize(css)
35893594
{
3590-
if (fontSize.substring(fontSize.length - 2) == 'px')
3595+
var fontSize = (css != null) ? css.fontSize : null;
3596+
3597+
if (fontSize != null && fontSize.substring(fontSize.length - 2) == 'px')
35913598
{
35923599
return parseFloat(fontSize);
35933600
}
35943601
else
35953602
{
35963603
return mxConstants.DEFAULT_FONTSIZE;
35973604
}
3598-
}
3605+
};
35993606

36003607
var css = mxUtils.getCurrentStyle(node);
3601-
var fontSize = getAbsoluteFontSize(css.fontSize);
3608+
var fontSize = getAbsoluteFontSize(css);
36023609
var lineHeight = getRelativeLineHeight(fontSize, css, node);
36033610

36043611
// Finds common font size
@@ -3614,7 +3621,7 @@ TextFormatPanel.prototype.addFont = function(container)
36143621
if (selection.containsNode(elts[i], true))
36153622
{
36163623
temp = mxUtils.getCurrentStyle(elts[i]);
3617-
fontSize = Math.max(getAbsoluteFontSize(temp.fontSize), fontSize);
3624+
fontSize = Math.max(getAbsoluteFontSize(temp), fontSize);
36183625
var lh = getRelativeLineHeight(fontSize, temp, elts[i]);
36193626

36203627
if (lh != lineHeight || isNaN(lh))

0 commit comments

Comments
 (0)