Please, someone quote this message. And then someome else quote the quoted message. Because I want to test how the ignore function works on quotes. Especially nested ones.
Please, someone quote this message. And then someome else quote the quoted message. Because I want to test how the ignore function works on quotes. Especially nested ones.
Please, someone quote this message. And then someome else quote the quoted message. Because I want to test how the ignore function works on quotes. Especially nested ones.
That works, though I will say that the nested quotes won't work simply by setting the display to none. Nested quotes already have that setting, it's when you press on the Show link that it then sets display to block. The only way to get rid of that would be to replace this: quotesToHide[i].parentNode.style.display = 'none'; with this: quotesToHide[i].parentNode.innerHTML = ''; This will actually remove/replace the body of the quote and the username from the markup code after the page has loaded—you won't even see it if you inspect using Firebug or Chrome. You could do an extra sweep and set the display for the Show link to none instead. Those are your two options. This will still not change the fact that actually quoting someone is an SQL query and will always pull the most up to date version of the post, user content and all.
So I will look into a way to erase a forum member's name from posts of other forum members.
There are not going to be very many ways to do this that will be 'good'; as in resource efficient. Continuing along the same lines to what you already have, this will work: var tagsToDelete = document.querySelectorAll("a");
for (var i=0; i < tagsToDelete.length; i++)
{
var inner = tagsToDelete[i].innerHTML;
if (userlist.indexOf(inner.substring(1,inner.length)) > -1 )
{
// uncomment the line you want to use
// option 1: replace text and link
//tagsToDelete[i].outerHTML = '<a href="#">@blockeduser</a>';
// option 2: replace just the visible text in the tag
//tagsToDelete[i].innerHTML = '@blockeduser';
}
}You have two options here:
One that changes the URL as well as the tag text; and
One that changes just the tag text but still allows you to follow the link to the users' profile.
This won't remove a person's name where someone is simply referring to someone else without tagging, though (e.g. "I'd like to refer back to what Shandyr said on the first page about X."). For that, you'd need a much more thorough (also generic) search and replace function.
Comments
quotesToHide[i].parentNode.style.display = 'none';
with this:
quotesToHide[i].parentNode.innerHTML = '';
This will actually remove/replace the body of the quote and the username from the markup code after the page has loaded—you won't even see it if you inspect using Firebug or Chrome. You could do an extra sweep and set the display for the Show link to none instead. Those are your two options. This will still not change the fact that actually quoting someone is an SQL query and will always pull the most up to date version of the post, user content and all.
Security-wise, it's fine. :-)
Instead of Greasmonkey you need the equal plugin for Chrome, called Tampermonkey.
var tagsToDelete = document.querySelectorAll("a"); for (var i=0; i < tagsToDelete.length; i++) { var inner = tagsToDelete[i].innerHTML; if (userlist.indexOf(inner.substring(1,inner.length)) > -1 ) { // uncomment the line you want to use // option 1: replace text and link //tagsToDelete[i].outerHTML = '<a href="#">@blockeduser</a>'; // option 2: replace just the visible text in the tag //tagsToDelete[i].innerHTML = '@blockeduser'; } }
You have two options here:- One that changes the URL as well as the tag text; and
- One that changes just the tag text but still allows you to follow the link to the users' profile.
This won't remove a person's name where someone is simply referring to someone else without tagging, though (e.g. "I'd like to refer back to what Shandyr said on the first page about X."). For that, you'd need a much more thorough (also generic) search and replace function.(I don't know jackshit about jawascript.)