Skip to content

Commit

Permalink
22.1.9 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Dec 14, 2023
1 parent 8373cb7 commit 6ab3e6e
Show file tree
Hide file tree
Showing 19 changed files with 1,829 additions and 1,714 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
14-DEC-2023: 21.1.9

- Scrolls to loaded libraries, fixes library export to browser
- Fixes library moved to end after edit
- Fixes relative links in print preview
- Alt+Shift+Drag ignores cell under mouse if selection not empty

12-DEC-2023: 22.1.8

- Adds color option in freehand dialog [drawio-3454]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.1.8
22.1.9
12 changes: 10 additions & 2 deletions src/main/mxgraph/handler/mxGraphHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,17 @@ mxGraphHandler.prototype.mouseMove = function(sender, me)
}
}

var cells = graph.getSelectionCells();

if (!this.graph.isToggleEvent(me.getEvent()) ||
!mxEvent.isAltDown(me.getEvent()) ||
graph.isSelectionEmpty())
{
cells = cells.concat(me.getCell());
}

this.start(this.cell, this.mouseDownX, this.mouseDownY,
this.getCells(null, graph.getSelectionCells().
concat(me.getCell())));
this.getCells(null, cells));
}

var delta = (this.first != null) ? this.getDelta(me) : null;
Expand Down
Binary file modified src/main/webapp/images/sidebar-gcp2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,246 changes: 630 additions & 616 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

130 changes: 58 additions & 72 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4122,6 +4122,29 @@ App.prototype.pickFile = function(mode)
App.prototype.pickLibrary = function(mode)
{
mode = (mode != null) ? mode : this.mode;

var doLoadLibary = mxUtils.bind(this, function(file)
{
try
{
this.loadLibrary(file);
this.showSidebar();

try
{
this.sidebar.palettes[file.getHash()][0].
scrollIntoView({behavior: 'smooth'});
}
catch (e)
{
// ignore
}
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
});

if (mode == App.MODE_GOOGLE || mode == App.MODE_DROPBOX || mode == App.MODE_ONEDRIVE ||
mode == App.MODE_GITHUB || mode == App.MODE_GITLAB || mode == App.MODE_TRELLO)
Expand All @@ -4139,15 +4162,7 @@ App.prototype.pickLibrary = function(mode)
{
if (optionalFile != null)
{
try
{
this.loadLibrary(optionalFile);
this.showSidebar();
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
doLoadLibary(optionalFile);
}
else
{
Expand All @@ -4156,16 +4171,7 @@ App.prototype.pickLibrary = function(mode)
peer.getLibrary(id, mxUtils.bind(this, function(file)
{
this.spinner.stop();

try
{
this.loadLibrary(file);
this.showSidebar();
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
doLoadLibary(file);
}), mxUtils.bind(this, function(resp)
{
this.handleError(resp, (resp != null) ? mxResources.get('errorLoadingFile') : null);
Expand Down Expand Up @@ -4194,16 +4200,8 @@ App.prototype.pickLibrary = function(mode)

reader.onload = mxUtils.bind(this, function(e)
{
try
{
this.loadLibrary(new LocalLibrary(this,
e.target.result, file.name));
this.showSidebar();
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
doLoadLibary(new LocalLibrary(this,
e.target.result, file.name));
});

reader.readAsText(file);
Expand Down Expand Up @@ -4255,17 +4253,9 @@ App.prototype.pickLibrary = function(mode)

window.openFile.setConsumer(mxUtils.bind(this, function(xml, filename)
{
try
{
this.loadLibrary((mode == App.MODE_BROWSER) ?
new StorageLibrary(this, xml, filename) :
new LocalLibrary(this, xml, filename));
this.showSidebar();
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
doLoadLibary((mode == App.MODE_BROWSER) ?
new StorageLibrary(this, xml, filename) :
new LocalLibrary(this, xml, filename));
}));

// Removes openFile if dialog is closed
Expand Down Expand Up @@ -6565,30 +6555,6 @@ App.prototype.exportFile = function(data, filename, mimeType, base64Encoded, mod
{
this.drive.insertFile(filename, data, folderId, mxUtils.bind(this, function(resp)
{
// TODO: Add callback with url param for clickable status message
// "File exported. Click here to open folder."
// this.editor.setStatus('<div class="geStatusMessage">' +
// mxResources.get('saved') + '</div>');
//
// // Installs click handler for opening
// if (this.statusContainer != null)
// {
// var links = this.statusContainer.getElementsByTagName('div');
//
// if (links.length > 0)
// {
// links[0].style.cursor = 'pointer';
//
// mxEvent.addListener(links[0], 'click', mxUtils.bind(this, function()
// {
// if (resp != null && resp.id != null)
// {
// window.open('https://drive.google.com/open?id=' + resp.id);
// }
// }));
// }
// }

this.spinner.stop();
}), mxUtils.bind(this, function(resp)
{
Expand Down Expand Up @@ -6660,18 +6626,38 @@ App.prototype.exportFile = function(data, filename, mimeType, base64Encoded, mod
}
else if (mode == App.MODE_BROWSER)
{
var fn = mxUtils.bind(this, function()
if (window.StorageFile != null && !base64Encoded &&
this.spinner.spin(document.body, mxResources.get('saving')))
{
localStorage.setItem(filename, data);
});

if (localStorage.getItem(filename) == null)
{
fn();
var file = data.substring(0, 10) == '<mxlibrary' ?
new StorageLibrary(this, data, filename) :
new StorageFile(this, data, filename)

StorageFile.doInsertFile(file,
mxUtils.bind(this, function()
{
this.spinner.stop();
}), mxUtils.bind(this, function(resp)
{
this.spinner.stop();
this.handleError(resp);
}));
}
else
{
this.confirm(mxResources.get('replaceIt', [filename]), fn);
var fn = mxUtils.bind(this, function()
{
localStorage.setItem(filename, data);
});

if (localStorage.getItem(filename) == null)
{
fn();
}
else
{
this.confirm(mxResources.get('replaceIt', [filename]), fn);
}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8887,7 +8887,7 @@ var ChatWindow = function(editorUi, x, y, w, h)
inner.style.cursor = 'default';

var inp = document.createElement('input');
inp.setAttribute('placeholder', 'Ask me anything');
inp.setAttribute('placeholder', mxResources.get('askMeAnything'));
inp.setAttribute('type', 'text');
inp.style.width = '100%';
inp.style.outline = 'none';
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/js/diagramly/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3368,14 +3368,14 @@
};

/**
* Changes the position of the library in the sidebar
* Changes the position of the library in the sidebar.
*/
EditorUi.prototype.repositionLibrary = function(nextChild, append)
{
var c = this.sidebar.getEntryContainer();

if (nextChild == null && (!append ||
!this.sidebar.appendCustomLibraries))
if (!this.sidebar.appendCustomLibraries ||
nextChild != null || !append)
{
if (nextChild == null)
{
Expand All @@ -3400,7 +3400,7 @@
c.insertBefore(content, nextChild);
c.insertBefore(title, content);
}
}
};

/**
* Translates this point by the given vector.
Expand Down
18 changes: 15 additions & 3 deletions src/main/webapp/js/diagramly/StorageFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,26 @@ StorageFile.prototype.saveAs = function(title, success, error)
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
StorageFile.insertFile = function(ui, title, data, success, error)
StorageFile.insertFile = function(ui, title, data, success, error, file)
{
StorageFile.doInsertFile(new StorageFile(ui, data, title), success, error);
};

/**
* Translates this point by the given vector.
*
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
StorageFile.doInsertFile = function(file, success, error)
{
var title = file.getTitle();
var ui = file.getUi();

var createStorageFile = mxUtils.bind(this, function(exists)
{
var fn = function()
{
var file = new StorageFile(ui, data, title);

// Inserts data into local storage
file.saveFile(title, false, function()
{
Expand Down
Loading

0 comments on commit 6ab3e6e

Please sign in to comment.