Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</span>
</div>
<div id="highlight">
28/04/2025: PushPull is currently not functioning due to server upgrades. When it will be back is currently unknown. Arctic Shift is available as an alternative backend, which should have similar features. The main disadvantage is that you cannot do a fulltext search without setting either subreddit or author.
28/04/2025: Pullpush is currently not functioning due to server upgrades. When it will be back is currently unknown. Arctic Shift is available as an alternative backend, which should have similar features. The main disadvantage is that you cannot do a fulltext search without setting either subreddit or author.
<br />
10/08/2025: While viewing comments of a post, it will now query the reddit api to highlight deleted comments in red. For performance reasons, this is currently only done for threads with less than 2000 comments. In addition it now supports reddit style links. E.g. https://ihsoyct.github.io/r/nextfuckinglevel/comments/1mmgsfs/damn_sorry_for_even_calling_myself_an_artist/ will show the comments of that thread
</div>
Expand Down
15 changes: 11 additions & 4 deletions dist/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
</head>
<body>
<a href="./index.html">Back</a>
<div>
<div>
<h3 class="section">25/10/2025</h3>
<ul>
<li>Pullpush is back online. You can now use it as a backend. Right it only has data up to 20th May 2025.</li>
<li>Added the backend parameter to all internal links. E.g. if you search using Pullpush and open a submission it will load all the comments using Pullpush</li>
<li>Pullpush will now show all images similar to Arctic Shift</li>
<li>PullPush now also has the pagination feature of Arctic Shift, this also works while sorting by score.</li>
</ul>
<h3 class="section">10/08/2025</h3>
<ul>
<li>Will now highlight deleted comments</li>
Expand All @@ -15,15 +22,15 @@ <h3 class="section">10/08/2025</h3>
<h3 class="section">28/04/2025</h3>
<ul>
<li>Update the looks a bits</li>
<li>Added separate search forms for PushPull and Arctic Shift backends</li>
<li>Added separate search forms for Pullpush and Arctic Shift backends</li>
<li>Added a button to show and hide images (why is 90% of reddit pictures of dicks???)</li>
<li>Improved performance when loading submissions with many comments</li>
</ul>
<h3 class="section">28/04/2025</h3>
<ul>
<li>Disabled PushPull temporarily. Added an alternative Backend called Arctic Shift</li>
<li>Disabled Pullpush temporarily. Added an alternative Backend called Arctic Shift</li>
<li>
Pushpull is currently updating their servers, and as a result it is currently disabled.
Pullpush is currently updating their servers, and as a result it is currently disabled.
</li>
<li>
Added an alternative backend called <a href="https://github.com/ArthurHeitmann/arctic_shift">Arctic Shift</a>.
Expand Down
3 changes: 2 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
</span>
</div>
<div id="highlight">
28/04/2025: PushPull is currently not functioning due to server upgrades. When it will be back is currently unknown. Arctic Shift is available as an alternative backend, which should have similar features. The main disadvantage is that you cannot do a fulltext search without setting either subreddit or author.
25/10/2025: Pullpush is back online. You can now use it as a backend. Right it only has data up to 20th May 2025.<br />
The advantage of using Pullpush is that it allows searching through all comments across all subreddits. While Arctic Shift can only search within a single subreddit at a time.
<br />
10/08/2025: While viewing comments of a post, it will now query the reddit api to highlight deleted comments in red. For performance reasons, this is currently only done for threads with less than 2000 comments. In addition it now supports reddit style links. E.g. https://ihsoyct.github.io/r/nextfuckinglevel/comments/1mmgsfs/damn_sorry_for_even_calling_myself_an_artist/ will show the comments of that thread
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { subreddit, Backends } from "./subreddit";
import pushpullSearchTemplate from "./templates/pushpull_search.pug";
import pullpushSearchTemplate from "./templates/pullpush_search.pug";
import arcticShiftSearchTemplate from "./templates/arctic_shift_search.pug";

/**
Expand All @@ -8,8 +8,8 @@ import arcticShiftSearchTemplate from "./templates/arctic_shift_search.pug";
*/
function renderSearchForm(backend) {
const searchformDiv = document.getElementById("searchform");
if (backend === "pushpull") {
searchformDiv.innerHTML = pushpullSearchTemplate();
if (backend === "pullpush") {
searchformDiv.innerHTML = pullpushSearchTemplate();
} else if (backend === "artic_shift") {
searchformDiv.innerHTML = arcticShiftSearchTemplate();
setTimeout(() => {
Expand All @@ -25,10 +25,14 @@ window.onload = () => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
let backend = urlParams.get("backend") || "artic_shift";
if(backend === "pushpull") {
backend = "pullpush";
}
window.currentBackend = backend;
renderSearchForm(backend);
urlParams.delete("backend");
if (backend === "pushpull") {
subreddit.backend = Backends.PUSHPULL;
if (backend === "pullpush") {
subreddit.backend = Backends.PULLPUSH;
} else if (backend === "artic_shift") {
subreddit.backend = Backends.ARTIC_SHIFT;
}
Expand Down Expand Up @@ -108,8 +112,8 @@ window.switchBackend = function (newBackend) {

// Field mapping and conversion
let mappedValues = { ...values };
if (newBackend === "pushpull") {
// Arctic Shift -> PushPull: query/body -> q, limit 'auto' -> 1000
if (newBackend === "pullpush") {
// Arctic Shift -> Pullpush: query/body -> q, limit 'auto' -> 1000
if (mappedValues.query !== undefined && mappedValues.query !== "") {
mappedValues.q = mappedValues.query;
delete mappedValues.query;
Expand All @@ -121,7 +125,7 @@ window.switchBackend = function (newBackend) {
mappedValues.limit = "1000";
}
} else if (newBackend === "artic_shift") {
// PushPull -> Arctic Shift: q -> query and body
// Pullpush -> Arctic Shift: q -> query and body
if (mappedValues.q !== undefined) {
mappedValues.query = mappedValues.q;
mappedValues.body = mappedValues.q;
Expand Down
Loading