Resizeable Text Fields

By Florian Höch Last update May 22, 2009 — Installed 6,083 times.

preformatted text

in
Subscribe to preformatted text 3 posts, 2 voices



IzzySoft Scriptwright

the PRE tag is sometimes used to display messages (ever got a PM here, and you know what I mean). It's the nature of PRE that line breaks are only made if there's really a "newline" character present. But e.g. here at USO with the PM, the width of the field is also limited - which makes those PMs hard to read.

Long talk - fast solution:

//		var TF = Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('textarea')).concat(Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('input'))).concat(Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('select')));
		var TF = Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('textarea')).concat(Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('input'))).concat(Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('select'))).concat(Array.prototype.slice.call(resizeableTF.doc.getElementsByTagName('pre')));
[...]
//			while (i--) if ((TF[i].tagName.toLowerCase() == 'textarea' || TF[i].tagName.toLowerCase() == 'select' || TF[i].type == 'text' || TF[i].type == 'password') && (!resizeableTF.loaded || resizeableTF.TF_names.indexOf(TF[i].name) < 0)) {
			while (i--) if ((TF[i].tagName.toLowerCase() == 'textarea' || TF[i].tagName.toLowerCase() == 'select' || TF[i].tagName.toLowerCase() == 'pre' || TF[i].type == 'text' || TF[i].type == 'password') && (!resizeableTF.loaded || resizeableTF.TF_names.indexOf(TF[i].name) < 0)) {

Just check for the "commented" lines of above quote in your code, and replace them with the following uncommented variant - so at least the width of those fields can be adjusted with your marvelous script. You can just try it out with the code above, which I put inside of PRE tags :-)

Thank you for your script - and I hope I was able to give something valuable in return!

Best regards,
Izzy.

 
Florian Höch Script's Author

Thanks, this is a nice addition. I also added vertical resizeability.

 
IzzySoft Scriptwright

Great - thank you, so it's time for me to update now Cool

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel