You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

64 lines
1.8 KiB

var ComponentsCodeEditors = function () {
var handleDemo1 = function () {
var myTextArea = document.getElementById('code_editor_demo_1');
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
lineNumbers: true,
matchBrackets: true,
styleActiveLine: true,
theme:"ambiance",
mode: 'javascript'
});
}
var handleDemo2 = function () {
var myTextArea = document.getElementById('code_editor_demo_2');
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
lineNumbers: true,
matchBrackets: true,
styleActiveLine: true,
theme:"material",
mode: 'css'
});
}
var handleDemo3 = function () {
var myTextArea = document.getElementById('code_editor_demo_3');
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
lineNumbers: true,
matchBrackets: true,
styleActiveLine: true,
theme:"neat",
mode: 'javascript',
readOnly: true
});
}
var handleDemo4 = function () {
var myTextArea = document.getElementById('code_editor_demo_4');
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
lineNumbers: true,
matchBrackets: true,
styleActiveLine: true,
theme:"neo",
mode: 'css',
readOnly: true
});
}
return {
//main function to initiate the module
init: function () {
handleDemo1();
handleDemo2();
handleDemo3();
handleDemo4();
}
};
}();
jQuery(document).ready(function() {
ComponentsCodeEditors.init();
});