Skip to content

Commit

Permalink
12.8.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alderg committed Mar 14, 2020
1 parent 4ba45d4 commit ce4550d
Show file tree
Hide file tree
Showing 25 changed files with 5,344 additions and 2,892 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,3 +1,16 @@
14-MAR-2020: 12.8.5

- Fixes drag and drop of images to containers in Firefox
- Adds (Alt+)Shift+Tab for outdent/indent while editing
- No longer selects moved cells after undo/redo
- Reduces number of automatic layout runs
- Merges PWA into online app
- Uses mxGraph 4.1.1 beta 13

11-MAR-2020: 12.8.4

- Changes canonical URL to app.diagrams.net

11-MAR-2020: 12.8.3

- Switches to PlantUML build 1.2020.2
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
12.8.3
12.8.5
44 changes: 23 additions & 21 deletions etc/mxgraph/mxClient.js

Large diffs are not rendered by default.

Binary file modified src/main/webapp/images/sidebar-floorplans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions src/main/webapp/index.html
Expand Up @@ -18,7 +18,6 @@
<meta name="theme-color" content="#d89000">
<script type="text/javascript">
var mxIsElectron = window && window.process && window.process.type;
var mxIsElectron5 = mxIsElectron && parseInt(process.versions.electron) >= 5;

/**
* URL Parameters and protocol description are here:
Expand Down Expand Up @@ -102,11 +101,6 @@
window.location.href = href;
}
}
else if (!mxIsElectron5)
{
// It's electron, but v3 or lower
window.location.href = 'https://about.draw.io/updates-to-draw-io-desktop/';
}
})();
}

Expand Down Expand Up @@ -152,7 +146,7 @@
addMeta('apple-mobile-web-app-title', name);
addMeta('application-name', name);

if (mxIsElectron5)
if (mxIsElectron)
{
addMeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');
}
Expand All @@ -165,7 +159,7 @@
<link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#d89000">
<link rel="stylesheet" type="text/css" href="js/croppie/croppie.min.css">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<link rel="canonical" href="https://www.draw.io">
<link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<style type="text/css">
Expand Down
2,662 changes: 1,353 additions & 1,309 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

104 changes: 62 additions & 42 deletions src/main/webapp/js/diagramly/App.js
Expand Up @@ -531,25 +531,12 @@ App.main = function(callback, createUi)

if (window.mxscript != null)
{
// Check that service workers are supported and registers,
// unregisters or updates the installed service worker
// Runs as progressive web app if service workers are supported
try
{
if ('serviceWorker' in navigator)
{
if (urlParams['offline'] == '1')
{
mxscript('js/shapes.min.js');
mxscript('js/stencils.min.js');
mxscript('js/extensions.min.js');

// Use the window load event to keep the page load performant
window.addEventListener('load', function()
{
navigator.serviceWorker.register('/service-worker.js');
});
}
else if (urlParams['offline'] == '0')
if (urlParams['offline'] == '0' || urlParams['dev'] == '1')
{
navigator.serviceWorker.getRegistrations().then(function(registrations)
{
Expand All @@ -559,9 +546,13 @@ App.main = function(callback, createUi)
}
});
}
else if (navigator.serviceWorker.controller)
else
{
// Updates cache if PWA was registered
mxscript('js/shapes.min.js');
mxscript('js/stencils.min.js');
mxscript('js/extensions.min.js');

// Use the window load event to keep the page load performant
window.addEventListener('load', function()
{
navigator.serviceWorker.register('/service-worker.js');
Expand Down Expand Up @@ -1441,17 +1432,15 @@ App.prototype.init = function()
}

// Integrates Add to Home Screen
if (urlParams['offline'] == '1' && 'serviceWorker' in navigator &&
!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
if ('serviceWorker' in navigator && !mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp &&
(/.*\.diagrams\.net$/.test(window.location.hostname) || urlParams['offline'] == '1'))
{
window.addEventListener('beforeinstallprompt', mxUtils.bind(this, function(e)
{
this.showBanner('AddToHomeScreenFooter',
mxResources.get('installDrawio'),
mxUtils.bind(this, function()
{
e.prompt();
}));
this.showBanner('AddToHomeScreenFooter', mxResources.get('installDrawio'), function()
{
e.prompt();
});
}));
}
else if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && !this.isOfflineApp() &&
Expand All @@ -1470,7 +1459,7 @@ App.prototype.init = function()
}

if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && urlParams['embed'] != '1' && DrawioFile.SYNC == 'auto' &&
urlParams['local'] != '1' && urlParams['stealth'] != '1' && urlParams['offline'] != '1' &&
urlParams['local'] != '1' && urlParams['stealth'] != '1' && this.isOffline() &&
(!this.editor.chromeless || this.editor.editable))
{
// Checks if the cache is alive
Expand Down Expand Up @@ -3483,6 +3472,22 @@ App.prototype.pickFile = function(mode)
window.openNew = this.getCurrentFile() != null && !this.isDiagramEmpty();
window.baseUrl = this.getUrl();
window.openKey = 'open';

window.listBrowserFiles = mxUtils.bind(this, function(success, error)
{
StorageFile.listFiles(this, 'F', success, error);
});

window.openBrowserFile = mxUtils.bind(this, function(title, success, error)
{
StorageFile.getFileContent(this, title, success, error);
});

window.deleteBrowserFile = mxUtils.bind(this, function(title, success, error)
{
StorageFile.deleteFile(this, title, success, error);
});

var prevValue = Editor.useLocalStorage;
Editor.useLocalStorage = (mode == App.MODE_BROWSER);
this.openFile();
Expand Down Expand Up @@ -3638,6 +3643,21 @@ App.prototype.pickLibrary = function(mode)
window.openNew = false;
window.openKey = 'open';

window.listBrowserFiles = mxUtils.bind(this, function(success, error)
{
StorageFile.listFiles(this, 'L', success, error);
});

window.openBrowserFile = mxUtils.bind(this, function(title, success, error)
{
StorageFile.getFileContent(this, title, success, error);
});

window.deleteBrowserFile = mxUtils.bind(this, function(title, success, error)
{
StorageFile.deleteFile(this, title, success, error);
});

var prevValue = Editor.useLocalStorage;
Editor.useLocalStorage = mode == App.MODE_BROWSER;

Expand Down Expand Up @@ -4420,11 +4440,19 @@ App.prototype.loadFile = function(id, sameWindow, file, success, force)
}
else
{
try
var error = mxUtils.bind(this, function (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'), mxUtils.bind(this, function()
{
var tempFile = this.getCurrentFile();
window.location.hash = (tempFile != null) ? tempFile.getHash() : '';
}));
});

id = decodeURIComponent(id.substring(1));

StorageFile.getFileContent(this, id, mxUtils.bind(this, function(data)
{
id = decodeURIComponent(id.substring(1));
var data = localStorage.getItem(id);

if (data != null)
{
this.fileLoaded(new StorageFile(this, data, id));
Expand All @@ -4436,17 +4464,9 @@ App.prototype.loadFile = function(id, sameWindow, file, success, force)
}
else
{
throw {message: mxResources.get('fileNotFound')};
error({message: mxResources.get('fileNotFound')});
}
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'), mxUtils.bind(this, function()
{
var tempFile = this.getCurrentFile();
window.location.hash = (tempFile != null) ? tempFile.getHash() : '';
}));
}
}), error);
}
}
else if (file != null)
Expand Down Expand Up @@ -4914,7 +4934,7 @@ App.prototype.loadLibraries = function(libs, done)
{
var name = decodeURIComponent(id.substring(1));

var xml = this.getLocalData(name, mxUtils.bind(this, function(xml)
StorageFile.getFileContent(this, name, mxUtils.bind(this, function(xml)
{
if (name == '.scratchpad' && xml == null)
{
Expand All @@ -4929,7 +4949,7 @@ App.prototype.loadLibraries = function(libs, done)
{
onerror();
}
}));
}), onerror);
}
catch (e)
{
Expand Down

0 comments on commit ce4550d

Please sign in to comment.