-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (44 loc) · 1.21 KB
/
index.html
File metadata and controls
51 lines (44 loc) · 1.21 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>Editor.js example page</title>
<style>
body {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
</style>
</head>
<body>
<div id="editorjs"></div>
<button id="save-button">Save</button>
<pre id="output"></pre>
<script type="module">
import EditorJS from '@editorjs/editorjs';
import paragraph from './src/index.ts';
const editor = new EditorJS({
tools: {
paragraph: {
class: paragraph,
// inlineToolbar: ['marker', 'link'],
// shortcut: 'CMD+SHIFT+H',
// config: {},
}
},
data: {
blocks: [
{
type: 'paragraph',
data: {},
}
],
},
});
const saveButton = document.getElementById('save-button');
const output = document.getElementById('output');
saveButton.addEventListener('click', () => {
editor.save().then( savedData => {
output.innerHTML = JSON.stringify(savedData, null, 4);
})
})
</script>
</body>
</html>