]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
little stuff - name change, live updates, new network types
[friendica.git] / js / main.js
index 430f216d148203b905e8d3c3d7f309672f40a824..b8b89cd9dfca3597ceae4ab898663b79ff10ae2a 100644 (file)
@@ -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});
                });
                
                
                        return false;
                });
                
+               // fancyboxes
+               $("a.popupbox").fancybox({
+                       'transitionIn' : 'elastic',
+                       'transitionOut' : 'elastic'
+               });
                
 
                /* notifications template */
                        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);
                        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("<li><a href='"+baseurl+"/notifications/network'>Show All Notifications</a></li>");
+                               
                                //nnm.attr('popup','true');
                                eNotif.children("note").each(function(){
                                        e = $(this);
                                        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);
                        });
                        eSysmsg.children("info").each(function(){
                                text = $(this).text();
-                               $.jGrowl(text, { sticky: false, theme: 'info' });
+                               $.jGrowl(text, { sticky: false, theme: 'info', life: 10000 });
                        });
                        
                });
                                }
                        }
 
-               });                                     
+               });
+               
+               
        });
 
        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);
        }
 
 
                $.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) {
                                        $('#' + 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() {
                                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');