This question about Missing functionality: Task filed

Provide queryMatchContains option

Will be nice to add a queryMatchContains option for searching the contents of the options.

Instead of having in lib/Foswiki/Plugins/AutoCompletePlugin.pm:
<script type="text/javascript">
    YAHOO.util.Event.addListener(window, "load", initAutoComplete$id);
    function initAutoComplete$id() {
        var topics = $dataVar;
        var oACDS = new YAHOO.widget.DS_JSArray(topics);
        var topicAC = new YAHOO.widget.AutoComplete("$Input", "$Results", oACDS);
        topicAC.queryDelay = 0;
        topicAC.autoHighlight = true;
        topicAC.useIFrame = false;
        topicAC.prehighlightClassName = "yui-ac-prehighlight";
        topicAC.typeAhead = false;
        $delimchar
        topicAC.allowBrowserAutocomplete = false;
        topicAC.useShadow = false;
        $customEvent
        topicAC.formatResult = function(item, query) { return $itemformat; };
    }
</script>

... I've added this line directly:

...
        topicAC.queryMatchContains = true;
...

... and so:

<script type="text/javascript">
    YAHOO.util.Event.addListener(window, "load", initAutoComplete$id);
    function initAutoComplete$id() {
        var topics = $dataVar;
        var oACDS = new YAHOO.widget.DS_JSArray(topics);
        var topicAC = new YAHOO.widget.AutoComplete("$Input", "$Results", oACDS);
        topicAC.queryDelay = 0;
        topicAC.autoHighlight = true;
        topicAC.useIFrame = false;
        topicAC.prehighlightClassName = "yui-ac-prehighlight";
        topicAC.typeAhead = false;
        $delimchar
        topicAC.allowBrowserAutocomplete = false;
        topicAC.useShadow = false;
        $customEvent
        topicAC.formatResult = function(item, query) { return $itemformat; };
        topicAC.queryMatchContains = true;
    }
</script>

... but I would prefer to create an specific option.

-- EduardoJ - 02 Sep 2009

Yeah this sounds sensible and should be easy to implement. I created a task for it at Tasks.Item8262, although it may take me a few weeks until I can find time to do it. If your good with Perl your more than welcome to submit a patch (or check in yourself), but im happy to do it if not.

Can you think of any other options that you would like to be configurable? I can do them at the same time.

-- AndrewJones - 02 Sep 2009

QuestionForm edit

Subject Missing functionality
Extension AutoCompletePlugin
Version Foswiki 1.0.5
Status Task filed
Topic revision: r2 - 02 Sep 2009, AndrewJones
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy