Mailing List Archive

category auto-completion
I'm really not impressed with this scriptaculous
auto-completion for the categories. It doesn't work
intuitively in many cases. When I hold down the down arrow,
I'd expect it to continue advancing down the items
of the list, but instead I have to hit the down arrow
over and over. When I hit Page Down, I'd expect the list
to scroll by a "page" of items, but it just sits there.
When the completion list is open and I hit the up arrow,
the page (note: in firefox) weirdly jumps up; then I hit
the down arrow again, and it jumps down.
Is there anything better?

I also noticed this in comp/media/js/lib.js :

Object.extend(Ajax.Autocompleter.prototype, {
onKeyPress: function(event) {
var originallyActive = this.active;
this._onKeyPress(event);

// Catch <enter> keypresses
if (event.keyCode == 13) {

// Workaround for a bug in for Safari 2.0.3. Already fixed in WebKit
as of 2006-06-29.
// This makes the selection go to the end.
if(navigator.appVersion.indexOf('AppleWebKit') < 3 ) {
var element = Event.element(event);
element.setSelectionRange(element.value.length,
element.value.length);
return false;
}

// Don't submit the form when you click enter!
Event.stop(event);

if (!originallyActive && this.options.onEnter) {
this.options.onEnter(this.element);
}

return false;
}

return true;
},


I think that can be replaced by passing { tokens: ['\n'] }
to new Ajax.Autocompleter. (?)
Re: category auto-completion [ In reply to ]
On Mar 25, 2009, at 8:39 AM, Scott Lanning wrote:

> I'm really not impressed with this scriptaculous
> auto-completion for the categories. It doesn't work
> intuitively in many cases. When I hold down the down arrow,
> I'd expect it to continue advancing down the items
> of the list, but instead I have to hit the down arrow
> over and over. When I hit Page Down, I'd expect the list
> to scroll by a "page" of items, but it just sits there.
> When the completion list is open and I hit the up arrow,
> the page (note: in firefox) weirdly jumps up; then I hit
> the down arrow again, and it jumps down.
> Is there anything better?

Dunno. Have you looked around at all?

> I think that can be replaced by passing { tokens: ['\n'] }
> to new Ajax.Autocompleter. (?)

Have you tried that and tested it with Safari and others? If so,
please do commit it!

Best,

David
Re: category auto-completion [ In reply to ]
On Wed, 25 Mar 2009, David E. Wheeler wrote:
> On Mar 25, 2009, at 8:39 AM, Scott Lanning wrote:
>> I'm really not impressed with this scriptaculous
>> auto-completion [...] Is there anything better?
>
> Dunno. Have you looked around at all?

Well, my email was part of looking. They all seem to suck
in some way. Google's is slightly better in that
it (slowly) advances when you hold down the down arrow.
The autocompletion of Firefox itself
(the list in the Location or Search boxes)
is what I have in mind, I guess.


>> I think that can be replaced by passing { tokens: ['\n'] }
>> to new Ajax.Autocompleter. (?)
>
> Have you tried that and tested it with Safari and others?

Well, no. Forget I said it.
Re: category auto-completion [ In reply to ]
On Wed, 25 Mar 2009, Scott Lanning wrote:
> I also noticed this in comp/media/js/lib.js :
>
> Object.extend(Ajax.Autocompleter.prototype, {
> onKeyPress: function(event) {
> var originallyActive = this.active;
> this._onKeyPress(event);
>
> // Catch <enter> keypresses
> if (event.keyCode == 13) {

Oh, question:
Where's this documented, onKeyPress
(and more directly, where do I find the code or whatever
for the down arrow and and Page Down; maybe I could
add a couple extensions like this to make it work better) ?
Re: category auto-completion [ In reply to ]
On Wed, 25 Mar 2009, Scott Lanning wrote:
> Oh, question:
> Where's this documented, onKeyPress

Sorry, nevermind, not thinking before I post today.
It's in comp/media/js/controls.js (scriptaculous controls code)
Re: category auto-completion [ In reply to ]
On Mar 25, 2009, at 11:54 AM, Scott Lanning wrote:

> On Wed, 25 Mar 2009, Scott Lanning wrote:
>> I also noticed this in comp/media/js/lib.js :
>>
>> Object.extend(Ajax.Autocompleter.prototype, {
>> onKeyPress: function(event) {
>> var originallyActive = this.active;
>> this._onKeyPress(event);
>>
>> // Catch <enter> keypresses
>> if (event.keyCode == 13) {
>
> Oh, question:
> Where's this documented, onKeyPress
> (and more directly, where do I find the code or whatever
> for the down arrow and and Page Down; maybe I could
> add a couple extensions like this to make it work better) ?

The googles.

-Matt
Re: category auto-completion [ In reply to ]
On Mar 25, 2009, at 8:39 AM, Scott Lanning wrote:

> I'm really not impressed with this scriptaculous
> auto-completion for the categories. It doesn't work
> intuitively in many cases.

We agree. I'm surprised we didn't actually file a bug/ehancement

> When I hold down the down arrow,
> I'd expect it to continue advancing down the items
> of the list, but instead I have to hit the down arrow
> over and over. When I hit Page Down, I'd expect the list
> to scroll by a "page" of items, but it just sits there.
> When the completion list is open and I hit the up arrow,
> the page (note: in firefox) weirdly jumps up; then I hit
> the down arrow again, and it jumps down.
> Is there anything better?

I wouldn't be surprised if the badness is not in Scriptaculous, but
rather in how we've implemented it.

> I also noticed this in comp/media/js/lib.js :
>
> Object.extend(Ajax.Autocompleter.prototype, {
> onKeyPress: function(event) {
> var originallyActive = this.active;
> this._onKeyPress(event);
>
> // Catch <enter> keypresses
> if (event.keyCode == 13) {
>
> // Workaround for a bug in for Safari 2.0.3. Already fixed
> in WebKit as of 2006-06-29.
> // This makes the selection go to the end.
> if(navigator.appVersion.indexOf('AppleWebKit') < 3 ) {
> var element = Event.element(event);
> element.setSelectionRange(element.value.length,
> element.value.length);
> return false;
> }
>
> // Don't submit the form when you click enter!
> Event.stop(event);
>
> if (!originallyActive && this.options.onEnter) {
> this.options.onEnter(this.element);
> }
>
> return false;
> }
>
> return true;
> },
>
>
> I think that can be replaced by passing { tokens: ['\n'] }
> to new Ajax.Autocompleter. (?)

I don't know, but I'd love to get rid of that code.

-Matt