When a file name is added to the input field for file type parameters, show a preview above the entry field (but below the parameter title and description) with a maximum size of 120px in either direction. When any part of the file name is removed or changed, remove the preview.
Requirements
- Preview appears when adding a file name to the entry field via upload, search, or directly entering a correct file name
- Preview disappears when the entry in the field is changed and therefore would no longer insert the file into the template on save
- Image files (jpg, png) show thumbnail
- PDFs, show thumbnail of first page (match existing style)
- Videos, show thumbnail from middle (match existing style)
- Audio files, show icon (match existing style)
- When no file is found (typo or otherwise), show no file found placeholder
- While fetching the image, use the OOUI loading animation of three dots 25px x 25px. The div with whitespace should take up the same amount of space as the image, 120px x 120px, and give this area a background of Base80 - see mock. (Alternate - use a small version of the OOUI widget: Progress bar (indeterminate)).
Nice to have
- When the image preview is clicked, the file's commons page opens in a new tab
Mocks
Specs: