-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestLightEditor.html
40 lines (39 loc) · 1.19 KB
/
testLightEditor.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="resources/css/Editor.css" />
<link rel="stylesheet" href="resources/css/Keyboard.css" />
<link rel="stylesheet" href="resources/css/DarkKeyboard.css" />
<link rel="stylesheet" href="resources/css/Toolbar.css" />
<style type="text/css">
#editor{
width: 200px;
height: 100px;
margin: 20px;
padding-left:0;
}
</style>
</head>
<body>
<!--<div><span>Test</span>I'm a <b>rich editor</b></div><div>aaa</div>-->
<span id="test"><span></span><button id="gc">content</button></span>
<div id="editor" data-plugins="Toolbar"><span>Test</span>I'm a <span style="font-weight:bold">rich editor</span><span>aaa</span><span>bbb</span><span>ccc</span></div>
<!--<div id="editor2"><span>Hello</span> world!</div>-->
<script src="Editor.js"></script>
<script src="Keyboard.js"></script>
<script src="Toolbar.js"></script>
<script>
var editor = new LightEditor({
node: "editor"
});
// new LightEditor({
// node: "editor2"
// });
document.getElementById("gc").addEventListener("click", function(){
console.log(editor.getContent());
// editor.getPreviousValidNode(editor.domNode.lastChild);
}, false);
</script>
</body>
</html>