From c000b08aa464656ee2628745d69c3d322e97d61a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 2 Jan 2012 16:43:12 +0100 Subject: [PATCH] Adds the possibility to exclude certain values from search --- wcfsetup/install/files/js/WCF.js | 36 ++++++++++++++++++- .../files/lib/data/user/UserAction.class.php | 30 +++++++++++----- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index f10e9e1938..901b187b14 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3070,6 +3070,12 @@ WCF.Search.Base = Class.extend({ * @var string */ _className: '', + + /** + * list with values that are excluded from seaching + * @var array + */ + _excludedSearchValues: [], /** * result list @@ -3100,14 +3106,18 @@ WCF.Search.Base = Class.extend({ * * @param jQuery searchInput * @param object callback + * @param array excludedSearchValues */ - init: function(searchInput, callback) { + init: function(searchInput, callback, excludedSearchValues) { if (!$.isFunction(callback)) { console.debug("[WCF.Search.Base] Given callback is invalid, aborting."); return; } this._callback = callback; + if (excludedSearchValues) { + this._excludedSearchValues = excludedSearchValues; + } this._searchInput = $(searchInput).keyup($.proxy(this._keyUp, this)); this._searchInput.wrap('
'); this._list = $('