') {
+ response = doc.body.firstChild.firstChild.nodeValue;
+ }
+ response = eval('(' + response + ')');
+ } catch (err) {
+ response = {status: 'ERROR'};
+ }
+
+ rcmail.hide_message(event.data.ts);
+
+ // refresh the list on upload success
+ if (file_api.response_parse(response))
+ file_api.file_list();
+ });
+ }
+ };
+
+ // post the given form to a hidden iframe
+ this.async_upload_form = function(form, action, onload)
+ {
+ var ts = rcmail.display_message(rcmail.get_label('kolab_files.uploading'), 'loading', 1000),
+ frame_name = 'fileupload'+ts;
+/*
+ // upload progress support
+ if (this.env.upload_progress_name) {
+ var fname = this.env.upload_progress_name,
+ field = $('input[name='+fname+']', form);
+
+ if (!field.length) {
+ field = $('').attr({type: 'hidden', name: fname});
+ field.prependTo(form);
+ }
+ field.val(ts);
+ }
+*/
+ // have to do it this way for IE
+ // otherwise the form will be posted to a new window
+ if (document.all) {
+ var html = '';
+ document.body.insertAdjacentHTML('BeforeEnd', html);
+ }
+ // for standards-compliant browsers
+ else
+ $('