forked from vectorsize/substance-text
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
86 lines (71 loc) · 2.53 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>PROPER™ - Semantic Rich Text Editor</title>
<!-- Styles -->
<link href="stylesheets/page.css" media="screen" rel="stylesheet" type="text/css" />
<link href="stylesheets/proper.css" media="screen" rel="stylesheet" type="text/css" />
<!-- Libraries -->
<script src="lib/jquery-min.js"></script>
<script src="lib/jquery.hotkeys.js"></script>
<script src="lib/underscore.js"></script>
<!-- Source -->
<script src="proper.js"></script>
<script>
// Proper Init
$(function() {
window.editor = new Proper();
$('.content').click(function() {
editor.activate($(this), {
placeholder: 'Enter Text',
controlsTarget: $('#tools'),
codeFontFamily: 'Monaco, Consolas, "Lucida Console", monospace'
});
// Update node when editor commands are applied
editor.bind('changed', function() {
$('#source').text(editor.content());
});
});
$('h2.no-markup').click(function() {
editor.activate($(this), { markup: false, multiline: false });
// Update node when editor commands are applied
editor.bind('changed', function() {
$('#source').text(editor.content());
});
});
});
</script>
</head>
<body>
<h1>PROPER™ - Semantic Rich Text Editor (Version 0.3.1)</h1>
<div id="main">
<div id="tools"></div>
<div class="content">
<p>Text wants to be <strong>editable</strong>.<br/>But text also wants to be <strong>meaningful</strong>.
</p>
</div>
<div class="content">
<p>
On the right, you see the <em>sanitized</em> (and hopefully correct) HTML output.
</p>
<p>
Known issues:
<ul>
<li>Does not yet consider <code>markup</code> for pasted content</li>
</ul>
</p>
</div>
<h2 class="no-markup">
Here we prevent from using markup and newlines
</h2>
</div>
<div id="source">
</div>
<br class="clear"/>
<div class="credits">
Straight from the labs of <a href="http://quasipartikel.at">Quaspartikel</a>
and <a href="http://froodee.at/">froodee</a>.
</div>
<a href="http://github.com/michael/proper"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://assets2.github.com/img/71eeaab9d563c2b3c590319b398dd35683265e85?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_right_gray_6d6d6d.png&path=" alt="Fork me on GitHub"></a>
</body>
</html>