From 9bb7f0d2f2abd51ecdeab6b11cb4bcdfde2bab0a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 12 Feb 2025 23:25:43 +0100 Subject: [PATCH 01/46] general.js: do not move the style-select in the options --- js/options/general.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/js/options/general.js b/js/options/general.js index c0652269..6715ae1d 100644 --- a/js/options/general.js +++ b/js/options/general.js @@ -43,9 +43,6 @@ $(function(){ document.location.reload(); } }); - - - $("#style-select").detach().css({float:"none","margin-bottom":0}).appendTo(tab.content); }); }(); From aed49a6188a79d0a87e7c744761a052a105efcee Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 13 Feb 2025 00:00:20 +0100 Subject: [PATCH 02/46] ajax.js: clear embed --- js/ajax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index f65c6c96..3cb06bf1 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -111,7 +111,7 @@ $(window).ready(function() { $(form).find('input[type="submit"]').val(submit_txt); $(form).find('input[type="submit"]').removeAttr('disabled'); $(form).find('input[name="subject"],input[name="file_url"],\ - textarea[name="body"],input[type="file"]').val('').change(); + textarea[name="body"],input[type="file"],input[name="embed"]').val('').change(); }, cache: false, contentType: false, @@ -123,7 +123,7 @@ $(window).ready(function() { $(form).find('input[type="submit"]').val(submit_txt); $(form).find('input[type="submit"]').removeAttr('disabled'); $(form).find('input[name="subject"],input[name="file_url"],\ - textarea[name="body"],input[type="file"]').val('').change(); + textarea[name="body"],input[type="file"],input[name="embed"]').val('').change(); } else { alert(_('An unknown error occured when posting!')); $(form).find('input[type="submit"]').val(submit_txt); From 9746293fed591e34d250f42c976977f44d05ec5f Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 13 Feb 2025 10:35:01 +0100 Subject: [PATCH 03/46] inline-expanding.js: fit expanded images into the screen's height (port of soyjak party feature) --- js/inline-expanding.js | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 41625d2d..c44843b0 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -17,6 +17,10 @@ $(document).ready(function() { // Default maximum image loads. const DEFAULT_MAX = 5; + if (localStorage.inline_expand_fit_height !== 'false') { + $('').appendTo($('head')); + } + let inline_expand_post = function() { let link = this.getElementsByTagName('a'); @@ -56,12 +60,12 @@ $(document).ready(function() { }, add: function(ele) { ele.deferred = $.Deferred(); - ele.deferred.done(function () { + ele.deferred.done(function() { let $loadstart = $.Deferred(); let thumb = ele.childNodes[0]; let img = ele.childNodes[1]; - let onLoadStart = function (img) { + let onLoadStart = function(img) { if (img.naturalWidth) { $loadstart.resolve(img, thumb); } else { @@ -69,15 +73,15 @@ $(document).ready(function() { } }; - $(img).one('load', function () { - $.when($loadstart).done(function () { - // Once fully loaded, update the waiting queue. + $(img).one('load', function() { + $.when($loadstart).done(function() { + // once fully loaded, update the waiting queue --loading; $(ele).data('imageLoading', 'false'); update(); }); }); - $loadstart.done(function (img, thumb) { + $loadstart.done(function(img, thumb) { thumb.style.display = 'none'; img.style.display = ''; }); @@ -202,6 +206,8 @@ $(document).ready(function() { Options.extend_tab('general', '' + _('Number of simultaneous image downloads (0 to disable): ') + ''); + Options.extend_tab('general', ''); + $('#inline-expand-max input') .css('width', '50px') .val(localStorage.inline_expand_max || DEFAULT_MAX) @@ -212,6 +218,21 @@ $(document).ready(function() { localStorage.inline_expand_max = val; }); + + $('#inline-expand-fit-height input').on('change', function() { + if (localStorage.inline_expand_fit_height !== 'false') { + localStorage.inline_expand_fit_height = 'false'; + $('#expand-fit-height-style').remove(); + } + else { + localStorage.inline_expand_fit_height = 'true'; + $('').appendTo($('head')); + } + }); + + if (localStorage.inline_expand_fit_height !== 'false') { + $('#inline-expand-fit-height input').prop('checked', true); + } } if (window.jQuery) { From b1989a69b05aa05bdeb9d2d65b966bbf5e0c3731 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Fri, 14 Feb 2025 09:40:04 +0100 Subject: [PATCH 04/46] flags: add Alunya flag --- static/flags/alunya.png | Bin 0 -> 399 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 static/flags/alunya.png diff --git a/static/flags/alunya.png b/static/flags/alunya.png new file mode 100644 index 0000000000000000000000000000000000000000..799fd5099a77c7347a60957b6b3690c2ee745cd5 GIT binary patch literal 399 zcmV;A0dW3_P)bF5XNV>34t64sf099iB{sD2k^wkC$QJzKu{mRSFrUdd;&p)v#>l7E6HiRBA^ct zOd0pv>?FHk&mZi~?94Zl*=&v!4X=ZpZ3@HCiSdf#n4%~mXzaMaPcywoki_^{+bqkp z9g^p{wzghs&w#>Z#lV;A8f;FkjQ2li!jl52&Lr#r;8AVt7&k$!e0qH|VSnKeTQmD8 z+;;#Vz)P})z8Iz$jYi~L+gh4-3wtHfRuy}5Ns^GP>lzysYxyh+ZTX3OWq@-`S(c4+ z1PFd)8(Kd-?~36Aq%8Tpw$LAQ1XfZc{zW znp_@U({1x&b}hOAcLcT%F2tVkdeDS*V!WTyboS*;fh2P?pBs Date: Fri, 14 Feb 2025 12:48:58 +0100 Subject: [PATCH 05/46] UserPostQueries.php: fix paging boundaries --- inc/Data/UserPostQueries.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/inc/Data/UserPostQueries.php b/inc/Data/UserPostQueries.php index 8f803b93..1c203431 100644 --- a/inc/Data/UserPostQueries.php +++ b/inc/Data/UserPostQueries.php @@ -44,19 +44,20 @@ class UserPostQueries { $posts_count = \count($posts); + // By fetching one extra post bellow and/or above the limit, we know if there are any posts beside the current page. if ($posts_count === $page_size + 2) { $has_extra_prev_post = true; $has_extra_end_post = true; - } elseif ($posts_count === $page_size + 1) { - $has_extra_prev_post = $start_id !== null && $start_id === (int)$posts[0]['id']; - $has_extra_end_post = !$has_extra_prev_post; } else { - $has_extra_prev_post = false; - $has_extra_end_post = false; + /* + * If the id we start fetching from is also the first id fetched from the DB, then we exclude it from + * the results, noting that we fetched 1 more posts than we needed, and it was before the current page. + * Hence, we have no extra post at the end and no next page. + */ + $has_extra_prev_post = $start_id !== null && $start_id === (int)$posts[0]['id']; + $has_extra_end_post = !$has_extra_prev_post && $posts_count > $page_size; } - // Since we fetched one post bellow and/or above the limit, we always know if there are any posts after the current page. - // Get the previous cursor, if any. if ($has_extra_prev_post) { \array_shift($posts); From 9a5b79452f6a8f87849227d525721971b4d425c0 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 16 Feb 2025 23:52:31 +0100 Subject: [PATCH 06/46] pages.php: remove unused code --- inc/mod/pages.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 380a5627..52b4ee2c 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1087,12 +1087,6 @@ function mod_user_posts_by_passwd(Context $ctx, string $passwd, string $encoded_ $args['boards'] = $boards; $args['token'] = make_secure_link_token('ban'); - if (empty($encoded_cursor)) { - $args['security_token'] = make_secure_link_token("user_posts/passwd/$passwd"); - } else { - $args['security_token'] = make_secure_link_token("user_posts/passwd/$passwd/cursor/$encoded_cursor"); - } - mod_page(\sprintf('%s: %s', _('Password'), \htmlspecialchars($passwd)), 'mod/view_passwd.html', $args); } From 2da6c95aa55ce6ed7cc44a06899acd85020867c0 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 16 Feb 2025 18:07:32 +0100 Subject: [PATCH 07/46] functions.php: remove unused parameter from markup --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index 66cd6fa7..90079561 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2069,7 +2069,7 @@ function remove_modifiers($body) { return preg_replace('@(.+?)@usm', '', $body); } -function markup(&$body, $track_cites = false, $op = false) { +function markup(&$body, $track_cites = false) { global $board, $config, $markup_urls; $modifiers = extract_modifiers($body); From c73a893e542ab5f91502605c57a77e2ed893919a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 00:31:59 +0100 Subject: [PATCH 08/46] functions.php: strikethrough bad citations --- inc/functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 90079561..def00287 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2168,12 +2168,15 @@ function markup(&$body, $track_cites = false) { link_for(array('id' => $cite, 'thread' => $cited_posts[$cite])) . '#' . $cite . '">' . '>>' . $cite . ''; + } else { + $replacement = ">>$cite"; + } - $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[3][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); - $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[3][0]) - mb_strlen($matches[0][0]); + $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[3][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); + $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[3][0]) - mb_strlen($matches[0][0]); - if ($track_cites && $config['track_cites']) - $tracked_cites[] = array($board['uri'], $cite); + if ($track_cites && $config['track_cites']) { + $tracked_cites[] = array($board['uri'], $cite); } } } From 9a4ce56d8687c46d12ec619eee1a7459b76254b1 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 17:21:32 +0100 Subject: [PATCH 09/46] dark_red.css: always use Verdana font if available --- stylesheets/dark_red.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stylesheets/dark_red.css b/stylesheets/dark_red.css index 173a6619..74ef4e2b 100644 --- a/stylesheets/dark_red.css +++ b/stylesheets/dark_red.css @@ -33,11 +33,11 @@ div.title p { a, a:link, a:visited, .intro a.email span.name { color: #CCC; text-decoration: none; - font-family: sans-serif; + font-family: Verdana, sans-serif; } a:link:hover, a:visited:hover { color: #fff; - font-family: sans-serif; + font-family: Verdana, sans-serif; text-decoration: none; } a.post_no { @@ -79,7 +79,7 @@ div.post.inline { } .intro span.subject { font-size: 12px; - font-family: sans-serif; + font-family: Verdana, sans-serif; color: #446655; font-weight: 800; } @@ -100,7 +100,7 @@ input[type="text"], textarea, select { border: #666666 1px solid; padding-left: 5px; padding-right: -5px; - font-family: sans-serif; + font-family: Verdana, sans-serif; font-size: 10pt; } input[type="password"] { @@ -151,7 +151,7 @@ span.trip { } div.pages { background: #1E1E1E; - font-family: sans-serif; + font-family: Verdana, sans-serif; } .bar.bottom { bottom: 0px; From 0819c509faadff388f5f983e005d4f3da958a17c Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 18:01:46 +0100 Subject: [PATCH 10/46] dark_red.css: increase contrast --- stylesheets/dark_red.css | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/stylesheets/dark_red.css b/stylesheets/dark_red.css index 74ef4e2b..4ffe4eeb 100644 --- a/stylesheets/dark_red.css +++ b/stylesheets/dark_red.css @@ -5,7 +5,7 @@ /*dark.css has been prepended (2021-11-11) instead of @import'd for performance*/ body { background: #1E1E1E; - color: #A7A7A7; + color: #C0C0C0; font-family: Verdana, sans-serif; font-size: 14px; } @@ -31,7 +31,7 @@ div.title p { font-size: 10px; } a, a:link, a:visited, .intro a.email span.name { - color: #CCC; + color: #EEE; text-decoration: none; font-family: Verdana, sans-serif; } @@ -48,11 +48,11 @@ a.post_no:hover { text-decoration: underline overline; } .intro a.post_no { - color: #CCC; + color: #EEE; } div.post.reply { background: #333333; - border: #555555 1px solid; + border: #4f4f4f 1px solid; @media (max-width: 48em) { border-left-style: none; @@ -60,7 +60,7 @@ div.post.reply { } } div.post.reply.highlighted { - background: #555; + background: #4f4f4f; border: transparent 1px solid; @media (max-width: 48em) { @@ -69,13 +69,13 @@ div.post.reply.highlighted { } } div.post.reply div.body a:link, div.post.reply div.body a:visited { - color: #CCCCCC; + color: #EEE; } div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover { color: #32DD72; } div.post.inline { - border: #555555 1px solid; + border: #4f4f4f 1px solid; } .intro span.subject { font-size: 12px; @@ -96,7 +96,7 @@ div.post.inline { } input[type="text"], textarea, select { background: #333333; - color: #CCCCCC; + color: #EEE; border: #666666 1px solid; padding-left: 5px; padding-right: -5px; @@ -105,7 +105,7 @@ input[type="text"], textarea, select { } input[type="password"] { background: #333333; - color: #CCCCCC; + color: #EEE; border: #666666 1px solid; } form table tr th { @@ -133,10 +133,10 @@ div.banner a { input[type="submit"] { background: #333333; border: #888888 1px solid; - color: #CCCCCC; + color: #EEE; } input[type="submit"]:hover { - background: #555555; + background: #4f4f4f; border: #888888 1px solid; color: #32DD72; } @@ -159,7 +159,7 @@ div.pages { background-color: #1E1E1E; } div.pages a.selected { - color: #CCCCCC; + color: #EEE; } hr { height: 1px; @@ -167,7 +167,7 @@ hr { } div.boardlist { text-align: center; - color: #A7A7A7; + color: #C0C0C0; } div.ban { background-color: transparent; @@ -188,7 +188,7 @@ div.boardlist:not(.bottom) { } .desktop-style div.boardlist:not(.bottom) { text-shadow: black 1px 1px 1px, black -1px -1px 1px, black -1px 1px 1px, black 1px -1px 1px; - color: #A7A7A7; + color: #C0C0C0; background-color: #1E1E1E; } div.report { @@ -211,7 +211,7 @@ div.report { } .box { background: #333333; - border-color: #555555; + border-color: #4f4f4f; color: #C5C8C6; border-radius: 10px; } @@ -221,7 +221,7 @@ div.report { } table thead th { background: #333333; - border-color: #555555; + border-color: #4f4f4f; color: #C5C8C6; border-radius: 4px; } @@ -229,11 +229,11 @@ table tbody tr:nth-of-type( even ) { background-color: #333333; } table.board-list-table .board-uri .board-sfw { - color: #CCCCCC; + color: #EEE; } tbody.board-list-omitted td { background: #333333; - border-color: #555555; + border-color: #4f4f4f; } table.board-list-table .board-tags .board-cell:hover { background: #1e1e1e; From 9256c15c4657b62009f0cafb5b2290b6f2e651cd Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 18:51:24 +0100 Subject: [PATCH 11/46] rules.html: extend rule 10 to extreme fetishes --- templates/rules.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/rules.html b/templates/rules.html index e152d682..9eaa3c3b 100644 --- a/templates/rules.html +++ b/templates/rules.html @@ -7,7 +7,7 @@

- RULES + RULES

GLOBAL:

@@ -36,7 +36,7 @@ Opening posts with liberalism or reactionary topics will be treated with far mor

9) Due to derailing, COVID denialism outside the COVID-19 thread will be deleted.

-

10) All boards except for /siberia/ (and potentially /roulette/) are 'Safe For Work' boards. Pornography should not be posted on them without good reason, and any pornography on these boards should be hidden using the Spoiler Image option. New threads on /siberia/ with pornographic topics should have a Spoiler Image on the opening post.

+

10) All boards except for /siberia/ (and potentially /roulette/) are 'Safe For Work' boards. Pornography should not be posted on them without good reason, and any pornography on these boards should be hidden using the Spoiler Image option. New threads on /siberia/ with pornographic topics should have a Spoiler Image on the opening post. Some kinds of pornographic content are always banned on every board, including /siberia/: cp/loli/jailbait/anything that could possibly interpreted a child, "feral" furry, zoophilia, murder/gore (photographic) and other suitably extreme fetishes.

11) Posts should, overall, be conductive to an informed and productive discussion. /leftypol/ is not an academic journal, but it also should not be a cesspit of back and forth bickering and pointless insults. Users should attempt to argue for the point they are presenting in an honest and open way and should be receptive to information or arguments that do, in fact, challenge their views.

From e5ba5feb25e6d7e7a4b47c673a321d82c23865b0 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 21:42:20 +0100 Subject: [PATCH 12/46] youtube.js: adjust referrer policy --- js/youtube.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/youtube.js b/js/youtube.js index 4c87b0aa..4a5a5afe 100644 --- a/js/youtube.js +++ b/js/youtube.js @@ -22,7 +22,7 @@ $(document).ready(function() { function makeEmbedNode(embedHost, videoId, width, height) { return $(`