MyBB Community Forums

Full Version: Can't locate the source of editor values
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to modfiy the editor of MyBB, but I can't seem to find the source of this:

<div style="position: relative; width: 528px; height: 387px;" class="messageEditor">

If I remove the $codebuttons variable from the newreply template then those variables go away, so I took a look at the codebuttons template:

<script type="text/javascript" src="jscripts/editor.js?ver=1600"></script>
<script type="text/javascript">
<!--
	{$editor_language}
	var clickableEditor = new messageEditor("{$bind}", {lang: editor_language, rtl: {$lang->settings['rtl']}, theme: "{$theme['editortheme']}"});
	if(clickableEditor)
	{
		clickableEditor.bindSmilieInserter("clickable_smilies");
	}
// -->
</script>

I figured the source may be this $bind variable, so I looked it up in the functions.php file, but again I am stuck here as well. It's also not the editor.js file.

So can anyone please tell me where the hell the div above comes from?
Thanks.
I believe that is inserted by the editor.js file. I don't think it's referenced exactly - it's calculated from the original width of the textbox or something. I definitely remember changing it by changing the editor.js file a while back anyway.

EDIT: Looking at the editor.js file, the stuff you want to look at starts around line 162. All the classes are applied from here onwards Smile
Thanks a bunch man, you are right Smile
But why so complicated? In my opinion users should be able to modify an editor without messing with core files.