Changeset 1182 for trunk/web-app/js


Ignore:
Timestamp:
Nov 22, 2010, 5:27:23 PM (11 years ago)
Author:
robert@…
Message:

Improved file upload fields so users can delete existing files and are able to access uploaded files (using a tag in the tag library). See ticket #17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/js/wizard.js

    r1040 r1182  
    372372                    // Give feedback to the user
    373373                    $('#' + field_id + 'Example').html('Uploading ' + createFileHTML( file ));
    374 
     374                    $('#' + field_id + 'Delete').hide();
    375375
    376376                },
     
    379379                        $('#' + field_id).val( '' );
    380380                        $('#' + field_id + 'Example').html('<span class="error">Error uploading ' + createFileHTML( file ) + '</span>' );
     381                            $('#' + field_id + 'Delete').hide();
    381382                    } else {
    382383                        $('#' + field_id).val( response );
    383384                        $('#' + field_id + 'Example').html('Uploaded ' + createFileHTML( file ) );
     385                            $('#' + field_id + 'Delete').show();
    384386                    }
    385387                }
    386388        });
     389}
     390
     391function deleteFile( field_id ) {
     392        $('#' + field_id).val( '*deleted*' );
     393        $('#' + field_id + 'Example').html('File deleted' );
     394        $('#' + field_id + 'Delete').hide();
    387395}
    388396
Note: See TracChangeset for help on using the changeset viewer.