]> git.mxchange.org Git - friendica.git/blobdiff - view/js/main.js
Merge pull request #13794 from annando/simplified-group-display
[friendica.git] / view / js / main.js
index a761f44fc8786a2b4dd68071cd48cc920e825269..0da6c1df1065dc29ce71010bdc082cc552a94148 100644 (file)
@@ -296,11 +296,11 @@ $(function() {
                        $(".circle-"+gid+" .notify").addClass("show").text(gcount);
                });
 
-               $(".forum-widget-entry .notify").removeClass("show");
-               $(data.forums).each(function(key, forum) {
-                       var fid = forum.id;
-                       var fcount = forum.count;
-                       $(".forum-"+fid+" .notify").addClass("show").text(fcount);
+               $(".group-widget-entry .notify").removeClass("show");
+               $(data.groups).each(function(key, group) {
+                       var fid = group.id;
+                       var fcount = group.count;
+                       $(".group-"+fid+" .notify").addClass("show").text(fcount);
                });
 
                if (data.notifications.length == 0) {
@@ -378,16 +378,10 @@ $(function() {
 
        // Allow folks to stop the ajax page updates with the pause/break key
        $(document).keydown(function(event) {
-               if (event.keyCode == '8') {
-                       var target = event.target || event.srcElement;
-                       if (!/input|textarea/i.test(target.nodeName)) {
-                               return false;
-                       }
-               }
-
-               if (event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
+               // Pause/Break or Ctrl + Space
+               if (event.which === 19 || (!event.shiftKey && !event.altKey && event.ctrlKey && event.which === 32)) {
                        event.preventDefault();
-                       if (stopped == false) {
+                       if (stopped === false) {
                                stopped = true;
                                if (event.ctrlKey) {
                                        totStopped = true;
@@ -506,7 +500,7 @@ function NavUpdate() {
                                $('nav').trigger('nav-update', data.result);
 
                                // start live update
-                               ['network', 'profile', 'community', 'notes', 'display', 'contact'].forEach(function (src) {
+                               ['network', 'profile', 'channel', 'community', 'notes', 'display', 'contact'].forEach(function (src) {
                                        if ($('#live-' + src).length) {
                                                liveUpdate(src);
                                        }
@@ -608,6 +602,26 @@ function liveUpdate(src) {
                update_url += '&max_id=' + getUrlParameter('max_id');
        }
 
+       match = $("span.received").first();
+       if (match.length > 0) {
+               update_url += '&first_received=' + match[0].innerHTML;
+       }
+
+       match = $("span.created").first();
+       if (match.length > 0) {
+               update_url += '&first_created=' + match[0].innerHTML;
+       }
+
+       match = $("span.commented").first();
+       if (match.length > 0) {
+               update_url += '&first_commented=' + match[0].innerHTML;
+       }
+
+       match = $("span.uriid").first();
+       if (match.length > 0) {
+               update_url += '&first_uriid=' + match[0].innerHTML;
+       }
+
        $.get(update_url, function(data) {
                in_progress = false;
                update_item = 0;
@@ -627,6 +641,11 @@ function liveUpdate(src) {
        });
 }
 
+function updateItem(itemNo) {
+       force_update = true;
+       update_item = itemNo;   
+}
+
 function imgbright(node) {
        $(node).removeClass("drophide").addClass("drop");
 }