projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don’t change the page title if we are focussed.
[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
39999e9
..
e07c51e
100644
(file)
--- a/
src/main/resources/static/javascript/sone.js
+++ b/
src/main/resources/static/javascript/sone.js
@@
-63,7
+63,7
@@
function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, op
* @param element
* The element to add a “comment” link to
*/
* @param element
* The element to add a “comment” link to
*/
-function addCommentLink(postId, element) {
+function addCommentLink(postId, element
, insertAfterThisElement
) {
if ($(element).find(".show-reply-form").length > 0) {
return;
}
if ($(element).find(".show-reply-form").length > 0) {
return;
}
@@
-86,9
+86,7
@@
function addCommentLink(postId, element) {
});
return commentElement;
})(postId);
});
return commentElement;
})(postId);
- $(element).find(".status-line .time").each(function() {
- $(this).after(commentElement.clone(true));
- });
+ $(insertAfterThisElement).after(commentElement.clone(true));
}
var translations = {};
}
var translations = {};
@@
-527,7
+525,7
@@
function ajaxifyReply(replyElement) {
});
});
})(replyElement);
});
});
})(replyElement);
- addCommentLink(getPostId(replyElement), replyElement);
+ addCommentLink(getPostId(replyElement), replyElement
, $(replyElement).find(".reply-status-line .time")
);
}
/**
}
/**
@@
-692,9
+690,11
@@
function resetActivity() {
}
function setActivity() {
}
function setActivity() {
- title = document.title;
- if (title.indexOf('(') != 0) {
- document.title = "(!) " + title;
+ if (!focus) {
+ title = document.title;
+ if (title.indexOf('(') != 0) {
+ document.title = "(!) " + title;
+ }
}
}
}
}
@@
-724,6
+724,8
@@
function createNotification(id, text, dismissable) {
// EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE
//
// EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE
//
+var focus = true;
+
$(document).ready(function() {
/* this initializes the status update input field. */
$(document).ready(function() {
/* this initializes the status update input field. */
@@
-826,7
+828,10
@@
$(document).ready(function() {
/* reset activity counter when the page has focus. */
$(window).focus(function() {
/* reset activity counter when the page has focus. */
$(window).focus(function() {
+ focus = true;
resetActivity();
resetActivity();
- });
+ }).blur(function() {
+ focus = false;
+ })
});
});