Skip to content
Snippets Groups Projects
Commit cb7dd057 authored by David Benson's avatar David Benson
Browse files

Desktop changes

Former-commit-id: 1113005b
parent 44c5cc00
No related branches found
No related tags found
No related merge requests found
......@@ -112,24 +112,29 @@ function createWindow (opt = {})
mainWindow.webContents.on('did-fail-load', function()
{
console.log('did-fail-load');
var choice = dialog.showMessageBox(mainWindow,
{
type: 'question',
buttons: ['Try again', 'Quit'],
title: 'Launcher',
message: 'Ensure you are online to setup'
});
if (choice === 0)
{
mainWindow.loadURL(wurl);
}
else if (choice === 1)
{
app.quit();
}
let ourl = url.format(
{
pathname: `${__dirname}/index.html`,
protocol: 'file:',
query:
{
'dev': __DEV__ ? 1 : 0,
'test': __DEV__ ? 1 : 0,
'db': 0,
'gapi': 0,
'od': 0,
'gh': 0,
'tr': 0,
'analytics': 0,
'picker': 0,
'mode': 'device',
'browser': 0,
'p': 'electron'
},
slashes: true,
})
mainWindow.loadURL(ourl)
});
return mainWindow.id
......
......@@ -79,39 +79,44 @@
(function()
{
var proto = window.location.protocol;
var host = window.location.host;
// Redirects apex and rt to www
if (host === 'draw.io' || host === 'rt.draw.io')
{
host = 'www.draw.io';
}
// Redirects to SSL/non-SSL
if (urlParams['demo'] != '1')
// Electron protocol is file:
if (proto != 'file:')
{
var ssl = (urlParams['https'] != null) ? urlParams['https'] == '1' :
navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 9;
var host = window.location.host;
// Redirects apex and rt to www
if (host === 'draw.io' || host === 'rt.draw.io')
{
host = 'www.draw.io';
}
if (ssl && proto != 'https:')
// Redirects to SSL/non-SSL
if (urlParams['demo'] != '1')
{
proto = 'https:';
var ssl = (urlParams['https'] != null) ? urlParams['https'] == '1' :
navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 9;
if (ssl && proto != 'https:')
{
proto = 'https:';
}
else if (!ssl && proto != 'http:')
{
proto = 'http:';
}
}
else if (!ssl && proto != 'http:')
var href = proto + '//' + host + window.location.href.substring(
window.location.protocol.length +
window.location.host.length + 2);
// Redirects if href changes
if (href != window.location.href)
{
proto = 'http:';
window.location.href = href;
}
}
var href = proto + '//' + host + window.location.href.substring(
window.location.protocol.length +
window.location.host.length + 2);
// Redirects if href changes
if (href != window.location.href)
{
window.location.href = href;
}
})();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment