Add files via upload

This commit is contained in:
seb1k 2024-10-05 18:17:19 +02:00 committed by GitHub
parent 6babcc1a85
commit 7f0127af99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

27
ui.min.js vendored
View file

@ -5378,26 +5378,36 @@ $('.attachment-size').each(function() { this.innerText=this.innerText.replace(/[
$('.attachmentslist .filename').off()
$('.attachmentslist .filename').removeAttr("onclick")
$('.attachmentslist .filename').attr('target','_blank');
$('.attachmentslist li:not(.pdf, .image) .filename').attr("download", "") // open image & pdf in browser, download everything else (bug for pdf is forced download :/)
//$('.attachmentslist li:not(.rfc822, .pdf, .image) .filename').attr("download", "") // open image & pdf in browser, download everything else (bug for pdf is forced download :/)
// add thumbail for .image
$('.attachmentslist .image').each(function() {
var bkgurl = jQuery(this).find(".filename")[0].href
bkgurl +="&_embed=1&_mimeclass=image&_thumb=1"
jQuery(this).find(".filename").append( "<div class='attachmentslistthumnb' style='background-image: url("+bkgurl+");'></div>" );
})
// add button for ics
if(typeof rcube_calendar ==="function") // rcube_calendar exist ?
{
var hovertxt = $('#attachmentsavecal').text()
$('.attachmentslist .ics').each(function() {
jQuery(this).find(".filename").append( "<div class='attachmentslistics' title='"+hovertxt+"'onclick='click_add_calendar(event,this)'></div>" );
jQuery(this).find(".filename").append( "<div class='attachmentslistplus' title='"+hovertxt+"' onclick='click_add_calendar(event,this)'></div>" );
})
}
// change behaviour for rfc822
$('.attachmentslist .rfc822').each(function() {
var Aelem = jQuery(this).find(".filename")[0]
var url = Aelem.href
Aelem.href+="&_extwin=1&_frame=1"
Aelem.dataset.original_href=url
jQuery(this).find(".filename").append( "<div class='attachmentslistplus' onclick='click_dl_attachement(this)'></div>" );
})
// zipdownload plugin
if($('.zipdownload').length )
@ -5410,11 +5420,6 @@ if($('.zipdownload').length )
$('.zipdownload').remove()
}
// force direct download on link
$('.attachmentslist .filename').off()
$('.attachmentslist .filename').removeAttr("onclick")
$('.attachmentslist .filename').attr('target','_blank');
$('.attachmentslist li:not(.pdf, .image) .filename').attr("download", "") // open image & pdf in browser, download everything else
// add button if more than 2 files
if($('.attachmentslist li').length > 2)
@ -5474,6 +5479,12 @@ else // show menu to choose the editable calendar
e.preventDefault();
}
function click_dl_attachement(elm)
{
var original_href = elm.closest('a').dataset.original_href
location.assign(original_href)
event.preventDefault();
}
function click_add_calendarid(calendarid,attachid)
{