As split out from the kitchensink patch, here's AJAX uploading support; a straight, simple port from imagefield. Renames a few bits to look more like imagefield's code, but apart from that there are no big surprises. Also fixes a potential, but currently ineffective bug in filefield_menu() where $may_cache and $maycache should be named the same.

Comments

jpetso’s picture

StatusFileSize
new6.1 KB

Here's a new version. Seems that I didn't include progress.js and upload.js, which is why the patch only worked when the upload module itself is enabled.

This one should be perfect :D

gordon’s picture

StatusFileSize
new9.63 KB

I have given this a bit of a bashing and it is working great.

I did find that the output of the upload form was not being themed so I have added that so that the output looks much better.

jpetso’s picture

Whoa, upload.module-like tabular displaying of the files. Themable.
I love this one, it's awesome.

Although, if I were the maintainer, I'm not sure if it would make sense to split such an intrusive change of the looks into a seperate patch, for easier includability. (Which is underlined by the fact that your updated version of the patch did not apply to my quite heavily patched version of filefield, and I had to merge it by hand. This would be easier if the patch is small and self-contained.)

But again, +1 on this improvement, imho it should get in as soon as possible.

jpetso’s picture

I split the user interface changes into #146294, so it can be reviewed and applied seperately from the larger AJAX patch. That would deprecate your filefield_ajax.diff file in favor of the new patch in the new issue, so filefield-ajax-try2.patch is the current applicant for inclusion again.

jpetso’s picture

StatusFileSize
new10.76 KB

Cheers for JavaScript delete buttons! This new version of the patch includes a port of my patch for Drupal core 6.x, and works in the same way, without conceptual changes to the JavaScript logic.

As it's quite impossible to separate this from the theme function, I based this new version of the patch on gordon's themed output improvements, even if those are also available as separate patch from the issue mentioned in the previous comment. As 'cvs diff' can't diff new files, the patch now consists of two parts: the module diff (as before) plus the complete .js file.

jpetso’s picture

StatusFileSize
new3.71 KB

Second part, the new filefield.js file which extends upload.js's functionality with delete button features. Also, did I mention that imagefield would also be able to use this without having their own .js file? Right. You _really_ want this stuff.

jpetso’s picture

StatusFileSize
new3.72 KB

New version of the JavaScript file, adding the form-item class to the button. It then gets the same positioning as the checkbox, which looks better in most cases.

jpetso’s picture

StatusFileSize
new3.73 KB

New version of the JavaScript file: adding semicolons to function/method declarations, like the JavaScript aggregator patch did with all those files. Given, we might not need this file anymore in Drual 6, but if it's a new file that needs no diff then let's do it right anyways.

jpetso’s picture

StatusFileSize
new10.76 KB

...and an update for the module file as well: fix the beginner's mistake of not using t() for the "abc.txt is scheduled for deletion." text.

jpetso’s picture

Status: Needs review » Fixed
StatusFileSize
new6.8 KB

dopry said that I may commit AJAX uploading for the (yet unreleased) 5.x-2.0 release, so it's now in CVS HEAD. Delete buttons have been left out for now (I believe they should go into Drupal core first) but uploading is there. For completeness, here's the final patch that I committed.

Enjoy! (and test!)

Anonymous’s picture

Status: Fixed » Closed (fixed)