2009-11-21 58 views
0

我想大多數人都知道基於網絡的代碼編輯器 - Mozilla's Bespin projectBespin嵌入式的設置?

兩個星期前,他們的嵌入式版本published their first release

alt text http://img.skitch.com/20091121-xuamnt5ribje25fp666ixyd67k.png

在alpha階段的documentation作爲是不是真的滿意。

儘管存在settings的列表,但我無法將語法更改爲js。 你如何做到這一點?

有一個bespin.setSetting方法,但我不知道如何使用它。

只有一個sample code(上面的屏幕截圖中顯示的那個)使用js語法高亮顯示。 但它也使用Dojo,我想避免使用Dojo。

這是可能的嗎?

回答

1

Bespin似乎以某種方式使用了一些dojo命令。 但是它不需要dojo庫。

JS(有載):

new bespin.editor.Component("editor", { 
    language: "js", 
    loadfromdiv: true 
}); 

HTML(頭):

<script src="https://bespin.mozilla.com/embed.js"></script> 

HTML(主體):

<div id="editor"></div> 

結果:JS highlighted editor