X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Fmain.js;h=6ab574c4e818f449742f9d9668c2b43b12b5ee2f;hb=f96b91c25483fc14d94911007c204b9416726b93;hp=6a26324419284f42e3771f4db77fc1a4fe4d2a8f;hpb=ab908469ae89cbc7ba3b45b25fd85668e51abaea;p=friendica.git diff --git a/js/main.js b/js/main.js index 6a26324419..6ab574c4e8 100644 --- a/js/main.js +++ b/js/main.js @@ -117,6 +117,9 @@ /* nav update event */ $('nav').bind('nav-update', function(e,data){; + var invalid = $(data).find('invalid').text(); + if(invalid == 1) { window.location.href=window.location.href } + var net = $(data).find('net').text(); if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') } $('#net-update').html(net); @@ -211,7 +214,8 @@ function NavUpdate() { if(! stopped) { - $.get("ping",function(data) { + var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : ''); + $.get(pingCmd,function(data) { $(data).find('result').each(function() { // send nav-update event $('nav').trigger('nav-update', this); @@ -276,8 +280,7 @@ //}); // add a new thread - - $('.tread-wrapper',data).each(function() { + $('.toplevel_item',data).each(function() { var ident = $(this).attr('id'); if($('#' + ident).length == 0 && profile_page == 1) { @@ -353,9 +356,9 @@ function dolike(ident,verb) { unpause(); $('#like-rotator-' + ident.toString()).show(); - $.get('like/' + ident.toString() + '?verb=' + verb ); - if(timer) clearTimeout(timer); - timer = setTimeout(NavUpdate,3000); + $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate ); +// if(timer) clearTimeout(timer); +// timer = setTimeout(NavUpdate,3000); liking = 1; } @@ -637,7 +640,7 @@ Array.prototype.remove = function(item) { function previewTheme(elm) { theme = $(elm).val(); $.getJSON('pretheme?f=&theme=' + theme,function(data) { - $('#theme-preview').html('
' + data.desc + '
' + theme + ''); + $('#theme-preview').html('
' + data.desc + '
' + data.version + '
' + data.credits + '
' + theme + ''); }); }