projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mark local elements as known from the core, not from the client.
[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
c9d51c4
..
d5db8ef
100644
(file)
--- a/
src/main/resources/static/javascript/sone.js
+++ b/
src/main/resources/static/javascript/sone.js
@@
-83,7
+83,9
@@
function addCommentLink(postId, author, element, insertAfterThisElement) {
});
})(replyElement);
textArea = replyElement.find("input.reply-input").focus().data("textarea");
});
})(replyElement);
textArea = replyElement.find("input.reply-input").focus().data("textarea");
- textArea.val(textArea.val() + "@sone://" + author + " ");
+ if (author != getCurrentSoneId()) {
+ textArea.val(textArea.val() + "@sone://" + author + " ");
+ }
});
return commentElement;
})(postId, author);
});
return commentElement;
})(postId, author);
@@
-1077,8
+1079,10
@@
function loadNotifications(notificationIds) {
oldNotification.replaceWith(notification.show());
} else {
$("#sone #notification-area").append(notification);
oldNotification.replaceWith(notification.show());
} else {
$("#sone #notification-area").append(notification);
- notification.slideDown();
- setActivity();
+ if (value.id.substring(0, 5) != "local") {
+ notification.slideDown();
+ setActivity();
+ }
}
});
});
}
});
});
@@
-1209,7
+1213,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;
}
}
@@
-1222,7
+1226,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;
@@
-1233,6
+1237,9
@@
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");
+ }
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
}
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
}
@@
-1266,6
+1273,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 {
@@
-1306,7
+1321,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) {
@@
-1322,7
+1337,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) {