EpicEditor怎么用叫?

东厢里的一只喵 发布于 2013/05/01 18:16
阅读 980
收藏 0
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
<script src="./js/epiceditor.min.js"></script>
<style>
	.dome{background: #09f;
		width: 100%;
		height: 300px;
	}
</style>
</head>
<body>
	<div id="epiceditor" class="dome"></div>
</body>
</html>

怎么会没用呢?

是不是那错了?

加载中
0
ccjjxl
ccjjxl
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>markdown</title>
    <script src="EpicEditor/js/epiceditor.min.js"></script>
    <script src="js/jquery.min.js"></script>
    <style type="text/css">
    #epiceditor{
    	height: 500px;
    	width: 960px;
    	margin: auto;
    }
    #tool{

    	width: 960px;
    	margin: auto;
    }
    </style>
</head>
<body>
    <div id="epiceditor">

    </div>
    <div id="tool">
        <button id="Show">发表</button>
        <button id="export">导出</button>
        <button id="open">打开</button>
    </div>
    
    <script>

        var opts = {
            container: 'epiceditor',
            basePath: 'EpicEditor',
            clientSideStorage: true,
            localStorageName: 'epiceditor',
            useNativeFullsreen: true,
            parser: marked,
            file: {
                name: 'epiceditor',
                defaultContent: '',
                autoSave: 100
            },
            theme: {
                base: '/themes/base/epiceditor.css',
                preview: '/themes/preview/bartik.css',
                editor: '/themes/editor/epic-dark.css'
            },
            focusOnLoad: false,
            shortcut: {
                modifier: 18,
                fullscreen: 70,
                preview: 80
            }
        }
        var editor = new EpicEditor(opts).load();
        $('#Show').click(function () {
            alert(editor.getElement('previewer').body.innerHTML);
            alert(editor.getElement('editor').body.innerHTML);
        });

        $('#export').click(function  () {
        	var theContent = editor.exportFile();

            alert(theContent);
        });
        $('#open').click(function  () {


  editor.importFile('a.md');

        });
    </script>
</body>
</html>
东厢里的一只喵
东厢里的一只喵
( ̄▽ ̄|||) 是不是还要加段 控制用的js
返回顶部
顶部