玛氪宕·梦魔(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.
		
		
		
		
		
			
		
			
				
					
					
						
							133 lines
						
					
					
						
							6.3 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							133 lines
						
					
					
						
							6.3 KiB
						
					
					
				
								<!DOCTYPE html>
							 | 
						|
								<html lang="zh">
							 | 
						|
								    <head>
							 | 
						|
								        <meta charset="utf-8" />
							 | 
						|
								        <title>Use sea.js - Editor.md examples</title>
							 | 
						|
								        <link rel="stylesheet" href="css/style.css" />
							 | 
						|
								        <link rel="stylesheet" href="../dist/css/editormd.min.css" /> 
							 | 
						|
								        <style>
							 | 
						|
								            header p code {
							 | 
						|
								                padding: 3px;
							 | 
						|
								                border: 1px solid #ddd;
							 | 
						|
								                background: #f6f6f6;
							 | 
						|
								                border-radius: 3px;
							 | 
						|
								                font-size: 85%;
							 | 
						|
								                font-family: Consolas, 'Monaco', courier, monospace;
							 | 
						|
								            }
							 | 
						|
								        </style>
							 | 
						|
								    </head>
							 | 
						|
								    <body>
							 | 
						|
								        <div id="layout">
							 | 
						|
								            <header>
							 | 
						|
								                <h1>Use sea.js</h1>   
							 | 
						|
								                <p>说明:</p>
							 | 
						|
								                <p>1、由于Editor.md是依赖jQuery的,所以在使用Sea.js加载Editor.md时,要在jQuery.js文件尾部加上 <code>if(typeof define === "function") { define(function () { return $.noConflict(); }); }</code>,使jQuery支持Sea.js;</p>  
							 | 
						|
								                <p>2、flowChart(流程图)和sequenceDiagram(时序图)基于Raphael.js,由于疑似Sea.js与Raphael.js有冲突,所以必须先加载Raphael.js再加载Sea.js,Editor.md才能在Sea.js下正常进行;</p>      
							 | 
						|
								            </header>
							 | 
						|
								            <div class="btns">
							 | 
						|
								                <button id="show-btn">显示编辑器</button>
							 | 
						|
								                <button id="hide-btn">隐藏编辑器</button>
							 | 
						|
								                <button id="get-md-btn">获取Markdown(源码)</button>
							 | 
						|
								                <button id="get-html-btn">获取HTML(源码)</button>
							 | 
						|
								                <button id="watch-btn">开启实时预览</button>
							 | 
						|
								                <button id="unwatch-btn">关闭实时预览</button>
							 | 
						|
								                <button id="preview-btn">预览HTML(按ESC取消)</button>
							 | 
						|
								                <button id="fullscreen-btn">全屏(按ESC取消)</button>
							 | 
						|
								                <button id="show-toolbar-btn">显示工具栏</button>
							 | 
						|
								                <button id="close-toolbar-btn">关闭工具栏</button>
							 | 
						|
								            </div>
							 | 
						|
								            <div id="test-editormd"></div>
							 | 
						|
								        </div>   
							 | 
						|
								        <script src="../lib/raphael.min.js"></script>
							 | 
						|
								        <script src="js/sea.js"></script>
							 | 
						|
								        <script type="text/javascript">
							 | 
						|
								            seajs.config({
							 | 
						|
								                base  : "../lib",
							 | 
						|
								                alias : {
							 | 
						|
								                    jquery   : "jquery.min",
							 | 
						|
								                    editormd : "../src/js/editormd"
							 | 
						|
								                }
							 | 
						|
								            });
							 | 
						|
								                
							 | 
						|
								            //seajs.use("./js/seajs-main"); //使用main.js时 editormd 路径要改为 "../../src/js/editormd"
							 | 
						|
											
							 | 
						|
								            seajs.use(["jquery", "editormd", "../src/js/languages/en"], function($, editormd) {
							 | 
						|
								                var testEditor;
							 | 
						|
								                
							 | 
						|
								                $.get("./test.md", function(md){
							 | 
						|
								                    testEditor = editormd("test-editormd", {
							 | 
						|
								                        width: "90%",
							 | 
						|
								                        height: 640,
							 | 
						|
								                        path : '../lib/',
							 | 
						|
								                        markdown : md,
							 | 
						|
								                        //toolbar  : false,             //关闭工具栏
							 | 
						|
								                        htmlDecode : true,            // 开启HTML标签解析,为了安全性,默认不开启
							 | 
						|
								                        tex : true,                   // 开启科学公式TeX语言支持,默认关闭
							 | 
						|
								                        //previewCodeHighlight : false,  // 关闭预览窗口的代码高亮,默认开启
							 | 
						|
								                        flowChart : true,              // 疑似Sea.js与Raphael.js有冲突,必须先加载Raphael.js,Editor.md才能在Sea.js下正常进行;
							 | 
						|
								                        sequenceDiagram : true,        // 同上
							 | 
						|
								                        //dialogLockScreen : false,   // 设置弹出层对话框不锁屏,全局通用,默认为true
							 | 
						|
								                        //dialogShowMask : false,     // 设置弹出层对话框显示透明遮罩层,全局通用,默认为true
							 | 
						|
								                        //dialogDraggable : false,    // 设置弹出层对话框不可拖动,全局通用,默认为true
							 | 
						|
								                        //dialogMaskOpacity : 0.4,    // 设置透明遮罩层的透明度,全局通用,默认值为0.1
							 | 
						|
								                        //dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff
							 | 
						|
								                        imageUpload : true,
							 | 
						|
								                        imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
							 | 
						|
								                        imageUploadURL : "./php/upload.php",
							 | 
						|
								                        onload : function() {
							 | 
						|
								                            console.log('onload', this);
							 | 
						|
								                            //this.fullscreen();
							 | 
						|
								                            //this.unwatch();
							 | 
						|
								                            //this.watch().fullscreen();
							 | 
						|
								
							 | 
						|
								                            //this.setMarkdown("#PHP");
							 | 
						|
								                            //this.width("100%");
							 | 
						|
								                            //this.height(480);
							 | 
						|
								                            //this.resize("100%", 640);
							 | 
						|
								                        }
							 | 
						|
								                    });
							 | 
						|
								                });
							 | 
						|
								
							 | 
						|
								                $("#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>
							 |