|
|
@ -7497,8 +7497,10 @@ function rcube_webmail()
|
|
|
|
// post the given form to a hidden iframe
|
|
|
|
// post the given form to a hidden iframe
|
|
|
|
this.async_upload_form = function(form, action, onload)
|
|
|
|
this.async_upload_form = function(form, action, onload)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var frame, ts = new Date().getTime(),
|
|
|
|
// create hidden iframe
|
|
|
|
frame_name = 'rcmupload'+ts;
|
|
|
|
var ts = new Date().getTime(),
|
|
|
|
|
|
|
|
frame_name = 'rcmupload' + ts,
|
|
|
|
|
|
|
|
frame = this.async_upload_form_frame(frame_name);
|
|
|
|
|
|
|
|
|
|
|
|
// upload progress support
|
|
|
|
// upload progress support
|
|
|
|
if (this.env.upload_progress_name) {
|
|
|
|
if (this.env.upload_progress_name) {
|
|
|
@ -7513,21 +7515,7 @@ function rcube_webmail()
|
|
|
|
field.val(ts);
|
|
|
|
field.val(ts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// have to do it this way for IE
|
|
|
|
// handle upload errors by parsing iframe content in onload
|
|
|
|
// otherwise the form will be posted to a new window
|
|
|
|
|
|
|
|
if (document.all) {
|
|
|
|
|
|
|
|
document.body.insertAdjacentHTML('BeforeEnd', '<iframe name="'+frame_name+'"'
|
|
|
|
|
|
|
|
+ ' src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>');
|
|
|
|
|
|
|
|
frame = $('iframe[name="'+frame_name+'"]');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// for standards-compliant browsers
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
frame = $('<iframe>').attr('name', frame_name)
|
|
|
|
|
|
|
|
.css({border: 'none', width: 0, height: 0, visibility: 'hidden'})
|
|
|
|
|
|
|
|
.appendTo(document.body);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handle upload errors, parsing iframe content in onload
|
|
|
|
|
|
|
|
frame.bind('load', {ts:ts}, onload);
|
|
|
|
frame.bind('load', {ts:ts}, onload);
|
|
|
|
|
|
|
|
|
|
|
|
$(form).attr({
|
|
|
|
$(form).attr({
|
|
|
@ -7540,6 +7528,13 @@ function rcube_webmail()
|
|
|
|
return frame_name;
|
|
|
|
return frame_name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create iframe element for files upload
|
|
|
|
|
|
|
|
this.async_upload_form_frame = function(name)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $('<iframe>').attr({name: name, style: 'border: none; width: 0; height: 0; visibility: hidden'})
|
|
|
|
|
|
|
|
.appendTo(document.body);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// html5 file-drop API
|
|
|
|
// html5 file-drop API
|
|
|
|
this.document_drag_hover = function(e, over)
|
|
|
|
this.document_drag_hover = function(e, over)
|
|
|
|
{
|
|
|
|
{
|
|
|
|