Modify

Opened 3 years ago

Last modified 11 months ago

#9599 new task

Switch to using jQuery UI 1.8.21

Reported by: rjollos Owned by: rjollos
Priority: normal Component: AutocompleteUsersPlugin
Severity: normal Keywords:
Cc: hasienda, memartin, mitar, agil, jun66j5 Trac Release: 0.11

Description (last modified by rjollos)

Switch to using jQuery UI 1.8.21, which is currently used for the DateFieldPlugin and the KeywordSuggestPlugin.

Attachments (0)

Change History (25)

comment:1 Changed 3 years ago by rjollos

  • Description modified (diff)
  • Summary changed from Switch to using jQuery 1.7.3 to Switch to using jQuery UI 1.8.16

We'll have to use 1.8.16 since 1.7.3 doesn't have the Autocomplete widget.

comment:2 follow-up: Changed 3 years ago by rjollos

  • Cc hasienda added
  • Description modified (diff)

On my Trac 0.12.2 installation, I'm finding that the latest version of the KeywordSuggestPlugin (r11027) works fine with the latest version of the DateFieldPlugin (r11026), but I get an error when the AutocompleteUsersPlugin (r10974) is enabled. The error is found in the Error Console on FF8, and appears when editing the CC field. The keywords field just behaves as if the KeywordSuggestPlugin is disabled.

Error: $(this).data("autocomplete") is undefined
Source File: <Link removed>/ticket/640
Line: 82

The conflict appears to be because AutocompleteUsersPlugin is using an old version of jQuery autocomplete (1.0.2), while KeywordSuggestPlugin has been ported to using jQuery UI 1.8.16.

comment:3 Changed 2 years ago by rjollos

  • Cc memartin added

#10097 closed as a duplicated.

comment:4 in reply to: ↑ 2 Changed 2 years ago by rjollos

  • Cc mitar added

Replying to rjollos:

The conflict appears to be because AutocompleteUsersPlugin is using an old version of jQuery autocomplete

Which in fact has been deprecated in favor of jQuery UI 1.8 Autocomplete: http://docs.jquery.com/Plugins/Autocomplete.

comment:5 Changed 2 years ago by mitar

Yes. jQuery autocomplete works nicely othewise, been using it in some other project.

comment:6 Changed 2 years ago by rjollos

  • Description modified (diff)
  • Summary changed from Switch to using jQuery UI 1.8.16 to Switch to using jQuery UI 1.8.21

Latest stable is jQuery UI 1.8.21.

comment:7 Changed 19 months ago by agil

  • Cc agil added

Hi,

I have the same problem with Trac1.0.
Any sugestion or workaround to solve the problem?

Thanks!

comment:8 Changed 18 months ago by rjollos

Not as far as I'm aware, but I'm in the process of upgrading my Trac instance to 1.0, and may get this plugin upgraded along the way.

comment:9 follow-ups: Changed 17 months ago by mwehr

Hi,

I've migrated the plugin to work with the ui.autocomplete widget.
It is now compatible with TracKeywordSuggest,..... and other jQuery based plugins.
Feel free to test it download site
Tested on Trac 1.x

Mario

comment:10 Changed 17 months ago by rjollos

Thanks, I will take a look and see about getting the changes applied to the repository.

comment:11 in reply to: ↑ 9 Changed 17 months ago by agil

Thanks Mario!

Feel free to test it download site
Tested on Trac 1.x

Ooops, I got the error:

You don't have permission to access /wehr/ on this server.

I can't wait for the commit in the repo! ;-)

Thanks!

Albert

comment:12 in reply to: ↑ 9 Changed 17 months ago by mwehr

Replying to mwehr:

Hi,

I've migrated the plugin to work with the ui.autocomplete widget.
It is now compatible with TracKeywordSuggest,..... and other jQuery based plugins.
Feel free to test it download site
Tested on Trac 1.x

Mario

Sorry there seems to be a problem with the http(s) stuff in my link :-)
Please use this download site

comment:13 Changed 17 months ago by agil

Hi!

I've just tested and now it doesn't break the TracKeywordSuggest, great!

But:

  • it puts the user's mail in the cc field instead of the username
    • or is it a configuration option?
  • it only works for the first user you try to add
    • it seems to me that it is not parsing the cc field (names betweeb ",") and it's using the whole cc field as a single string to match a username, o something similar?

Thanks Mario!

Albert

comment:14 Changed 17 months ago by mwehr

Hi Albert,

lol, I forget that it is also possible to add only the user name and trac searches for the mail addresses :-)
I will change that asap.
Up To now, if you choose a user for CC the mail addresses will get added with ";" as seperator. I'll change also ";" -> ","

Mario

comment:15 Changed 17 months ago by mwehr

Hi Albert,

New version is online.

  • Mail-addresses are separated with ",".
  • Multiple mail receiver with auto-completion should work now.
  • Mail selections now uses the user-name.
  • Mail auto-completion items got a custom item layout.

Mario

comment:16 Changed 17 months ago by agil

Hi Mario!

It seems that we are close!

Everything seems fine but when you add a second user to the cc field, the first one is just removed...

It hapens if you already have any number of users in the cc and you try to add a new one; all existing users are removed.

Thanks!

Albert

comment:17 follow-up: Changed 17 months ago by anonymous

Hi Albert,

I can add multiple users into the CC Field without problems. Also if I open a ticket with multiple users in the CC.
Tested on Firefox and IE.
Maybe you might need to clear your browser cache in case of old .js scripts?

Mario

comment:18 in reply to: ↑ 17 ; follow-up: Changed 17 months ago by agil

Replying to anonymous:

I can add multiple users into the CC Field without problems. Also if I open a ticket with multiple users in the CC.
Tested on Firefox and IE.
Maybe you might need to clear your browser cache in case of old .js scripts?

That's strange...
I re-deploied the trac installation, and tried with chrome and firefox.
And the problem persist...
Maybe is a problem with other plugins like KeywordsSuggest...?

Albert

comment:19 follow-up: Changed 17 months ago by mwehr

Albert,

Which version of Trac do you use?

comment:20 in reply to: ↑ 19 Changed 17 months ago by agil

Replying to mwehr:

Which version of Trac do you use?

1.0

comment:21 in reply to: ↑ 18 Changed 17 months ago by agil

Replying to agil:

Maybe is a problem with other plugins like KeywordsSuggest...?

I've done a simple test that maybe helps.
I note that it works different if you are also using the KeywordSuggestPlugin or not.

If I disable the KeywordSuggestPlugin, then the AutocompleteUsersPlugin seems that it's not working at all: no suggested users appear, the "waiting cursor/icon" doesn't apear...

But if I enable the KeywordSuggestPlugin, then the sugested users appear (also the sugested keywords), but the selected user is always removing the previous users in the cc field.

Does it help?

Thanks!

Albert

comment:22 Changed 17 months ago by rjollos

  • Cc jun66j5 added

I've started to take a look at the code by mwehr, but I probably won't get anything committed to the repository until at least this weekend. I'm attaching a diff of the changes.

comment:23 Changed 17 months ago by rjollos

I've had no luck getting the patch to render properly after upload (known issue on t-h.o), so I've pasted it here: http://pastebin.com/RxweA4Lt.

comment:24 Changed 16 months ago by rjollos

There is a lot of nearly identical code in the patch. Minor mutations on this function are common:

$.ajax({
    url: "../subjects",
    type: "GET",
    dataType: "text",
    data: 'q=' + extractLast( request.term ) ,
    success: function( data ) {
        response( $.map( data.split("\n"), formatItem ));
    }
});

Sometimes request.term is wrapped in a call to extractLast, and sometimes not. I haven't looked closely why that is. However, that difference aside, we could make a function with the url as the argument, and eliminate a lot of the code. Thoughts?

comment:25 Changed 11 months ago by rjollos

#10417 closed as a duplicate.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.