From 812abdd7973810690969c64a8d03513a7cba8a56 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 22 Feb 2010 06:26:25 -0500
Subject: [PATCH] - Fix email address auto-completion shows regexp pattern (#1486258)

---
 CHANGELOG         |    1 +
 program/js/app.js |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index e4d54f9..5e0460a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Fix email address auto-completion shows regexp pattern (#1486258)
 - Fix merging of configuration parameters: user prefs always survive (#1486368) 
 - Fix quota indicator value after folder purge/expunge (#1486488)
 - Fix external mailto links support for use as protocol handler (#1486037)
diff --git a/program/js/app.js b/program/js/app.js
index 747a69f..c5bac85 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2806,8 +2806,8 @@
   this.ksearch_display_results = function (a_results)
   {
     // display search results
-    if (a_results.length && this.ksearch_input) {
-      var p, ul, li;
+    if (a_results.length && this.ksearch_input && this.ksearch_value) {
+      var p, ul, li, s_val = this.ksearch_value;
       
       // create results pane if not present
       if (!this.ksearch_pane) {
@@ -2819,11 +2819,11 @@
       // remove all search results
       ul = this.ksearch_pane.__ul;
       ul.innerHTML = '';
-            
+
       // add each result line to list
       for (i=0; i<a_results.length; i++) {
         li = document.createElement('LI');
-        li.innerHTML = a_results[i].replace(new RegExp('('+this.ksearch_value+')', 'ig'), '##$1%%').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/##([^%]+)%%/g, '<b>$1</b>');
+        li.innerHTML = a_results[i].replace(new RegExp('('+s_val+')', 'ig'), '##$1%%').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/##([^%]+)%%/g, '<b>$1</b>');
         li.onmouseover = function(){ ref.ksearch_select(this); };
         li.onmouseup = function(){ ref.ksearch_click(this) };
         li._rcm_id = i;

--
Gitblit v1.9.1