diff options
author | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
commit | 89285f1408d21091bb80d45b391ddcbe06ba8d0f (patch) | |
tree | b2eb07d9f3d91d77f89a4565a58e6e5231b20c1c /view/js | |
parent | 0a679e503ef367eda3085c44af103ee53869a94f (diff) | |
parent | 17c0bb2069dcfe35d3febc5bfdb3a7295f15d49c (diff) | |
download | volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.tar.gz volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.tar.bz2 volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.zip |
Merge branch '8.2RC'8.2
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/autocomplete.js | 21 | ||||
-rw-r--r-- | view/js/main.js | 4 | ||||
-rw-r--r-- | view/js/mod_cal.js | 22 | ||||
-rw-r--r-- | view/js/mod_connections.js | 4 | ||||
-rw-r--r-- | view/js/mod_poke.js | 6 |
5 files changed, 19 insertions, 38 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index d6893073d..8edd8dafa 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 "<div class='{0} dropdown-item dropdown-notification clearfix' title='{4}'><img class='menu-img-2' src='{1}' loading='lazy'><span class='font-weight-bold contactname'>{2}</span><span class='dropdown-sub-text'>{4}</span></div>".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')','')); + return "<div class='dropdown-item dropdown-notification lh-sm text-truncate' title='{4}'><img class='menu-img-2' src='{1}' loading='lazy'><strong>{2}</strong><br><small class='opacity-75'>{4}</small></div>".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')','')); } else - return "<div>" + item.text + "</div>"; + 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..dcdf58396 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1234,7 +1234,7 @@ function doscroll(parent, hidden) { }); $('html, body').animate({scrollTop:(id.offset().top) - 50}, 'slow'); - $('<a href="javascript:doscrollback(' + pos + ');" id="back-to-reply" class="float-end" title="' + aStr['to_reply'] + '"><i class="fa fa-angle-double-down"> </i></a>').insertBefore('#wall-item-info-' + id.attr('id').replace(/\D/g,'')); + $('<a href="javascript:doscrollback(' + pos + ');" id="back-to-reply" title="' + aStr['to_reply'] + '"><i class="fa fa-angle-double-down"></i></a>').insertAfter('#wall-item-ago-' + id.attr('id').replace(/\D/g,'')); } function doscrollback(pos) { @@ -1259,7 +1259,7 @@ function dopin(id) { $('.dropdown-item-pinnable').html($('.dropdown-item-pinnable').html().replace(aStr['unpin_item'],aStr['pin_item'])); $('.wall-item-pinned').remove() if(i.length == 0) { - $('<span class="float-end wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack"> </i></span>').insertBefore('#wall-item-info-' + id); + $('<span class="wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack"> </i></span>').insertAfter('#wall-item-ago-' + id); me.html(me.html().replace(aStr['pin_item'],aStr['unpin_item'])); }; }) diff --git a/view/js/mod_cal.js b/view/js/mod_cal.js deleted file mode 100644 index 5867f676e..000000000 --- a/view/js/mod_cal.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * JavaScript for mod/cal - */ - -$(document).ready( function() { - $(document).on('click','#fullscreen-btn', on_fullscreen); - $(document).on('click','#inline-btn', on_inline); -}); - -function on_fullscreen() { - var view = $('#events-calendar').fullCalendar('getView'); - if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper - } -} - -function on_inline() { - var view = $('#events-calendar').fullCalendar('getView'); - if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', ''); - } -} diff --git a/view/js/mod_connections.js b/view/js/mod_connections.js index 848e9ed9f..cb3ecc922 100644 --- a/view/js/mod_connections.js +++ b/view/js/mod_connections.js @@ -1,5 +1,7 @@ $(document).ready(function() { - $("#contacts-search").contact_autocomplete(baseurl + '/acl', 'a', true); + $("#contacts-search").name_autocomplete(baseurl + '/acl', 'a', true, function(data) { + $("#contacts-search-xchan").val(data.xid); + }); $(".autotime").timeago(); }); 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); }); -}); +}); |