Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Title: Patch for Form Files or type="file" » Support input fields of type 'file'
Category: support » feature
Status: Needs review » Needs work

The patch is reversed. But also, can you post a screenshot of how this looks, please?

elvis2’s picture

Thanks for pointing out the reversed patch. Attached are 4 screenshots. Two are only related to the file filed itself before and after on FF. The other two are to show the safari/chrome issues (before and after the fix).

elvis2’s picture

Sorry, compact_forms_file_safari_after.PNG was messed up. Here is the better one.

sun’s picture

Status: Needs review » Needs work

Thanks for re-rolling an providing those screenshots.

Regarding the screenshots, I'm not sure what I'm looking at. I've highly prefer to see a screenshot from one of Drupal core's stock/default themes; e.g., Garland. With this patch, I guess you should be able to compact the node form (with Upload module enabled) and have the file attachments field compacted.

+++ compact_forms.js	2010-09-09 20:05:51.000000000 -0400
@@ -16,21 +16,26 @@
-
+      ¶

(and elsewhere in this patch) Trailing white-space introduced.

+++ compact_forms.js	2010-09-09 20:05:51.000000000 -0400
@@ -16,21 +16,26 @@
+      // If Safari or Chrome and are dealing with file field, we need to hide the label
+      if ($field.is('input:file') && $.browser.safari) {
+         $label.css('display', 'none');
+      }

1) "dealing" does not explain why we are implementing this special, browser-specific code and behavior.

2) The comment talks about Chrome and Safari, but the code is conditionally executed for Safari only.

Powered by Dreditor.

elvis2’s picture

Thanks for the feedback. First you should know this is a webform file field the patch is dealing with. The screenshots are only referring the file field.

compact_forms_before.PNG AND compact_forms_after.PNG show the "file upload" label is not in the textfield form element.
http://drupal.org/files/issues/compact_forms_before.PNG
http://drupal.org/files/issues/compact_forms_after.PNG

On Safari and Chrome, the filefield is overridden by the browser, which is fine except the label field shows (on top) of the "Choose File" button the browser renders. See
http://drupal.org/files/issues/compact_forms_file_safari_before.PNG AND
http://drupal.org/files/issues/compact_forms_file_safari_after_0.PNG

Regarding the code for Safari and not Chrome condition, on my PC JS does not recognize $.browser.chrome when using chrome. But, it does recognize $.browser.safari when using both chrome and safari. Maybe it is different on a Mac.

elvis2’s picture

Status: Needs work » Needs review
FileSize
10.61 KB
11.62 KB
16.75 KB
18.3 KB

Here are the screenshots with the garland theme...

sun’s picture

Status: Needs review » Needs work

Sorry, but http://drupal.org/files/issues/garland_Safari-Chrome_after.PNG won't fly -- the label is missing entirely, so the user has no idea what to upload.