From 2d22a58324194ebb37b042658db5a8fc2d94b3a7 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 26 Oct 2011 15:14:12 -0700 Subject: [PATCH] @ tag completion enhancements, show url on hover and respect custom attags --- boot.php | 2 +- database.sql | 7 +++++++ js/fk.autocomplete.js | 4 ++-- mod/acl.php | 4 ++-- update.php | 27 +++++++++++++++++++++++++-- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/boot.php b/boot.php index 9582147cac..707ca19882 100644 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); define ( 'FRIENDIKA_VERSION', '2.3.1146' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1098 ); +define ( 'DB_UPDATE_VERSION', 1099 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 5d7a3020cf..ead3637955 100644 --- a/database.sql +++ b/database.sql @@ -100,6 +100,13 @@ CREATE TABLE IF NOT EXISTS `contact` ( PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `self` (`self`), + KEY `network` (`network`), + KEY `name` (`name`), + KEY `nick` (`nick`), + KEY `attag` (`attag`), + KEY `url` (`url`), + KEY `addr` (`addr`), + KEY `batch` (`batch`), KEY `issued-id` (`issued-id`), KEY `dfrn-id` (`dfrn-id`), KEY `blocked` (`blocked`), diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js index 1484758add..6a1f1965aa 100644 --- a/js/fk.autocomplete.js +++ b/js/fk.autocomplete.js @@ -65,7 +65,7 @@ ACPopup.prototype._search = function(){ that.cont.show(); $(data.items).each(function(){ html = "{1} ({2})".format(this.photo, this.name, this.nick) - that.add(html, this.nick); + that.add(html, this.nick + ' - ' + this.link); }); } else { that.cont.hide(); @@ -78,7 +78,7 @@ ACPopup.prototype.add = function(label, value){ var that=this; var elm = $("
"+label+"
"); elm.click(function(e){ - t = $(this).attr('title'); + t = $(this).attr('title').replace(new RegExp(' \- .*'),''); el=$(that.element); sel = el.getSelection(); sel.start = sel.start- that.searchText.length; diff --git a/mod/acl.php b/mod/acl.php index 07ca096e5b..735c2c0b00 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -15,7 +15,7 @@ function acl_init(&$a){ if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; - $sql_extra2 = "AND (`name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; + $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; } // count groups and contacts @@ -89,7 +89,7 @@ function acl_init(&$a){ "id" => intval($g['id']), "network" => $g['network'], "link" => $g['url'], - "nick" => $g['nick'], + "nick" => ($g['attag']) ? $g['attag'] : $g['nick'], ); } diff --git a/update.php b/update.php index c859626917..8f1cee75b4 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@