Skip to content
Snippets Groups Projects
Commit 93635124 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix links to filenames with spaces

View images in a smaller viewport (I'm no CSS expert here, obviously)
parent 80ff3be5
No related branches found
No related tags found
No related merge requests found
Pipeline #8349 passed
......@@ -23,6 +23,7 @@ function header(title) {
writeln("div.form-container { margin-bottom: .5rem; }");
writeln("div.form-container > form { display: inline; margin-right: .5rem; }");
writeln("div.table-container { overlow: auto; }");
writeln("div.img-container { width: 50%; height: 50%; }");
writeln("table { border-collapse: collapse; }");
writeln("thead th { position: sticky; top: 0; background-color: white; }");
writeln("th { padding: .5rem; }");
......@@ -140,9 +141,9 @@ function dir_index(dir)
write("<td>");
var view_icon = viewable_file(f.name);
if(view_icon)
write("<a href=?view=" + encodeURIComponent(f.name) + " title='View'>" + view_icon + "</a>");
write("<a href=?view=\"" + encodeURIComponent(f.name) + "\" title='View'>" + view_icon + "</a>");
write("</td>");
write("<td><a title='Download' href='" + f.name + "'>" + f.name.bold() + "</a></td>");
write("<td><a title='Download' href=" + encodeURIComponent(f.name) + ">" + f.name.bold() + "</a></td>");
write("<td align=right>" + file_size(f) + "</td>");
write("<td align=right>" + file_date(f) + "</td>");
write('<td class="desc" onclick="showExtDesc(event)">');
......@@ -341,7 +342,10 @@ function view_archive(filename)
function view_image(filename)
{
writeln("<img src=" + file_getname(filename) + " />");
writeln('<div style="width: 100%;">');
writeln('<img style="object-fit: contain; width:50%" src=' +
encodeURIComponent(file_getname(filename)) + ' />');
writeln('</div>');
}
// Listing all libraries
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment