From cf55c37944273617ec8d6c7eafa5ceb6482f1d1c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 6 Aug 2012 12:53:54 +0200 Subject: [PATCH] Added support for comma-separated suggestions --- wcfsetup/install/files/js/WCF.js | 106 +++++++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 69f8e1c6f0..f181afdbbf 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3954,24 +3954,36 @@ WCF.Search.Base = Class.extend({ */ _className: '', + /** + * comma seperated list + * @var boolean + */ + _commaSeperated: false, + /** * list with values that are excluded from seaching * @var array */ _excludedSearchValues: [], - + /** * result list * @var jQuery */ _list: null, - + + /** + * old search string, used for comparison + * @var array + */ + _oldSearchString: [ ], + /** * action proxy * @var WCF.Action.Proxy */ _proxy: null, - + /** * search input field * @var jQuery @@ -3983,16 +3995,17 @@ WCF.Search.Base = Class.extend({ * @var integer */ _triggerLength: 3, - + /** * Initializes a new search. * * @param jQuery searchInput * @param object callback * @param array excludedSearchValues + * @param boolean commaSeperated */ - init: function(searchInput, callback, excludedSearchValues) { - if (!$.isFunction(callback)) { + init: function(searchInput, callback, excludedSearchValues, commaSeperated) { + if ((callback === null && !commaSeperated) && !$.isFunction(callback)) { console.debug("[WCF.Search.Base] The given callback is invalid, aborting."); return; } @@ -4005,6 +4018,8 @@ WCF.Search.Base = Class.extend({ this._searchInput = $(searchInput).keyup($.proxy(this._keyUp, this)); this._searchInput.wrap(''); this._list = $('