2013-11-04, 06:18 PM
In the name of God.
in this thread you are learning how to use CodeMirror for MyBB 1.6.x
author: http://my-bb.ir
1) upload this attachment in MyBB_ROOT and then extract this.
[attachment=30458]
2) edit admin/jscripts/codepress/codepress.js and replace codes with:
3) go to ACP -> Preferences -> Turn on CodePress
in this thread you are learning how to use CodeMirror for MyBB 1.6.x
author: http://my-bb.ir
1) upload this attachment in MyBB_ROOT and then extract this.
[attachment=30458]
2) edit admin/jscripts/codepress/codepress.js and replace codes with:
CodePress = function(obj) {
}
CodePress.languages = {
}
CodePress.run = function() {
var editor = CodeMirror.fromTextArea(document.getElementsByClassName("codepress")[0], {
lineNumbers: true,
lineWrapping: true,
tabMode: "indent",
theme: "mybb"
});
}
document.write('<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">\
<link href="./jscripts/codemirror/theme/mybb.css" rel="stylesheet">\
<script src="./jscripts/codemirror/lib/codemirror.js"></script>\
<script src="./jscripts/codemirror/mode/css/css.js"></script>\
<style>.codepress { width:auto !important} </style>');
if(window.attachEvent) window.attachEvent('onload',CodePress.run);
else window.addEventListener('DOMContentLoaded',CodePress.run,false);
3) go to ACP -> Preferences -> Turn on CodePress