Commit 08dce556 authored by JC Brand's avatar JC Brand

When correcting a message, also highlight the textarea.

parent 27bc33ba
...@@ -7490,6 +7490,8 @@ body.reset { ...@@ -7490,6 +7490,8 @@ body.reset {
margin-bottom: -4px; } margin-bottom: -4px; }
#conversejs .chatbox .sendXMPPMessage .chat-textarea.spoiler { #conversejs .chatbox .sendXMPPMessage .chat-textarea.spoiler {
height: 42px; } height: 42px; }
#conversejs .chatbox .sendXMPPMessage .chat-textarea.correcting {
background-color: #e7f7ee; }
#conversejs .chatbox .sendXMPPMessage .send-button { #conversejs .chatbox .sendXMPPMessage .send-button {
position: absolute; position: absolute;
left: 3px; left: 3px;
...@@ -8676,6 +8678,9 @@ body.reset { ...@@ -8676,6 +8678,9 @@ body.reset {
#conversejs.converse-embedded .chatroom .sendXMPPMessage .chat-textarea, #conversejs.converse-embedded .chatroom .sendXMPPMessage .chat-textarea,
#conversejs .chatroom .sendXMPPMessage .chat-textarea { #conversejs .chatroom .sendXMPPMessage .chat-textarea {
border-bottom-right-radius: 0; } border-bottom-right-radius: 0; }
#conversejs.converse-embedded .chatroom .sendXMPPMessage .chat-textarea.correcting,
#conversejs .chatroom .sendXMPPMessage .chat-textarea.correcting {
background-color: #fadfd7; }
#conversejs.converse-embedded .chatroom .sendXMPPMessage .send-button, #conversejs.converse-embedded .chatroom .sendXMPPMessage .send-button,
#conversejs .chatroom .sendXMPPMessage .send-button { #conversejs .chatroom .sendXMPPMessage .send-button {
background-color: #E77051; } background-color: #E77051; }
...@@ -8840,7 +8845,7 @@ body.reset { ...@@ -8840,7 +8845,7 @@ body.reset {
#conversejs .message.chat-msg:hover .chat-msg__actions .chat-msg__action { #conversejs .message.chat-msg:hover .chat-msg__actions .chat-msg__action {
opacity: 1; } opacity: 1; }
#conversejs .message.chat-msg.correcting.groupchat { #conversejs .message.chat-msg.correcting.groupchat {
background-color: #fdf1ee; } background-color: #fadfd7; }
#conversejs .message.chat-msg.correcting:not(.groupchat) { #conversejs .message.chat-msg.correcting:not(.groupchat) {
background-color: #e7f7ee; } background-color: #e7f7ee; }
#conversejs .message.chat-msg .spoiler { #conversejs .message.chat-msg .spoiler {
......
...@@ -251,6 +251,9 @@ ...@@ -251,6 +251,9 @@
&.spoiler { &.spoiler {
height: 42px; height: 42px;
} }
&.correcting {
background-color: lighten($chat-head-color, 50%);
}
} }
.send-button { .send-button {
......
...@@ -271,6 +271,9 @@ ...@@ -271,6 +271,9 @@
} }
.chat-textarea { .chat-textarea {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
&.correcting {
background-color: lighten($chatroom-head-color, 30%);
}
} }
.send-button { .send-button {
background-color: $chatroom-head-color; background-color: $chatroom-head-color;
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
} }
&.correcting { &.correcting {
&.groupchat { &.groupchat {
background-color: lighten($chatroom-head-color, 35%); background-color: lighten($chatroom-head-color, 30%);
} }
&:not(.groupchat) { &:not(.groupchat) {
background-color: lighten($chat-head-color, 50%); background-color: lighten($chat-head-color, 50%);
......
...@@ -803,7 +803,7 @@ ...@@ -803,7 +803,7 @@
*/ */
this.showMessage(message); this.showMessage(message);
if (message.get('correcting')) { if (message.get('correcting')) {
this.insertIntoTextArea(message.get('message'), true); this.insertIntoTextArea(message.get('message'), true, true);
} }
_converse.emit('messageAdded', { _converse.emit('messageAdded', {
'message': message, 'message': message,
...@@ -944,10 +944,10 @@ ...@@ -944,10 +944,10 @@
currently_correcting.save('correcting', false); currently_correcting.save('correcting', false);
} }
message.save('correcting', true); message.save('correcting', true);
this.insertIntoTextArea(message.get('message'), true); this.insertIntoTextArea(message.get('message'), true, true);
} else { } else {
message.save('correcting', false); message.save('correcting', false);
this.insertIntoTextArea('', true); this.insertIntoTextArea('', true, false);
} }
}, },
...@@ -966,10 +966,10 @@ ...@@ -966,10 +966,10 @@
} }
} }
if (message) { if (message) {
this.insertIntoTextArea(message.get('message'), true); this.insertIntoTextArea(message.get('message'), true, true);
message.save('correcting', true); message.save('correcting', true);
} else { } else {
this.insertIntoTextArea('', true); this.insertIntoTextArea('', true, false);
} }
}, },
...@@ -989,7 +989,7 @@ ...@@ -989,7 +989,7 @@
} }
message = message || this.getOwnMessages().findLast((msg) => msg.get('message')); message = message || this.getOwnMessages().findLast((msg) => msg.get('message'));
if (message) { if (message) {
this.insertIntoTextArea(message.get('message'), true); this.insertIntoTextArea(message.get('message'), true, true);
message.save('correcting', true); message.save('correcting', true);
} }
}, },
...@@ -1010,7 +1010,7 @@ ...@@ -1010,7 +1010,7 @@
return this; return this;
}, },
insertIntoTextArea (value, replace=false) { insertIntoTextArea (value, replace=false, correcting=false) {
const textarea = this.el.querySelector('.chat-textarea'); const textarea = this.el.querySelector('.chat-textarea');
if (replace) { if (replace) {
textarea.value = value; textarea.value = value;
...@@ -1021,6 +1021,11 @@ ...@@ -1021,6 +1021,11 @@
} }
textarea.value = existing+value+' '; textarea.value = existing+value+' ';
} }
if (correcting) {
u.addClass('correcting', textarea);
} else {
u.removeClass('correcting', textarea);
}
textarea.focus() textarea.focus()
}, },
......
...@@ -154,10 +154,10 @@ ...@@ -154,10 +154,10 @@
// Refer to docs/source/configuration.rst for explanations of these // Refer to docs/source/configuration.rst for explanations of these
// configuration settings. // configuration settings.
_converse.api.settings.update({ _converse.api.settings.update({
auto_list_rooms: false, 'auto_list_rooms': false,
hide_muc_server: false, // TODO: no longer implemented... 'hide_muc_server': false, // TODO: no longer implemented...
muc_disable_moderator_commands: false, 'muc_disable_moderator_commands': false,
visible_toolbar_buttons: { 'visible_toolbar_buttons': {
'toggle_occupants': true 'toggle_occupants': true
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment