X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjs%2Fmain.js;h=a0ffea3718222a8aef9664f0f18eb9a13b92e86d;hb=2edad06972057dad1d959e8b4affa4916df0d5bc;hp=b523ce6e70f43af10b9004537ce7958306719542;hpb=0c24532b42aa258d0378225c6c25a341e300c3b2;p=friendica.git diff --git a/view/js/main.js b/view/js/main.js index b523ce6e70..a0ffea3718 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -175,6 +175,17 @@ $(function() { $(textarea).trigger('change'); }); + $(".comment-edit-wrapper textarea, .wall-item-comment-wrapper textarea") + .editor_autocomplete(baseurl + '/search/acl') + .bbco_autocomplete('bbcode'); + + // Ensures asynchronously-added comment forms recognize mentions, tags and BBCodes as well + document.addEventListener("postprocess_liveupdate", function() { + $(".comment-edit-wrapper textarea, .wall-item-comment-wrapper textarea") + .editor_autocomplete(baseurl + '/search/acl') + .bbco_autocomplete('bbcode'); + }); + /* popup menus */ function close_last_popup_menu() { if (last_popup_menu) { @@ -568,10 +579,6 @@ function updateConvItems(data) { commentBusy = false; $('body').css('cursor', 'auto'); } - /* autocomplete @nicknames */ - $(".comment-edit-form textarea").editor_autocomplete(baseurl + '/search/acl'); - /* autocomplete bbcode */ - $(".comment-edit-form textarea").bbco_autocomplete('bbcode'); } function liveUpdate(src) { @@ -620,6 +627,10 @@ function liveUpdate(src) { in_progress = false; update_item = 0; + if ($('.wall-item-body', data).length == 0) { + return; + } + $('.wall-item-body', data).imagesLoaded(function() { updateConvItems(data); @@ -889,16 +900,29 @@ function loadScrollContent() { // get the raw content from the next page and insert this content // right before "#conversation-end" - $.get(infinite_scroll.reload_uri + '&mode=raw&last_received=' + received + '&last_commented=' + commented + '&last_created=' + created + '&last_uriid=' + uriid, function(data) { + $.get({ + url: infinite_scroll.reload_uri, + data: { + 'mode' : 'raw', + 'last_received' : received, + 'last_commented': commented, + 'last_created' : created, + 'last_uriid' : uriid + } + }) + .done(function(data) { $("#scroll-loader").hide(); if ($(data).length > 0) { $(data).insertBefore('#conversation-end'); - lockLoadContent = false; } else { $("#scroll-end").fadeIn('normal'); } document.dispatchEvent(new Event('postprocess_liveupdate')); + }) + .always(function () { + $("#scroll-loader").hide(); + lockLoadContent = false; }); }