Changeset 1182 for trunk/web-app


Ignore:
Timestamp:
Nov 22, 2010, 5:27:23 PM (10 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

Location:
trunk/web-app
Files:
2 edited

Legend:

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

    r980 r1182  
    381381    margin-left: 5px;
    382382}
     383
     384#content .wizard .upload_info a {
     385        text-decoration: underline;
     386}
     387
     388.wizard .upload_del img {
     389        border-width: 0;
     390        padding-left: 6px;
     391}
     392
     393.wizard .upload_del {
     394        display: none;
     395}
     396
    383397.wizard .upload_info .error {
    384398    color: red;
  • 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.