Permalink
Browse files

loading markdown.md as sample editor content

Fixes #4
  • Loading branch information...
1 parent cd91fb1 commit a690d9df4210546a86d679307cbcb0b6cf8e4e78 @BigBlueHat BigBlueHat committed Dec 3, 2013
Showing with 11 additions and 2 deletions.
  1. +1 −0 Gruntfile.js
  2. +10 −2 docs/index.html
View
@@ -87,6 +87,7 @@ module.exports = function(grunt) {
data += grunt.file.read('editor.css');
grunt.file.write('build/editor.css', data);
grunt.file.copy('docs/index.html', 'build/index.html');
+ grunt.file.copy('docs/markdown.md', 'build/markdown.md');
grunt.file.copy('docs/markdown.html', 'build/markdown.html');
grunt.file.copy('docs/yue.css', 'build/yue.css');
grunt.file.copy('docs/marked.js', 'build/marked.js');
View
@@ -39,9 +39,17 @@
<input class="title" type="text" placeholder="Title" />
<textarea id="editor" placeholder="Content here ...."></textarea>
</div>
+ <!-- only required for loading sample markdown into the textarea -->
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script type="text/javascript">
- var editor = new Editor();
- editor.render();
+ (function($) {
+ $('#editor').load('markdown.md',
+ function(data) {
+ var editor = new Editor();
+ editor.render();
+ }
+ );
+ })(Zepto);
</script>
</body>
</html>

0 comments on commit a690d9d

Please sign in to comment.