forked from mquan/freshereditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
executable file
·79 lines (74 loc) · 3.83 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
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="shortcut.js" type="text/javascript"></script>
<script src="farbtastic/farbtastic.js" type="text/javascript"></script>
<script src="bootstrap/bootstrap-dropdown.js" type="text/javascript"></script>
<script src="freshereditor.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#content-editor').freshereditor({toolbar_selector: "#toolbar", excludes: ['removeFormat', 'insertheading4']});
$("#content-editor").freshereditor("edit", true);
});
</script>
<link href="bootstrap/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />
<link href="freshereditor.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#content-editor {
margin: 50px 10px 10px 10px;
}
#toolbar {
margin:10px;
}
</style>
</head>
<body>
<div class='navbar navbar-fixed-top'><div id="toolbar"></div></div>
<div id="wrapper">
<div id="content-editor" class="clear">
<p><strong>fresherEditor</strong> is a light-weight WYSIWYG rich text editor plugin that uses <em>contentEditable</em> support in modern browsers for in-place HTML editing.</p>
<p>Click on this text to edit right away!</p>
<h2>Features</h2>
<ol>
<li>Supports all text editing features such as bold, italic, font size and font name settings, text alignments, links and picture insertion, and more</li>
<li>Builds toolbar automatically. By default, all buttons are built. You can configure which buttons to hide</li>
<li>Triggers 'change' event so you can perform action when html content changes</li>
<li>Uses <a href='http://twitter.github.com/bootstrap/index.html'>Twitter Bootstrap</a></li>
</ol>
<h2>Dependencies</h2>
<ul>
<li>jQuery (1.7.1 or higher is recommended)</li>
<li>shortcut.js</li>
<li>farbtastic colorpicker plugin</li>
<li>Twitter bootstrap.css and bootstrap-dropdown.js</li>
</ul>
<p>jQuery ContentEditable depends on jQuery and <em>shortcut.js</em> for keyboard shortcuts, as given below.</p>
<h3>Some jQuery Calls:</h3>
<ol>
<li>To initialise the toolbar, call <em>$(".fresheditable").fresheditor();</em><br />
</li>
<li>To start/stop editing, call <em>$(".fresheditable").fresheditor("edit", true);</em> for editable elements.</li>
<li>To save, call <em>$(".fresheditable").fresheditor("save", function(id, content) { ... });</em> to have the callback function called for each editable element being saved.</li>
<li>To perform action on change event <em>$(".fresheditable").on('change', function() { ... });</em></li>
</ol>
<h2>Keyboard Shortcuts</h2>
<ul>
<li><strong>Tab</strong> indents the selected content</li>
<li><strong>Shift+Tab</strong> outdents selected content</li>
<li><strong>Ctrl+B</strong> makes text <strong>bold</strong><br />
</li>
<li><strong>Ctrl+I</strong> makes text <em>italic</em></li>
<li><strong>Ctrl+U</strong> <u>underlines</u> text</li>
<li><strong>Ctrl+L</strong> inserts a <a href="#">link</a><br />
</li>
<li><strong>Ctrl+Alt+0</strong> formats a paragraph</li>
<li><strong>Ctrl+Alt+1</strong> through <strong>Ctrl+Alt+5</strong> adds headings 1 through 5</li>
<li><strong>Ctrl+J</strong> creates an unordered list, like this one<br />
</li>
<li><strong>Ctrl+K</strong> creates an ordered list.</li>
</ul>
</div>
</div>
</body>
</html>