-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
191 lines (183 loc) · 8.21 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>WriteOn Pad - What You See Is What You Get (WYSIWYG)</title>
<style type="text/css">
html {
border-bottom:10px #0c84e4 solid;
}
#toolbar {
margin-bottom:1em;
}
#mode {
cursor:pointer;
}
#mode.btn-default {
color:#666;
}
#hinted {
cursor:pointer;
}
#hinted.btn-default {
color:#666;
}
#fork {
position:fixed;
right:0;
top:0;
}
/*
When the webpage is printed
this media query hides extra elements,
and makes the text content fit the page.
*/
@media print {
#fork, #toolbar {
display: none;
}
body {
width: 94%;
padding-top: 1em;
font-size: 12px;
}
html {
border-top: 0;
}
}
</style>
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.4/paper/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="src/pad.css" />
</head>
<body>
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">WriteOn Pad</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav">
<li class="active"><a href="#"><span class="glyphicon glyphicon-text-size"></span> Demo<span class="sr-only">(current)</span></a>
</li>
<li><a href="https://github.com/BeardandFedora/WriteOn-Pad"><span class="glyphicon glyphicon-compressed"></span> Source</a>
</li>
<li>
<a href="#" style="padding: 13px;">
<button id="mode" type="button" class="btn btn-danger" aria-label="Disable Editor">
<span class="icon-mode glyphicon glyphicon-ban-circle"></span> Disable/Enable Editing
</button>
</a>
</li>
<li>
<a href="#" style="padding: 13px;">
<button id="hinted" type="button" class="btn btn-info" aria-label="Toggle Markdown Hints">
<span class="icon-pre glyphicon glyphicon-eye-open" title="Toggle Markdown Hints"></span> Toggle Markdown Hints
</button>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://writeon.io">writeon.io</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container"><div class="row">
<!-- <div id="custom-toolbar" class="pad-menu pad-menu" style="display: block; top: 20px; left: 10px;">
<i class="pad-icon icon-insertimage" data-action="insertimage"></i>
<i class="pad-icon icon-blockquote" data-action="blockquote"></i>
<i class="pad-icon icon-h2" data-action="h2"></i>
<i class="pad-icon icon-h3" data-action="h3"></i>
<i class="pad-icon icon-p active" data-action="p"></i>
<i class="pad-icon icon-code" data-action="code"></i>
<i class="pad-icon icon-insertorderedlist" data-action="insertorderedlist"></i>
<i class="pad-icon icon-insertunorderedlist" data-action="insertunorderedlist"></i>
<i class="pad-icon icon-inserthorizontalrule" data-action="inserthorizontalrule"></i>
<i class="pad-icon icon-indent" data-action="indent"></i>
<i class="pad-icon icon-outdent" data-action="outdent"></i>
<i class="pad-icon icon-bold" data-action="bold"></i>
<i class="pad-icon icon-italic" data-action="italic"></i>
<i class="pad-icon icon-underline" data-action="underline"></i>
<i class="pad-icon icon-createlink" data-action="createlink"></i>
</div> -->
<div class="col-lg-12 col-md-12 col-sm-12 offset-lg-1 offset-md-1 offset-sm-1" data-toggle="pad" data-placeholder="im a placeholder">
<h2>Enjoy live editing (+markdown)</h2>
<p><b><i>Click to edit, Select to apply effect, click items of toolbar to toggle effects.</i></b>
</p>
<hr>
<p>Horizontal-Rule can be inserted by click「...」on the toolbar or just type「... 」/「--- 」/「*** 」at line start. Note that there's a SPACE at the end of a command.</p>
<p>
<img src="https://writeon.io/images/main/writeon-sketch.c7f663a2.png" width="300" />
</p>
<hr>
<p>To link or unlink, please press the <i>ENTER</i> key after you filled the input field with your a link.
A <a href="https://writeon.io">link</a> can be unlinked by applying an empty value to the input field.
<p>
<ul>
<li>Ordered list and unordered list are supported.</li>
<li>Use the toolbar or use markdown syntax like「<b>1. </b>」,「<b>- </b>」or「<b>* </b>」</li>
</ul>
<blockquote>You can quote text by type「<b>></b>」at line start.</blockquote>
<p>What about add underline to text? "<u>Stay Hungry, Stay Foolish - <i>Steve Jobs</i></u>".</p>
<pre>A code block is also supported by type 「```」 at line start and press SPACE.</pre>
<p>For more, please checkout: <a href="https://github.com/BeardandFedora/WriteOn-Pad#readme" target="_blank">https://github.com/BeardandFedora/WriteOn-Pad#readme</a>
</p>
</div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="src/pad.js"></script>
<script src="src/markdown.js"></script>
<script type="text/javascript">
// config
var options = {
// toolbar: document.getElementById('custom-toolbar'),
editor: document.querySelector('[data-toggle="pad"]'),
debug: true,
list: ['insertimage', 'blockquote', 'h2', 'h3', 'p', 'code', 'insertorderedlist', 'insertunorderedlist', 'inserthorizontalrule', 'indent', 'outdent', 'bold', 'italic', 'underline', 'createlink']
};
// create editor
var pad = window.pad = new Pad(options);
pad.focus();
// toggle editor mode
document.querySelector('#mode').addEventListener('click', function() {
var text = this.textContent;
if(this.classList.contains('active')) {
this.classList.remove('active');
pad.rebuild();
} else {
this.classList.add('active');
pad.destroy();
}
});
// toggle editor mode
document.querySelector('#hinted').addEventListener('click', function() {
var pad = document.querySelector('.pad')
if(this.classList.contains('active')) {
pad.classList.remove('hinted');
this.classList.remove('active');
} else {
pad.classList.add('hinted');
this.classList.add('active');
}
});
// Include the UserVoice JavaScript SDK (only needed once on a page)
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/9ETh8LB2ADPn5Iwpgytg.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})();
UserVoice.push(['set', {
accent_color: '#808283',
trigger_color: 'white',
trigger_background_color: 'rgba(46, 49, 51, 0.6)'
}]);
UserVoice.push(['addTrigger', { mode: 'satisfaction', trigger_position: 'bottom-left' }]);
UserVoice.push(['autoprompt', {}]);
</script>
</body>
</html>