From 833d3b32cd3b5bc44dc49fdb8e6f739f48fe56fd Mon Sep 17 00:00:00 2001 From: juzz Date: Tue, 19 Jan 2021 21:21:13 +1100 Subject: [PATCH 1/4] fix short comment URLs #114 --- routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes.js b/routes.js index 37b5a5d..2764ce2 100644 --- a/routes.js +++ b/routes.js @@ -854,7 +854,7 @@ module.exports = (app, redis, fetch, RedditAPI) => { }) }) - app.get('/r/:subreddit/comments/:id/:snippet/:comment_id?', (req, res, next) => { + app.get('/r/:subreddit/comments/:id/:snippet?/:comment_id?', (req, res, next) => { let subreddit = req.params.subreddit let id = req.params.id let snippet = encodeURIComponent(req.params.snippet) From d47da7f6dcfa7d493b38edef20b5629d2e753c41 Mon Sep 17 00:00:00 2001 From: ltGuillaume Date: Wed, 20 Jan 2021 23:24:46 +0100 Subject: [PATCH 2/4] Style infobars --- static/css/sepia.css | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/static/css/sepia.css b/static/css/sepia.css index 9728b7a..348f148 100644 --- a/static/css/sepia.css +++ b/static/css/sepia.css @@ -10,6 +10,7 @@ --shadow: #9e9e9e; --buttonbg: #f2f0ea; --buttontext: #53524b; + --infobarbg: #ebe6b6; --oddbg: #e2dfd7; --oddborder: #616161; --evenbg: #f2f0ea; @@ -134,6 +135,9 @@ body.sepia #links.search { width: calc(100% - 40px); } /* Comments */ +body.sepia #post header div a { + color: var(--headerfaded); +} body.sepia #post .score { color: var(--graytext); } @@ -154,8 +158,10 @@ body.sepia #post .crosspost { body.sepia #post .crosspost { padding: 0 16px 16px 0; } -body.sepia #post header div a { - color: var(--headerfaded); +body.sepia .infobar { + background: var(--infobarbg); + border-radius: 3px; + box-shadow: 0 0 2px var(--shadow); } body.sepia .comment { background: var(--oddbg); @@ -210,7 +216,7 @@ body.sepia .comments > form button { } @media only screen and (max-width: 600px) { - body.sepia #sidebar { - width: 100%; - } + body.sepia #sidebar { + width: 100%; + } } From 5dad0c407e183e49a8ba42738bfec76edab62aa5 Mon Sep 17 00:00:00 2001 From: ltGuillaume Date: Thu, 21 Jan 2021 01:32:49 +0100 Subject: [PATCH 3/4] Style footer --- static/css/sepia.css | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/css/sepia.css b/static/css/sepia.css index 348f148..c8dbac5 100644 --- a/static/css/sepia.css +++ b/static/css/sepia.css @@ -1,7 +1,7 @@ :root { --bodybg: #ccc9b8; /* #cac5ad; */ --bodytext: #53524b; - --topbarbg: #992c09; + --endsbg: #992c09; --headerbg: #bf360c; --headertext: white; --headerfaded: #ecc3b7; @@ -29,7 +29,7 @@ body.sepia { color: var(--bodytext); } body.sepia nav { - background: var(--topbarbg); + background: var(--endsbg); color: var(--headertext); } body.sepia .top-links { @@ -126,10 +126,14 @@ body.sepia input[type="checkbox"] { margin-top: 6px; } body.sepia footer { - margin-top: 20px; + margin-top: 16px; padding: 8px 0 8px 20px; + background: var(--endsbg); box-shadow: 0 0 2px var(--shadow); } +body.sepia footer a { + color: var(--headerfaded); +} /* Search */ body.sepia #links.search { width: calc(100% - 40px); From 408eb259f4a3534b73c39fa5b3caef5f174c2356 Mon Sep 17 00:00:00 2001 From: teddit Date: Fri, 22 Jan 2021 18:23:38 +0100 Subject: [PATCH 4/4] fix unescape's regex, put dot inside character class. fixes #128 --- inc/commons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/commons.js b/inc/commons.js index 3e88ece..d24f241 100644 --- a/inc/commons.js +++ b/inc/commons.js @@ -152,7 +152,7 @@ module.exports = function(request, fs) { let str = s.replace(re, (m) => { return unescaped[m] }) - let r = new RegExp('((www|old)\.)?reddit.com', 'g') + let r = new RegExp('((www|old)\.)?reddit[.]com', 'g') let result = str.replace(r, config.domain) return result } else {