From 7d8fe723514c8dd329340db2d7a3a66a0c448626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 1 Oct 2014 18:08:24 +0200 Subject: [PATCH] customize search results --- js/loader.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/loader.js b/js/loader.js index d87671a0..95c012c7 100644 --- a/js/loader.js +++ b/js/loader.js @@ -129,6 +129,23 @@ OC.ContactsImporter = OC.ContactsImporter || { $(document).ready(function(){ + // translate search result type + OC.search.resultTypes.contact = t('contacts', 'Contact'); + + OC.search.customResults.contact = function (row, item){ + var text = ''; + if (item.email) { + text += '✉ ' + item.email; + if (item.phone) { + text += ', ' + } + } + if (item.phone) { + text += '☎ ' + item.phone + } + row.find('td.result .text').text(text); + }; + // If the app is already active there's no need for the FileActions if(OC.Contacts) { return;