mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
closes #1513
This commit is contained in:
@@ -3,5 +3,6 @@
|
|||||||
"chat.placeholder": "type chat message here, press enter to send",
|
"chat.placeholder": "type chat message here, press enter to send",
|
||||||
"chat.send": "Send",
|
"chat.send": "Send",
|
||||||
"chat.no_active": "You have no active chats.",
|
"chat.no_active": "You have no active chats.",
|
||||||
"chat.user_typing": "%1 is typing ..."
|
"chat.user_typing": "%1 is typing ...",
|
||||||
|
"chat.user_has_messaged_you": "%1 has messaged you."
|
||||||
}
|
}
|
||||||
@@ -385,16 +385,20 @@ var socket,
|
|||||||
if (!titleObj.titles[0]) {
|
if (!titleObj.titles[0]) {
|
||||||
titleObj.titles[0] = window.document.title;
|
titleObj.titles[0] = window.document.title;
|
||||||
}
|
}
|
||||||
titleObj.titles[1] = title;
|
|
||||||
|
translator.translate(title, function(translated) {
|
||||||
|
titleObj.titles[1] = translated;
|
||||||
if (titleObj.interval) {
|
if (titleObj.interval) {
|
||||||
clearInterval(titleObj.interval);
|
clearInterval(titleObj.interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
titleObj.interval = setInterval(function() {
|
titleObj.interval = setInterval(function() {
|
||||||
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
|
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
|
||||||
if (title) {
|
if (title) {
|
||||||
window.document.title = title;
|
window.document.title = title;
|
||||||
}
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (titleObj.interval) {
|
if (titleObj.interval) {
|
||||||
clearInterval(titleObj.interval);
|
clearInterval(titleObj.interval);
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isSelf && (!modal.is(":visible") || !app.isFocused)) {
|
if (!isSelf && (!modal.is(":visible") || !app.isFocused)) {
|
||||||
app.alternatingTitle(username + ' has messaged you');
|
app.alternatingTitle('[[modules:chat.user_has_messaged_you, ' + username + ']]');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
module.createModal(username, data.withUid, function(modal) {
|
module.createModal(username, data.withUid, function(modal) {
|
||||||
module.toggleNew(modal.attr('UUID'), true);
|
module.toggleNew(modal.attr('UUID'), true);
|
||||||
if (!isSelf) {
|
if (!isSelf) {
|
||||||
app.alternatingTitle(username + ' has messaged you');
|
app.alternatingTitle('[[modules:chat.user_has_messaged_you, ' + username + ']]');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -91,6 +91,9 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
|
|||||||
socket.on('event:chats.userStartTyping', function(withUid) {
|
socket.on('event:chats.userStartTyping', function(withUid) {
|
||||||
var modal = module.getModal(withUid);
|
var modal = module.getModal(withUid);
|
||||||
var chatContent = modal.find('#chat-content');
|
var chatContent = modal.find('#chat-content');
|
||||||
|
if (!chatContent.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var atBottom = chatContent[0].scrollHeight - chatContent.scrollTop() === chatContent.innerHeight();
|
var atBottom = chatContent[0].scrollHeight - chatContent.scrollTop() === chatContent.innerHeight();
|
||||||
|
|
||||||
modal.find('.user-typing').removeClass('hide').appendTo(chatContent);
|
modal.find('.user-typing').removeClass('hide').appendTo(chatContent);
|
||||||
|
|||||||
Reference in New Issue
Block a user