Page MenuHomePhabricator

Resizing of edit box on screen using JavaScript
Closed, DeclinedPublic

Description

Author: jasonspiro4

Description:
When you start to edit a page, a JavaScript should automatically run to grow or
shrink the editing textarea's height to take up 80% of your browser window's
total height.

(This would work best if bug 9369 "Edit page should automatically scroll down a
bit" was also implemented.)


Version: unspecified
Severity: enhancement

Details

Reference
bz9370

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:37 PM
bzimport set Reference to bz9370.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

This is a matter of taste. Possibly best to have little JavaScript arrows or something so users
can grow or shrink the edit box to whatever size they like, like vBulletin does. We could also
remember this sizing per user (or for anons, per session or whatnot), using a hidden form
variable (or for anons, maybe a cookie).

eep wrote:

What's the status on this? Is there a 3rd-party javascript that can be implemented in a MediaWiki wiki in the meantime? I'd rather have textareas a configurable size at first (if empty) and automatically expand as necessary (heightwise at least, especially if "edit box has full width" is selected in MediaWiki user preferences).

jasonspiro4 wrote:

(In reply to comment #2)

Is there a 3rd-party javascript that can be
implemented in a MediaWiki wiki in the meantime?

Could we implement this functionality in MediaWiki based on the code attachment to the last post at http://www.webdeveloper.com/forum/showthread.php?t=64005 perhaps[1]?

^ [1]. I tested the attachment that is posted there on IE7. When I save it to my USB flash drive and view it, a yellow Information Bar appears at top of screen. It prompts me to enable scripts. After I say "yes" it works fine and gives me a resizable textarea with nice thick borders to show that it is resizable. The textarea is resizable on all 4 sides. I did not test the code in any other browser. But the code is not free-licensed. If you email the author to ask that they release it to the public domain, please let us know you did so in this thread to avoid us requesting twice.

I don't really see how useful this is, due to the css rule (at least in modern skin) of:

#wpTextbox1 {width:100%}

but anyways, I thought it'd be an interesting js thing to do. So, I made a start on javascript to make this. See [[n:User:Bawolff/sandbox/resizeEditbox/resizeEdit.js]]

See demo at [[n:User:Bawolff/sandbox/resizeEditbox]]. (bearing in mind, its not done yet, so its not perfect, but it does work).

-[[n:user:Bawolff]]

Note that some browsers already implement a small area at the bottom-right corner of textareas to allow resizing them.

Firefox can do this. Opera not. Not sure about other browsers.

Resizing the height of the textarea to adapt to window's height could be nice, though. But not sure if that would annoy some users, or would interfere with custom toolbars, etc. If done please make sure it's a user preference option.

Opera does this now as well.

I think we should WONTFIX this bug. Many wikis have custom tools above or below edit box; I could see the resizing being annoying.