forked from openannotation/annotator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
97 lines (74 loc) · 3.88 KB
/
demo.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JS annotation test</title>
<!-- jQuery must be included before Annotator -->
<script src="lib/vendor/jquery.js"></script>
<!-- If you're sure your users will only be using browsers modern
enough to have their own JSON.parse and JSON.stringify
implementations you can skip this -->
<script src="lib/vendor/json2.js"></script>
<!-- The main Annotator script -->
<script src="pkg/annotator.min.js"></script>
<!-- Annotator's styling and images -->
<link rel="stylesheet" type="text/css" href="pkg/annotator.min.css">
<!-- The following plugins are entirely optional -->
<!-- The Store plugin. Saves annotations to a remote backend -->
<script src="pkg/annotator.store.min.js"></script>
<!-- The Auth plugin. Allows users of Annotator to authenticate themselves
to the remote backend -->
<script src="pkg/annotator.auth.min.js"></script>
<!-- The Permissions plugin. See who created which annotation and create
annotations as a specified user -->
<script src="pkg/annotator.permissions.min.js"></script>
<!-- The Tags plugin. Edit and display tag keywords on annotations -->
<script src="pkg/annotator.tags.min.js"></script>
<!-- The Markdown plugin. Treat annotation text as Markdown -->
<script src="lib/vendor/showdown.js"></script>
<script src="pkg/annotator.markdown.min.js"></script>
</head>
<body>
<header>
<h1>Javascript annotation service test</h1>
</header>
<div id="airlock">
<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>
<h2>Header Level 2</h2>
<ol>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ol>
<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote>
<h3>Header Level 3</h3>
<ul>
<li id="listone">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li id="listtwo">Aliquam tincidunt mauris eu risus.</li>
</ul>
<pre><code>
#header h1 a {
display: block;
width: 300px;
height: 80px;
}
</code></pre>
</div>
<script>
jQuery(function ($) {
if (typeof $.fn.annotator !== 'function') {
alert("Ooops! it looks like you haven't built the Annotator concatenation file. " +
"Either download a tagged release from GitHub, or modify the Cakefile to point " +
"at your copy of the YUI compressor and run `cake package`.");
} else {
// This is the important bit: how to create the annotator and add
// plugins
$('#airlock').annotator()
.annotator('addPlugin', 'Permissions')
.annotator('addPlugin', 'Markdown')
.annotator('addPlugin', 'Tags');
$('#airlock').data('annotator').plugins['Permissions'].setUser("Joe Bloggs");
}
});
</script>
</body>
</html>