Antechinus said something interesting - and useful.Quote All it needs is the CSS3 resize property set to 'vertical'.Quote I took a few minutes out and stretched my brain, was quite nice.Quote I don't write GM nearly enough.
Just had an idea and messed around with it a little bit. Since anyone using a decent browser these days is already used to having the nifty textarea click and drag resize by default (ie: without relying on 2.0's legacy code) it occurred to me that having the same resize ability on code blocks could be handy at times.
Not quite sure how to handle this at the moment. I'm certainly not planning on committing it to svn, but it's a nice touch in FF4 or Webkit as you can set the default height to whatever and then just drag when necessary. Might make a handy Greasemonkey addition for peeps on FF4 or Webkit. Just a thought.
ETA: Actually jQuery could probably handle this for all browsers, including auto shrink for height with one or two line snippets. < 2.1 feature
Eh, what the hell.Code: [Select] // ==UserScript==
// @name Code Block Resizer
// @namespace http://www.simplemachines.org/
// @description Adds the fancy resize element
// @include http://www.simplemachines.org/community/index.php?topic=*
// ==/UserScript==
var divX = document.evaluate("//code[@class='bbc_code']", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (divX.snapshotLength > 0)
for (i = 0, n = divX.snapshotLength; i < n; i++)
divX.snapshotItem(i).style.resize = 'vertical';
Didn't really want to make it work on lots of forums since the @include could easily hit way too many sites and slow them all down.
EDIT: I don't think jQuery can actually handle this for browsers that don't have the feature or something relating to it. But it IS a one-liner in jQuery if you go down that road:Code: [Select] $('code.bbc_code').css('resize', 'vertical');
Anything else is getting overly technical, I suspect, and unreliable when you consider how themers will want to play.


