Merge branch 'linkmauve-better-chat_status'

This commit is contained in:
JC Brand 2018-07-16 01:07:00 +02:00
commit 62dc0c494e
6 changed files with 25 additions and 21 deletions

22
dist/converse.js vendored
View File

@ -68518,10 +68518,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}, 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({
@ -70396,13 +70398,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
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) {
@ -74751,16 +74753,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
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;
}
@ -87318,7 +87320,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return tpl_file({
'url': url,
'label_download': __('Download: "%1$s', filename)
'label_download': __('Download "%1$s"', filename)
});
};

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)
})
};