问题
I guess most of you know the web-based code editor - Mozilla's Bespin project.
Two weeks ago they published their first release of an embedded version:
alt text http://img.skitch.com/20091121-xuamnt5ribje25fp666ixyd67k.png
Being in a alpha stage the documentation isn't really satisfying.
Although there is list of settings I wasn't able to change the syntax to js. How do you achieve this?
There is a bespin.setSetting method but I have no clue how to use it.
Only one sample code ( the one shown on the screen shot above ) uses js syntax highlighting. But it also uses Dojo and I would like to avoid using Dojo.
Is that possible somehow?
回答1:
Bespin seems to use some dojo commands somehow. However it does not require the dojo libraries.
JS (onload):
new bespin.editor.Component("editor", {
language: "js",
loadfromdiv: true
});
HTML (head):
<script src="https://bespin.mozilla.com/embed.js"></script>
HTML (body):
<div id="editor"></div>
Result: JS highlighted editor
来源:https://stackoverflow.com/questions/1774776/settings-of-bespin-embedded