diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 14:15:28 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 14:15:28 +0200 |
| commit | 9143c5e0cfc2640195cd9fe85b71c8e95d687126 (patch) | |
| tree | 2198798af20d37cea2891ed63f4ffc36e15d1fdd /js | |
| parent | a2db431bbd43f2c49c026d765099dbcffbbdb72e (diff) | |
| parent | e7a8961a1674477f64048d995dfad9dcc3b15fce (diff) | |
Merge branch 'totalName' of WubTheCaptain/pomf
OK ewhal@
Diffstat (limited to 'js')
| -rw-r--r-- | js/pomf.js | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,6 @@ /** * Copyright (c) 2013 Peter Lejeck <peter.lejeck@gmail.com> + * Copyright (c) 2015 the Pantsu.cat developers <hostmaster@pantsu.cat> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -103,11 +104,12 @@ $(function() { var totalRow = createRow('', files.humanSize, 'total'); totalRow.appendTo(uploadFiles); + var totalName = $('.file-name', totalRow); + if (files.size > MAX_SIZE) { uploadFiles.addClass('error'); - $('.file-name', totalRow).html('onii-chan y-your upload is t-too ' + - 'big…'); + totalName.html('onii-chan y-your upload is t-too big…'); return; } @@ -123,8 +125,6 @@ $(function() { }); }; - var totalName = $('.file-name', totalRow); - up.on('uploadprogress', function(e, files) { eachRow(files, function(row, file, files) { $('.progress-inner', row).width((file.percentUploaded * 100) + '%'); @@ -143,8 +143,7 @@ $(function() { var res = JSON.parse(res); if (!res.success) { uploadFiles.addClass('error'); - $('.file-name', totalRow).text('Something went wrong; try again ' + - 'later.'); + totalName.text('Something went wrong; try again later.'); break; } eachRow(res.files, function(row, file, files) { |
