upload: Support drag and dropping files anywhere on message viewport.

While Zulip has supported drag/drop into the compose box for some
time, if you drag/drop the file onto other parts of the message
viewport, it would just do the default browswer behavior of replacing
the Zulip app with that file opened in a new tab, which nobody wants.

The inline comments document the set of rules for how we choose
whether to drop the upload into the compose box or an edit widget, and
also how to open the compose box in different situations.

Fixes #14579.
This commit is contained in:
Brijmohan Siyag
2023-06-16 16:19:02 +05:30
committed by Tim Abbott
parent 1b9fb037a1
commit 4e7bf3c4fb
5 changed files with 251 additions and 2 deletions

View File

@@ -113,6 +113,7 @@ import * as typing from "./typing";
import * as unread from "./unread";
import * as unread_ops from "./unread_ops";
import * as unread_ui from "./unread_ui";
import * as upload from "./upload";
import * as user_group_edit from "./user_group_edit";
import * as user_group_edit_members from "./user_group_edit_members";
import * as user_groups from "./user_groups";
@@ -762,6 +763,7 @@ export function initialize_everything() {
hotspots.initialize();
typing.initialize();
starred_messages_ui.initialize();
upload.initialize();
user_status_ui.initialize();
fenced_code.initialize(generated_pygments_data);
message_edit_history.initialize();