Saturday, 23. September 2006, 03:09:38
Textarea resizer
OK, ladies and gentleman: new toy. This one is veeeeeeeeeeeeeeery useful.resize-textarea-util.js
Just, hover your mouse over a textarea, and press ctrl at the same time. A pop up menu will appear with several options to resize the current textarea. Play a bit and you'll quickly find out what each of the options do.
Note: there are still a few tweaks I must do, like using the current Opera skin as theme for the menu, and providing a more robust CSS, to deal well with as many webpages as possible.
Tuesday, 2. January 2007, 10:14:05
- Deals much better with page styles ! (uses custom elements)
- Uses system colors and fonts
- Probably some bug squashed.
Tuesday, 2. January 2007, 18:06:08
And really gets in the way when copying/pasting text with ctrl+c/ctrl+v. I'm talking about previous version now, which was actually showing the menu all the time.
Tuesday, 2. January 2007, 18:10:32
Maybe just invoke the menu when hovering _into_ textarea from some other element. So don't invoke menu when we are inside textarea and we press shift. What do you think? It should be doable from what I know.
Wednesday, 3. January 2007, 08:23:37
Thursday, 4. January 2007, 22:05:37
Thursday, 4. January 2007, 22:22:25
Originally posted by armbar:
It would be nice if the menu came up on the release of the shift key, so that typing quotes and parenthesis doesn't trigger the event.
The menu comes when you hold shift key then move the mouse OR when you move the mouse and press shift. Anyway, you can change it so that menu comes when you hold Ctrl+Shift :
Change this :
var shortcut = { eventType:'mousemove', shiftKey:true, ctrlKey:false, altKey:false };
to
var shortcut = { eventType:'mousemove', shiftKey:true, ctrlKey:true, altKey:false };
Thursday, 4. January 2007, 22:28:58
Either way, just a suggestion.
Tuesday, 8. May 2007, 22:33:11
Example: http://en.wikipedia.org/wiki/Opera_browser
Navigate through the table of contents, it selects "1 History", then "History", then "2 Future development", then "Future development"
but it should select "1 History", then "2 Future Development" and so on.
And this happens not only on wikipedia.
Is there a chance that this will be fixed in the future?
Thursday, 10. May 2007, 12:23:49
Originally posted by xErath:
Still it seems to be this script..For sure it's not the script that's affecting that.
I just deleted my userjs folder, and then the shift + arrows worked just fine, then I put the textarea resizer back in and the same thing that I described in my last post happened again. =/
Thursday, 13. September 2007, 22:06:06
Sunday, 16. September 2007, 19:27:37
I've picked that one up and editted it to prevent many problems I encountered, like not pickig up dinamically generated textareas, or the script messing with the textarea's css. I had some problems with it.
textarea-drag-resizer.js
Sunday, 16. September 2007, 22:09:57
Tuesday, 18. September 2007, 07:28:24
Originally posted by xErath:
There's another script like this one floating around the forums, which enables the textarea corner to be dragged.
Excellent!
Glad I dropped by this thread again. The drag option is much better for me - I used to invoke the resize menu by mistake too many times using the CTRL key.
Thanks!
Thursday, 20. September 2007, 09:34:55
Sunday, 30. September 2007, 23:05:18
Drag the lower-right corner to resize, and double click it to restore the original dimensions.
Works with inputs and textareas
textarea-drag-resizer.js
Monday, 1. October 2007, 22:03:39
Originally posted by xErath:
hum.. It might be good to keep those. What do you think ?
And,I forgot to include images
We won't hold it against you.
BTW: Reply to this topic or quote me without using the Quick Reply field, and hover your mouse over the submit button. Notice anything odd?
Tuesday, 2. October 2007, 00:08:32
Originally posted by xErath:
image inputs.
Sorry, I guess I didn't notice that.
Saturday, 13. October 2007, 18:35:04 (edited)
- Different width/height calculations have to be applied for textarea in quirks mode. Right now script is bassically broken in quirks mode when textareas have padding/border set. Look where drag handler appears on most of this textareas: http://east.portland.ne.jp/~sigekazu/css/test/textarea2.htm .
- Opera have some bug that makes images added to documentElement sometimes invsible. I had the same problem with OrangooSpellCheck before. I've changed
document.documentElement.appendChild
to(document.body||document.documentElement).appendChild
back then. Same could me made for drag resizer.
- Textareas with big padding and/or border have this annoying effect when starting resizing. Needs some more refined size calculations.
- Little comsetic nitpicking. When we click on drag handler and move mouse a bit, text area bottom right corner is aligning to cursor. It's basically same thing as previous point but on smaller scale.
I have fixed those problems (excluding the first one but it's a metter of adding few if's). If you want I can post fixed version or send it to you so that you could review and polish it.
EDIT: And file input seems to have wrong box model applied in latest build (9594).
http://files.myopera.com/d.i.z./bugs/inputs_boxmodel.html
Saturday, 13. October 2007, 22:38:55
Originally posted by d.i.z.:
Different width/height calculations have to be applied for textarea in quirks mode. Right now script is bassically broken in quirks mode when textareas have padding/border set. Look where drag handler appears on most of this textareas: http://east.portland.ne.jp/~sigekazu/css/test/textarea2.htm .
They all appear fine to me.
Originally posted by d.i.z.:
Textareas with big padding and/or border have this annoying effect when starting resizing. Needs some more refined size calculations.
Confirmed.
A couple of suggestions from me:
1. I'd like to turn off the corner image altogether (I find it a little distracting) but keep the cursor change. [EDIT: ok found the bit in the code with the image, commenting it out seems to work without any errors]
2. A Creative Commons license is not for software, as I recently discovered. Use GPL instead.
Sunday, 14. October 2007, 10:57:06
Originally posted by svivian:
Originally posted by d.i.z.:
Different width/height calculations have to be applied for textarea in quirks mode. Right now script is bassically broken in quirks mode when textareas have padding/border set. Look where drag handler appears on most of this textareas: http://east.portland.ne.jp/~sigekazu/css/test/textarea2.htm .
They all appear fine to me.
Because you are using O9.23. Latest alphas have some fixes for textarea so that border-box boxmodel is properly applied in quirksmode. This breaks script.
Sunday, 14. October 2007, 15:34:20
Originally posted by d.i.z.:
Because you are using O9.23. Latest alphas have some fixes for textarea so that border-box boxmodel is properly applied in quirksmode. This breaks script.
OK well you didn't say that you were using alpha verison
Sunday, 21. October 2007, 08:02:23
- ...Textarea resizer doesn't cover the right-below corner, so I can use NoScript.js, too.
- ...Textarea resizer doesn't "ignore" the Ospell.js. (Expandarea can't cooperate with ospell correctly)
Congrats for the fine work
Tuesday, 30. October 2007, 00:31:29
I fixed the bugs d.i.z. reported, but I still need a better way to get the computed box-sizing value for textareas, else textareas like the ones on gmail will have the drag anchor mispositioned.
textarea-drag-resizer.js
Tuesday, 30. October 2007, 11:48:06
When I get home, I will send you my version which works great both in quirks and standards mode unless one forces different box model for textarea (or input) with box-sizing. And this is because I base my calculations on document.compatMode.
Monday, 5. November 2007, 21:35:47 (edited)
More another small update.
Now textarea's in gmail work ok
@d.i.z., it's too cumbersome and ineficcient to check stylesheets for the proper rules which affect box-sizing for each element.
The script deals with most common cases, and I added a sniff for when Opera supports boxSizing in CSSStyleDeclaration objects.
Monday, 5. November 2007, 22:44:17
Originally posted by xErath:
@d.i.z., it's too cumbersome and ineficcient to check stylesheets for the proper rules which affect box-sizing for each element.
Of course, I would never suggest anything like this.
It works really well now, better then mine, thanks to exceptions for 'file' and 'select'. Moose explained to me that it's not really a bug with quirks box-model for them so I have settled this in my mind now.
But please take image from my version where I have cropped graphic. Yours is resized with css and that makes it look bad. And add a bit of opacity maybe?
And sorry for off topic but I hate that bug in Opera 9.50 when scripts contain non-ascii characters and you edit them and they no longer work. If I save your script without modifying anything, my editor removes all trailing spaces. And this makes script not work anymore because of parsing error. Is this bug on it's way to be fixed?
And I wonder how you make your scripts so they work initially? I guess that these white spaces compensate those non-ascii characters in some way but how do you know where to put those spaces and how much of them?
Tuesday, 6. November 2007, 22:05:27
Originally posted by d.i.z.:
And this makes script not work anymore because of parsing error. Is this bug on it's way to be fixed?
known and reported #288115
Originally posted by d.i.z.:
Having an accented char makes the last byte of the file being ignored.And I wonder how you make your scripts so they work initially?
Originally posted by d.i.z.:
My editor keeps all white-spaceAnd I wonder how you make your scripts so they work initially?
Just leave a newline in the end.
Thursday, 8. November 2007, 01:52:38
Thanks
textarea-drag-resizer.js
Sunday, 11. November 2007, 06:06:41
I've always wanted a way to do this on a lot of pages & now I can!!
Now, my next JS type task/wish is to get this problem resolved.
Thanks again
Thursday, 15. November 2007, 20:31:10
Originally posted by skye11:
nice script!
but the resized box returns to its usual size when leaving and later returning to a site
it would be great if the script could retain the resized dimensions of the input/text boxes
perhaps an option to either 'Discard' or 'Remember' a site's resized dimensions...
As default I prefer to return to the original size. But as on option, nothing exception.
Thursday, 15. November 2007, 21:09:05
many websites' input boxes are just way too short (ie. google)
esp. since there's plenty of room (unused space) across the page to accomodate a longer one
it's a pain to have to resize Google's input box every time I input lengthy search parameters
a site-specific resizing option would be ideal
Friday, 16. November 2007, 00:03:57
Originally posted by skye11:
nice script!but the resized box returns to its usual size when leaving and later returning to a siteit would be great if the script could retain the resized dimensions of the input/text boxesperhaps an option to either 'Discard' or 'Remember' a site's resized dimensions...
This case fits much better with a user stylesheet.
Tuesday, 25. December 2007, 20:19:15
Originally posted by skye11:
many websites' input boxes are just way too short (ie. google)
esp. since there's plenty of room (unused space) across the page to accomodate a longer one
it's a pain to have to resize Google's input box every time I input lengthy search parameters
a site-specific resizing option would be ideal
Just create a CSS file with this content and add its location to your site preferences for Google:
input[type="text"] {
width:600px !important;
}
Showing topic replies 1 - 50 of 155.
Forums » Opera Community » General Opera topics » User JavaScript