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>
|
2016-07-25 22:27:29 +00:00
|
|
|
<script src="./external/jsonlint.js"></script>
|
|
|
|
<script src="./external/raven.min.js"></script>
|
|
|
|
<script>
|
|
|
|
// Sentry
|
|
|
|
|
2016-08-19 23:12:33 +00:00
|
|
|
Raven.config('https://fb3242f902b54cdd934b8ffa204426c0:23430fbe203a4189a68efb63c38fc50b@app.getsentry.com/88289', {
|
|
|
|
allowSecretKey: true,
|
|
|
|
logger: 'sentry',
|
|
|
|
environment: process.env.INSOMNIA_ENV || 'production',
|
|
|
|
levels: ['warn', 'error'],
|
|
|
|
release: require('./app.json').version,
|
|
|
|
ignoreUrls: [
|
|
|
|
/.*raven\.min\.js.*/
|
|
|
|
],
|
|
|
|
includePaths: [
|
|
|
|
/^(?!.*raven.min.js$).*$/ // Ignore raven stuff
|
|
|
|
],
|
|
|
|
dataCallback: function (data) {
|
|
|
|
var normalize = function (filename) {
|
|
|
|
var match = filename.match(/\/(app.asar|build)\/(.*)/);
|
|
|
|
if (match) {
|
|
|
|
return match[2]; // return everything after ../app.asar/*
|
|
|
|
} else {
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
};
|
2016-08-17 19:12:13 +00:00
|
|
|
|
2016-08-19 23:12:33 +00:00
|
|
|
data.exception.values[0].stacktrace.frames.forEach(function (frame) {
|
|
|
|
frame.filename = normalize(frame.filename);
|
|
|
|
});
|
2016-08-17 19:12:13 +00:00
|
|
|
|
2016-08-19 23:12:33 +00:00
|
|
|
return data
|
|
|
|
}
|
|
|
|
}).install();
|
2016-07-25 22:27:29 +00:00
|
|
|
|
2016-08-19 23:12:33 +00:00
|
|
|
console.log('-- Initialized Sentry --');
|
2016-07-25 22:27:29 +00:00
|
|
|
</script>
|
2016-07-21 22:26:51 +00:00
|
|
|
<script>
|
|
|
|
const {longName} = require('./app.json');
|
|
|
|
document.title = `${longName}`;
|
|
|
|
</script>
|
2016-03-22 18:20:05 +00:00
|
|
|
<script>
|
2016-07-25 22:27:29 +00:00
|
|
|
// HOT RELOADING IN DEV
|
|
|
|
|
2016-03-22 18:20:05 +00:00
|
|
|
(function () {
|
|
|
|
const script = document.createElement('script');
|
2016-07-18 20:10:18 +00:00
|
|
|
script.src = (process.env.HOT) ? 'http://localhost:3333/build/bundle.js' : './bundle.js';
|
2016-03-22 18:20:05 +00:00
|
|
|
document.write(script.outerHTML);
|
|
|
|
}());
|
|
|
|
</script>
|
2016-07-07 22:06:18 +00:00
|
|
|
|
2016-07-07 20:10:55 +00:00
|
|
|
<script>
|
2016-07-25 22:27:29 +00:00
|
|
|
// CREATE MENUS
|
|
|
|
|
2016-07-07 20:10:55 +00:00
|
|
|
const remote = require('electron').remote;
|
|
|
|
const Menu = remote.Menu;
|
|
|
|
const MenuItem = remote.MenuItem;
|
|
|
|
|
|
|
|
var menu = new Menu();
|
|
|
|
menu.append(new MenuItem({label: "Undo", selector: "undo:"}));
|
|
|
|
menu.append(new MenuItem({label: "Redo", selector: "redo:"}));
|
|
|
|
menu.append(new MenuItem({type: "separator"}));
|
|
|
|
menu.append(new MenuItem({label: "Cut", selector: "cut:"}));
|
|
|
|
menu.append(new MenuItem({label: "Copy", selector: "copy:"}));
|
|
|
|
menu.append(new MenuItem({label: "Paste", selector: "paste:"}));
|
|
|
|
menu.append(new MenuItem({label: "Select All", selector: "selectAll:"}));
|
|
|
|
|
|
|
|
window.addEventListener('contextmenu', function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
menu.popup(remote.getCurrentWindow());
|
|
|
|
}, false);
|
|
|
|
</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
|
2016-07-07 22:06:18 +00:00
|
|
|
|
2016-07-25 22:27:29 +00:00
|
|
|
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>
|