2016-03-22 18:20:05 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2016-07-21 22:26:51 +00:00
|
|
|
<title>Insomnia</title>
|
2016-03-22 18:20:05 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="root"></div>
|
2017-07-27 22:59:07 +00:00
|
|
|
<div id="dropdowns-container"></div>
|
|
|
|
<div id="tooltips-container"></div>
|
2017-03-03 01:44:07 +00:00
|
|
|
<script>
|
|
|
|
// HOT RELOADING IN DEV
|
|
|
|
(function () {
|
|
|
|
const script = document.createElement('script');
|
2017-05-16 03:06:20 +00:00
|
|
|
script.async = true; // Make Chrome not warn about cross-origin script blocking
|
|
|
|
script.src = process.env.HOT
|
|
|
|
? 'http://localhost:3333/bundle.js'
|
|
|
|
: 'bundle.js';
|
|
|
|
|
2017-03-03 01:44:07 +00:00
|
|
|
document.write(script.outerHTML);
|
2017-05-16 03:06:20 +00:00
|
|
|
|
|
|
|
if (process.env.HOT) {
|
|
|
|
const msg = 'Waiting for build server. The initial build can ' +
|
|
|
|
'take over a minute on slower hardware.';
|
|
|
|
document.querySelector('#root').innerHTML = `<p>${msg}</p>`;
|
|
|
|
}
|
2017-03-03 01:44:07 +00:00
|
|
|
}());
|
|
|
|
</script>
|
2016-10-11 21:06:25 +00:00
|
|
|
<script>
|
|
|
|
// UPDATE HANDLERS
|
|
|
|
(function () {
|
|
|
|
function showUpdateNotification () {
|
|
|
|
console.log('-- Update Available --');
|
2017-03-03 20:09:08 +00:00
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new window.Notification('Insomnia Update Ready', {
|
2016-10-26 17:49:49 +00:00
|
|
|
body: 'Relaunch the app for it to take effect',
|
|
|
|
silent: true,
|
2016-11-07 20:24:38 +00:00
|
|
|
sticky: true
|
2016-10-11 21:06:25 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const {ipcRenderer} = require('electron');
|
|
|
|
ipcRenderer.on('update-available', () => {
|
2016-12-06 00:32:24 +00:00
|
|
|
// Give it a few seconds before showing this. Sometimes, when
|
|
|
|
// you relaunch too soon it doesn't work the first time.
|
2017-03-03 20:09:08 +00:00
|
|
|
setTimeout(showUpdateNotification, 1000 * 10);
|
2016-10-11 21:06:25 +00:00
|
|
|
});
|
|
|
|
})();
|
|
|
|
</script>
|
2016-07-21 22:26:51 +00:00
|
|
|
<script>
|
2016-10-28 18:42:40 +00:00
|
|
|
(function () {
|
|
|
|
const {productName, version} = require('./package.json');
|
|
|
|
if (process.env.INSOMNIA_ENV === 'development') {
|
2017-01-24 00:07:00 +00:00
|
|
|
document.title = `${productName}`;
|
2016-10-28 18:42:40 +00:00
|
|
|
} else {
|
|
|
|
document.title = `${productName} v${version}`;
|
|
|
|
}
|
2017-03-03 20:09:08 +00:00
|
|
|
})();
|
2016-07-21 22:26:51 +00:00
|
|
|
</script>
|
2016-07-07 22:06:18 +00:00
|
|
|
|
2016-07-18 19:44:46 +00:00
|
|
|
<script>
|
2016-07-25 22:27:29 +00:00
|
|
|
// SOME HELPERS
|
|
|
|
document.body.setAttribute('data-platform', process.platform);
|
2016-07-07 22:06:18 +00:00
|
|
|
</script>
|
2016-03-22 18:20:05 +00:00
|
|
|
</body>
|
|
|
|
</html>
|