-
-
Notifications
You must be signed in to change notification settings - Fork 34
Code Editor
SteveRidout edited this page Sep 5, 2012
·
8 revisions
A basic example of it's use is the bare-bones example Code Editor page.
See the relevant files in the reference implementation for a more complete example:
var codeEditor = new CSLEDIT_CodeEditor('#codeEditorContainer', {
initialCslCode : '<style>this style is not valid!</style>',
onChange : function (cslCode) {
// do something after each change
}
});
require(['src/dataInstance'], function (CSLEDIT_data) {
// Get the current csl code:
var cslCode = CSLEDIT_data.getCslCode();
alert('CSL code: ' + cslCode);
// Get the current style name
var title = CSLEDIT_data.getNodesFromPath("style/info/title")[0].textValue;
alert('Style Title: ' + title);
});