Page MenuHomePhabricator

VisualEditor: Initiate file upload by drag-and-drop
Closed, ResolvedPublic8 Estimated Story Points

Description

Once basic image support is included, and there's some integration with UploadWizard or similar, it should be possible to initialize the upload tool with drag-and-dropped image files.

This would allow simply dragging one or more files from your file manager over to the spot in the document where you want them, ending up with a single image or gallery at the end.

Compared to T40030: Way in VisualEditor to initiate Commons file uploading, and insert image on completion, needs to be able to initialize the wizard with given File objects received via a drop.

See also: T11133: Drag and drop uploading

Related Objects

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:46 AM
bzimport set Reference to bz38031.

This is not on schedule for before the next big release; noting as such.

Request for similar functionality made at MediaWiki today:

Hi, I see a number of requests for the ability to easily upload local images (from our local HD to Wiki I guess). I'd like to add my vote for this request. How is this progressing? How would it work? Simply browse for an image locally and then go through the captioning, sizing, aligning, positioning, licensing — then upload for it to appear immediately in the desired location with also the hi-res and info immediately in Wikimedia Commons?

Robertwhyteus (talk)‎20:27, 9 July 2013

I think roughly what we'd want to happen is something like this:

  • user drag-and-drops an image file from Explorer/Finder/file manager into the document.
    • if possible, show a rectangular placeholder box around the cursor position while dragging
  • on drop, save the cursor position so we know where in the document to insert...
  • ...and spawn the UploadWizard or similar interface, handing it the file we've received to start the actual upload process, select a license, save a description etc.
  • At the end of the UploadWizard, instead of showing you the link to the file we transition straight back to the editor...
  • ...and you can then modify the positioning/sizing/caption/etc with the VisualEditor's existing dialogs.

If using UploadWizard itself is not feasible at this stage, a lightweight uploader UI similar to what's available on mobile might be good -- this does a cross-origin POST to Commons for the upload, so we don't have to leave the page or open an iframe or anything weird like that.

(In reply to comment #3)

If using UploadWizard itself is not feasible at this stage, a lightweight
uploader UI similar to what's available on mobile might be good -- this does
a cross-origin POST to Commons for the upload, so we don't have to leave the
page or open an iframe or anything weird like that.

Opening up an iframe isn't too hard for VisualEditor (every dialog is one already), but re-using UploadWizard (and refactoring it so this is possible) seems like a much better solution than writing our own.

There's wider product questions about whether to allow uploading to local, or just to Commons (given that relatively few wikis allow local uploads, and that those are only meant to be used in special circumstances, making it too easy to upload copyvios/etc. and having licence proliferation might be the wrong approach).

VE's drop handler needs a list of allowed file extensions on the target remote wiki. You can get this via the API – http://commons.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions – but we'll need T114765 before we can scrape it. It also/instead needs a list of MIME types; not sure if that's possible in MW, sadly.

Jdforrester-WMF raised the priority of this task from Low to High.Oct 7 2015, 2:11 AM

Change 244331 had a related patch set uploaded (by Esanders):
Media upload: Initiate upload process on image drop

https://gerrit.wikimedia.org/r/244331

Change 244331 merged by jenkins-bot:
Media upload: Initiate upload process on image drop

https://gerrit.wikimedia.org/r/244331

Change 246185 had a related patch set uploaded (by Prtksxna):
Media upload: Initialize booklet before setting file on drag drop

https://gerrit.wikimedia.org/r/246185

Change 246185 merged by jenkins-bot:
Media upload: Initialize booklet before setting file on drag drop

https://gerrit.wikimedia.org/r/246185

Hey, just curious if this feature is actually in Visual Editor or not? I can't seem to find it, or figure out how to use it.

@Thedonquixotic : This task is resolved (see top bar). If something does not work for you, see https://www.mediawiki.org/wiki/VisualEditor/Portal for where to discuss issues. Thanks!