Skip to content

Instantly share code, notes, and snippets.

@yumitsu
Created October 21, 2011 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yumitsu/1303945 to your computer and use it in GitHub Desktop.
Save yumitsu/1303945 to your computer and use it in GitHub Desktop.
125a126,131
>
> hidden.bind('uploadcare-success', function() {
> UploadCare.FileData.fetch(hidden.val(), function(data) {
> UploadCare.Line.showFileData(data);
> });
> });
206a213,229
> },
>
> showFileData: function(fileData) {
> var widget = $('input[value=' + fileData.file_id + ']').next();
> var uploadPane = $('.uploadcare-line-slider', widget);
> var filename = $('.uploadcare-line-filedata-filename', widget);
> var filesize = $('.uploadcare-line-filedata-filesize', widget);
> var human_size = Math.ceil(fileData.size / 1024) + "kb";
> var human_filename = fileData.original_filename;
>
> if ( human_filename.length > 16 ) {
> human_filename = human_filename.slice(0, 8) + '...' + human_filename.slice(-8);
> }
>
> filename.html(human_filename);
> filesize.html(human_size);
> uploadPane.css({ "margin-top": -60 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment