wiki:KeywordSuggestPlugin

Version 15 (modified by rjollos, 3 years ago) (diff)

Link to report showing open tickets only.

Autocomplete feature for the keywords field

Description

The KeywordsSuggestPlugin provides an autocomplete function for the keywords ticket field. Optionally, it is possible to restrict the list of allowed keywords. The KeywordSuggestPlugin uses the jQuery plugin: Autocomplete for the javascript part. See also the LoomingCloudsPlugin.

There is a patch provided in #4201 that allows this plugin to work well with the TagsPlugin.

Bugs/Feature Requests

Existing bugs and feature requests for KeywordSuggestPlugin are here.

If you have any issues, create a new ticket.

Download and Source

Download the zipped source, check out KeywordSuggestPlugin using Subversion, or browse the source with Trac.

Example



Sample picture of autocomplete feature

Label can be the link to a wiki page

'helppage' option turned on

Configuration

Following section must be added to trac.ini configuration file:

[keywordsuggest]
keywords = tag1,tag2,tag3
mustmatch = True
helppage = TicketKeywords
helppage.newwindow = True
matchcontains = True
multipleseparator = ', '

There are two parameters to configure:

  • 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 wiki page
  • 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.

Recent Changes

[12103] by rjollos on 2012-10-03 07:38:09

Refs #8141:

  • 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.
[12101] by rjollos on 2012-10-03 03:31:24
Refs #8141:

  • 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).

[12094] by rjollos on 2012-10-02 09:37:00

Refs #8141:

  • 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).

Author/Contributors

Author: scratcher
Maintainer: scratcher
Contributors:

Attachments (2)

Download all attachments as: .zip