insomnia/app/renderer.html

68 lines
1.8 KiB
HTML
Raw Normal View History

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>
<script>
// HOT RELOADING IN DEV
(function () {
const script = document.createElement('script');
script.async = true; // Make Chrome not warn about cross-origin script blocking
script.src = process.env.HOT
? 'http://localhost:3333/bundle.js'
: 'bundle.js';
document.write(script.outerHTML);
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>`;
}
}());
</script>
2016-10-11 21:06:25 +00:00
<script>
// UPDATE HANDLERS
(function () {
function showUpdateNotification () {
console.log('[app] Update Available');
// eslint-disable-next-line no-new
new window.Notification('Insomnia Update Ready', {
body: 'Relaunch the app for it to take effect',
silent: true,
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.
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}`;
}
})();
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>
// 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>