1
0
Fork 0

Only auto update when there is content

This commit is contained in:
Michael 2020-10-20 20:43:51 +00:00
parent 74305b3dc8
commit 1fc36c4470
8 changed files with 20 additions and 19 deletions

View file

@ -697,6 +697,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
'$live_update' => $live_update_div, '$live_update' => $live_update_div,
'$remove' => DI::l10n()->t('remove'), '$remove' => DI::l10n()->t('remove'),
'$mode' => $mode, '$mode' => $mode,
'$update' => $update,
'$user' => $a->user, '$user' => $a->user,
'$threads' => $threads, '$threads' => $threads,
'$dropping' => ($page_dropping ? DI::l10n()->t('Delete Selected Items') : False), '$dropping' => ($page_dropping ? DI::l10n()->t('Delete Selected Items') : False),

View file

@ -620,6 +620,12 @@ function liveUpdate(src) {
in_progress = false; in_progress = false;
update_item = 0; update_item = 0;
if (data.length < 100) {
// console.log('No data ' + data.length + ':' + data);
return;
}
// console.log('Got data: ' + data.length + ':' + data);
$('.wall-item-body', data).imagesLoaded(function() { $('.wall-item-body', data).imagesLoaded(function() {
updateConvItems(data); updateConvItems(data);

View file

@ -1,6 +1,4 @@
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
<div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper"> <div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper">
{{foreach $thread.items as $item}} {{foreach $thread.items as $item}}
@ -18,7 +16,7 @@
{{/foreach}} {{/foreach}}
</div> </div>
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -28,3 +26,4 @@
</div> </div>
<div id="item-delete-selected-end"></div> <div id="item-delete-selected-end"></div>
{{/if}} {{/if}}
{{/if}}

View file

@ -1,10 +1,8 @@
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
{{include file="{{$thread.template}}" item=$thread}} {{include file="{{$thread.template}}" item=$thread}}
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -15,3 +13,4 @@
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" /> <img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
<div id="item-delete-selected-end"></div> <div id="item-delete-selected-end"></div>
{{/if}} {{/if}}
{{/if}}

View file

@ -1,8 +1,6 @@
<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script> {{if !$update}}<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>{{/if}}
{{if $mode == display}}<script type="text/javascript" src="view/theme/frio/js/mod_display.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>{{/if}} {{if $mode == display}}<script type="text/javascript" src="view/theme/frio/js/mod_display.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>{{/if}}
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
<hr class="sr-only" /> <hr class="sr-only" />
<div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{$thread.network}} {{if $thread.thread_level==1}}panel-default panel{{/if}} {{if $thread.thread_level!=1}}comment-wrapper{{/if}}" style="{{if $item.thread_level>2}}margin-left: -15px; margin-right:-16px; margin-bottom:-16px;{{/if}}"><!-- panel --> <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{$thread.network}} {{if $thread.thread_level==1}}panel-default panel{{/if}} {{if $thread.thread_level!=1}}comment-wrapper{{/if}}" style="{{if $item.thread_level>2}}margin-left: -15px; margin-right:-16px; margin-bottom:-16px;{{/if}}"><!-- panel -->
@ -15,7 +13,7 @@
</div><!--./tread-wrapper--> </div><!--./tread-wrapper-->
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -24,3 +22,4 @@
</button> </button>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" /> <img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{/if}} {{/if}}
{{/if}}

View file

@ -1,5 +1,4 @@
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
<div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper"> <div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper">
{{foreach $thread.items as $item}} {{foreach $thread.items as $item}}
@ -23,7 +22,7 @@
{{/foreach}} {{/foreach}}
</div> </div>
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -46,4 +45,4 @@
$('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000); $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
</script> </script>
{{/if}} {{/if}}
{{/if}}

View file

@ -1,5 +1,4 @@
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
<div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{if $thread.toplevel}} h-entry {{else}} u-comment h-cite {{/if}} {{$thread.network}}"> <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{if $thread.toplevel}} h-entry {{else}} u-comment h-cite {{/if}} {{$thread.network}}">
@ -13,7 +12,7 @@
</div> </div>
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -37,4 +36,4 @@
$('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000); $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
</script> </script>
{{/if}} {{/if}}
{{/if}}

View file

@ -1,5 +1,4 @@
{{$live_update nofilter}} {{$live_update nofilter}}
{{foreach $threads as $thread}} {{foreach $threads as $thread}}
<hr class="sr-only" /> <hr class="sr-only" />
<div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{if $thread.toplevel}}h-entry{{/if}} {{$thread.network}}"> <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{if $thread.toplevel}}h-entry{{/if}} {{$thread.network}}">
@ -13,7 +12,7 @@
</div> </div>
{{/foreach}} {{/foreach}}
{{if !$update}}
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{if $dropping}} {{if $dropping}}
@ -37,4 +36,4 @@
$('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000); $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
</script> </script>
{{/if}} {{/if}}
{{/if}}