-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
43 lines (38 loc) · 947 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
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CKEditor</title>
<script src="./ckeditor/ckeditor.js"></script>
<script>
document.addEventListener("message", function(data) {
console.log(data.data);
CKEDITOR.instances.editor1.setData( data.data, function()
{
this.checkDirty(); // true
});
});
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<textarea name="editor1"></textarea>
<script>
CKEDITOR.replace('editor1', {
on: {
'instanceReady': function (evt) { evt.editor.execCommand('maximize'); }
}
});
CKEDITOR.instances.editor1.on('change', function() {
// alert(CKEDITOR.instances.editor1.getData())
try {
window.postMessage(CKEDITOR.instances.editor1.getData(), '*')
}
catch (e) {
alert(e)
}
});
</script>
</body>
</html>