|
@@ -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 @@
|
|
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 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
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 @@
|
|
}
|
|
}
|
|
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 @@
|
|
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 @@
|
|
}
|
|
}
|
|
textarea.value = existing+value+' ';
|
|
textarea.value = existing+value+' ';
|
|
}
|
|
}
|
|
|
|
+ if (correcting) {
|
|
|
|
+ u.addClass('correcting', textarea);
|
|
|
|
+ } else {
|
|
|
|
+ u.removeClass('correcting', textarea);
|
|
|
|
+ }
|
|
textarea.focus()
|
|
textarea.focus()
|
|
},
|
|
},
|
|
|
|
|