update files script

This commit is contained in:
2024-09-27 16:27:37 +03:00
parent 6458c1e71d
commit 19931cb4d1
4 changed files with 34 additions and 6 deletions
+4 -5
View File
@@ -1,5 +1,4 @@
export function imgurl(channel,record) {
export function imgurl(channel, record) {
if (record._file.mime === "image/svg+xml") {
return fileurl(channel, record);
}
@@ -10,15 +9,15 @@ export function fileurl(channel, record) {
return channel.disks[record._file.disk] + `/${record._file.path}`;
}
export function htmlurl(channel,record, preset) {
export function htmlurl(channel, record, preset) {
let html = "";
let url = fileurl(channel,record)
let url = fileurl(channel, record)
if (record._file.width > 0) {
let presetUrl = url;
if (preset) {
presetUrl = channel.disks[record._file.disk] + `/templates/${preset}/${record._file.path}`;
presetUrl = channel.disks[record._file.disk] + `/templates/${preset}/${record._file.path}`;
}
html = `<img src="${presetUrl}" alt="${record._file.path}" />`
} else if (record._file.mime === "image/svg+xml") {