-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
32 lines (30 loc) · 883 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="index.css" rel="stylesheet">
<title>Kurage</title>
</head>
<body>
<div id="editor"></div>
<script>
// You can also require other files to run in this process
// require('./renderer.js')
const file = require('./file.js')
const fs = require('fs')
const electron = require('electron')
const {dialog} = require('electron').remote
file.load()
electron.ipcRenderer.on('writeFileSyncMemo', () => {
fs.writeFileSync(dialog.showSaveDialog(), ace.edit("editor").getValue())
console.log("Memo was saved!")
})
</script>
<script src="./node_modules/ace-builds/src-min/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/markdown");
</script>
</body>
</html>