This function, in theme_filter_tips_more_info, creates a link to /filter/tips within the same window. With some browsers, if you were typing a comment and clicked there in the middle of your comment, the browser tips window would open up in the same window, and then when you hit the back button your message is gone.
Instead this should bring up a pop up window or some sort of javascript hovering trickery.
Comment | File | Size | Author |
---|---|---|---|
#299 | drupal8.filter-target-blank.299.patch | 601 bytes | sun |
#285 | filter_popup.patch | 1.06 KB | quicksketch |
#281 | 87994-quick-fix-filter-tips.patch | 707 bytes | aspilicious |
#242 | 0001-87994.patch | 15.37 KB | gordon |
#238 | drupal.effect.238.patch | 14.34 KB | sun |
Comments
Comment #1
piersonr CreditAttribution: piersonr commentedmodified issue version - this is also in the cvs version of the filter module.
Comment #2
chx CreditAttribution: chx commentedComment #3
lilou CreditAttribution: lilou commentedComment #4
David_Rothstein CreditAttribution: David_Rothstein commentedThis is really a combination of a bug report and feature request, I think.
There is more discussion of the data loss bug at #153313: ckeditor input is lost when using the browser's back button. So I'm tempted to leave this one open just as the feature request... a popup or modal dialog or something seems like it would be more user-friendly.
Comment #5
starbow CreditAttribution: starbow commentedOne solution to the issue is available at #374646: Popbox (Popups Lite): Adding Modal Dialogs to Confirmations
Comment #6
Dave ReidMarked #394398: Using the help link is clearing previously entered data and #423734: More information about text formats loses text as duplicates of this issue.
Comment #7
XanoThe new help system might be used for this, since filter tips are help and the new system includes popup windows.
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #15
Jody LynnFor now, how about we just do the quick fix and open the link in a new window as this issue's title requests.
Comment #16
David_Rothstein CreditAttribution: David_Rothstein commentedIt seems this same approach was proposed a long time ago at #59430: "More information about formatting options" must open in new window and marked "won't fix". Worth at least looking at the arguments there...
Not that Drupal is completely strict about this though. I checked, and currently install.php is already using a link with target=_blank.
Comment #17
Bojhan CreditAttribution: Bojhan commentedI am tempted to mark this RTBC. Can we get another code review? And I think most arguments are pretty straight forward, but we simply have to fix this.
Comment #18
wr5aw CreditAttribution: wr5aw commentedI'm opposed to using target=_blank as a "quick fix." You'll certainly have some folks screaming about not validating strict. I would prefer a js/window.open fix. I think we need some alternatives.
Comment #19
Bojhan CreditAttribution: Bojhan commentedSpoke to webchick, basicly this solution is a no go! Sorry :(
Comment #20
webchickSorry, but as much as I really want this stupid bug fixed, we simply can't fix this with a one-off target="_blank" hack. I believe there was a means of displaying inline help in popups as part of the #299050: Help System - Master Patch patch. Possibly pulling that out and using it here would work.
Comment #21
Jody Lynnok, changed title
Comment #22
Jody LynnI started a drupal_dialog function in common.inc to use jQuery UI's dialog js and css and have this working for filter tips.
Comment #24
rickvug CreditAttribution: rickvug commentedThis problem has come up many times in training sessions and also in formal usability testing, IIRC. I'd assume that everyone is +1 to fixing with a modal. With jQuery UI in core, I'd also assume that we'd use its modal dialog library. Jody Lynn, I think your patch correctly moves in this direction.
Where things get tricky is the fact that multiple areas of core could be improved through the use of modal dialogs. What standards are to be used? Reviewing the jQuery UI demo page, you can see that there are many options to be set. For this use case, it could be helpful to allow the dialog box to be moved and re-sized and moved so that one could refer to it during content creation. If modals are used for confirmation messages (ex: node deletion), we'd want to grey out the rest of the screen and disallow resizing.
It would be helpful to have a comment from the D7UX team, Gabor or Webchick regarding the direction for implementing modal dialogs. Should there be a master patch that implements changes in multiple areas or should all the patches be separate? If patches are to be separate, should a usage guideline be created? Should there be a separate "enabler" patch that focuses on providing the helper function (drupal_dialog etc.) before individual implementations are made?
Here are a few related links/issues for background:
- http://hojtsy.hu/blog/2009-jun-17/two-alternatives-d7ux-overlay-implemen...
- #374646: Popbox (Popups Lite): Adding Modal Dialogs to Confirmations
- #193311: Ajax Popups in Drupal 7: Adding Modal Dialogs to Help, Confirmations and Filter tips (Unified)
- #218820: Popups: Adding the core modal dialog API
Comment #25
Jody LynnYeah. it seems for a minimum drupal_dialog will need to accept settings for the dialog. I'll look more into the past issues as well.
Updated patch fixes the test in php module which failed due to the additional text displayed by the modal and cleans up filter_tips_long function which had no need for the arg() nonsense it was using.
Screenshot attached of the generic jquery ui dialog in effect from this patch.
Comment #26
EvanDonovan CreditAttribution: EvanDonovan commentedMmm... I like the screenshot of the modal dialog. Would this pattern be reusable elsewhere? From the patch code it looks like it would be, but I haven't actually tested the patch.
Modal dialogs might also be useful in some of the areas where people are considering #492834: Hover operations for flooded state screens, especially admin/content/node (see Dries' video in #30 of that issue).
Comment #27
Jody LynnYeah, it adds a reusable drupal_dialog function you can call anywhere. It won't work in all cases because it uses static text for the modal, no AJAX.
Comment #29
scroogie CreditAttribution: scroogie commentedSo this is now the official patch to add modal dialog support to drupal 7?
Comment #30
quicksketchSubscribe to see where this goes. A few notes on the patch so far:
- We can now get rid of the extensive drupal_add_js/css calls now and just say drupal_add_library('system', 'dialog'); which should add all the JS/CSS files needed.
- Rather than having a set of parameters such as $title and $content, I'd like to see this all just become $options instead, which map directly to the the options provided by jQuery UI's Dialog options. That way we'd have a much more generic use of this function.
- I think keeping $link_class would be a good thing, but it shouldn't be called "link_class". Maybe just something like "class", since it doesn't have to be a link that gets clicked. It's tempting to make this a full selector such as ".link-class" as the value rather than "link-class". We're getting so deep into jQuery I'm not sure CSS/jQuery selectors should scare people any more.
Comment #31
Jody LynnI'm having trouble with drupal_add_library because it seems to be ignoring all but the first usage (I want to use dialogs, draggable and droppable)
I started moving things around so now you specify two jquery selectors (the activator and the modal content selector). I need to implement the options properly still.
Comment #32
Jody LynnOk this is working well now. You can define a new modal dialog by specifying the selector to be clicked and the selector that has the content, and an array of options.
Comment #34
Jody LynnI forgot to 'fakeadd' the new file.
Comment #35
moshe weitzman CreditAttribution: moshe weitzman commentedCode looks good to me.
This page should really use a render() array but thats probably too much scope creep for this issue. We can do that after freeze.
Comment #36
dropcube CreditAttribution: dropcube commentedThe results are great, indeed, a very useful and valuable addition. However, the main concern I have now is about the hardcoded dialog dimensions.
How the dialogs dimensions/settings can be altered. Let's say for example, how a module/theme can alter settings of dialogs.
In this case, the dialog is being added inside a theme function, but in other cases, it might be added in menu callbacks, or other places, not necessarily inside theme functions.
Comment #37
Jody LynnOk, I added a drupal_alter into the drupal_dialog function so you can alter dialogs.
Summary of this patch:
Adds a drupal_dialog function to allow creation of modal windows with settings.
Adds a corresponding misc/dialog.js that uses jQuery UI to implement the dialogs.
Changes the 'more filter tips' link to use drupal_dialog, which creates a draggable resizable modal window.
Context creep in this patch:
Fixes filter_tips_long function which had some unused cruft.
Fixes some unrelated simpletests which superficially break from this patch, due their testing for whether the word 'print' was on the page or not.
Comment #38
Jody LynnForgot the fakeadd. again.
Comment #39
tizzo CreditAttribution: tizzo commentedThis patch is clean and does what it says.
I think it's RTBC, anyone care to mark it as such?
+1!
Comment #40
kleinmp CreditAttribution: kleinmp commentedNice dialog boxes! This does what it says and code looks good.
Comment #41
tizzo CreditAttribution: tizzo commentedSoooo... I marked it as such. My bad, +1 anyone?
Comment #42
Dries CreditAttribution: Dries commentedThe big question is: how does this work with the overlay patch?
Comment #43
dropcube CreditAttribution: dropcube commentedCan you combine all this parameters into the $options parameter, and pass 'trigger_selector' and 'content_selector' in the array.
We already have drupal_add_js(), drupal_add_library(), drupal_add_css(), drupal_add_html_head(), drupal_add_link(), drupal_add_tabledrag(), ..., etc.
Can you follow this common pattern an rename this function to drupal_add_dialog(), for consistency.
(minor) Wrong indentation here.
(minor) should go in the next line.
Comment #44
dropcube CreditAttribution: dropcube commentedComment #45
cwgordon7 CreditAttribution: cwgordon7 commentedDoesn't comply to coding standards, improper indentation in dialog.js.
Comment #46
Jody LynnI'll test this with the overlay patch and make sure everything's copacetic.
But I think in terms of having both the overlay patch and this general simple modal implementation, that that makes since, because the overlay functionality is so much more complex and specific.
Comment #47
Jody LynnI lean towards not putting every parameter into the $options array- those are specifically jQuery UI options for the modal dialog, and sticking everything all together in one array seems more confusing to me.
Everything else I'll change and study the js coding standards.
Comment #48
Jody LynnI made dropcube's changes and hopefully that addressed cwgordon7's indentation concerns as well.
Still need to confirm this works well with overlay patch applied.
Comment #49
David_Rothstein CreditAttribution: David_Rothstein commentedI reviewed this patch and made a couple of minor fixes to the code comments (attached). I think this is RTBC.
I also tried it with the overlay patch, and the answer to the question of how it works is "well enough". I was able to click on the filter tips link from within the overlay and get it to pop up on top of that (at least in Firefox) and look pretty much OK. If there are any details to worry about beyond that, I don't think it's the job of this patch to do that.
Comment #50
moshe weitzman CreditAttribution: moshe weitzman commentedThis is a nice usability improvement. Yet its integration into the render() model was a bit lacking. I've fixed it up. render elements may now add a dialog by setting #attached_dialogs. This goes on to call drupal_add_dialog() which was not changed at all.
I removed the more-info from a theme function since we don't do customizations like this via theme anymore. One can use the $conf['custom_strings'] feature of settings.php or hook_page_alter() to fiddle with the link.
If this patch fails testing, feel free to commit the prior one which is green right now.
Comment #52
moshe weitzman CreditAttribution: moshe weitzman commentedthose 4 exceptions have nothing to do with this patch AFAICT.
Comment #53
dropcube CreditAttribution: dropcube commentedI thinks it's a better and more extensible approach integrated with render(). A few comments, though.
There should be a way to 'attach' other stuff further, now it has the parameters fixed, and is not simple to attach other stuff dynamically.
The same, IMO, we should not do special case for dialogs, rather integrate it with the code we currently have:
If the dialogs are attached to the render() page structure, we do NOT need this pecial hook any more. The structure can be altered with hook-page_alter() or other _alter hooks.
- Sounds better in plural: '#attached_dialogs'
- All the parameters should be combined in one associative array, for example:
This way, it's easier to read, and easier to alter the complete '#attached_dialogs' structure.
Working on a patch to implement these changes.
Comment #54
dropcube CreditAttribution: dropcube commentedThe following patch implements the changes commented above.
Comment #56
moshe weitzman CreditAttribution: moshe weitzman commentedUgh. bot says - failed to apply
Comment #57
dropcube CreditAttribution: dropcube commentedI have created a separate issue to deal with the dynamic attaching to render() structures that that would be required here: #565496: Allow dynamic attaching of other types of stuff to render() structures .
Comment #58
dropcube CreditAttribution: dropcube commented@moshe: ugh, I had an outdated copy of HEAD, let's re-roll.
Comment #59
dropcube CreditAttribution: dropcube commentedUpdated patch against HEAD implementing the changes commented in #53 plus other fixes. Note that this patch includes for now the patch from #565496: Allow dynamic attaching of other types of stuff to render() structures, to allow attaching of stuff dynamically instead of doing a special case for dialogs.
Comment #63
cwgordon7 CreditAttribution: cwgordon7 commentedNot cool, someone ban that spammer.
Comment #65
cwgordon7 CreditAttribution: cwgordon7 commented(Please?)
Comment #67
dropcube CreditAttribution: dropcube commentedUpdated patch, now using #attached.
Comment #68
moshe weitzman CreditAttribution: moshe weitzman commentedThats some nice rendering ... Please wait for green before commit.
Comment #69
Bojhan CreditAttribution: Bojhan commentedI think this needs a usability review - to make sure it matches the overlay style somewhat. And not create a new style, that will confuse the user.
I am totally for committing this by the way, just want to make sure its done well - so we don't encounter issues down the road. Sadly I don't have a local machine here, but I will review later.
No worries about RTBC, this is a usability bug.
Comment #70
Bojhan CreditAttribution: Bojhan commentedTagging
Comment #71
catchLooks like wrong status.
Comment #77
Nick Lewis CreditAttribution: Nick Lewis commentedHmmmmm..... I don't want to block this because of overlays. http://drupal.org/node/517688 -- the issue looks troublesome, and it strikes me as funny to shelf a perfectly good usage of a dialog widget - as well as standard code to get them up in running (the first is it in drupal core?!) jQuery UI is such a slick library, and this particular usage is basically by the book: http://jqueryui.com/demos/dialog/#modal-confirmation (minus dropping an overlay).
The patch applied fine, as did playing with it. I've attached screenshots of how it looks. Will wait for 24 hours before i mess with webchick's mellow by marking RTBC
Comment #79
Jody LynnI think it's ready. If there are minor issues with style matching the overlays (it's using all default jQuery UI style now) that can be sorted out later.
Comment #80
Bojhan CreditAttribution: Bojhan commentedI would like to remind everyone, that "now" is later.
Comment #81
David_Rothstein CreditAttribution: David_Rothstein commentedI agree this is RTBC.
Note that in #49 above I tested a previous version of this patch with the overlay and it did not look horrible or create any big explosions or anything. I just tried it again with the latest versions now, and the same is true (although the overlay patch currently sets the z-index of the toolbar to a gigantic value, which causes the filter tips to appear underneath the toolbar, but that's a minor conflict that would be easy to resolve).
I don't see any reason to hold this patch up for another patch which does not seem like it's particularly close to being committed. Minor tweaks can be made if and when necessary.
Comment #84
sunI guess this can be considered RTBC, but it needs a re-roll to fix a few minor issues.
Comment #85
dropcube CreditAttribution: dropcube commented@sun: can you specify what issues should be fixed so that we can fix them ?
Comment #87
sunIntroduced in #37.
Please remove these changes from this patch, unless they're strictly necessary.
Trailing white-space here.
Can we remove this function and just add those elements to the form?
"Filter tips" (lower-case t)
The key description should follow after a colon + space (: ) right after the key name.
Indentation is correct here, though.
The proper syntax for @link is
@link [url] [title] @endlink
There should be a sanity check in here that $.dialog() is actually available.
Please use Drupal's new $.once() here.
Such basics can be removed.
This review is powered by Dreditor.
Comment #88
Damien Tournoud CreditAttribution: Damien Tournoud commentedt('Filter Tips') needs to be check-plained.
Comment #89
Damien Tournoud CreditAttribution: Damien Tournoud commentedI don't see how this is a bug, reclassifying.
Comment #90
SeanBannister CreditAttribution: SeanBannister commentedSub
Comment #91
sun@Damien: uhm, no. As of now, we "trust" user interface string translations. Only user-supplied data needs to be escaped. We have many examples in core, so I hope one arbitrary is sufficient to convince you: http://api.drupal.org/api/function/contact_form_user_profile_form_alter/7
Also, this is a usability problem, not really a feature. Since you lose all your form data when clicking on that filter tips link, it can certainly be considered as a bug. However, let's just treat it as a task. ;)
Comment #92
sunIncorporated issues from #87.
Taking account for #583400: jQuery UI libraries are loading too much CSS that needs to be reverted / Allow jQuery UI themes to be swappable.
Screenhots for Garland and Seven attached.
Comment #94
sunForgot dialog.js and those php test changes actually seem to be required (not sure why).
Comment #95
RobLoachThis abstracts dialog.js into jqueryui.js and adds
drupal_add_jqueryui()
which allows the registration/binding of jQuery UI elements.As you can see, we create the dialog box, in the first call, and then register the click event to show it. The good thing about this is that it will work on any bindable event, as well as any jQuery UI tool we have available, which gives us quite a bit of power.
Couple side notes:
Comment #97
RobLoachCleaned up
drupal_add_jqueryui()
with some documentation. Also added a$base
parameter, so that we're not restricted to "ui" libraries. We can now also usedrupal_add_jqueryui()
to add UI Effects as well. Yay screenshot!Comment #98
SeanBannister CreditAttribution: SeanBannister commentedGreat work on this. From a usability/accessibility point of view I really think a drop shadow would add great separation between the content in the dialog and the content behind it.
However I'm not sure what the state of Drop Shadows is in jQueryUI I heard at one point they were removed because they needed more work. I'll have a look at this if I get some time.
Comment #99
Bojhan CreditAttribution: Bojhan commentedOk, so first things - first. Lets remove the scrollbar - just expand the browsers scroll bar. Then onto the style, as far as I can see the < li >'s cause a lot of indentation - is there anyway we can fix this? (Perhaps some screenshots of other help text's.
Also, can someone run this in sync with overlay to see how it looks, what we change about it visuals.
Comment #100
RobLoachOne thing that the popup is missing is draggable and resizable. Right now once the dialog is presented, you can't move it out of the way and continue writing. We need draggable and resizable jQuery UI libraries so that the user can move it without loosing their place.
Bojhan at #99:
Do you think modifying the actual filter tips content should be in a different issue? Here we're just sticking it in a popup dialog box. Sun brought up the idea of sticking it in jQuery UI tabs/accordion, which might help.
SeanBannister at #98:
Yeah, unfortunately jQuery UI Drop Shadow is still in planning phase of jQuery UI 1.8. We could look at bringing in jQuery Drop Shadow....
Bojhan at #99:
That is the browser's scroll bar ;-) .
Bojhan at #99:
Good idea!
Comment #103
zenrei CreditAttribution: zenrei commentedsubscribing.
Comment #104
Jody Lynn@sun in #94, That php filter test was testing for whether or not the word 'print' was appearing on the screen (not the most robust test). The filter tips contain the word 'print', so it broke the test.
Comment #105
Jody LynnI updated the filter_tips_long code (looks like there was a recent change to theme_filter_tips that affected it), and added draggable and resizable as dependencies to the dialog js, which makes the dialog draggable and resizable. (Which is in agreement with http://docs.jquery.com/UI/Dialog#overview which lists them as dependencies)
I think the theming recommendations are out of this issue's scope. We haven't done any theming at all to the dialog, it's just jQueryUI out of the box. Theming dialogs or the filter tips content should be new issues.
Comment #107
Jody LynnForgot my own advice in #104
Comment #109
RobLoachRerolled Jody's last patch to HEAD without the PHP test update. I really like it with the resizable and draggable.
Here's a Screenshot of it with #583400-19: jQuery UI libraries are loading too much CSS that needs to be reverted / Allow jQuery UI themes to be swappable :-) .
Comment #111
RobLoachBojhan at #99 asked to see how this works with the Overlay, so I took the steps I outlined at #583400-19: jQuery UI libraries are loading too much CSS that needs to be reverted / Allow jQuery UI themes to be swappable, and then applied the latest patch in #517688: Initial D7UX admin overlay, and the attached screenshot is the result. Seems to work quite well!
Through #583400: jQuery UI libraries are loading too much CSS that needs to be reverted / Allow jQuery UI themes to be swappable, we could give Seven's jQuery UI theme a look that more matches the administrative stuff. Theme roller and theme_hook_alter to the rescue! Yay! :-)
Anyone know why the PHP test failed?
Comment #112
David_Rothstein CreditAttribution: David_Rothstein commentedThe code discussed in #104 and #107 needs to be added back to the patch to make the tests pass again.
Comment #113
Jody LynnLooking great with #583400. Seems like we just need to reroll with that php test adjustment and we're golden.
Comment #114
RobLoachHmmm, bizarre.
Comment #115
rickvug CreditAttribution: rickvug commentedJody in #113 says that everything checks out. #111 addresses the way forward and compatibility. All tests pass in #114. Is this RTBC?
Comment #116
sun@RobLoach: Very nice job!
The order of arguments looks very unnatural to me. I'd expect $base, $tool, and both being required.
s/of which//
"document ready" ?
Perhaps, "document.ready()".
Or, "document's 'ready'".
s/then/than/
Not 100% sure, but I'd prefer if core would take away the "ui" behavior namespace (i.e. skipping the "jquery" prefix).
So also this file would be renamed to ui.js.
Because, we still don't know about the future of the contributed jquery_ui module...
This review is powered by Dreditor.
Comment #117
RobLoachThanks for the review. I've included the notes sun made in this patch.
drupal_add_ui()
, along with renamed jqueryui.js to ui.js and the namespace change$base
argument. You're right in this not really being optional.... Got an idea regarding
$base
, we could remove the base part from the related jQuery UI libraries in system_library so we're left with$libraries['dialog']
instead of$libraries['ui.dialog']
, and$libraries['explode']
instead of$libraries['ui.explode']
. Then we wouldn't need this $base argument at all. Thoughts?Comment #118
RobLoachAfter a quick discussion with tha_sun and DamZ, we ended up going with:
This matches the function definition of drupal_add_library for added bonus consistency.
Comment #119
RobLoachForgot to remove the $base PHP docs.
Comment #120
sunI love it.
This may even be usable for Overlay.
Comment #123
RobLoachComment #124
Dries CreditAttribution: Dries commentedI like this, but I think it is secondary to the main overlay patch at #517688: Initial D7UX admin overlay. I'd like to get the main Overlay in first, and then see how both play together. I think that is the best, and most natural order, that would give us the biggest bang.
Comment #126
RobLoachRerolled. And yup, it works alongside the Overly! :-) http://drupal.org/files/issues/OverlayAndFilterTips.png from #583400-19: jQuery UI libraries are loading too much CSS that needs to be reverted / Allow jQuery UI themes to be swappable.
Comment #128
Jody LynnThe theme_filter_tips_more_info function was removed, but it was still being used in filter.admin.inc. I fixed that, but we probably want to just put a modal dialog in the filter admin as well.
Comment #129
Jody LynnI added the modal for the filter admin pages (e.g. /admin/config/content/formats/1)
Comment #130
RobLoachYup!
Just created a follow up issue: #609094: Popups for the "More Help" links.
Comment #132
rickvug CreditAttribution: rickvug commentedAny update here? We're now a week past freeze #2 and overlay's status is unclear. I would hate to see a usability improvement like this one passed over while waiting for a mega-patch that may or may not land (...and I do hope it lands).
Comment #133
RobLoachBrought back to HEAD.
Comment #134
dmitrig01 CreditAttribution: dmitrig01 commentedPlease roll with -p
do you really need these changes?
What jQuery UI elements would not be defined by system? none! Please remove $module altogether
use a big $options array for all but the first two items please. Also, it's bound, not binded
what about just a #attached[ui] ?
Comment #135
Jody LynnDmitri: Comment #104 explains why we need that change to php.test
Comment #136
RobLoachThanks for giving it a look, Dmitri! I like the options array idea, as well as [#attached][ui].....
Comment #137
RobLoachCleaned up the code a bit.
Comment #138
Bojhan CreditAttribution: Bojhan commentedObviously I agree with Dries that Overlay should go in first, but given the progress on that issue - I think its smart to commit this anyway. Since it is almost always already demonstrated with the Overlay, we know the visual issues are fixable and no bugs have been encounterd yet.
Comment #139
RobLoachMy mistake. This should add an item to $elements[$library][$tool], and then get the count of $elements[$library][$tool] instead so that $index keeps growing correctly. As it is now, $index will stay on how many tools you add, as oppose to how many jQuery UI elements you invoke. With this, when the settings are merged, you'd hit conflicts.
This review is powered by Dreditor.
Comment #140
RobLoachBraindump.....
apply
JavaScript function.Comment #141
dwwI'm slightly worried about calling the new function
drupal_add_ui()
. I'm worried novice developers will think that means "output the form elements" or something. ;) I'd rather it was calleddrupal_add_jqueryui()
or something, since it's entirely specific to jQuery UI, right?Also, I wish I knew why we need to do this twice, more or less:
Isn't there some better way to handle this? Can't we merge the definition of the dialog and defining how it's attached to various triggers into the same step? Even if jQuery UI itself can't handle that, and jQuery UI really thinks of this as 2 actions, couldn't we handle that ourselves in drupal_add_jqueryui() to avoid the duplication at every call site? Roughly:
Also, is there a good way to associate actions with the "okay" and "cancel" buttons on the dialog? E.g. if I want to trigger something when the user clicks "cancel" in the dialog, how would I do that?
Otherwise, this is looking very cool. I applied the patch and played with the filter help tip popup -- super yummy!
Thanks,
-Derek
Comment #142
RobLoachThis patch adds a couple things:
It would be great to have the ability to call multiple "actions" on a given element like Derek suggested above.
Comment #143
RobLoachWhoops, wrong patch.
Comment #144
RobLoachAdds a "functions" associative array, which allows declaration of JavaScript functions for use in the "arguments" array. This is handy when you want to have a function callback passed into, say a jQuery UI Dialog button, like in #613654-11: update.manager.js is missing.
Comment #145
RobLoachInteresting...... #617730: UX: Use modal dialogs for confirmation forms..
Comment #146
RobLoachAdded in this patch
Things to consider
drupal_add_ui()
Comment #147
sunAwesome!
Not sure what to do about the multiple invocation thing. Basically, each invocation seems to add cruft to the settings array, so it seems to be worth to consider multiple things for the same module + library + selector for bandwidth reasons alone.
We need at least one example usage in the PHPDoc here.
It seems like the more natural order is:
library
selector
event
bound_element (optional)
arguments
The @param description of drupal_add_ui() should use the very same order, having any other (totally optional) parameters appended last.
Looks like we need a helper function now. Makes no sense to have the identical code.
Strange indentation.
We can use $ here.
(and elsewhere) Anonymous functions should have a space between 'function' and the opening parenthesis.
I'm on crack. Are you, too?
Comment #148
RobLoachI hit some of the tha_sun's comments, as well as added dww's "actions" parameter. I find it helps a bit with the developer experience.....
.... Is it just me or does
$(this)[action].apply($(this), effect.arguments);
not work on Safari or Internet Explorer? It works fine in Firefox.Comment #150
jriedel CreditAttribution: jriedel commentedI just ran into this issue on 6.14, or I should say my customer just did and was very unhappy about it. I can't wait for 7.X to fix it, and I don't want to go around patching up the core.
I have a menu item I needed to put in a popup, so I used the same idea. I created a block that is in the footer of every page. The block has this in it
The first part takes care of the menu item, the second part fixes all the filter tips links. The format is just a slightly different format in teh theme that has no headers, menus, sidebars, just the content. Maybe someone better at Jquery can cleanup the code a bit.
So for someone finding this thread and needing a quick fix before 7.x comes out give this a try.
Comment #151
Jody LynnI did some more of sun's comments and fixed it for Safari (Safari didn't like "effect.return" as I guess return is a reserved word, so I switched return to 'return_value'.)
I don't understand the conditionals in ui.js that are like
if (settings.ui || false) {
Why not justif (settings.ui)
?Is this patch going to have a shot to make it in under the 'usability extension' category? It's some pretty important jquery UI integration stuff.
Comment #152
RobLoachThanks for the Safari fix, I was having troubles with that one. Seems to be missing ui.js :-) .
Regarding
if (settings.ui || false)
, I have a habit of strict typing code. We could just use settings.ui no problem, I was just concerned what would happen if settings.ui didn't exist.Comment #153
Jody LynnHere it is with ui.js.
I guess the conditionals should just be however the rest of core does it.
Comment #154
mcrittenden CreditAttribution: mcrittenden commentedSub.
Comment #155
rickvug CreditAttribution: rickvug commentedOverlay (which seemed to be a blocker here) is now committed. Hoping that there is still time to get this in.
Comment #157
RobLoachGood point, rickvug! Having a look at
$form['#ajax']
, is there anyway it could fit in here? Maybe not since they both are trying to accomplish different things....Comment #158
moshe weitzman CreditAttribution: moshe weitzman commentedLets get this in. It was ready before freeze and was told to sit and a corner and wait for overlay. It did so without complaint. Whats left?
Comment #159
Bojhan CreditAttribution: Bojhan commentedAgreed, guess this is RTBC then.
Comment #162
RobLoachRerolled. There's an unrelated issue in the Filter module that displays a warning and doesn't show the Allowed Tags. Should we fix that here?
Comment #164
chx CreditAttribution: chx commented@Rob Loach, well, if you want the patch to be committed ;) of course could be fixed in a separate issue if it's a big / complicated one but a minor one should be just fine here.
Comment #166
casey CreditAttribution: casey commentedsubscribing
Comment #167
bleen CreditAttribution: bleen commentedSubscribe
Comment #172
casey CreditAttribution: casey commented@Rob_Loach in #162, what issue are you exactly talking about? Could you give us a reroll?
Lets get this patch in. Especially the [#attachted][ui] stuff...
Comment #173
RobLoachdrupal_add_action()
as this is not restricted to "UI". You can call any jQuery method using this.@casey: The warnings I was referring to is big red messages you see at the top of the screenshot. Unrelated to this patch.
Comment #175
RobLoachForgot to update the PHP test.
Comment #176
Frando CreditAttribution: Frando commentedThis doesn't work with the overlay. Clicking the filter tips link within the overlay gets me out of the overlay and on the regular filter tips page.
Comment #177
yched CreditAttribution: yched commented@Rob Loach #162: "There's an unrelated issue in the Filter module that displays a warning and doesn't show the Allowed Tags"
I had those too. This comes from a previous patch in the filter config UI. You need to resave your filters config.
Comment #178
RobLoachFrando at #176:
This is actually because the Overlay goes through each link and changes its behavior. Telling the Overlay not to change the link's behavior fixed it. It would be nice if the Overlay had a hook_overlay_no_process(), or something so that we could tell it how to behave or how not to behave on any given link. Like hook_admin_paths(), but to tell the Overlay to not process X links....
Telling the Overlay not to process it through the class seems the easiest solution around this for now.
yched at #177:
Hmmm, do you know where that issue is? It would be nice if the upgrade path didn't require us to visit that configuration.
Well, here's an updated patch that works with the Overlay, along with a screenshot of it in the Overlay. #614494: Give Seven a nice looking default jQuery UI theme would make it prettier, but that's unrelated to this patch.
Comment #179
Jacinesubscribing
Comment #180
casey CreditAttribution: casey commented#178
#668104: Make overlay respect other click handlers should fix that.
['#attached']['action'] and drupal_add_action(): I am not sure about the name 'action'. Action is already being used elsewhere. We need a name that makes clear this is about adding scripts/interaction to the webpage/document/ui clientside. I think I would stick to 'ui'. Not by means of jQuery UI, but in general; a dialog or a collapsing event is part of the user interface, right? UI doesn't always mean GUI.
Comment #181
casey CreditAttribution: casey commentedoops
Comment #182
Jody LynnI tested it and reviewed and it looks good to me with and without overlay. I'd be very glad to see this make it in.
I'm opening up a new issue for the php test adjustment that comes along with this issue, in the hopes that can go right in and avoid any further confusion here.
Comment #183
sunExceeds 80 chars.
Can we please remove Overlay from core? How much more ugly does it need to be?
Speaking of dialog... did you test whether this entire action handling actually works for Dialog module?
Powered by Dreditor.
Comment #184
casey CreditAttribution: casey commented#183 Those classes ( 'overlay-displace-no-click', 'overlay-processed') aren't necessary any more when #668104: Make overlay respect other click handlers gets committed.
Comment #185
Jody LynnIt sounds like webchick wants to get #668104: Make overlay respect other click handlers in before this one.
Also she committed #673252: Adjust a test in php.test for issue #87994 so we need to pull the change to php.test out of this patch.
Comment #186
RobLoachThe Overlay has dramatically slowed the progress on this. The issue was RTBC during the summer and was postponed due to it. Is there anywhere else we could apply this instead so we can at least get some seeable core jQuery UI elements into one of the required Drupal modules?
jQuery UI Tabs on the Filter Tips page?
Comment #187
markus_petrux CreditAttribution: markus_petrux commentedOff topic under the context of D7, I know. But maybe someone landing here could be interested in this kind of things for D6. Here's Filter Tips (and other usability enhancements for D6) with the help of the Modal Frame API:
http://drupal.org/project/modalframe_contrib
Comment #188
casey CreditAttribution: casey commented#668104: Make overlay respect other click handlers has landed.
Comment #190
aspilicious CreditAttribution: aspilicious commentedI retested this because i think its gonna fail
And it needs a lil tweak as the overlay click handler is fixed now
Comment #192
mrfelton CreditAttribution: mrfelton commentedI think the initial width of the dialog is too small since most of the filter tips contain tables with fairly wide content. See screenshot.
Comment #193
aspilicious CreditAttribution: aspilicious commentedPushing this again, cause i think this can be fixed before alpha and need to be fixed.. (before or fast after alpha)
Comment #194
RobLoachThank you to jacine for the .js-show class that solved an issue that was popping with when the filter tips dialog was in the overlay.
@mrfelton:
Increased it to 600, which helped it a bit. We'll be re-theming the filters page after this one, so hopefully that will make it a bit thinner.
@markus_petrux:
The Modal Frame API is a great module. This is doing a bit more then just providing one modal box though. It gives us an API that allows calling any jQuery method on elements from PHP through #attached ui and drupal_add_ui(). This small filter tips dialog is just one application of it. We could use #attached ui to apply tabs to filter tips page, for example, without having to put together an additional JavaScript file.
Comment #195
RobLoachThe .js-show class needed display: static.
Comment #196
scroogie CreditAttribution: scroogie commentedsubscribing.
Comment #197
moshe weitzman CreditAttribution: moshe weitzman commentedreviews anyone? this is marked critical.
Comment #198
casey CreditAttribution: casey commentedThis needs an ID. Maybe we should make 'selector' optional and when not provided ensure that element has an ID and use that ID as selector.
Same here. Can't use ID of element however. "$element_id . ' .filter-tips-help-link'" should do however.
Not part of this issue?
Powered by Dreditor.
Comment #200
Everett Zufelt CreditAttribution: Everett Zufelt commentedHas this modal dialog had an accessibility review?
Comment #201
RobLoachThanks for giving it a look, Casey. I addressed your concerns here. Also noticed that we could use a #theme property call for one of the elements.
Regarding the test, Jody outlined why we need that change at #104:
Comment #202
Everett Zufelt CreditAttribution: Everett Zufelt commentedI would be happy to give a brief accessibility review of this patch if someone can point me to a place where I can test it out. I can install head / the patch myself, but would strongly prefer not to.
Clearly everyone would prefer not to install and patch head themself, but with the limited time I have to contribute, and with the limited number of individuals involved in the community with accessibility skills I find this to be the best use of available resources for ensuring that d7 is as accessible as possible.
Comment #203
mfer CreditAttribution: mfer commentedThis would be pretty cool if it actually worked. On a fresh checkout of head + #201 I didn't get any usable tips.
See...
http://img.skitch.com/20100202-funp9wjc9a7nf7knw7s8rx3gu.jpg
http://img.skitch.com/20100202-k53ckwrgiyijsdfx1m8krr4k9i.jpg
The other burning question I have is, since we are replicating jQuery UI type functionality in PHP... what happens when a module updates jQuery / UI to newer versions that have API changes? How does altering drupal work there?
Comment #204
RobLoachHmmm, Matt, are you using an old patch? The reason this happens is because the content is set to display:none. But then when the dialog hits it, it should be show()-ing it. I don't get those results on Chrome, Firefox or IE.
Comment #205
RobLoachIt seemed that for some reason, WebKit was thinking that .ui-helper-hidden was taking priority, even though it shouldn't. In this patch, we use a .js-show class (now alongside .js-hide) that will show the element only when JavaScript is enabled.
Comment #206
mfer CreditAttribution: mfer commentedWhile I am not entirely sure about the ickiness of a pop-up inside an overlay it does work now.
http://img.skitch.com/20100202-bthp657t4pg2r8rquqdtc26wnb.jpg
There is an issue with having a horizontal scrollbar. The vertical one I understand but we shouldn't have the horizontal one.
Here is a more detailed review....
What is a jQuery action? Reading through I understand what it does. But, where does this name come from? Is it another drupalism?
drupal_add_library makes sure a library has not already been added. Why are we adding a check here as well?
doesn't should be does not.
isn't should be is not. Not sure how that conjunction got in there in the first place.
isn't should be is not.
Powered by Dreditor.
Comment #207
RobLoachChanged the width of the dialog so that the horizontal bar doesn't show up.
Comment #208
mgiffordsubscribe.
Comment #209
RobLoachIt would be great to do some more work on the code comments. Mfer is right in "action" being the wrong word.
Comment #210
casey CreditAttribution: casey commentedDecorator? Or just function?
Comment #211
Everett Zufelt CreditAttribution: Everett Zufelt commentedtagging
Comment #212
mcrittenden CreditAttribution: mcrittenden commentedFixing tag spelling.
Comment #213
Everett Zufelt CreditAttribution: Everett Zufelt commentedI took a quick look at the filter tips dialog with four different screen-readers: JAWS 10 and Firefox 3.6, JAWS 6 and IE6, NVDA 0.6p2 and Firefox 3.6, and VoiceOver (Leopard) and Safari 4.
The dialog is using ARIA (Accessible Rich Internet Applications) markup which does improve accessibility for those user agents and assistive technologies that properly implement the draft W3C recommendation. Note that this is a draft recommendation and although pages will still validate (as the ARIA markup is injected with JS) it does theoretically break the validity of the DOM.
JAWS10: When activating the "More Information" link the screen-reader moves to the top of the dialog and begins reading. The user must then move back to the top of the dialog (if they realize that they are in a dialog) to close the dialog. This leaves the user at the bottom of the Add Content page. I can imagine users hitting the back button here because they do not realize that the content is in a modal JS dialog.
JAWS 6: Nothing appears to happen. If the user moves down to the Powered by Drupal footer of the page they can find the content. Nothing directs the user to look here and they may anticipate that the link has not functioned correctly. I believe that this behaviour will be present in JAWS versions up to JAWS 8 or possibly JAWS 9.
NVDA: The user is taken to the first link in the dialog. Same issues as in 1. above with JAWS 10.
VoiceOver: Same as NVDA.
** Note: this was a very fast preliminary assessment of the patch from the perspective of only one user, only testing with screen-reader technology, with no structured QA methodology, and does not constitute a thorough accessibility review.
I would suggest that this functionality would be at best confusing to most screen-reader users and would, depending on where the functionality is implemented, substantively break some functionality on the site.
Comment #214
mfer CreditAttribution: mfer commented@Everett Zufelt thanks for the feedback. This is great feedback that we need more of.
Comment #215
TwoDHow about calling actions 'interactions', 'widgets' or 'effects' instead, as that's what's seen in the jQuery UI demos? Or maybe just "[jQuery] methods" as all this is done to 'call', or at least queue a call to, some method on a jQuery object?
I just tested the patch in #209 and I like it!
My english is not perfect, but:
and
and
s/binded/bound/ ?
"... Selected handlers can be bound to events (like click) or be executed once the element is ready." ?
A few side notes:
When testing this I had a pretty high CPU load (mostly due to other things) and I got a pretty annoying 'trail/tear' effect when moving the dialog. I happened to catch one of the more extreme ones in a screenshot. The trail/tear is not what I'm most concerned about tho (don't think it can be avoided), if you look at the top of the same screenshot, you'll notice I've got CKEditor loaded as well, and as soon as the dialog is over it's iframe and lags behind even a pixel, it stops dead until the cursor is outside the frame again. This also applies to resizing. The problem also exists in the jQuery UI demos if you inject an iframe there, so I'm not asking for a fix here. I'll just inform those who care that temporarily putting a div over any iframe will keep the mouse events inside the document and allow for normal dialog functionality.
The resize handle itself obscures and blocks the scroll-down button on the scrollbar, which also happens in the official demos. I guess that's a task for those jQuery UI theming issues mentioned above.
I know nothing about screen readers, so I'm afraid I can't help test that. :/ But the rest looks great to me!
Powered by Dreditor.
Comment #216
RobLoachSwitched to TwoD's suggestion of "effect". This gives us drupal_add_effect(), which does reflect what the function does. Also touched up the documentation a bunch.
Comment #218
Everett Zufelt CreditAttribution: Everett Zufelt commentedRelated issue about accessibility of jQuery UI modal dialog used in overlay #716612: Overlay is not accessible to screen reader users. At this time modal dialogs are impossible to implement for at least the following screen-readers (JAWS, VoiceOver, NVDA). Dialogs can be implemented, modality is not possible to control.
Comment #219
RobLoachI give up.
Comment #220
catchIt's a shame that the overlay blocked this /actual/ usability improvement getting fixed while making the original bug worse with #655388: Many ways to lose data on form input in the overlay.
Comment #221
David_Rothstein CreditAttribution: David_Rothstein commentedRob Loach: No way, you're not allowed to :)
This patch was essentially RTBC six months ago and held up for the overlay, which at the time was still three months from being committed. That's just plain wrong.
Surely, somewhere among the 15 patches above that were marked RTBC above, there is something committable here?
@catch: This is a feature/task, not a bug. The bug you're thinking of is #153313: ckeditor input is lost when using the browser's back button, I think.
Comment #222
catch@David, no, this is very different from clicking random other links on the screen, or even closing the overlay, because the filter tips are embedded help text in the form itself linked directly to the process of content creation, so you fully expect not to be messed with when clicking on them. At Baltimore usability testing, someone clicked one of the links, lost all their form data, then said "I'll never click a help link again". IMO the expectations are very different from clicking on a menu item, home icon or wherever else which might take you away from the node from. If you can't complete your form without clicking on a help link, then a warning that you might lose context by visiting the help page does you absolutely no good whatsoever.
In other words this is a special kind of WTF, which even if we don't fix the overall form data loss elsewhere ought to be fixed here, and an (albeit huge) hovertip or modal popup for help text makes sense here, whereas a warning dialog or disabling clicking links, or any of the other suggestions in other issues, would make no sense at all.
Comment #223
EvanDonovan CreditAttribution: EvanDonovan commentedI haven't done any reviewing on this issue, but I have followed it very closely because this is one of the biggest "small" usability improvements that I think could be made in Drupal 7.x. I am sorry that the scope of it crept to include an entire jQuery UI API - I was just hoping for a popup window... I think David_Rothstein is right at #221 - I am very busy right now, but I might be able to give a layman's usability review sometime this week, if I know which patch to apply to the latest D7 alpha.
Comment #224
casey CreditAttribution: casey commentedSo... what needs to be done here? To me it looks like we're stuffing all kind of other issues into this one, making this one unfixable.
At least overlay doesn't block anything of this patch any more (#668104: Make overlay respect other click handlers)
Comment #225
Everett Zufelt CreditAttribution: Everett Zufelt commentedRegarding modal dialogs and accessibility for screen-reader users. I have written a blog article Can a modal dialog be made to work properly for screen-reader users on the web?. The short answer is kind of, but not really. I would have posted the entire article here, but it is a lttle to long for that. It explains the objective problem, as well as the subjective experience.
Comment #226
EvanDonovan CreditAttribution: EvanDonovan commentedWould it be sufficient simply to make the filter tips show up in a new window or tab by setting the link to have target="_blank"?
I think that would address the problem of "I just lost my work by clicking a help link."
Comment #227
bleen CreditAttribution: bleen commentedsadly (and inexplicably) target="_blank" is not XHTML compliant
Comment #228
EvanDonovan CreditAttribution: EvanDonovan commentedI had no idea. Huge bummer :(
Another reason, imo, that XHTML should not be the goal in D8. HTML5 FTW!
Comment #229
EvanDonovan CreditAttribution: EvanDonovan commentedGuess I'll have to create the "Filter tips in target blank" contrib module then...
Comment #230
David_Rothstein CreditAttribution: David_Rothstein commentedWell, we already use target="_blank" several places in core, so I doubt adding it one more place would be a disaster...
Comment #231
sunGuys, can we stop derailing this issue, please? This patch was RTBC a couple of times over the past months already, but always deferred due to unrelated bugs elsewhere.
What we need is a final re-roll and final review to get this sucker done.
Comment #232
Jody LynnI am rerolling.
Comment #233
David_Rothstein CreditAttribution: David_Rothstein commentedWell, has anyone addressed Everett's comments above? I assume that's the main remaining blocker, and it seems to be a big one.
Comment #234
RobLoachIt would be very nice to have this in, but I'm not really confident it's where it should be. There are some things it does right, and some things it does wrong. Although it's really powerful and gives us a lot of JavaScript power from the PHP side, I think we need to just think about what it really should be. Maybe strip it down a bit? Not sure. A reroll would help us understand what's missing.
Haha :-).... Yeah, the good thing about all this stuff is that it can be "fixed" in contrib.
I haven't seen a patch update or any code to help fix this for screen readers. I'd love to get the accessibility in, but just haven't seen a viable solution yet, and this is part of the reason why I gave up on it a while ago.
Comment #235
Jody LynnWell, here's a re-roll to look at.
This post may have some help about jquery ui dialog accessibility: http://www.geedew.com/2010/02/25/jquery-ui-dialog-accessibility/
Comment #237
gordon CreditAttribution: gordon commentedrolled.
Comment #238
sunRe-rolled against HEAD and cleaned up.
Comment #239
Everett Zufelt CreditAttribution: Everett Zufelt commented@Jody Lynn
Took a look at the post, I didn't know about this accessibility problem. Unfortunately it doesn't address the problems that modal dialogs can cause for screen-reader users.
Comment #241
gordon CreditAttribution: gordon commentedInvestigating the current problem is that the #filter-guidelines-n where n is the filter id, which breaks unique id's when there is multiple textareas on the page.
Comment #242
gordon CreditAttribution: gordon commentedI have fixed up all the ids so that they will be unique.
Comment #243
gordon CreditAttribution: gordon commentedComment #244
DevElCuy CreditAttribution: DevElCuy commentedPerhaps focusing on #716612: Overlay is not accessible to screen reader users would be more effective, that one is a big critical issue!
Comment #245
Dries CreditAttribution: Dries commentedThis is not a regression from Drupal 6 -- this should not hold up a release. Changing priority to 'normal'.
Comment #246
AdrianB CreditAttribution: AdrianB commentedSubscribing.
Comment #247
RobLoachHmmm, although drupal_add_action is pretty cool, I think #647228: Links are needlessly unable to fully participate in D7 AJAX framework features might be a better way to do it.
Comment #248
RobLoachDrupal 7 is feature frozen and I believe #647228: Links are needlessly unable to fully participate in D7 AJAX framework features is a better route to get this kind of thing into contrib.
Comment #251
ksenzeeThere's a contrib stopgap solution at http://drupal.org/project/filter_tips_dialog that uses Dialog API. It would be nice to focus some accessibility efforts on Dialog API in the Drupal 7 cycle so we can make it accessible enough for Drupal 8 core.
Comment #252
EvanDonovan CreditAttribution: EvanDonovan commentedksenzee: So the plan would be to get something like http://drupal.org/project/dialog, or a stripped-down version of it, into D8, so that this super-long-standing issue could be resolved by depending on it?
Comment #253
ksenzeeI think so. Basically we need a way of saying "this link should pop up in a simple jQuery UI dialog." People thought Overlay was going to serve that function, but it really doesn't. Dialog API does. And honestly, if we never use dialogs in core for anything more than this one issue, it's still a good enough reason to have them.
Comment #254
David_Rothstein CreditAttribution: David_Rothstein commentedThe current patch in this issue is more generic than Dialog API (it allows you to do any jQuery effect, not just dialogs, as I recall)... Probably worth continuing with that, unless there is a specific reason not to?
Regarding accessibility, my understanding from above is that it's an issue with jQuery UI and current screen reader technology itself... is that still correct? If so, I am not sure how we fix it in Drupal. It sounded like one option was to give up on making the dialog modal.
Comment #255
RobLoachTwo discussions going on here:
Comment #256
David_Rothstein CreditAttribution: David_Rothstein commentedIt's out of scope technically, but it's absolutely a blocker for this issue. Turning off JavaScript is not a reasonable solution.
Also, some of the things that were done to work around the accessibility issue for the overlay are unfortunately probably less of an option here (since the filter tips are not typically an admin-only feature like the overlay is).
Comment #257
RobLoachTruth... Everett talked with the team at Screen-readers and UI modal dialog, but I'm not sure how that translates into how it's used on the Drupal side. Maybe with JavaScript on load, we inject the user-agent into a body class and don't apply the model dialog if it's a screen reader application class? I'm not sure how to deal with this... Some direction would be great.
Comment #258
ksenzeeUnfortunately you can't detect screenreaders - the user agent is the same with or without a screenreader turned on. If you could, it would have saved literally weeks of developer time on overlay.
Maybe we have to leave the popup dialog in contrib until jQuery UI fixes its accessibility problems, and for core move the filter tips into an expandable div or something.
Comment #259
RobLoachI'd love to fix this in jQuery UI itself, but I just don't understand what the underlaying issue is, or where to begin to fix it. If someone provides a technical explanation of what is required in order to get around it, then I'd be more then happy to spend a weekend fixing this in jQuery UI itself.
One of my friends is legally blind, and has the colours on his monitor turned on high contract with an extremely low resolution so he pretty much just sees black and white colour differences. I showed him the jQuery UI Dialog default form, and he said he didn't have any troubles with it. Seriously, if someone please points me in the right direction, and a way to test things, that would be great. jQuery UI isn't going to fix the accessibility problems unless we go in and fix it for them.
Reading Everett's comment at #890288: Improve Overlay accessibility by using modal dialogs, if we set role=dialog, would that help? Assuming that's what was done for the Overlay? I'm seriously at a loss. Everett, could you provide some documentation or anything? This is why I gave up on this issue last year.
Comment #260
EvanDonovan CreditAttribution: EvanDonovan commentedSeems reasonable to me, unless you have a ton of filters enabled (which is probably a bad practice anyway).
I think the direction this issue went in before was probably scope creep, and should probably take place in a separate issue.
Comment #261
mgiffordThere are some nice, accessibile solutions posted here that are worth looking at http://hanshillen.github.com/aegisdemo/
All with Accessible jQuery-ui Components.
Comment #262
Everett Zufelt CreditAttribution: Everett Zufelt commentedIt is still incredibly difficult to create a modal dialog that doesn't cause problems for screen-readers.
In short the following is required, but still causes problems for some modern screen-readers, and for the many users that are using older technology.
1. When the link to activate the dialog is activated create the dialog and move focus to the first focusable element.
2. The dialog container should have role="dialog"
3. the next inner container should have role="document"
4. the control to close the dialog needs to be at the top of the DOM of tat inner container.
5. When the dialog is closed, or dismissed, the focus needs to return to the activating control.
6. use aria-label on the container with the role="dialog" to give a name to the dialog. If the name of the dialog is visible you can use aria-labelledby instead to point to the id of the element containing the name of the dialog.
Comment #263
David_Rothstein CreditAttribution: David_Rothstein commentedHm... Taking a step back here, are we sure we want the filter tips dialog to be modal in the first place?
Modal dialogs are useful for cases where there is a defined interaction to complete (e.g., clicking an "OK" button) but the filter tips are basically help text, and people might reasonably want to refer back and forth to them while adding content to the site. In that case, it seems like a non-modal dialog might be better.
I'm not sure if using a non-modal dialog would help with the accessibility issue or not, but I thought I remembered Everett suggesting somewhere that non-modal dialogs have fewer accessibility issues than modal ones?
Comment #264
Everett Zufelt CreditAttribution: Everett Zufelt commentedAt the very least, the advantage of a non-modal dialog is that there is no need to attempt to sandbox users within the dialog. If we go with a modeless dialog it should be inserted into the dom as a direct sibling to the link which is used to activate it.
Comment #265
EvanDonovan CreditAttribution: EvanDonovan commentedEverett & David: What about ksenzee's alternative suggestion in #258? Would an expandable div have the same accessibility problems?
Seems to me that would be a simpler way to lay this issue to rest than #242, etc.
Comment #266
Everett Zufelt CreditAttribution: Everett Zufelt commented@Evan
The expandable fieldsets in core have no accessibilty problems at this time. This is likely the best structure to use if not a modless dialog, as it is reusable and tested.
Comment #267
RobLoachThe later versions of jQuery UI add in the aria- and role attributes. If we get those updated, we'll be able to make use of the accessibility fixes: #1085590: Update to jQuery UI 1.9.
If it's missing something missing from Everett's summary, then it's something that we could work with the jQuery UI team to add in. Thanks for the details on this, Everett. Having solid direction on this really helps.
Comment #268
TwoDI was just about to say what I see David_Rothstein already did. Why use a modal dialog? This seems to have been an assumption from way back that never had any pros/cons listed.
I don't know much about screen readers so sorry if I missed an important point here, but most replies mentioning them seem to only show how tough it is for them to process modals. The recent discussion following #263 seems to indicate there's no real requirement for the dialog to be modal, and I would personally really dislike being forced to repeatedly open/close it just to see what I can or can't do in a field while editing. If using a popup at all, I think I'd even prefer an "old school" new window so I can move it to my second monitor. Much like I do with the advanced help popup when working with Views etc...
If we follow KISS, the latest replies seem to be pretty solid arguments for using expandable divs, right?
Comment #269
RobLoachIs there an initiative to get more Advanced Help-esque stuff in core?
Comment #270
EvanDonovan CreditAttribution: EvanDonovan commented@Rob: I remember that was happening about mid-way through D7, but stalled due, I think, to debates about a filter format for the internal links. I am not sure if work has been restarted.
Comment #271
David_Rothstein CreditAttribution: David_Rothstein commentedThis issue was encountered by one participant during UMN Usability testing, in a big way. (We have a great video of it somewhere.) It would be lovely to get it fixed :) (Actually, #655388: Many ways to lose data on form input in the overlay is what we really need to fix, but this would help tons too.)
I'm also unpostponing this because it sounds like we haven't settled on using a modal dialog, so the accessibility fixes in jQuery 1.6 might not wind up being relevant for this issue.
Comment #272
asb CreditAttribution: asb commentedWow, living since 4.7.3 and still not buried. Subscribing.
Comment #273
David_Rothstein CreditAttribution: David_Rothstein commentedRelated issue to watch: #1175830: Update to jQuery UI 1.10.2
Comment #274
geerlingguy CreditAttribution: geerlingguy commented#263 / David_Rothstein:
#258 / ksenzee:
I'm completely for an expandable div, or something along those lines. There's no reason, in my mind, to perform an entire page load to look at some formatting tips/guidelines.
I just had a user (sitting in front of me) spend about 5 minutes typing up a node, then click that link. I had no idea it wasn't a
target="_blank"
, and was surprised (as was the user, even more so) that all his diligent data entry had been promptly wiped out. This is a major DrupalWTF—not for developers like you and I (because we don't ever click that link anyways), but for content editors and end-users—and I think we should get this fixed.I could care less about using
target="_blank"
, as that (a) fixes the problem, and (b) works in every browser in existence, back to something like Netscape Navigator 2.0, XHTML strict standards be damned. It puzzles me as to why the W3C chose to deprecate that attribute, because there really is no other way to accomplish the same thing consistently and accessibly.I'll be implementing the following in my theme's template.php file to fix this for my sites (for now):
But, as I have discovered in reading through this issue, it looks like we won't be doing that; so, instead, I vote for a hidden div that simply expands to show filter tips; there's precedent for that all over drupal's admin interfaces, and it sounds a hundred times more accessible and user-friendly than overlays or modal dialogs...
Comment #275
quicksketchDon't worry, it's back again now in HTML 5. http://www.w3.org/TR/html5-diff/#changed-attributes :)
Comment #276
geerlingguy CreditAttribution: geerlingguy commentedAh, didn't see that. So... if Drupal 8 is going to be HTML5 ready, then why not just add
target="_blank"
and be done with this?Reading around some other places, too, it seems most people are scrapping JS-based solutions to open things in new windows or popups and switching back to
target="_blank"
. I can see some value to using a modal or a slide-open div, but if that's never going to happen due to bikeshedding...Comment #277
EvanDonovan CreditAttribution: EvanDonovan commentedHmm...in light of the last 3 comments, why don't we just add target="_blank" for D8 and finally be done with this? I think this whole issue got sidetracked when it became a way for people to get a modal dialog framework into Drupal. It was really initially about fixing a simple usability problem. Right now, I always have to CTRL+click on the filter tips link because I know it would make me lose my work.
Of course, if we had one of those "You have entered text on this page" dialogs that came up when you were going to another page, it wouldn't be as much of a problem, but that is a separate issue.
Comment #278
RobLoachIf we can use
target="_blank"
, can we get some Advanced Help-esque stuff in for this?Let's not rush it ;-) .
Comment #279
ksenzee#15: filter-tips.patch queued for re-testing.
Comment #280
ksenzeeChanging the title to reflect that this isn't necessarily about a modal popup anymore. I agree we ought to just add _blank in there to stop the bleeding. That would be the patch at... wait for it... #15.
Comment #281
aspilicious CreditAttribution: aspilicious commentedLets get this in. I don't need any credit for this, just a reroll of #15.
Comment #282
RobLoachInstead of just having a lazy popup window, let's make it at least somewhat sane with jQuery.PopUpWindow() or a related plugin. Having a huge window pop up makes me want to throw up.
Comment #283
quicksketchAlso, as most people didn't notice (and I sure as hell wasn't going to bring it up after what happened in this issue), I pushed through a target="_blank" into core already as part of the file.module (even on the node form), but it's not in the HTML code (it's added by JS). If you upload a file and then click on the file name link, it opens in a new window. The same code also binds a nicely sized window to those links using window.open(). Let's not try to make a generic "window-opening solution" here though, it's literally a total of 2 lines to open the window and add the target.
Comment #284
EvanDonovan CreditAttribution: EvanDonovan commentedOn technical review, the patch looks good :) Untested though, so still at needs review.
Comment #285
quicksketchHere's an implementation that matches the File module. I couldn't find any way to make the contents of the popup look respectable (i.e. removing the blocks and header) without significant rearchitecturing. From my attempt, it'd look like we'd need to create a new delivery callback function for delivering popups. Let's just say, that would be another crazy rabbit hole. This patch matches the way we add a popup for File module and makes a nicely sized window. It's a good place to start.
Comment #286
lock2007 CreditAttribution: lock2007 commented#285: filter_popup.patch queued for re-testing.
Comment #287
mrfelton CreditAttribution: mrfelton commentedI just tried out the patch in #285. It works, but the end result is pretty rough. The content of the popup is supposed to be help text, and should be limited to help text only. Appart from looking terrible aesthetically, presenting the user with an entire webpage with menus, blocks and everything else is pretty darn confusing as your also giving them a hundred other links that they could potentially click on and navigate away from the help text. I clicked the link to read the help text and the help text alone.
Comment #288
Fidelix CreditAttribution: Fidelix commentedI have to agree with mrfelton.
I'm not sure which would be the best approach to implement this, but showing a simple popup with the help the user wanted would definitely work best.
Maybe we can just have a menu callback for filter help that doesn't render anything but $content, or even better, $content['tips']?
Comment #289
EvanDonovan CreditAttribution: EvanDonovan commentedIf only the filter tips should be rendered, then you could just have a menu callback that uses print, instead of return.
Comment #290
dqdAfter reading each single post thru' the whole issue starting from top with comments and patches from ... years ago, I would like to inject a thought impetus here. But let me start with "what is up now" ...
1.) We have 3,4,5 (?) developers, who've spend a lot of work to bring us this awesome contribution of UI.dialog functionality at short hand by providing several versions of a patch, which was close before going into core. So close, that it hurts to scroll back in the issue and see how it has stopped so nearby before happening. Even if this particular use-case here has its own obstacles making hesitant to vote for this, it is still an improvement of admin experience. Thanks to TwoD, Jody Lynn, RobLoach, sun, gordon and many more for that very promising drupal_add_effect() "dream", which hopefully comes true, one way or another.
2.) And we still have this sticky years old bête noire with its back n' forth's making developers like RobLoach getting dissatisfied after spending so much time into a growing patch. All the concerns which may have or may have not caused this break indirectly, were needed, entitled and helpful. And I think I speak for respected core maintainers that purging overrides stuffing. But the concerns were equipped with wrong conclusions and has leaded to making a subjacent conceptional mistake beforehand by constraining consensus at the wrong place. What leads me to point 3:
3.) The pro's and con's here can not and never will lead to a final decision which meets all of your views in questions of accessibility or design. - Why? - Because it is an attempt doomed to failure trying to crave for a coherent decision, which has to be made rather by website builders and themers who use these tools afterwards, than on this table here which is about to deliver the options for that. That's why it got bogged down. A frameworks core should deliver "options" (or points of intersection to add these "options"), but not final "decisions", which would lead to another contrary motion then in the contrib to satisfy the other half of evangelists. It should rather left up to website builders and themers, regarding which clientele to target and what decision has to be made therefore. And they should bear the responsibility for their decisions made in questions of design and accessibility, not you as core contributor. That's their job. I am not offending here and I don't want to sound smart-alecky. But this comes from experience of working with developers for over a decade. I am a project lead over hear in Germany, not a developer at all. And I have more respect for what developers do in the deep of the bits than for what I do on top of it, actually, but ...
Round-up - Lets break it down: The issue is finally assessed as such not because of the first vexation from data loss after pressing the filter tips link allone, rather because of the adding fact, that there were NO option at all to change that after finding out. But it is only a small little corner of the whole Drupal core universe and it shoud not become such a big thing and should has been solved already by having all this lil' options discussed here in core. What finally means: What's wrong with having (1.) the jQuery.popupWindow() option mentioned by Rob Loach available, (2.) the awesome (my favourite) drupal_add_effect() option available, and (3.) the collapsing fieldset option available, all exchangeable in the site configuration? Or - for my sake - in the theme options or at minimum available as insertable handler, maybe with a arguable default setting? As if I understood correctly target _blank was a no-go from webchick, that'S why I left it out here. We may can group all that options into one so called "internal link handler", available for many use-cases. That would finally honor, value and factor in all the work, which has been done already in this issue queue. Delivering possibilities to choose from, would finally satisfy all parties, would emphasize the scalability of Drupal again, and would leave enough space for decisions of web administrators, depending on how the jQuery UI.dialog is shaping and improving accessibility in the next time.
Comment #291
dqdI split that part here (my big comment above looks too frightening) and I add the issue links here:
I've spoken with sun, RobLoach, catch and webchick on IRC #drupal-contribute and - if I'm not mistaken - there was a accordance to, that we actually need at least 3 issues:
(a) the one here which already exists to approve that we can access the handlers
(b) another one to extract that drupal_add_effect() handler code and the others into an own issue. LInk to that issue is here #1404712: drupal_add_effect() to use basic jQuery UI effects from PHP (without JS)
(c) and a third one for jQuery UI version 1.9 and higher to make sure that we can use all improvements from jQuery's next big releases ... Issue already exists here -> #1085590: Update to jQuery UI 1.9
Comment #292
xjmTagging.
Comment #293
webchickThis has been consistently found in every UX study we've ever done. Escalating to Major.
Comment #294
xjmAlso, not that this issue needs another tag, but this monster could really use a concise-yet-thorough summary that explains what approaches have been tried, what issues were found with them, what the current status is, etc.
Comment #295
jenlamptonWe saw this in the 2012 Google Usability study too, along with #1440662: UX regression: Prevent links in node preview from being clicked
Comment #296
jenlamptonaaaand removing the other tag for the same thing :) but here's a fun video of watching someone loose their content, if you'd like to experience some #facepalm
Comment #297
JacineCan we please just add the
target="_blank"
to the anchor and call it a day? Yeah... that means re-roll patch in #15.I'd really rather not see an JavaScript for this. It's not like we are popping up a small window with focused content, and the code would be useless on mobile devices. Yeah, it's not 100% ideal, but let's not pretend that the code for this module is so great anyway. it would fix the bug, and let this issue RIP already. Also, if a themer removes/changes the wrapper markup here, it would still work, and it would be easy to override the traditional way.
Also, it's valid in HTML5: http://www.w3.org/TR/html5/browsers.html#valid-browsing-context-name-or-...
Comment #298
webchickI actually would be totally fine with that, even in XHTML-land (D7). Resolving this pain is worth a small W3C warning, esp. given it's a legacy thing that's resolved in HTML5.
After, if we wanted to, we could always file a non-major follow-up to switch from target="_blank" to an approach along the lines of quicksketch's that simply rendered the content area rather than the entire page in the modal. I'd rather deal with that at #1175830: Update to jQuery UI 1.10.2 though.
Comment #299
sunNo tests required.
Comment #300
JacineGreat! #299 looks good to me. :) Happy comment #300.
Comment #301
ksenzeeYes please. Confirmed it works.
Comment #302
dqdksenzee++ for doing it ;)
I can confirm, patch works
Comment #303
geerlingguy CreditAttribution: geerlingguy commentedAnother RTBC here, for goodness' sake!
Comment #304
webchickOk! :)
Committed and pushed to 8.x and 7.x. YAY. And sorry for being a purist back in July 2009. :\
Comment #305
jide CreditAttribution: jide commentedWow ! Funny to see it was addressed in #15 back in july 2009 :) Maybe there is something we should learn from this.
Comment #306
amateescu CreditAttribution: amateescu commentedDon't you just love core development? :)
Comment #307
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedI never thought my old geek heart could experience this feeling of joy again. Great work on the managing/persuading!
Comment #308
NWwaterboy CreditAttribution: NWwaterboy commentedlol .. just realized this thread started in 2006 . Wonder what the record is for longest running thread successfully completed.
Comment #309
catchThat's http://drupal.org/node/8.
Comment #310
dwwYeah, although the oldest still open and legitimate bug is #2946: Login fails and no warning is issued if cookies are not enabled. Oddly, I *just* replied there earlier today to try to move it along...
Comment #312
webchickx
Comment #313
cweagansFixing tags per http://drupal.org/node/1517250