Okay, I am not a fan of all the javascript hardcoded into core, hence I might be a bit preoccupied when writing yet another bug report :)
I tested the new JS resizer when it was in patch mode, and then I found nothing strange. I mean, it worked.
The committed one, however, does not play nicely along with the CSS in konqueror. Konqueror insistst (so it seems) on keeping the size of the textfield. The only thing that happens when I drag the resizer is that the content below it moves up or down.
See the screenshot for an example.
I am feeling more and more:
+1 for removing this unneeded core feature into a contrib module.
Or
+1 for disabling all this in core and providing this as theme APIs function
Or
+1 for using a proven-to-work toolbox like prototype.
The current route is just not working. I recall filing an issue for each and every AJAX and JS feature added since 4.6.
and yes I know konq is not playing nice in the Js world, but this proves, IMO, that Js is not yet ready for core. As long as production browsers have issues we failed to deliver good code. and I rather not present any Js then potentially broken sites.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | drupal-5.1-textarea.patch | 2.04 KB | mr700 |
| #2 | resize_off_by_default.patch | 1.76 KB | Bèr Kessels |
| B0rken_js_resizer.png | 10.17 KB | Bèr Kessels |
Comments
Comment #1
pfaocleI'm sure this has been mentioned elsewhere (some fun and frolics at the end of this issue, but I'm with Bèr 100% on this one. The resizable text areas (in HEAD and 4.7.0-beta3) don't work at all for me in Konqueror, and are very jerky and strange under Firefox. I've experienced jumping textareas, textareas inaccessible and hidden under other content and content not complying and remaining fixed in place in the window even when the textarea is resized (ie it fails to 'push' the content down).
How about a contrib module to provide all (or most of) this JS/AJAX stuff, with a list to allow admins to turn different features on and off?
Comment #2
Bèr Kessels commentedThe attached patch sets the *default* for textareas to false.
I have also added a theme function to chameleon theme. This has a few good sides:
* It adds an example of a theme function for a form element to a core theme. Examples are great learning material.
* It shows with chameleon, that we do have fancy JS resizers.
* It moves features like JS resizers to the place where they belong: a theme!
I think we should ship with *less* cruft, not more. This patch adresses that. Please consider this for core. I am feeling a lot of resistance for features such as the resizing areas. We must not ignore that resistance, javascript is long away from being foolproof, so we too must me carefull about enforcing it upon all users.
Comment #3
pfaocle+1 - great idea, but untested as yet. Could this also allow for a whopping toggle switch for all supported JS/AJAX within a theme?
Comment #4
Bèr Kessels commentedNo, a "toggle all" is a bit beyond my intentions of this patch.
But certainly, it can be a good idea to make all JS off by default, and let themers or module devels switch it on. Just like this one does for this case. Its a post 4.7 project though.
Let us first look how this patch is received. :)
Comment #5
pfaocleWell, it gets my vote. I test it tomorrow sometime.
Comment #6
ixis.dylan commented+1 for removing this unneeded core feature into a contrib module.
I think it would be better in a module than a theme, as users will be able to switch it on or off without hacking it into their favourite theme.
Comment #7
markus_petrux commented...or the theme settings page. ;-)
Comment #8
Bèr Kessels commentedThe theme settings page should be implemented by the theme itself. Then a themer of a theme can decide to provide these settigns for that specific theme.
I, personally, perfer to decide such things in my theme. I mean: my client will only once decide whether or not we ened a JS feature. No need to clutter an admin area with that, then.
-1 on a theme setting.
and yes, my current patch lets one decide this in a module too, if you prefer not to use the theme for this.
Comment #9
killes@www.drop.org commentedI agree with Ber's approach to nifty features that might be annoying to other people. The patc also looks ok to me.
Comment #10
Steven commentedThe resizable textareas are just as much a usability add-on as e.g. collapsible fieldsets. Should those be disabled by default too? Before you say "the collapsible fieldsets are not buggy", let me remind you of the kind of hacks that we went through to make those work:
But, they do work now.
When it comes down to it, Javascript is not the real issue. It's crappy CSS support; the fieldsets have demonstrated this before. With the textareas, all the different browsers have their own idea of how CSS applies to them. Check the various incarnations of textarea.js: it was the CSS styling and markup which changed again and again. The mouse handling on the other hand hasn't changed since day one; its 'browser compatibility layer' consists of a single, short line of code.
So, your proposal that we use a "a proven-to-work toolbox like prototype" would not change a thing about the issues you're seeing with the textareas. Remember that Konqueror file upload bug a while ago? Same story. In fact a JS toolkit would only make it much harder to track down, because of the extra layers in between.
I think that keeping our 'rich UI' features on by default provides more incentive for modules and themes to work with them, rather than against them. Many people are shouting for "more Ajax" and "more rich UIs!", so this can only be a good thing.
If you want to do a rich UI in Drupal, you need to deal with variable content in variable forms with variable styles and it all needs to degrade. It is not trivial to get right, but it is worth trying to get right. We don't need patches to disable JS, we need more people to stop being afraid of it. Code, debug, play around, test. But don't throw out the baby with the bathwater.
Comment #11
Crell commentedYes. :-) I've said before we're over-relying on those.
What I could go for is a checkbox set inside a fieldset somewhere (theme page? settings page? I don't know.) to selectively enable or disable "Visual FX". Want collapsable fieldsets? Check on the "collapsable fieldsets" checkbox and they're done. Don't want the super-resizing textareas? Check that checkbox off. The functionality shouldn't be affected, but implementing it shouldn't be too difficult, I'd think. We'd just need some sort of "visual FX" registry. If someone adds a funky-effect (core or contrib), they register that as a string. Then a simple
And we're done. We can even default stuff to on if we want to show off, but those who don't want it for whatever reason can easily get rid of them.
Comment #12
Stefan Nagtegaal commentedI know my opinion isn't that important, but have too admit that I rather would see the JavaScript/Ajax usability things in several contrib-modules, than default in core.. So +1 on moving *all* JavaScript/AJAX features from core to contrib into /several/ modules.
Comment #13
killes@www.drop.org commentedWell, there are JS thingies that are (IMO of course) usability improvements and there are some that aren't. The collapsible fieldsets belong into the first category, while the expandible textareas are of the second kind.
People who want to write the great novels of the 21st century in a browser textarea should not be taken serious anyway.
And there also were times where we didn't care for the shouting masses.
Comment #14
mr700 commentedI see no konqueror version. While it was not working with Drupal 4.7 beta 2 and konqueror 3.5 it started working somewhere between beta2 and beta3 in the cvs (#42913 I think it was - removed a ta.endDrag(e) ). I tested this 3/4/5 days ago with Fedora Core 4. Firefox 1.0.7 and 1.5.0 work also.
Comment #15
Bèr Kessels commentedSo, people, in the very end, after all the "i want all to go, No it should be there and here, no it should be as it is now". This patch, the one attached in this thread, is the only one so far that actually *does* something.
Steven: can you comment on the patch, and on what it tries to do?
I also want to add that my patch marked drupal more consistent in the JS behaviour.
* The autofills are normal textfields with a special flag set
* The collapses are normal fieldsets ith a special flag set
* The textareas are special JS enabled things, UNLESS one sets a flag.
My patch changes that into:
* The resizable textareas are normal textareas with a flag set.
You see what I try to achieve? Maybe this makes it clearer why I think my solution is important!
Bèr
Comment #16
dries commentedResizable textarea should be on by default. Feel free to turn them off in your theme.
Comment #17
Bèr Kessels commentedComment #18
ixis.dylan commentedResizable textareas should probably work by default, too. I don't know (or care) enough about javascript to fix it, sorry, but it means that we can't upgrade any of our sites beyond beta 2 without stripping this feature out of the code.
Comment #19
Bèr Kessels commentedLeafish, I think I will get some information in the handbooks, together with some pathces and stuff, to hack all this out.
I am sure that when 4.7 hits the big masses there will be more people grummbling about all these "nifty" features. A central place to explain how to hack it out might be a good idea.
Comment #20
Crell commentedWhy should resizable textareas be on by default but collapsable fieldsets off by default? What makes the one more important to push so heavily than the other?
Comment #21
Bèr Kessels commentedI am afraid the answer is something like "because wordpress has it that way" :p
No, seruious: My guess is that Dries et al want to see all textareas resizable. If it would be left to the modules to implement it would hardly be used and it would be used inconsistently.
IMO, this patch should have never gotten in like this. Indeed: instead the page, story, book, comment and blog module (and prolly some others too) should have been patched to make some of their input areas resizabl.
But that is such a huge task, that there is no fsking way I am going to patch that. Most of all because I am not going to sweep up the "mess" that a) is not considered "mess" by lots of people and b) was put there while i never agreed on putting it there (which is fine, since we have to make decisions even if some disagree).
My wild guess though.
Comment #22
Bèr Kessels commentedSo, i finally found out why this all happens (and setting this back to active in the mean time..)
It really is a konqueror only isseu, first of all. But the reaon for that is not poor JS support!
[00:38:24] kde/konq does actively *not* support any styling of certain for stuff
[00:38:40] hm, weird
[00:38:45] why?
[00:38:54] to make sure people cannot hide forms of fill hideen (withCSS disabbled) form elements
In other words: its rather easy to fill a css-obscured upload form in most browsers and fill that with a known ugly file, using JS. Or fill that with some cookie info.
As a security measure, konqueror decided
* not to support background images in forms (the throbber is b0rken too)
* not support any resizing (for it is not too hard to just make some JS to resize an input for to 1px)
* and more of these rather obvious tricks
Yup, firefox has deeper layered checks for these, but they are -by far- not as secure as simply stating "no we disallow any resizing"
in other words: it breaks because konqueror decided to go for a safe route!
Comment #23
Crell commentedSince upgrading to KDE 3.5, I've found the resizable text areas not working every other time I update against CVS HEAD or so. As of this post it is working, but I've no faith in it staying that way. What happens is that the page below the textarea moves, but the textarea itself doesn't go anywhere.
With that kind of unpredictability, the first thing I'd do on any Drupal install is go in and strip out the damned JS for it. But I'm skilled enough to do that (I hope :-) ). Not everyone setting up a Drupal site is.
Really, this would be a simple contrib module to achieve the same global effect. Like rich-editors (HTMLArea, FCKEditor, etc.), this should be an admin option via module, not an essentially mandatory feature.
Comment #24
markus_petrux commentedI can't believe KDE is going that route. what else are they going to remove? ...maybe they should think about packing the browser as a virtual machines ...sorry, I know I'm not adding anything useful here, but I couldn't resist.
Maybe it is easy to add a global setting to allow admins decide, maybe the attribute #resizable could be inserted on textareas by default if they choose, or maybe even an option at user level?
Comment #25
killes@www.drop.org commentedI fully support Crell. the feature as such does not add much to Drupal and has the potential to alienated quite a few people. It should not be enabled by default and maybe not even in core. Niftyness isn't an appropriate core standard.
Comment #26
mr700 commentedBèr, you can not fill a upload form with javascript (only read the file name maybe), this is what makes it secure. All other things you can hide to submit some text (javascript can not access local files) info back to the server hiding this fact from the user can be done easy with xmlhttp (and it should be that way, javascript is designed to hide things from the user). Real life example is gmail, they allows you to dynamically add more uploads using javascript.
About javascript security read more at http://www.quirksmode.org/js/intro.html. Konqueror 3.5, at least mine with FC4, asks you every time you upload file(s) if you would like to do so. If Konqueror developers are implementing security by disallowing you to hide things, which I don't believe, they are just creating Security through obscurity and breaking standards. I can not find anything on this subject with google, if you have links please give me some.
Comment #27
Bèr Kessels commentedPLEASE! people. this is NOT about KDE. this is not about security: this is NOT about one client sucking more then another one. This is not even about certain clients being possibly broken.
This is about whether or not Drupal should add "nifty" features by default. And about (when chose to add niftyness) how to do that.
All my patch does, is make the way we add JS to add niftyness consistent with the other JS.
That that fixes numerous issues with numerous clients is nice, but should not be the reason for voting for this patch! Because if that is a criteria we will go down that old DHTML alert('your browser does not support our site, please get the latest IE') (or any modern ajax way of doing so) road. That is a definate no go IMO.
Comment #28
drewish commented+1 for making resizer optional, it's tacky and not that useful.
Comment #29
Dublin Drupaller commented+1 on making it optional.
(anyone worked out how to get rid of it?)
Dub
Comment #30
Dublin Drupaller commentedAnswering my own question here..but, here's a phptemplate template.php snippet that will override and disable the resizable text area thingy for a specific theme
hope that helps others.
I imagine it wouldn't be too hard to plop a checkbox on the theme configure page to toggle it?
Dub
Comment #31
magico commented+1 should be optional!
See also: http://drupal.org/node/84500
Comment #32
mr700 commentedAs I feel a bit resposible defending resizable textareas, here's a patch that should (worked for me) make this optional feature with setting at admin/settings/textarea (copy-paste + modify from Clean URLs).
Comment #33
Zen commentedI think a more generic fix will be better. Rather than adding checkboxes galore for each feature that we want disabled etc., introducing an option to override (or unload) JS (or CSS) files will be more prudent, cleaner and modular. drupal_add_js / drupal_add_css store all includes in a static array. Adding a method to replace this array accordingly will solve this (and other) issues.
My 10p.
-K
Comment #34
drummComment #35
catchCan now override css in .info files, .js should be coming soon if not already, so won't fixing this since there's more and more javascript in core and this isn't the sort of thing you want to add checkboxes for.