forked from steveathon/bootstrap-wysiwyg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.html
124 lines (118 loc) · 4.63 KB
/
events.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tiny, opensource, Bootstrap WYSIWYG rich text editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../external/google-code-prettify/prettify.css" rel="stylesheet" />
<link rel="stylesheet"
href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
<link
href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css"
rel="stylesheet" />
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../external/jquery.hotkeys.js"></script>
<script
src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="../external/google-code-prettify/prettify.js"></script>
<link href="../css/style.css" rel="stylesheet" />
<script src="../src/bootstrap-wysiwyg.js"></script>
</head>
<body>
<div class="container">
<h1>Type something to see events</h1>
<div class="btn-toolbar" data-role="editor-toolbar"
data-target="#editor">
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Font Size"><i class="icon-text-height"></i> <b
class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a data-edit="fontSize 5"><font size="5">Huge</font>
</a>
</li>
<li><a data-edit="fontSize 3"><font size="3">Normal</font>
</a>
</li>
<li><a data-edit="fontSize 1"><font size="1">Small</font>
</a>
</li>
</ul>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="bold"
title="Bold (Ctrl/Cmd+B)"><i class="icon-bold"></i>
</a> <a class="btn btn-default" data-edit="italic"
title="Italic (Ctrl/Cmd+I)"><i class="icon-italic"></i>
</a> <a class="btn btn-default" data-edit="strikethrough"
title="Strikethrough"><i class="icon-strikethrough"></i>
</a> <a class="btn btn-default" data-edit="underline"
title="Underline (Ctrl/Cmd+U)"><i class="icon-underline"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="insertunorderedlist"
title="Bullet list"><i class="icon-list-ul"></i>
</a> <a class="btn btn-default" data-edit="insertorderedlist"
title="Number list"><i class="icon-list-ol"></i>
</a> <a class="btn btn-default" data-edit="outdent"
title="Reduce indent (Shift+Tab)"><i class="icon-indent-left"></i>
</a> <a class="btn btn-default" data-edit="indent" title="Indent (Tab)"><i
class="icon-indent-right"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="justifyleft"
title="Align Left (Ctrl/Cmd+L)"><i class="icon-align-left"></i>
</a> <a class="btn btn-default" data-edit="justifycenter"
title="Center (Ctrl/Cmd+E)"><i class="icon-align-center"></i>
</a> <a class="btn btn-default" data-edit="justifyright"
title="Align Right (Ctrl/Cmd+R)"><i class="icon-align-right"></i>
</a> <a class="btn btn-default" data-edit="justifyfull"
title="Justify (Ctrl/Cmd+J)"><i class="icon-align-justify"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Hyperlink"><i class="icon-link"></i>
</a>
<div class="dropdown-menu input-append">
<input class="span2" placeholder="URL" type="text"
data-edit="createLink" />
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="unlink"
title="Remove Hyperlink"><i class="icon-cut"></i>
</a> <a class="btn btn-default"
title="Insert picture (or just drag & drop)" id="pictureBtn">
<i class="icon-picture"></i> <input type="file"
data-role="magic-overlay" data-target="#pictureBtn"
data-edit="insertImage" /> </a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="undo"
title="Undo (Ctrl/Cmd+Z)"><i class="icon-undo"></i>
</a> <a class="btn btn-default" data-edit="redo"
title="Redo (Ctrl/Cmd+Y)"><i class="icon-repeat"></i>
</a>
</div>
</div>
<div id="editor" class="lead" placeholder="This is a basic example with no toolbars."></div>
<h2>Live Preview</h2>
<div id="editorPreview"></div>
<h2>Events fired:</h2>
<p id="events_log">
</p>
</div>
<script type='text/javascript'>
$('#editor').wysiwyg().on('change', function(){
$('#editorPreview').html($(this).cleanHtml());
$('#events_log').append(' change');
});
</script>
</body>
</html>