Skip to content

Commit a690d9d

Browse files
committed
loading markdown.md as sample editor content
Fixes #4
1 parent cd91fb1 commit a690d9d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Gruntfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ module.exports = function(grunt) {
8787
data += grunt.file.read('editor.css');
8888
grunt.file.write('build/editor.css', data);
8989
grunt.file.copy('docs/index.html', 'build/index.html');
90+
grunt.file.copy('docs/markdown.md', 'build/markdown.md');
9091
grunt.file.copy('docs/markdown.html', 'build/markdown.html');
9192
grunt.file.copy('docs/yue.css', 'build/yue.css');
9293
grunt.file.copy('docs/marked.js', 'build/marked.js');

docs/index.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,17 @@
3939
<input class="title" type="text" placeholder="Title" />
4040
<textarea id="editor" placeholder="Content here ...."></textarea>
4141
</div>
42+
<!-- only required for loading sample markdown into the textarea -->
43+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
4244
<script type="text/javascript">
43-
var editor = new Editor();
44-
editor.render();
45+
(function($) {
46+
$('#editor').load('markdown.md',
47+
function(data) {
48+
var editor = new Editor();
49+
editor.render();
50+
}
51+
);
52+
})(Zepto);
4553
</script>
4654
</body>
4755
</html>

0 commit comments

Comments
 (0)