From 09c9b47265b144c905a51434c40002d8aef526e5 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Feb 2023 01:52:48 +0000 Subject: fix more hubloc confusion, implement hq widget author filter and some autocomplete fixes --- view/js/autocomplete.js | 21 ++++++++--------- view/js/main.js | 2 +- view/js/mod_poke.js | 6 ++--- view/theme/redbasic/css/style.css | 7 +++--- view/tpl/messages_widget.tpl | 47 ++++++++++++++++++++++++++++++++++----- 5 files changed, 60 insertions(+), 23 deletions(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index d6893073d..e50a4f927 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -31,8 +31,6 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine }, }).fail(function () {callback([]); }); // Callback must be invoked even if something went wrong. } -contact_search.cache = {}; - function contact_format(item) { // Show contact information if not explicitly told to show something else @@ -40,10 +38,10 @@ function contact_format(item) { var desc = ((item.label) ? item.nick + ' ' + item.label : item.nick); if(typeof desc === 'undefined') desc = ''; if(desc) desc = ' ('+desc+')'; - return "".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')','')); + return "".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')','')); } else - return "
" + item.text + "
"; + return ""; } function smiley_format(item) { @@ -247,7 +245,7 @@ function string2bb(element) { template: tag_format }; - this.attr('autocomplete', 'off'); + //this.attr('autocomplete', 'off'); var textcomplete; var Textarea = Textcomplete.editors.Textarea; @@ -296,6 +294,7 @@ function string2bb(element) { textcomplete = new Textcomplete(editor, { dropdown: { maxCount: 100 + } }); textcomplete.register([contacts]); @@ -305,7 +304,8 @@ function string2bb(element) { textcomplete.on('selected', function() { this.editor.el.form.submit(); }); if(typeof onselect !== 'undefined') - textcomplete.on('select', function() { var item = this.dropdown.getActiveItem(); onselect(item.searchResult.data); }); + textcomplete.on('select', function() { var item = this.dropdown.getActiveItem(); onselect(item.searchResult.data);}); + }; })( jQuery ); @@ -331,11 +331,11 @@ function string2bb(element) { //this.attr('autocomplete','off'); - var textcomplete; - var Textarea = Textcomplete.editors.Textarea; + let textcomplete; + let Textarea = Textcomplete.editors.Textarea; $(this).each(function() { - var editor = new Textarea(this); + let editor = new Textarea(this); textcomplete = new Textcomplete(editor, { dropdown: { maxCount: 100 @@ -344,11 +344,12 @@ function string2bb(element) { textcomplete.register([names]); }); + if(autosubmit) textcomplete.on('selected', function() { this.editor.el.form.submit(); }); if(typeof onselect !== 'undefined') - textcomplete.on('select', function() { var item = this.dropdown.getActiveItem(); onselect(item.searchResult.data); }); + textcomplete.on('select', function() { let item = this.dropdown.getActiveItem(); onselect(item.searchResult.data); }); }; })( jQuery ); diff --git a/view/js/main.js b/view/js/main.js index fdebb5faa..8b348b2c9 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -163,7 +163,7 @@ $(document).ready(function() { }); // @hilmar <-| - $(document).on('click', '.notification, .message', function(e) { + $(document).on('click focus', '.notification, .message', function(e) { let b64mid = this.dataset.b64mid; let notify_id = this.dataset.notify_id; let path = $(this)[0].pathname.split('/')[1]; diff --git a/view/js/mod_poke.js b/view/js/mod_poke.js index 221cbbb31..88fa9f7c2 100644 --- a/view/js/mod_poke.js +++ b/view/js/mod_poke.js @@ -1,5 +1,5 @@ -$(document).ready(function() { - $("#poke-recip").name_autocomplete(baseurl + '/acl', 'a', false, function(data) { +$(document).ready(function() { + $("#poke-recip").contact_autocomplete(baseurl + '/acl', 'a', false, function(data) { $("#poke-recip-complete").val(data.id); }); -}); +}); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 9548d73f5..bf7ea2a37 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1111,7 +1111,7 @@ img.mail-conv-sender-photo { .wall-item-ago, .dropdown-sub-text { - color: #777; + color: var(--bs-tertiary-color); } .wall-item-content, @@ -1425,9 +1425,10 @@ blockquote { overflow: auto; } -.dropdown-item.active { +.dropdown-item.active, +.textcomplete-item.active { color: #fff; - background-color: #007bff; + background-color: var(--bs-tertiary-bg); } .navbar { diff --git a/view/tpl/messages_widget.tpl b/view/tpl/messages_widget.tpl index ee933b392..f71d8a223 100644 --- a/view/tpl/messages_widget.tpl +++ b/view/tpl/messages_widget.tpl @@ -39,7 +39,12 @@ {8} -
+
+
+
+ +
+
{{foreach $entries as $e}}
@@ -67,15 +72,42 @@
-- cgit v1.2.3