This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
73 lines (62 loc) · 2.59 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<head>
<title>Text</title>
<link href='http://fonts.googleapis.com/css?family=Merriweather:400,700,300,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="stylesheets/text.css">
<!-- Libs -->
<script type="text/javascript" src="lib/underscore.js"></script>
<script type="text/javascript" src="lib/jquery-min.js"></script>
<script type="text/javascript" src="lib/dmp.js"></script>
<script type="text/javascript" src="lib/rangy/core.js"></script>
<script type="text/javascript" src="lib/rangy/dom.js"></script>
<script type="text/javascript" src="lib/rangy/domrange.js"></script>
<script type="text/javascript" src="lib/rangy/wrappedrange.js"></script>
<script type="text/javascript" src="lib/rangy/wrappedselection.js"></script>
<script type="text/javascript" src="lib/rangy/cssclassapplier.js"></script>
<!-- Templates -->
<script type="text/html" name="toolbar">
<div id="toolbar"></div>
</script>
<script type="text/html" name="tool">
<a class="tool" data-command="<%= type %>" href="#<%= type %>"><%= text %></a>
</script>
<!--
<script type="text/html" name=""></script>
-->
<!-- Source -->
<script type="text/plain" name="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</script>
<script type="text/javascript" src="lib/surface.js"></script>
<script type="text/javascript" src="text.js"></script>
<script type="text/javascript">
$(function() {
var text = new Substance.Text({
el: "#content",
content: $('script[name=content]').text(),
annotations: [
// {
// "id": "a:1",
// "type": "comment",
// "pos": [0,10],
// "properties": {"content": "This is a comment for you"}
// },
// {
// "id": "a:2",
// "type": "em",
// "pos": [20,24]
// }
//
]
});
// Debug
// --------------
text.on('text:change', function(delta, content) {
console.log("DELTA", delta);
});
});
</script>
</head>
<body>
<div id="content" class="content" contenteditable="true"></div>
<div class="clear"></div>
</body>