From aa7d8b102bb6c5fdd5534d703f87a1453e52d64e Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 7 Sep 2009 20:36:11 +0000 Subject: Added bolding to term searc in user picker. git-svn-id: https://code.elgg.org/elgg/trunk@3477 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/css.php | 6 +++++- views/default/input/userpicker.php | 18 +++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'views/default') diff --git a/views/default/css.php b/views/default/css.php index d61d5a6c4..4d6c9e2a5 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -2593,6 +2593,10 @@ a.delete_report_button:hover { width:300px; } +.ac_results strong { + font-weight: bold; +} + .user_picker .user_picker_entry { clear: both; padding: 1em; @@ -2601,4 +2605,4 @@ a.delete_report_button:hover { .livesearch_icon { float: left; padding-right: 1em; -} \ No newline at end of file +} diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 8f26b8916..b69d295f0 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -66,14 +66,7 @@ function userPickerBindAutocomplete(e) { formatItem: userPickerFormatItem, formatResult: function (row, i, max) { eval("var info = " + row + ";"); - //console.log('format result'); - // upon select, adding the user to the user basket. - // this is slightly abusive for this function. - // set it to the hidden input name - - //userPickerAddUser(info.guid); - - // returning the name + // returning the just name return info.name; } }); @@ -85,18 +78,21 @@ function userPickerBindAutocomplete(e) { function userPickerFormatItem(row, i, max, term) { eval("var info = " + row + ";"); var r = ''; + var name = info.name.replace(new RegExp("(" + term + ")", "gi"), "$1"); + var desc = info.desc.replace(new RegExp("(" + term + ")", "gi"), "$1"); switch (info.type) { case 'user': case 'group': - r = info.icon + info.name + ' - ' + info.desc; + r = info.icon + name + ' - ' + desc; break; default: - r = info.name + ' - ' + info.desc; + r = name + ' - ' + desc; break; } - return r.replace(new RegExp("(" + term + ")", "gi"), "$1"); + return r; + //return r.replace(new RegExp("(" + term + ")", "gi"), "$1"); } function userPickerAddUser(event, data, formatted) { -- cgit v1.2.3