Revision fefc5343
b/src/gr/grnet/pithos/web/client/FileUploadDialog.java | ||
---|---|---|
165 | 165 |
|
166 | 166 |
native void setupUpload(FileUploadDialog dlg, String path, String token) /*-{ |
167 | 167 |
var uploader = $wnd.$('#uploader').pluploadQueue(); |
168 |
$wnd.console.log(uploader); |
|
169 |
if (!uploader) { |
|
168 |
var createUploader = function() { |
|
170 | 169 |
$wnd.$("#uploader").pluploadQueue({ |
171 | 170 |
// General settings |
172 | 171 |
runtimes : 'html5, flash, gears, silverlight, browserplus, html4', |
... | ... | |
208 | 207 |
$wnd.console.log('All files finished'); |
209 | 208 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::hideUploadIndicator()(); |
210 | 209 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::refreshFolder()(); |
210 |
}, |
|
211 |
|
|
212 |
Error: function(up, error) { |
|
213 |
$wnd.console.log("Error occured:" + error); |
|
211 | 214 |
} |
212 | 215 |
} |
213 | 216 |
}); |
214 |
uploader = $wnd.$("#uploader").pluploadQueue(); |
|
217 |
return $wnd.$('#uploader').pluploadQueue(); |
|
218 |
}; |
|
219 |
|
|
220 |
$wnd.console.log(uploader); |
|
221 |
if (!uploader) { |
|
222 |
uploader = createUploader(); |
|
215 | 223 |
} |
216 | 224 |
else { |
217 | 225 |
var removeAll = true; |
... | ... | |
226 | 234 |
} |
227 | 235 |
if (removeAll) { |
228 | 236 |
$wnd.console.log('About to remove ' + files.length + ' files'); |
229 |
while (files.length > 0) { |
|
230 |
uploader.removeFile(files[0]); |
|
231 |
} |
|
237 |
uploader.destroy(); |
|
238 |
uploader = createUploader(); |
|
232 | 239 |
$wnd.console.log(uploader); |
233 | 240 |
} |
234 | 241 |
} |
Also available in: Unified diff