v1.18.x
barisusakli 11 years ago
parent 4c28de659c
commit 8ee866fc9d

@ -3,5 +3,6 @@
"chat.placeholder": "type chat message here, press enter to send",
"chat.send": "Send",
"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]) {
titleObj.titles[0] = window.document.title;
}
titleObj.titles[1] = title;
if (titleObj.interval) {
clearInterval(titleObj.interval);
}
titleObj.interval = setInterval(function() {
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
if (title) {
window.document.title = title;
translator.translate(title, function(translated) {
titleObj.titles[1] = translated;
if (titleObj.interval) {
clearInterval(titleObj.interval);
}
}, 2000);
titleObj.interval = setInterval(function() {
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
if (title) {
window.document.title = title;
}
}, 2000);
});
} else {
if (titleObj.interval) {
clearInterval(titleObj.interval);

@ -72,13 +72,13 @@ define(['taskbar', 'string', 'sounds'], function(taskbar, S, sounds) {
}
if (!isSelf && (!modal.is(":visible") || !app.isFocused)) {
app.alternatingTitle(username + ' has messaged you');
app.alternatingTitle('[[modules:chat.user_has_messaged_you, ' + username + ']]');
}
} else {
module.createModal(username, data.withUid, function(modal) {
module.toggleNew(modal.attr('UUID'), true);
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) {
var modal = module.getModal(withUid);
var chatContent = modal.find('#chat-content');
if (!chatContent.length) {
return;
}
var atBottom = chatContent[0].scrollHeight - chatContent.scrollTop() === chatContent.innerHeight();
modal.find('.user-typing').removeClass('hide').appendTo(chatContent);

Loading…
Cancel
Save