Mybb editor fix
techu Offline
Member
***
Posts: 154
Joined: Sep 2010
Post: #6
RE: Mybb editor fix
(03-28-2011 08:41 AM)ZiNgA BuRgA Wrote:  I think MyBB didn't properly do the OOP model of the editor, so it was impossible to have more than one instance of it on a page.
Dunno if changed in 1.6 - will need to check.

Javascript Code
textInput.style.width = "99%";

I'm a little critical of relying on a 1% difference.  Is there a way to have some sort of containing div with a more fixed padding width?
You might also want to keep the height setting code in the Javascript, though I'm not sure if it really does much.
Haven't tried your code yet.

Although I don't like it, there's perhaps a reason why it's fixed width - for one, it ensures a minimum dimension so that the buttons don't go haywire.

99% was a quick and easy fix and it appears ok on all major browser so I went with that. Div would have be an better solution.
You are right, the height settings code does not do much so I removed the whole thing.

(03-28-2011 08:41 AM)ZiNgA BuRgA Wrote:  Although I don't like it, there's perhaps a reason why it's fixed width - for one, it ensures a minimum dimension so that the buttons don't go haywire.

But minimum width can also be set using a div class. I am not sure why the developers made the editor that way.
BTW I have noticed that editors of other forum or cms script also has a fixed width, not really sure why..

(03-28-2011 08:41 AM)ZiNgA BuRgA Wrote:  If you just want it to fill 100% without supporting browser window resizes, it's probably better to do a HTML/CSS edit.

Thanks for sharing though - I also somewhat prefer a more dynamic width to the editor Smile

BTW, you moved the location of the video button - is that so it works better with smaller widths?
Filling 100% without supporting browser window resizes can be done with the default editor.js all we have to change the values of cols and rows attributes of the textarea in newthread and newreply templates.

I moved the video button because the dropdown menu does not appear properly near the browser border..
(03-28-2011 04:30 AM)RateU Wrote:  Very good if this can be done now (1.6). I've tried to 'steal' the editor using 1.4 before, unfortunately I failed to make it work if there is more than one textarea in the same page.
Maybe I'll try it later using 1.6.

I thought this might work but have`nt tried it myself.

[Image: banner.png]
(This post was last modified: 03-28-2011 01:16 PM by techu.)
03-28-2011 01:14 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Mybb editor fix - techu - 03-27-2011, 04:04 AM
RE: Mybb editor fix - RateU - 03-28-2011, 02:13 AM
RE: Mybb editor fix - techu - 03-28-2011, 03:24 AM
RE: Mybb editor fix - RateU - 03-28-2011, 04:30 AM
RE: Mybb editor fix - ZiNgA BuRgA - 03-28-2011, 08:41 AM
RE: Mybb editor fix - techu - 03-28-2011 01:14 PM
RE: Mybb editor fix - ZiNgA BuRgA - 03-28-2011, 09:51 PM
RE: Mybb editor fix - techu - 03-28-2011, 10:18 PM
RE: Mybb editor fix - Tomm - 03-29-2011, 08:32 AM

 Standard Tools
Forum Jump: