|Version 33 (modified by rjollos, 3 years ago) (diff)|
Autocomplete feature for the keywords field
The KeywordsSuggestPlugin provides an autocomplete function for the keywords ticket field or any other text-based ticket field. Optionally, it is possible to restrict the list of allowed keywords.
See also LoomingCloudsPlugin.
Version 0.5dev of this plugin is now available. The 0.11 branch is undergoing frequent change. If you want to test out the latest version, report back how it is working and possibly do some debugging, then the latest version is for you. Otherwise, r11004 should be fairly stable.
Recent changes are:
- Upgraded from the jQuery Autocomplete Plugin to jQuery UI 1.8.16.
- Added support for the TagsPlugin (#4201).
- The autocomplete list can be attached to a text-based field other than the Keywords field (#5831).
- The helppage link can point to any resource in any realm. For example, it can be a link to the /tags page. Previously, it could only point to a wiki page (#5907).
- Several bug fixes.
- Previously, the multipleseparator configuration option was defined in quotes (e.g. ", "). Now, only the separator character should be specified (e.g. multipleseparator = ,).
- Several of the configuration options will be renamed before 0.5 is released. Please revisit this section for additional notes before installing a new version.
Planned enhancements before 0.5 is released:
- Allow the autocomplete list to be attached to more than one text-based ticket field. Additionally, different configurations will be supported for each ticket field. For example, one of the ticket fields could be using keywords from the TagsPlugin and the other could be using keywords defined in trac.ini (#5831).
- A new boolean option usetagsplugin. Currently, the TagsPlugin will be used when it is installed and enabled.
- Offer all keywords used up until now for use, even if the TagsPlugin is not installed (#3816).
- There is the possibility of supporting multiple themes (comment:8:ticket:8141). Please comment in that ticket if you have any thoughts on the issue.
If you have any issues, create a new ticket.
Download and Source
The Keywords Label can be the link to a wiki page.
Following section must be added to trac.ini configuration file:
[keywordsuggest] field = keywords keywords = tag1,tag2,tag3 mustmatch = False helppage = wiki/TicketKeywords helppage.newwindow = False matchcontains = True multipleseparator = ,
There are two parameters to configure:
- field - field to which the suggestion will be attached (default: keywords)
- keywords - specifies list of comma separated values available for input
- mustmatch - optional, if specified, 'keywords' field accepts values from the keywords list only
- helppage - optional, if specified, 'keywords' label will be turned into the link to a resource. This could be a wiki page, or any resource in any realm, such as the tags page (helppage = tags).
- helppage.newwindow - optional, whether wiki page opened in new window or not`
- matchcontains - optional, whether keywords which matched not from the beginning must be included into list
- multipleseparator - which character(s) is used as separator between keywords. Must be enclosed with quotas or other characters. If not specified, ', ' is used.
-  by rjollos on 2012-10-03 07:38:09
- Moved generation of keywords string into a private method.
- Several other refactorings, backed by unit tests.
- In Trac 1.0 and later, jQuery-UI from the Trac core is added to the page. The ability to add jQuery-UI to the page was added in Trac 1.0.
-  by rjollos on 2012-10-03 03:31:24
- Strip single quotes from the multipleseparator Option value. This allows the user to specify a single whitespace separator as ' ' (which is not necessary since a single whitespace is the default), or even dream up separators such as double whitespace as ' '. A single whitespace character is used as the separator in the case the user specifies ''. Thanks to itamarost for pointing out this corner case in his original patch.
- Wired up unit tests.
- Renamed keywords.py to web_ui.py, to work around an issue described in comment:39, in which the keywordsuggest.keywordsuggest module was not being found by the keywordsuggest.tests.keywordsuggest module when running unit tests.
NOTE: If you have enabled the plugin through webadmin or by editing trac.ini with keywordsuggest.keywordsuggest.* = enabled, you will need to re-enable the plugin through webadmin, or edit the line to keywordsuggest.web_ui.* = enabled (or keywordsuggest.web_ui.keywordsuggestmodule = enabled).
-  by rjollos on 2012-10-02 09:37:00
- Allow whitespace as a separator. The default separator, if not otherwise specified, is whitespace.
- Trim extra whitespace when selecting a keyword.
- Removed fix-up of keyword list on the client-side. This is done on the server side (although there appears to be room for improvement there).