Use "hidden message" instead of spoiler
This commit is contained in:
parent
f267ee5ae0
commit
4732f315ed
@ -137,10 +137,10 @@
|
|||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
||||||
|
|
||||||
spoiler_toggle = view.el.querySelector('.toggle-spoiler');
|
spoiler_toggle = view.el.querySelector('.toggle-spoiler');
|
||||||
expect(spoiler_toggle.textContent).toBe('Show spoiler');
|
expect(spoiler_toggle.textContent).toBe('Show hidden message');
|
||||||
spoiler_toggle.click();
|
spoiler_toggle.click();
|
||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeFalsy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeFalsy();
|
||||||
expect(spoiler_toggle.textContent).toBe('Hide spoiler');
|
expect(spoiler_toggle.textContent).toBe('Hide hidden message');
|
||||||
spoiler_toggle.click();
|
spoiler_toggle.click();
|
||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
@ -203,10 +203,10 @@
|
|||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
||||||
|
|
||||||
spoiler_toggle = view.el.querySelector('.toggle-spoiler');
|
spoiler_toggle = view.el.querySelector('.toggle-spoiler');
|
||||||
expect(spoiler_toggle.textContent).toBe('Show spoiler');
|
expect(spoiler_toggle.textContent).toBe('Show hidden message');
|
||||||
spoiler_toggle.click();
|
spoiler_toggle.click();
|
||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeFalsy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeFalsy();
|
||||||
expect(spoiler_toggle.textContent).toBe('Hide spoiler');
|
expect(spoiler_toggle.textContent).toBe('Hide hidden message');
|
||||||
spoiler_toggle.click();
|
spoiler_toggle.click();
|
||||||
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
expect(_.includes(spoiler_msg_el.classList, 'collapsed')).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
|
@ -330,7 +330,7 @@
|
|||||||
renderMessageForm () {
|
renderMessageForm () {
|
||||||
let placeholder;
|
let placeholder;
|
||||||
if (this.model.get('composing_spoiler')) {
|
if (this.model.get('composing_spoiler')) {
|
||||||
placeholder = __('Spoiler message');
|
placeholder = __('Hidden message');
|
||||||
} else {
|
} else {
|
||||||
placeholder = __('Personal message');
|
placeholder = __('Personal message');
|
||||||
}
|
}
|
||||||
@ -570,7 +570,7 @@
|
|||||||
* (Object) attrs: An object containing message attributes.
|
* (Object) attrs: An object containing message attributes.
|
||||||
*/
|
*/
|
||||||
if (attrs.is_spoiler) {
|
if (attrs.is_spoiler) {
|
||||||
return {'label_show': __('Show spoiler')};
|
return {'label_show': __('Show hidden message')};
|
||||||
} else {
|
} else {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
@ -829,7 +829,7 @@
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* (String) text - The chat message text.
|
* (String) text - The chat message text.
|
||||||
* (String) spoiler_hint - A hint in case the message
|
* (String) spoiler_hint - A hint in case the message
|
||||||
* text is a spoiler message. See XEP-0382
|
* text is a hidden/spoiler message. See XEP-0382
|
||||||
*/
|
*/
|
||||||
if (!_converse.connection.authenticated) {
|
if (!_converse.connection.authenticated) {
|
||||||
return this.showHelpMessages(
|
return this.showHelpMessages(
|
||||||
@ -1028,12 +1028,12 @@
|
|||||||
toggle_el.parentElement.querySelector('.spoiler')
|
toggle_el.parentElement.querySelector('.spoiler')
|
||||||
);
|
);
|
||||||
if (toggle_el.getAttribute("data-toggle-state") == "closed") {
|
if (toggle_el.getAttribute("data-toggle-state") == "closed") {
|
||||||
toggle_el.textContent = __('Hide spoiler');
|
toggle_el.textContent = __('Hide hidden message');
|
||||||
toggle_el.classList.remove("icon-eye");
|
toggle_el.classList.remove("icon-eye");
|
||||||
toggle_el.classList.add("icon-eye-blocked");
|
toggle_el.classList.add("icon-eye-blocked");
|
||||||
toggle_el.setAttribute("data-toggle-state", "open");
|
toggle_el.setAttribute("data-toggle-state", "open");
|
||||||
} else {
|
} else {
|
||||||
toggle_el.textContent = __('Show spoiler');
|
toggle_el.textContent = __('Show hidden message');
|
||||||
toggle_el.classList.remove("icon-eye-blocked");
|
toggle_el.classList.remove("icon-eye-blocked");
|
||||||
toggle_el.classList.add("icon-eye");
|
toggle_el.classList.add("icon-eye");
|
||||||
toggle_el.setAttribute("data-toggle-state", "closed");
|
toggle_el.setAttribute("data-toggle-state", "closed");
|
||||||
|
Loading…
Reference in New Issue
Block a user