Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Jun 2005 at 18:07 UTC
Updated:
5 Mar 2010 at 19:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Thox commentedUsing bold instead of underline is much more effective. See screenshot or my usual autocomplete demo page.
New patch attached.
Comment #2
Chris Johnson commentedVery nice feedback. On your demo page, I like the icon in the text field that indicates active "matching."
One small bug (it seems). Typing "c" alone gets me a list of matches, but the last (bottom) entry has a piece of javascript appended to it with a line through it.
Using Firefox 1.04 on Windows 2000.
Similar bug, but with several lines of javascript fragments in the match box, appears using MSIE 6 on Windows 2000.
Comment #3
Steven commented+1 on the idea, but wouldn't it be better to have the highlighting be done in a themable function on the server side?
For one thing, it makes it more flexible. But also, the displayed values can contain HTML, so there might be conflicts with HTML tags in there if you do a blind search and replace on the client-side. Think icons/thumbnails, Google Suggest-style popularity counts/indicators, etc.
If bloating the ajax data is a concern, then perhaps the default themable should use
<strong>instead of.Comment #4
Steven commented...instead of
<span class="match">.By the way Chris, the animated icon is called the throbber and it is part of core.
Comment #5
Thox commentedSteven, originally I used an underline, then I used bold. Is it right to use
<strong>if the style might be completely different?I'm hoping to get the server side to use even less bandwidth. In the future, I'd like to remove the drupal_implode_matches function and get the folksonomy field working based on client-side code. This would remove duplicate data on the vast majority of autocomplete callbacks.
A suggestion was made in #drupal that the delay should be adjustable (either at coding time or with a simple admin control). The other suggestion, which appeals more to me, is to get the javascript to run a timer and adjust the suggestions delay based on the response time of the requests.
Comment #6
dries commentedTypically, bandwidth isn't the problem. The problem is the fact we have to load the entire core to handle a single request. That is, CPU cycles is the problem, not bandwidth. Personally, I'm in favor of keeping the Javascript code simple.
Comment #7
killes@www.drop.org commentedok, the patch bingo oracle can be cryptic: Why did I get a patch that has both CSS and JS?
Anyway: Thox' second patch didn't apply anymore, I've rerolled it and attach it.
The discussion has strayed a bit from the original issue, but I think that a server based solution (eg a themable function) is to be preferred.
Comment #8
killes@www.drop.org commentedoops, part of the patch went mia. Seeting to "needs work" as i 'd really prefer a themable function.
Comment #9
Steven commentedYeah... the autocomplete separates displayed HTML from the autocomplete value, so you can just pass each match through a theme_autocomplete_highlight() or something which does a simple preg_replace by default.
Comment #10
Uwe Hermann commentedVery very nice feature. I rerolled both changes into one patch. Ready to be committed, if you ask me.
Comment #11
singularoLooks nice to me, lets commit it.
Comment #12
Steven commented-1 as this breaks HTML-formatted matches. Highlighting needs to happen on the server-side.
Comment #13
Jaza commented+1 to this feature. Moving to 6.x-dev queue.
Comment #14
slayerment commentedIs there a 5.0 patch?
Thanks!
Comment #15
Jaza commentedNo, there is no 5.0 patch. Please leave this in the 6.x-dev queue, as this is a new feature, and won't be going into the Drupal 5 branch.
Comment #16
Steven commentedNothing will happen to this patch unless someone changes it so the highlighting happens in the menu callback, not in the JavaScript. We cannot tell HTML from text in the JSON strings, and the server might want to do more advanced highlighting anyway.
Comment #17
Frando commentedtrying to fix markup.
Comment #18
Frando commentedSo,
here's a patch for drupal HEAD that introduces a new theme function theme_autocomplete_highlight. All core autocompletes are altered to use the highlight theme function (user select, tag select, profile field values and profile field groups).
Works great and is a valuable usability enhancment, IMO.
Comment #19
Steven commentedYou should use preg_quote to escape the check_plained input.
Comment #20
Frando commentedRight. Patch rerolled.
Comment #21
Steven commentedComment #22
panchoFeatures have been frozen for a long time now. I'd like to see this in D7 though!
Moving to theme system, as we decided to go for a server based solution.
Comment #23
Uwe Hermann commentedPatch doesn't apply anymore.
Comment #24
effulgentsia commented+1. Anyone up for re-rolling a patch? @Dries: can it still make it into D7?