if (data.success) {
$("#sone .post#" + postId).slideUp();
} else if (data.error == "invalid-post-id") {
- alert("Invalid post ID given!");
+ /* pretend the post is already gone. */
+ getPost(postId).slideUp();
} else if (data.error == "auth-required") {
alert("You need to be logged in.");
} else if (data.error == "not-authorized") {
if (data.success) {
$("#sone .reply#" + replyId).slideUp();
} else if (data.error == "invalid-reply-id") {
- alert("Invalid reply ID given!");
+ /* pretend the reply is already gone. */
+ getReply(replyId).slideUp();
} else if (data.error == "auth-required") {
alert("You need to be logged in.");
} else if (data.error == "not-authorized") {
}
$(this).slideUp("normal", function() {
$(this).remove();
+ /* remove activity when no notifications are visible. */
+ if ($("#sone #notification-area .notification").length == 0) {
+ resetActivity();
+ }
});
}
});
$.each(data.newReplies, function(index, value) {
loadNewReply(value.id, value.sone, value.post, value.postSone);
});
- /* remove activity when no notifications are visible. */
- if ($("#sone #notification-area .notification").length == 0) {
- resetActivity();
- }
/* do it again in 5 seconds. */
setTimeout(getStatus, 5000);
} else {
* The tooltip to show
*/
function updateReplyTime(replyId, timeText, refreshTime, tooltip) {
- if (!getReply(replyId).is(":visible")) {
- return;
- }
getReply(replyId).find(".reply-status-line > .time").html(timeText).attr("title", tooltip);
(function(replyId, refreshTime) {
setTimeout(function() {
if (title.indexOf('(') == 0) {
setTitle(title.substr(title.indexOf(' ') + 1));
}
+ iconBlinking = false;
}
function setActivity() {
* showing the activity state, it is returned to normal.
*/
function toggleIcon() {
- if (focus) {
+ if (focus || !iconBlinking) {
if (iconActive) {
changeIcon("images/icon.png");
iconActive = false;