projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show posts mentioning a local Sone by a new notification.
[Sone.git]
/
src
/
main
/
resources
/
static
/
javascript
/
sone.js
diff --git
a/src/main/resources/static/javascript/sone.js
b/src/main/resources/static/javascript/sone.js
index
60a6a0b
..
0cc6480
100644
(file)
--- a/
src/main/resources/static/javascript/sone.js
+++ b/
src/main/resources/static/javascript/sone.js
@@
-1211,7
+1211,7
@@
function loadNewPost(postId, soneId, recipientId, time) {
}
if (!isIndexPage() || (getPage(".pagination-index") > 1)) {
if (!isViewPostPage() || (getShownPostId() != postId)) {
}
if (!isIndexPage() || (getPage(".pagination-index") > 1)) {
if (!isViewPostPage() || (getShownPostId() != postId)) {
- if (!isViewSonePage() || ((getShownSoneId() != soneId) && (getShownSoneId() != recipientId))) {
+ if (!isViewSonePage() || ((getShownSoneId() != soneId) && (getShownSoneId() != recipientId))
|| (getPage(".post-navigation") > 1)
) {
return;
}
}
return;
}
}
@@
-1224,7
+1224,7
@@
function loadNewPost(postId, soneId, recipientId, time) {
if (hasPost(data.post.id)) {
return;
}
if (hasPost(data.post.id)) {
return;
}
- if ((!isIndexPage() || (getPage(".pagination-index") > 1)) && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) {
+ if ((!isIndexPage() || (getPage(".pagination-index") > 1)) && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)
|| (getPage(".post-navigation") > 1)
))) {
return;
}
var firstOlderPost = null;
return;
}
var firstOlderPost = null;
@@
-1235,6
+1235,14
@@
function loadNewPost(postId, soneId, recipientId, time) {
}
});
newPost = $(data.post.html).addClass("hidden");
}
});
newPost = $(data.post.html).addClass("hidden");
+ if ($(".post-author-local", newPost).text() == "true") {
+ newPost.removeClass("new");
+ (function(newPost) {
+ setTimeout(function() {
+ markPostAsKnown(newPost, false);
+ }, 5000);
+ })(newPost);
+ }
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
}
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
}
@@
-1268,6
+1276,14
@@
function loadNewReply(replyId, soneId, postId, postSoneId) {
}
});
newReply = $(data.reply.html).addClass("hidden");
}
});
newReply = $(data.reply.html).addClass("hidden");
+ if ($(".reply-author-local", newReply).text() == "true") {
+ newReply.removeClass("new");
+ (function(newReply) {
+ setTimeout(function() {
+ markReplyAsKnown(newReply, false);
+ }, 5000);
+ })(newReply);
+ }
if (firstNewerReply != null) {
newReply.insertBefore(firstNewerReply);
} else {
if (firstNewerReply != null) {
newReply.insertBefore(firstNewerReply);
} else {
@@
-1308,7
+1324,7
@@
function markSoneAsKnown(soneElement, skipRequest) {
function markPostAsKnown(postElements, skipRequest) {
$(postElements).each(function() {
postElement = this;
function markPostAsKnown(postElements, skipRequest) {
$(postElements).each(function() {
postElement = this;
- if ($(postElement).hasClass("new")) {
+ if ($(postElement).hasClass("new")
|| ((typeof skipRequest != "undefined") && !skipRequest)
) {
(function(postElement) {
$(postElement).removeClass("new");
if ((typeof skipRequest == "undefined") || !skipRequest) {
(function(postElement) {
$(postElement).removeClass("new");
if ((typeof skipRequest == "undefined") || !skipRequest) {
@@
-1324,7
+1340,7
@@
function markPostAsKnown(postElements, skipRequest) {
function markReplyAsKnown(replyElements, skipRequest) {
$(replyElements).each(function() {
replyElement = this;
function markReplyAsKnown(replyElements, skipRequest) {
$(replyElements).each(function() {
replyElement = this;
- if ($(replyElement).hasClass("new")) {
+ if ($(replyElement).hasClass("new")
|| ((typeof skipRequest != "undefined") && !skipRequest)
) {
(function(replyElement) {
$(replyElement).removeClass("new");
if ((typeof skipRequest == "undefined") || !skipRequest) {
(function(replyElement) {
$(replyElement).removeClass("new");
if ((typeof skipRequest == "undefined") || !skipRequest) {