玛氪宕·梦魔(Markdown Memo),使用Markdown的云端备忘录,百度IFE的RIA启航班的不合格的作业,才……才没有什么阴谋呢!
源gitee链接https://gitee.com/arathi/MarkdownMemo?_from=gitee_search
				
			
			
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							148 lines
						
					
					
						
							6.8 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							148 lines
						
					
					
						
							6.8 KiB
						
					
					
				
								<!DOCTYPE html>
							 | 
						|
								<html lang="zh">
							 | 
						|
								    <head>
							 | 
						|
								        <meta charset="utf-8" />
							 | 
						|
								        <title>Resettings - Editor.md examples</title>
							 | 
						|
								        <link rel="stylesheet" href="css/style.css" />
							 | 
						|
								        <link rel="stylesheet" href="../css/editormd.css" />        
							 | 
						|
								        <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
							 | 
						|
								    </head>
							 | 
						|
								    <body>
							 | 
						|
								        <div id="layout">
							 | 
						|
								            <header>
							 | 
						|
								                <h1>Resettings</h1>
							 | 
						|
								                <p>只能设置依赖模块加载完成之后的相关配置或者使用拖动加载模块方式。</p>
							 | 
						|
								                <p>Only be resetting the relevant configuration of dependent module loaded after, or using manually load modules mode.</p>     
							 | 
						|
								            </header>
							 | 
						|
								            <div class="btns">
							 | 
						|
								                <button id="show-btn">Show editor</button>
							 | 
						|
								                <button id="hide-btn">Hide editor</button>
							 | 
						|
								                <button id="get-md-btn">Get Markdown</button>
							 | 
						|
								                <button id="get-html-btn">Get HTML</button>
							 | 
						|
								                <button id="watch-btn">Watch</button>
							 | 
						|
								                <button id="unwatch-btn">Unwatch</button>
							 | 
						|
								                <button id="preview-btn">Preview HTML(Press ESC cancel)</button>
							 | 
						|
								                <button id="fullscreen-btn">Fullscreen (Press ESC cancel)</button>
							 | 
						|
								                <button id="show-toolbar-btn">Show toolbar</button>
							 | 
						|
								                <button id="close-toolbar-btn">Hide toolbar</button>
							 | 
						|
								            </div>
							 | 
						|
								            <div id="test-editormd"></div>
							 | 
						|
								            <pre id="append-code" style="display:none;">####Resettings
							 | 
						|
								
							 | 
						|
								```javascript
							 | 
						|
								this.config("lineNumbers", false);
							 | 
						|
								
							 | 
						|
								this.config({
							 | 
						|
								    toc : false,
							 | 
						|
								    tex : false,
							 | 
						|
								    previewCodeHighlight : true, // before set previewCodeHighlight == false, editor not load pretty.js, so now codes can't highlight and line numbers.
							 | 
						|
								    flowChart : false,
							 | 
						|
								    sequenceDiagram : false,
							 | 
						|
								    dialogLockScreen : false,
							 | 
						|
								    dialogDraggable : false,
							 | 
						|
								    dialogMaskBgColor : "teal",
							 | 
						|
								    toolbar : true
							 | 
						|
								});
							 | 
						|
								
							 | 
						|
								this.config("onresize", function(){
							 | 
						|
								    console.log("onresize =>", this);
							 | 
						|
								});
							 | 
						|
								```</pre>
							 | 
						|
								        </div>
							 | 
						|
								        <script src="js/jquery.min.js"></script>
							 | 
						|
								        <script src="../editormd.js"></script>   
							 | 
						|
								        <script type="text/javascript">
							 | 
						|
								            var testEditor;
							 | 
						|
								            
							 | 
						|
								            $(function() {
							 | 
						|
								                
							 | 
						|
								                $.get('test.md', function(md){
							 | 
						|
								                    testEditor = editormd("test-editormd", {
							 | 
						|
								                        width: "90%",
							 | 
						|
								                        height: 740,
							 | 
						|
								                        path : '../lib/',
							 | 
						|
								                        markdown : $("#append-code").html() +"\n"+ md,
							 | 
						|
								                        saveHTMLToTextarea : true,    // 保存HTML到Textarea
							 | 
						|
								                        watch : false,                // 关闭实时预览
							 | 
						|
								                        htmlDecode : true,            // 开启HTML标签解析,为了安全性,默认不开启    
							 | 
						|
								                        toolbar  : false,             //关闭工具栏
							 | 
						|
								                        previewCodeHighlight : false, // 关闭预览HTML的代码块高亮,默认开启
							 | 
						|
								                        tex : true,                   // 开启科学公式TeX语言支持,默认关闭
							 | 
						|
								                        flowChart : true,             // 开启流程图支持,默认关闭
							 | 
						|
								                        sequenceDiagram : true,       // 开启时序/序列图支持,默认关闭,
							 | 
						|
								                        emoji : true,
							 | 
						|
								                        taskList : true,
							 | 
						|
								                        //dialogLockScreen : false,   // 设置弹出层对话框不锁屏,全局通用,默认为true
							 | 
						|
								                        //dialogShowMask : false,     // 设置弹出层对话框显示透明遮罩层,全局通用,默认为true
							 | 
						|
								                        //dialogDraggable : false,    // 设置弹出层对话框不可拖动,全局通用,默认为true
							 | 
						|
								                        //dialogMaskOpacity : 0.4,    // 设置透明遮罩层的透明度,全局通用,默认值为0.1
							 | 
						|
								                        //dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff
							 | 
						|
								                        onload : function() {
							 | 
						|
								                            console.log('onload', this);
							 | 
						|
								                            
							 | 
						|
								                            this.config("lineNumbers", false);
							 | 
						|
								                            
							 | 
						|
								                            this.config({
							 | 
						|
								                                toc : false,
							 | 
						|
								                                tex : false,
							 | 
						|
								                                previewCodeHighlight : true, // before set previewCodeHighlight == false, editor not load pretty.js, so now codes can't highlight and line numbers.
							 | 
						|
								                                flowChart : false,
							 | 
						|
								                                sequenceDiagram : false,
							 | 
						|
								                                dialogLockScreen : false,
							 | 
						|
								                                dialogDraggable : false,
							 | 
						|
								                                dialogMaskBgColor : "teal",
							 | 
						|
								                                toolbar : true
							 | 
						|
								                            });
							 | 
						|
								                
							 | 
						|
								                            this.config("onresize", function(){
							 | 
						|
								                                console.log("onresize =>", this);
							 | 
						|
								                            });
							 | 
						|
								                            
							 | 
						|
								                            this.watch();
							 | 
						|
								                        }
							 | 
						|
								                    });
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#show-btn").bind('click', function(){
							 | 
						|
								                    testEditor.show();
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#hide-btn").bind('click', function(){
							 | 
						|
								                    testEditor.hide();
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#get-md-btn").bind('click', function(){
							 | 
						|
								                    alert(testEditor.getMarkdown());
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#get-html-btn").bind('click', function() {
							 | 
						|
								                    alert(testEditor.getHTML());
							 | 
						|
								                });                
							 | 
						|
								                
							 | 
						|
								                $("#watch-btn").bind('click', function() {
							 | 
						|
								                    testEditor.watch();
							 | 
						|
								                });                 
							 | 
						|
								                
							 | 
						|
								                $("#unwatch-btn").bind('click', function() {
							 | 
						|
								                    testEditor.unwatch();
							 | 
						|
								                });              
							 | 
						|
								                
							 | 
						|
								                $("#preview-btn").bind('click', function() {
							 | 
						|
								                    testEditor.previewing();
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#fullscreen-btn").bind('click', function() {
							 | 
						|
								                    testEditor.fullscreen();
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#show-toolbar-btn").bind('click', function() {
							 | 
						|
								                    testEditor.showToolbar();
							 | 
						|
								                });
							 | 
						|
								                
							 | 
						|
								                $("#close-toolbar-btn").bind('click', function() {
							 | 
						|
								                    testEditor.hideToolbar();
							 | 
						|
								                });
							 | 
						|
								            });          
							 | 
						|
								        </script>
							 | 
						|
								    </body>
							 | 
						|
								</html>
							 |