forked from guardian/scribe-plugin-curly-quotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
67 lines (58 loc) · 1.24 KB
/
example.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
<!--
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
-->
<style>
button {
height: 3em;
}
.active {
border-style: inset;
}
.rte {
display: block;
}
p {
margin-top: 0;
}
.rte {
border: 1px solid gray;
height: 300px;
overflow: auto;
}
.rte-output {
width: 100%;
height: 10em;
}
</style>
<script src="./bower_components/requirejs/require.js"></script>
<script>
/*global window, require*/
require({
paths: {
'scribe-common': './bower_components/scribe-common',
'lodash-amd': './bower_components/lodash-amd'
}
}, [
'./bower_components/scribe/src/scribe',
'./src/scribe-plugin-curly-quotes'
], function (
Scribe,
scribePluginCurlyQuotes
) {
var scribe = new Scribe(window.document.querySelector('.rte'));
window.scribe = scribe;
scribe.setContent('<p>Hello, World!<\/p>');
scribe.use(scribePluginCurlyQuotes());
scribe.on('content-changed', updateHtml);
function updateHtml() {
window.document.querySelector('.rte-output').value = scribe.getHTML();
}
updateHtml();
});
</script>
<div class="rte"></div>
<section>
<h1>Output</h1>
<textarea class="rte-output" readonly></textarea>
</section>