This repository has been archived by the owner on Apr 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.html
70 lines (59 loc) · 2.17 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
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>redact-popover</title>
<link rel='stylesheet' href='build/build.css'>
<style>
body {
font: 200 14px 'Helvetica Neue';
padding: 80px;
}
h1 {
font: 300 28px 'Helvetica Neue';
}
[contenteditable] {
padding: 8px;
border-left: 4px solid #eee;
max-width: 300px;
}
:focus {
outline: 0 none;
}
.redact-popover a {
color: #fff;
font-weight: bold;
padding: 6px;
border-right: 1px solid #222;
display: inline-block;
text-decoration: none;
}
.redact-popover a:last-child {
border-right: 0 none;
}
.redact-popover a:hover {
background: #222;
}
.redact-popover .tip-inner {
padding: 0;
overflow: hidden;
}
</style>
</head>
<body>
<div contenteditable>
<h1>dr evil</h1>
<p>The details of my life are quite inconsequential ... Very well, where do I begin? My father was a relentlessly self-improving boulangerie owner from Belgium with low-grade narcolepsy and a penchant for buggery. My mother was a 15-year-old French prostitute named Chloé with webbed feet. My father would womanize; he would drink. He would make outrageous claims like he invented the question mark. Sometimes, he would accuse chestnuts of being lazy. The sort of general malaise that only the genius possess and the insane lament ... My childhood was typical: summers in Rangoon ... luge lessons ... In the spring, we'd make meat helmets ... When I was insolent I was placed in a burlap bag and beaten with reeds — pretty standard, really. At the age of 12, I received my first scribe. At the age of 14, a Zoroastrian named Vilmer ritualistically shaved my testicles. There really is nothing like a shorn scrotum — it's breathtaking ... I suggest you try it</p>
</div>
<script src='build/build.js'></script>
<script>
var el = document.body.children[0];
var popover = require('redact-popover')(el);
popover.add('bold', 'B');
popover.add('italic', 'I');
popover.add('underline', 'U');
popover.on('click', function(action){
document.execCommand(action);
});
</script>
</body>
</html>