github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/themes/wind/templates/editor-front.html (about) 1 <script src="/libs/tinymce/tinymce.min.js"></script> 2 <script type="text/javascript"> 3 tinymce.init({ 4 selector: ".inline", 5 inline: true, 6 height : "48", 7 relative_urls:false, 8 menubar : false, 9 statusbar : false, 10 language: 'zh_CN', 11 theme: "modern", 12 skin : 'lightgray', 13 extended_valid_elements: "video[*],audio[*],object[data|width|height|classid|codebase],param[name|value],embed[src|type|width|height|align|flashvars|wmode|quality|allowfullscreen|allowscriptaccess]", 14 plugins: [ 15 "advlist autolink lists link jbimages image charmap print preview hr anchor pagebreak", 16 "searchreplace visualblocks visualchars code fullscreen", 17 "insertdatetime media nonbreaking save table contextmenu directionality", 18 "emoticons template paste textcolor colorpicker textpattern imagetools" 19 ], 20 toolbar: "undo redo | styleselect | bullist numlist table | outdent indent | pagebreak hr | insertdatetime emoticons charmap visualblocks visualchars | code link | jbimages image media" 21 }); 22 23 tinymce.init({ 24 selector: ".editor", 25 relative_urls:false, 26 menubar : false, 27 statusbar : false, 28 language: 'zh_CN', 29 theme: "modern", 30 skin : 'lightgray', 31 extended_valid_elements: "video[*],audio[*],object[data|width|height|classid|codebase],param[name|value],embed[src|type|width|height|align|flashvars|wmode|quality|allowfullscreen|allowscriptaccess]", 32 plugins: [ 33 "advlist autolink lists link jbimages image charmap print preview hr anchor pagebreak", 34 "searchreplace visualblocks visualchars code fullscreen", 35 "insertdatetime media nonbreaking save table contextmenu directionality", 36 "emoticons paste textcolor colorpicker textpattern imagetools" 37 ], 38 toolbar: "undo redo | styleselect | bullist numlist table | outdent indent pagebreak hr | insertdatetime emoticons charmap | print searchreplace | code link jbimages image media" 39 }); 40 41 function SubmitHolder(){ 42 var pretitle=tinyMCE.get('PostForm-Title').getContent(); 43 var precontent=tinyMCE.get('PostForm-Content').getContent(); 44 var title=$("#title"); 45 var content=$("#postcontent"); 46 {% comment %} 47 var pretitle=tinyMCE.editors[0].getContent(); 48 var precontent=tinyMCE.editors[1].getContent(); 49 var mdtitle= toMarkdown(pretitle); 50 title.val(mdtitle); 51 var mdcontent= toMarkdown(precontent); 52 content.val(mdcontent); 53 {% endcomment %} 54 title.val(pretitle); 55 content.val(precontent); 56 var f=$("#post-new"); 57 f.submit(); 58 } 59 60 function SubmitHolder2(){ 61 var precontent=tinyMCE.activeEditor.getContent(); 62 var content=$("#postcontent"); 63 {% comment %} 64 var mdcontent= toMarkdown(precontent); 65 content.val(mdcontent); 66 {% endcomment %} 67 content.val(precontent); 68 var f=$("#post-new"); 69 f.submit(); 70 } 71 72 function CommentHolder(){ 73 var cfm=tinyMCE.get('CommentForm-Message').getContent(); 74 var content=$("#comment"); 75 content.val(cfm); 76 var f=$("#post-reply"); 77 f.submit(); 78 } 79 </script>