configuring MyBB with Ace Editor
#3
Hello,
I try this, in a regular HTML page, and it works
<html>
<head>
</head>
<body>

<div id="editor">function foo(items) {
    var x = "All this is syntax highlighted";
    return x;
}</div>

<script>
document.getElementById("editor").style.fontSize = "18px";
document.getElementById("editor").style.height = "300px";
document.getElementById("editor").style.width = "500px";
</script>

<script src="/src-min/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/monokai");
    editor.session.setMode("ace/mode/javascript");
</script>

</body>
</html>

However I try this in a MyBB post, and the width, height, font-size scripts work, as opposed to the Ace Editor script, it has no effect:

<div id="editor">function foo(items) {
    var x = "All this is syntax highlighted";
    return x;
}</div>

[javascript] document.getElementById("editor").style.fontSize = "30px"; [/javascript]
[javascript] document.getElementById("editor").style.height = "300px"; [/javascript]
[javascript] document.getElementById("editor").style.width = "300px"; [/javascript]

[javascript="/src-min/ace.js"]
[javascript] var editor = ace.edit("editor"); editor.setTheme("ace/theme/monokai"); editor.session.setMode("ace/mode/javascript");[/javascript]

EDIT: I found the problem.
entering external Javascript link needs to be: [javascript=/src-min/ace.js]
instead of [javascript="/src-min/ace.js"]
(which is according to the MyCode I provided)
Reply


Messages In This Thread
configuring MyBB with Ace Editor - by wajed - 2021-04-26, 08:07 PM
RE: configuring MyBB with Ace Editor - by effone - 2021-04-26, 09:31 PM
RE: configuring MyBB with Ace Editor - by wajed - 2021-04-27, 01:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)