aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-11-24 14:19:22 +0100
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-11-24 14:19:22 +0100
commitbef8879cb1356b880279c6104fcffb0752414a7c (patch)
treece3733df7ca168f4afe7e963dc81b6f00944c34c /view/js/main.js
parent1cb45c30e9032794b7827738cc28f7728ac28677 (diff)
parent5b7124f0daeca4aa619f6411ee373d9ff5a22b7b (diff)
downloadvolse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.gz
volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.bz2
volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.zip
Merge pull request #7 from friendica/master
Merge from main project
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js30
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){