Skip to content
Snippets Groups Projects
Commit 6e6ae388 authored by echicken's avatar echicken :chicken:
Browse files

Skip the short description if there's an extended one available

parent f3ff0dc3
Branches
Tags
No related merge requests found
...@@ -28,23 +28,23 @@ if (typeof http_request.query.dir !== 'undefined' && ...@@ -28,23 +28,23 @@ if (typeof http_request.query.dir !== 'undefined' &&
); );
function writeFileDetails(file) { function writeFileDetails(file) {
if (typeof file.extdesc === 'undefined') { var description = '<p>' + file.desc + '</p>';
file.extdesc = ''; if (typeof file.extdesc !== 'undefined') {
} else if (file.extdesc.search(/(\x1B\[|[\xA8-\xFE])/) > -1) { if (file.extdesc.search(/(\x1B\[|[\xA8-\xFE])/) > -1) {
file.extdesc = '<pre class="ansi">' + html_encode(file.extdesc, true, false, true, true) + '</pre>'; description = '<pre class="ansi">' + html_encode(file.extdesc, true, false, true, true) + '</pre>';
} else { } else {
file.extdesc = '<pre class="list">' + file.extdesc + '</pre>'; description = '<pre class="list">' + file.extdesc + '</pre>';
}
} }
writeln( writeln(
format( format(
'<a href="./api/files.ssjs?call=download-file&amp;dir=%s&amp;file=%s" target="_blank" class="list-group-item striped">' + '<a href="./api/files.ssjs?call=download-file&amp;dir=%s&amp;file=%s" target="_blank" class="list-group-item striped">' +
'<strong>%s</strong> (%s)' + '<strong>%s</strong> (%s)' +
'<p><em>Uploaded %s</em></p>' + '<p><em>Uploaded %s</em></p>' +
'<p>%s</p>' +
'%s' + '%s' +
'</a>', '</a>',
http_request.query.dir[0], file.name, file.name, file.size, http_request.query.dir[0], file.name, file.name, file.size,
system.timestr(file.uldate), file.desc, file.extdesc system.timestr(file.uldate), description
) )
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment