Added toggle for brand line

pull/126/head
tycrek 3 years ago
parent 1f94513e1c
commit 651f213351
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -16,6 +16,10 @@ import { users } from '../auth';
import express from 'express'; import express from 'express';
const router = express.Router(); const router = express.Router();
let theme = {};
if (path('share/', 'theme.json'))
theme = fs.readJsonSync(path('share/', 'theme.json'));
// Middleware for parsing the resource ID and handling 404 // Middleware for parsing the resource ID and handling 404
router.use((req: Request, res: Response, next) => { router.use((req: Request, res: Response, next) => {
// Parse the resource ID // Parse the resource ID
@ -57,7 +61,9 @@ router.get('/', (req: Request, res: Response, next) => data().get(req.ass.resour
ogtype: fileData.is.video ? 'video.other' : fileData.is.image ? 'image' : 'website', ogtype: fileData.is.video ? 'video.other' : fileData.is.image ? 'image' : 'website',
urlType: `og:${fileData.is.video ? 'video' : fileData.is.audio ? 'audio' : 'image'}`, urlType: `og:${fileData.is.video ? 'video' : fileData.is.audio ? 'audio' : 'image'}`,
opengraph: replaceholder(ogs.join('\n'), fileData.size, fileData.timestamp, fileData.timeoffset, fileData.originalname), opengraph: replaceholder(ogs.join('\n'), fileData.size, fileData.timestamp, fileData.timeoffset, fileData.originalname),
viewDirect viewDirect,
//@ts-ignore
showAd: theme.showAd ?? true,
}); });
}).catch(next)); }).catch(next));

@ -41,4 +41,5 @@ html
span #{timestamp} (#{size}) span #{timestamp} (#{size})
br br
span: a.link(href='#' onclick=`window.location = '${resourceAttr.src}?download=yes'; return false;` download=title) Download span: a.link(href='#' onclick=`window.location = '${resourceAttr.src}?download=yes'; return false;` download=title) Download
.mx-4.mb-8.text-footer: p Image hosted by #[a.link(href='https://github.com/tycrek/ass' target='_blank'): strong ass], the superior self-hosted ShareX server if showAd
.mx-4.mb-8.text-footer: p Image hosted by #[a.link(href='https://github.com/tycrek/ass' target='_blank'): strong ass], the superior self-hosted ShareX server

Loading…
Cancel
Save