message_actions: Split the View source / Move message option into two menu options.

Split the View source / Move message option into two menu options that
take you to the same UI: Move message and View message source.
Previously, it was confusing to have this double option,
and hard to parse it at a glance.

-View message source uses the current icon.

-Move message uses the arrows icon from the Move topic menu option.

-New option order: (1) Move message, (2) Quote and reply or forward,
 (3) View message source.

Also remove the "Topic editing only" and "View source" text on the
bottom right of the message edit UI along with the tooltips. Only
the timer text is shown (along with tooltip) when content editing
is allowed.
This commit is contained in:
Akarsh Jain
2022-08-03 11:18:43 +05:30
committed by Tim Abbott
parent 9bac655cd2
commit 67d7efefdc
7 changed files with 31 additions and 24 deletions

View File

@@ -454,8 +454,6 @@ function edit_message($row, raw_content) {
message_id: message.id,
is_editable,
is_content_editable,
is_widget_message: is_widget_message(message),
has_been_editable: editability !== editability_types.NO,
topic: message.topic,
content: raw_content,
file_upload_enabled,
@@ -517,13 +515,11 @@ function edit_message($row, raw_content) {
// in streams), then we'll need to disable
// row.find('input.message_edit_topic') as well.
$message_edit_content.attr("readonly", "readonly");
$message_edit_countdown_timer.text($t({defaultMessage: "View source"}));
create_copy_to_clipboard_handler($row, $copy_message[0], message.id);
break;
case editability_types.TOPIC_ONLY:
$message_edit_content.attr("readonly", "readonly");
// Hint why you can edit the topic but not the message content
$message_edit_countdown_timer.text($t({defaultMessage: "Topic editing only"}));
create_copy_to_clipboard_handler($row, $copy_message[0], message.id);
break;
case editability_types.FULL: {
@@ -547,7 +543,7 @@ function edit_message($row, raw_content) {
// Add tooltip
if (
editability !== editability_types.NO &&
editability === editability_types.FULL &&
page_params.realm_message_content_edit_limit_seconds > 0
) {
$row.find(".message-edit-timer").show();