X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Fmain.js;h=b8b89cd9dfca3597ceae4ab898663b79ff10ae2a;hb=b795ce4fe7c952600ed3520d6822006a2190d4f8;hp=430f216d148203b905e8d3c3d7f309672f40a824;hpb=273594af62c960b5a52da5ec1cf6d6bd450415ba;p=friendica.git diff --git a/js/main.js b/js/main.js index 430f216d14..b8b89cd9df 100644 --- a/js/main.js +++ b/js/main.js @@ -42,7 +42,7 @@ if (e.hasClass("ttbottom")) pos="bottom"; if (e.hasClass("ttleft")) pos="left"; if (e.hasClass("ttright")) pos="right"; - e.tipTip({defaultPosition: pos}); + e.tipTip({defaultPosition: pos, edgeOffset: 8}); }); @@ -79,6 +79,11 @@ return false; }); + // fancyboxes + $("a.popupbox").fancybox({ + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic' + }); /* notifications template */ @@ -95,6 +100,8 @@ if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') } $('#home-update').html(home); + + var intro = $(data).find('intro').text(); if(intro == 0) { intro = ''; $('#intro-update').removeClass('show') } else { $('#intro-update').addClass('show') } $('#intro-update').html(intro); @@ -103,14 +110,14 @@ if(mail == 0) { mail = ''; $('#mail-update').removeClass('show') } else { $('#mail-update').addClass('show') } $('#mail-update').html(mail); - - var eNotif = $(data).find('notif') notif = eNotif.attr('count'); if (notif>0){ $("#nav-notifications-linkmenu").addClass("on"); nnm = $("#nav-notifications-menu"); - nnm.html(""); + + nnm.html("
  • Show All Notifications
  • "); + //nnm.attr('popup','true'); eNotif.children("note").each(function(){ e = $(this); @@ -118,6 +125,7 @@ html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date')); nnm.append(html); }); + } else { $("#nav-notifications-linkmenu").removeClass("on"); $("#nav-notifications-menu").html(notifications_empty); @@ -132,7 +140,7 @@ }); eSysmsg.children("info").each(function(){ text = $(this).text(); - $.jGrowl(text, { sticky: false, theme: 'info' }); + $.jGrowl(text, { sticky: false, theme: 'info', life: 10000 }); }); }); @@ -160,37 +168,45 @@ } } - }); + }); + + }); function NavUpdate() { + if(! stopped) { $.get("ping",function(data) { $(data).find('result').each(function() { // send nav-update event $('nav').trigger('nav-update', this); + + + // start live update + + if($('#live-network').length) { src = 'network'; liveUpdate(); } + if($('#live-profile').length) { src = 'profile'; liveUpdate(); } + if($('#live-community').length) { src = 'community'; liveUpdate(); } + if($('#live-notes').length) { src = 'notes'; liveUpdate(); } + if($('#live-display').length) { + if(liking) { + liking = 0; + window.location.href=window.location.href + } + } + if($('#live-photos').length) { + if(liking) { + liking = 0; + window.location.href=window.location.href + } + } + + + + }); }) ; } - - - if($('#live-network').length) { src = 'network'; liveUpdate(); } - if($('#live-profile').length) { src = 'profile'; liveUpdate(); } - if($('#live-community').length) { src = 'community'; liveUpdate(); } - if($('#live-notes').length) { src = 'notes'; liveUpdate(); } - if($('#live-display').length) { - if(liking) { - liking = 0; - window.location.href=window.location.href - } - } - if($('#live-photos').length) { - if(liking) { - liking = 0; - window.location.href=window.location.href - } - } - timer = setTimeout(NavUpdate,30000); } @@ -208,7 +224,7 @@ $.get(update_url,function(data) { in_progress = false; - $('.ccollapse-wrapper',data).each(function() { + $('.collapsed-comments',data).each(function() { var ident = $(this).attr('id'); var is_hidden = $('#' + ident).is(':hidden'); if($('#' + ident).length) { @@ -230,6 +246,7 @@ $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago')); if($('#' + ident + ' ' + '.comment-edit-text-empty').length) $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper')); + $('#' + ident + ' ' + '.hide-comments-total').replaceWith($(this).find('.hide-comments-total')); $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like')); $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike')); $('#' + ident + ' ' + '.my-comment-photo').each(function() { @@ -243,6 +260,8 @@ commentBusy = false; $('body').css('cursor', 'auto'); } + /* autocomplete @nicknames */ + $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl"); }); } @@ -443,6 +462,7 @@ function setupFieldRichtext(){ }); } + /** * sprintf in javascript * "{0} and {1}".format('zero','uno');