Feature Proposal: Attach should support drag and drop
Motivation
The current attach mechanism is clumsy and slow. One file at a time, several screens. Yuck. Various plugins have attempted to improve this, but it remains painful.
My users kept asking why they couldn't simply drag and drop files as attachments. After a while, I wondered too.
Description and Documentation
Drag and drop is now feasible for many browsers. When HTML5 is universal, it will be for all. At the moment, Google Gears can be made - with some pain - to work. I have a prototype based on TWiki 4.2.3 and Google Gears.
The core changes are minimal - and mostly mechanical.
But, since
a prototype is worth more than a random request, simply
click here for the current snapshot. I'm sure some css purists would do things a bit differently, and the skins folks will want to make corresponding changes in the other skins. Not being a skins person, I'm sure there's a more elegant approach.
Comments and improvements welcome. However, many of the limitations are due to Gears - which is not under active development (though Google supports it.)
Examples
Impact
Implementation
--
Contributors: TimotheLitt - 2010-06-27
Discussion
Excellent stuff Timothe! I am looking forward to use the full power of
HTML5.
--
PeterThoeny - 2010-06-27
--
TimotheLitt - 2010-06-28
I added a comment, got the login prompt, then a "you're not allowed access" error. That needs to be fixed.
--
TimotheLitt - 2010-06-28
And this time, I'll use firefox - I recommend Lazarus ;-(
You'll be waiting a long time for HTML5 - 2012 - 2022 according the links pointed to by the topic above.
Meantime, I expect the usual mess - not-quite-standards, incompatible previews, ugly legacy.
The prototype is intended to stimulate thought and more immediate action - as well as solve a current problem.
You might want to put the core change in (it's backward compatible); then the rest could be packaged as a contrib.
I encourage playing with it to get some feel for what works - and what doesn't. I can say that the first time I dragged 200 files onto the attach page and they appeared instantly (I was on the LAN), I decided my users were right!
On the other hand, the foswiki folks are promising an updated
UploadPlugin that will be far more comprehensive.
If you want to try the prototype, cd to /twiki on a 4.2.3 system and unzip the file. Fix the usual permissions (ownership, selinux contexts) & it should just work. Or, there's a patch file (but you still need to copy the images). I haven't looked at later releases, but would expect the patch to apply smoothly.
Enjoy,
--
TimotheLitt - 2010-06-28
Timothe - sounds interesting. Would you mind sharing your work here? we can get the best use of it
--
SopanShewale - 2010-06-29
As noted, I'd attached a .zip file with my work back in June.
I've just updated it (see
DraggerV2.tar.gz , attached). This version has some fixes/work-arounds that make it more robust in the face of some Gears issues.
It's also much easier to use with an arbitrary form (besides the attach form) -- the javascript will now automagically scan the form and submit the appropriate controls. Although you can still explicitly specify what post URL, file control and formid you want, it can figure this out for itself.
I use this interface for other applications, so it's quite modular.
I didn't create a patch file, but you can untar this over a 4.2.3 image and it should work. You can create your own diffs if you need them.
Also, the javascript can be compiled with Google's closure compiler, which shrinks the code. This isn't necessary for correct operation, but I've attached the script to do this in another file. The filenames in the script differ (I use symlinks from the twiki area), but it should be obvious what's going on.
Enjoy.
P.S. Note that I don't monitor all these pages - if you want quicker replies, you have my e-mail address.
--
TimotheLitt - 2010-09-29
Thank you Timothe for sharing the updated version!
--
PeterThoeny - 2010-09-30