[pmwiki-users] Drag-and-drop uploads
Petko Yotov
5ko at 5ko.fr
Fri Jul 26 10:08:49 PDT 2024
I started work on integrating the functionality of the recipe
DragDropMultiUpload (DDMU) directly in the core:
https://www.pmwiki.org/wiki/Cookbook/DragDropMultiUpload
It is quite popular on the *-Talk/*-Users pages, and I enable it on all
wikis I install. I figured adding it to the core will make it easier for
me to maintain and for everyone to use and upgrade.
It will not be enabled by default, but will be easy to enable or
disable.
To test it, download the pre-release from Subversion or a zip archive
from ChangeLog:
https://www.pmwiki.org/wiki/PmWiki/ChangeLog
Then add to config.php:
$EnableUploadDrop = 1;
(Also, comment out the inclusion of DDMU if you have it.)
There will be a "drop zone" when editing or uploading, inserted above
the edit form, and above the upload form.
The differences from DDMU are:
* simplified, integrated in the core, no dependencies (Unverse.js
dropped)
* reuse of some PmSyntax colors which are more likely to be compatible
with different skins and backgrounds, but also easy to customize
* the status box characters are now before the file names
* a drop zone is always enabled, dropping on the full page is not
* the files are always queued for upload one after another, not uploaded
in parallel
* queued files have a different styling from the currently uploading
file
* improved error handling, message appearing as tooltip when mouse
hovers the file links
* clicking on the file name inserts a link Attach:file.ext in the text
area
* to insert an absolute link Attach:Group.Name/file.ext, hold down the
Ctrl key
* middle-clicking on the file name opens it in a new browser tab for
preview
Let me know if you notice any problems or can suggest improvements.
Petko
P.S. On Ubuntu, some combinations of browser+file-manager may not work,
it has been reported that some versions of Firefox with Thunar or
PCManFM-QT can't upload files by dropping them. This is beyond what
PmWiki can do but I'll be looking into it, and future versions may
become compatible. (This applies to both PmWiki/DDMU and other sites
like webmails that have drop to upload function.)
More information about the pmwiki-users
mailing list