MyBB Community Forums
[1.6.x] Fix Editor & TextArea - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: [1.6.x] Fix Editor & TextArea (/thread-75337.html)

Pages: 1 2 3 4 5 6 7 8 9 10


[1.6.x] Fix Editor & TextArea - Warmonger - 08-06-2010

If your like me you'd hate for your forums to not look half way decent. If you get sick and tired of looking at this, with the text area all hanging out of the editor, then scroll down.

[Image: 90djtl.png]

Then follow these steps below.

Open (jscripts/editor.js)

Find:
		// Determine the overall height and width - messy, but works
		w = oldTextarea.getDimensions().width+"px";
		if(!w || parseInt(w) < 400)
		{
			w = "400px";
		}
		if(this.options && this.options.height)
		{
			h = this.options.height;
		}
		else if(oldTextarea.offsetHeight)
		{
			h = oldTextarea.offsetHeight+"px";
		}
		else if(oldTextarea.clientHeight)
		{
			h = oldTextarea.clientHeight+"px";
		}
		else if(oldTextarea.style.height)
		{
			h = oldTextarea.style.height;
		}
		else
		{
			h = "400px";
		}
		this.editor.style.width = w;
		this.editor.style.height = h;
Replace With:
		// Determine the overall height and width - messy, but works
		w = "550px";
		h = "300px";
		this.editor.style.width = w;
		this.editor.style.height = h;

Find:
		textInput.style.height = parseInt(areaContainer.style.height)+"px";
		textInput.style.width = parseInt(areaContainer.style.width)+"px";
Replace With:
		textInput.style.height = "229px";
		textInput.style.width = "544px";

And you should end up with a fixed editor and textarea that looks like this.

[Image: 141qyr7.png]

You can play around with the height and width to your liking/size. This works and looks the same on IE, Firefox, and Chrome.

Still having problems applying the patch? Download a original copy of editor.js with this patch applied below.

If you like push the [Image: postbit_reputation.gif] button!
-Warmonger

UPDATED FOR 1.6.3!


RE: Fix Editor & TextArea - Solstice - 08-07-2010

hey any can move this to turorials??


RE: Fix Editor & TextArea - Starnova - 08-07-2010

Perfect solution to the same problem I had. Thank you!


RE: Fix Editor & TextArea - Janota - 08-07-2010

Yea works perfectly Smile


RE: Fix Editor & TextArea - kjaonline - 08-07-2010

Thanks for this!


RE: Fix Editor & TextArea - Scoutie44 - 08-08-2010

Much easier and simpler to do with solely CSS.


RE: Fix Editor & TextArea - Warmonger - 08-08-2010

(08-08-2010, 05:41 AM)Scoutie44 Wrote: Much easier and simpler to do with solely CSS.

Tried editing templates and CSS. Much easier/faster to edit the JavaScript itself.


RE: Fix Editor & TextArea - Gunner10 - 08-09-2010

Thanks!!


RE: Fix Editor & TextArea - Janota - 08-09-2010

(08-08-2010, 05:41 AM)Scoutie44 Wrote: Much easier and simpler to do with solely CSS.

Post your css solution ?

Because i can tell you 100% that editing the css or templates wont give you the same result.




RE: Fix Editor & TextArea - MadDogTen - 08-09-2010

Thanks! This works Nice, it was getting REALLY annoying the other way.