Tiny-editor基于 Ace 的在線代碼編輯器
Tiny-editor 是和jsFiddle一樣具有在線運行js功能的在線代碼編輯器,基于Ace。
Demo:http://lipten.link/demo/editor
Usage
1.下載slidePage
git clone https://github.com/lipten/Tiny-editor.git
2.引用相關(guān)文件
<link rel="stylesheet" href="Tiny-editor.css"/>
3.引用js文件
<script src="http://cdn.bootcss.com/ace/1.2.3/ace.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" src="Tiny-editor.js"></script>
4.html結(jié)構(gòu)
//--html結(jié)構(gòu)比較復(fù)雜,看下載后的editor.html比較完整
5.初始化代碼
var Tiny = new TinyEditor()
Method
Tiny.tab(num)
-
tab顯示第幾個面板,num傳序號,從1開始
Tiny.run()
-
運行結(jié)果并跳到result面板
Tiny.save()
-
保存代碼至緩存
Tiny.fullScreen()
-
全屏模式開啟或關(guān)閉
Tiny.dockMode()
-
dock邊欄模式開啟或關(guān)閉
Tiny.liveMode()
-
實時運行模式,發(fā)生change事件時執(zhí)行一次,僅開啟dock模式的前提下才能開啟
評論
圖片
表情
