![]() ![]() |
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
204.94.81.82
In Reply to: RE: OK, these seems happier posted by The Killer Piglet on February 27, 2025 at 10:17:01
Thanks, I get the function, but nothing happens. I've guessing that I need to modify the code to add the root number in each child.
Take a look at the test forum:
https://www.audioasylum.com/cgi/tv.mpl?forum=test
What I need is to grab some of the source for the first topic and the changes to make it work immediately. I tried the console and it didn't do anything, but that's because the link does a perl function and isn't using the JS.
-Rod
It will just add the new function to the browser session, you can then click the existing 'Mark as Read' Link and it will run the new code.
The current link is JS, that JS then calls a server side function.
The new function does all the work on the client side.
I want to get back on this project. We were on a trip in March and I'm getting back into the groove. Maybe a phone call or email will be a better discussion as I do want to get this done.
-Rod
KPps. realized the server is doing something to persist the change on page reload, cookie maybe?
edit: ok, I see it seems to associate with the user log-inthis accounts for that:
function confirmRead(ReadForum, ReadThread) {
if (userID) {
if (userID != null) {
if (confirm("Are you sure you want to mark toggle - test " + ReadThread + " as read/unread?")) {
location = "/cgi/markread.mpl?forum="+ReadForum+"&thread="+ReadThread;
var anchorElement = document.querySelector('a[href*="' + ReadThread + '.html"]');var nearestLiParent = anchorElement.parentNode.closest('li');
toggleElement = nearestLiParent;toggleElement.classList.add('aa-d');
var nextSib = nearestLiParent.nextElementSibling;
if (anchorElement) {
var count = 0;
var ulChildren;
var children = nearestLiParent.nextElementSibling.querySelectorAll('*');
children = nextSib.querySelectorAll('li');for (let i = 0; i < children.length; i++) {
var toggleElement = children[i];
toggleElement.classList.add('aa-d');
}
}
}
} else {
alert("You must log in to Mark Threads as read.")
}
} else {
alert("You must log in to Mark Threads as read.")
}
}
Edits: 03/25/25
![]()
It also does nothing new for me when I run click, still have to refresh pagebest approach is to rename that
confirmRead_ooldand paste the new code into aa.js
Edits: 02/27/25
![]()
Hum, not sure what is running in Test, I will see if I can snag the JS
It is diff that my code though
it shows
Are you sure you want to mark thread 1251 as read?
vs
Are you sure you want to mark toggle - test 1234 as read/unread?
(I stuk 'toggle - test' in there)
I dropped the script int consoles and run as expected
This post is made possible by the generous support of people like you and our sponsors: