Merge branch 'better-chat_status' of https://github.com/linkmauve/converse.js into linkmauve-better-chat_status

This commit is contained in:
JC Brand 2018-07-16 01:05:45 +02:00
commit bb5dff9a74
5 changed files with 13 additions and 11 deletions

View File

@ -1688,7 +1688,7 @@
var media = view.el.querySelector('.chat-msg .chat-msg-media');
expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual(
'<!-- src/templates/file.html -->'+
'<a target="_blank" rel="noopener" href="http://localhost/funny.pdf">Download: "funny.pdf</a>');
'<a target="_blank" rel="noopener" href="http://localhost/funny.pdf">Download "funny.pdf"</a>');
done();
});
}));

View File

@ -217,9 +217,11 @@
}, false);
xhr.onerror = () => {
let message = __('Sorry, could not succesfully upload your file.');
let message;
if (xhr.responseText) {
message += ' ' + __('Your server\'s response: "%1$s"', xhr.responseText)
message = __('Sorry, could not succesfully upload your file. Your servers response: "%1$s"', xhr.responseText)
} else {
message = __('Sorry, could not succesfully upload your file.');
}
this.save({
'type': 'error',

View File

@ -1071,13 +1071,13 @@
let text;
if (u.isVisible(this.el)) {
if (show === 'offline') {
text = fullname+' '+__('has gone offline');
text = __('%1$s has gone offline', fullname);
} else if (show === 'away') {
text = fullname+' '+__('has gone away');
text = __('%1$s has gone away', fullname);
} else if ((show === 'dnd')) {
text = fullname+' '+__('is busy');
text = __('%1$s is busy', fullname);
} else if (show === 'online') {
text = fullname+' '+__('is online');
text = __('%1$s is online', fullname);
}
if (text) {
this.content.insertAdjacentHTML(

View File

@ -208,16 +208,16 @@
if (this.model.get('sender') === 'me') {
text = __('Typing from another device');
} else {
text = name +' '+__('is typing');
text = __('%1$s is typing', name);
}
} else if (this.model.get('chat_state') === _converse.PAUSED) {
if (this.model.get('sender') === 'me') {
text = __('Stopped typing on the other device');
} else {
text = name +' '+__('has stopped typing');
text = __('%1$s has stopped typing', name);
}
} else if (this.model.get('chat_state') === _converse.GONE) {
text = name +' '+__('has gone away');
text = __('%1$s has gone away', name);
} else {
return;
}

View File

@ -267,7 +267,7 @@
}
return tpl_file({
'url': url,
'label_download': __('Download: "%1$s', filename)
'label_download': __('Download "%1$s"', filename)
})
};