jQuery: The Write Less, Do More JavaScript Library

Changeset 4107

Show
Ignore:
Timestamp:
12/11/07 20:50:17 (8 months ago)
Author:
joern.zaefferer
Message:

Fix for #2018

Location:
trunk/plugins/autocomplete
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/autocomplete/jquery.autocomplete.js

    r4096 r4107  
    508508    multipleSeparator: ", ", 
    509509    highlight: function(value, term) { 
    510         return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); 
     510        return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); 
    511511    }, 
    512512    scroll: true, 
  • trunk/plugins/autocomplete/todo

    r4097 r4107  
    22TODO 
    33 
     4- prevent redundant requests on 
     5  - superstring returned no result, no need to query again for substring, eg. pete returned nothing, peter won't either 
     6  - previous query mustn't be requested again, eg. pete returns 10 lines, peter nothing, backspace to pete should get the 10 lines from cache (may need TimeToLive setting for cache to invalidate it) 
    47- incorporate improvements and suggestions by Hector: http://beta.winserver.com/public/test/MultiSuggestTest.wct 
    58- json support: An optional JSON format, that assumes a certain JSON format as default and just looks for a dataType "json" to be activated; [records], where each record is { id:String, label:String, moreOptionalValues... }