-
Notifications
You must be signed in to change notification settings - Fork 3
/
froala.html
32 lines (29 loc) · 1.11 KB
/
froala.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">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<script src="https://sapling.ai/static/js/sapling-sdk-v1.0.7.min.js"></script>
</head>
<body>
<div id="editor"></div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
<script>
var editor = new FroalaEditor('#editor', {
events: {
'initialized': function () {
Sapling.init({
key: '<API_KEY>',
mode: 'dev', // NOTE Do not expose API key in production (see https://sapling.ai/docs/sdk/HTML/quickstart/)
});
const contentEditable = document.querySelector('#editor .fr-element');
Sapling.observe(contentEditable);
}
}
});
</script>
<script type="text/javascript">
</script>
</body>
</html>