bugfix: work with truncated filenames
This commit is contained in:
parent
3287e57421
commit
c567131ca7
@ -16,12 +16,20 @@
|
|||||||
|
|
||||||
onready(function(){
|
onready(function(){
|
||||||
$('.postfilename').each(function() {
|
$('.postfilename').each(function() {
|
||||||
|
var filename, truncated;
|
||||||
|
if ($(this).attr('title')) {
|
||||||
|
filename = $(this).attr('title');
|
||||||
|
truncated = true;
|
||||||
|
} else {
|
||||||
|
filename = $(this).text();
|
||||||
|
}
|
||||||
|
|
||||||
$(this).replaceWith(
|
$(this).replaceWith(
|
||||||
$('<a></a>')
|
$('<a></a>')
|
||||||
.attr('download', $(this).text())
|
.attr('download', filename)
|
||||||
.append($(this).contents())
|
.append($(this).contents())
|
||||||
.attr('href', $(this).parent().parent().find('a').attr('href'))
|
.attr('href', $(this).parent().parent().find('a').attr('href'))
|
||||||
.attr('title', _('Save as original filename'))
|
.attr('title', _('Save as original filename') + (truncated ? ' (' + filename + ')' : ''))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user