* Change the file display mode.

This commit is contained in:
tianshujie
2023-07-28 10:39:15 +08:00
parent c54c3742b7
commit 9116c7108a
3 changed files with 18 additions and 28 deletions
+1 -8
View File
@@ -58,13 +58,6 @@ window.downloadFile = function(fileID, extension, imageWidth)
url += `'${sessionString}'`;
width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth * 0.5) ? windowWidth * 0.5 : imageWidth) : windowWidth;
if(fileTypes.includes(extension))
{
loadModal(url);
}
else
{
loadPage(url);
}
loadModal(url);
return false;
}
-1
View File
@@ -1,5 +1,4 @@
#imageFile > img {margin: 0 auto;}
.modal-body #errorMessage {padding: 80px 20px; text-align: center;}
.m-file-download #header, .m-file-download #mainNavbar {display: none;}
.m-file-download #mainContent .modal-header {margin-left: 0;}
#txtFile > pre {display: block; padding: 10px; border: 1px solid rgb(var(--color-gray-300-rgb)); border-radius: 4px;}
+17 -19
View File
@@ -43,28 +43,26 @@ else
}
}
panel
modalHeader
(
modalHeader
set::title($lang->file->preview),
$fileType == 'txt' ? to::suffix
(
set::title($lang->file->preview),
$fileType == 'txt' ? to::suffix
div
(
div
(
select(setID('charset'), set::name('charset'), set::items($config->file->charset), set::required(true), set::value($charset), set('onchange', 'setCharset(this)'), setClass('ml-2')),
)
) : null,
),
$fileType == 'image' ? div
(
setID('imageFile'),
h::img(set::src($this->createLink('file', 'read', "fileID={$file->id}")))
) : div
(
setID('txtFile'),
h::pre(set::style(array('background-color' => 'rgb(var(--color-gray-200-rgb))')), $fileContent),
),
select(setID('charset'), set::name('charset'), set::items($config->file->charset), set::required(true), set::value($charset), set('onchange', 'setCharset(this)'), setClass('ml-2')),
)
) : null,
);
$fileType == 'image' ? div
(
setID('imageFile'),
h::img(set::src($this->createLink('file', 'read', "fileID={$file->id}")))
) : div
(
setID('txtFile'),
h::pre(set::style(array('background-color' => 'rgb(var(--color-gray-200-rgb))')), $fileContent),
);
$isInModal = isInModal();