mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 07:30:10 +01:00
download-original.js: format
This commit is contained in:
parent
5550bc4212
commit
44e9a5aa57
@ -15,16 +15,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
onready(function(){
|
||||
var do_original_filename = function() {
|
||||
var filename, truncated;
|
||||
onready(function() {
|
||||
let doOriginalFilename = function() {
|
||||
let filename, truncated;
|
||||
if ($(this).attr('title')) {
|
||||
filename = $(this).attr('title');
|
||||
truncated = true;
|
||||
} else {
|
||||
filename = $(this).text();
|
||||
}
|
||||
|
||||
|
||||
$(this).replaceWith(
|
||||
$('<a></a>')
|
||||
.attr('download', filename)
|
||||
@ -34,9 +34,9 @@ onready(function(){
|
||||
);
|
||||
};
|
||||
|
||||
$('.postfilename').each(do_original_filename);
|
||||
$('.postfilename').each(doOriginalFilename);
|
||||
|
||||
$(document).on('new_post', function(e, post) {
|
||||
$(post).find('.postfilename').each(do_original_filename);
|
||||
$(document).on('new_post', function(e, post) {
|
||||
$(post).find('.postfilename').each(doOriginalFilename);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user