diff options
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/view/js/main.js b/view/js/main.js index beedb7f01..04e43f72e 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -180,6 +180,13 @@ timer = setTimeout(NavUpdate,2000); } + function markItemRead(itemId) { + $.get('ping?f=&markItemRead='+itemId); + $('.unseen-wall-indicator-'+itemId).hide(); + } + + + var src = null; var prev = null; var livetime = null; @@ -200,6 +207,7 @@ var loadingPage = true; var pageHasMoreContent = true; var updateCountsOnly = false; + var divmore_height = 400; $(function() { $.ajaxSetup({cache: false}); @@ -335,7 +343,7 @@ if($('#live-network').length) { src = 'network'; liveUpdate(); } if($('#live-channel').length) { src = 'channel'; liveUpdate(); } - if($('#live-community').length) { src = 'community'; liveUpdate(); } + if($('#live-home').length) { src = 'home'; liveUpdate(); } if($('#live-display').length) { src = 'display'; liveUpdate(); } if($('#live-search').length) { src = 'search'; liveUpdate(); } @@ -458,25 +466,17 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // divgrow doesn't prevent itself from attaching a second (or 500th) - // "show more" div to a content region - it also has a few other - // issues related to how we're trying to use it. - // disable for now. - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } else { $('img',this).each(function() { $(this).attr('src',$(this).attr('dst')); }); - // more FIXME related to expanded comments if($('#collapsed-comments-'+itmId).is(':visible')) isVisible = true; $('#' + ident).replaceWith($(this)); if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } prev = ident; }); @@ -508,8 +508,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } else { $('img',this).each(function() { @@ -521,7 +519,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } }); @@ -557,7 +554,6 @@ function updateConvItems(mode,data) { showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } prev = ident; }); @@ -597,17 +593,15 @@ function updateConvItems(mode,data) { function collapseHeight() { $(".wall-item-body").each(function() { - if($(this).height() > 410) { + if($(this).height() > divmore_height + 10) { if(! $(this).hasClass('divmore')) { - $(this).divgrow({ initialHeight: 400, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).divgrow({ initialHeight: divmore_height, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); $(this).addClass('divmore'); } } }); } - - function liveUpdate() { if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } if(($('.comment-edit-text-full').length) || (in_progress)) { @@ -749,7 +743,7 @@ function updateConvItems(mode,data) { $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); $(data.notify).each(function() { - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.class); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); $("#nav-" + notifyType + "-menu").append(html); }); $(".dropdown-menu img[data-src]").each(function(i, el){ |