Quote Link in "Author VCard"
![]() ![]() |
Sizzle,
may I suggest a slight change (made necessary by the introduction of that "useragent" div):
line 315 now reads:
var posts = document.evaluate('//td[@class="author vcard"]', document, null, 6, null), post, i=posts.snapshotLength;
Please change to:
var posts = document.evaluate('//td[@class="author vcard"]/p/span[@class="edit"]', document, null, 6, null), post, i=posts.snapshotLength;
After I did that, I was surprised you also add a "report spam" link I didn't see before (probably hidden below the useragent icons or something like that) ![]() Edit: this needs an addition following line 315, i.e. line 316 must be added: if (i<1) var posts = document.evaluate('//td[@class="author vcard"]/span[@class="role"]', document, null, 6, null), i=posts.snapshotLength;
Otherwise it would only work for your own posts ;)
|
![]() ![]() |
Just found out this is not working as expected - so second approach here: Mentioned line 315 should read:
var posts = document.evaluate('//td[@class="author vcard"]/span[@class="role"]', document, null, 6, null), post, i=posts.snapshotLength, post, i=posts.snapshotLength, br = document.createElement('br');
br.style.clear = 'both';
Then, the new elements should be appended like this: if (post.nextSibling.nextSibling.tagName.toLowerCase()=='p')
post.nextSibling.nextSibling.firstChild.nextSibling.appendChild(quote);
else {
post.appendChild(br);
post.appendChild(quote);
}
For the reports correspondingly: if (post.nextSibling.nextSibling.tagName.toLowerCase()=='p') continue; // we don't report ourselves, do we? else post.appendChild(report); This way they are placed correctly in both cases: for own and foreign posts. But the function quote_handle(e) {
...
post_id = e.target.parentNode.parentNode.parentNode.id.split('row-')[1];
if (post_id==undefined) post_id = e.target.parentNode.parentNode.parentNode.parentNode.id.split('row-')[1];
...
}
Same for report_handle():
function report_handle(e) {
...
var l=e.target.parentNode.parentNode.childNodes[5].lastChild.previousSibling;
...
}
Results look much better for me
|
![]() ![]() |
Thanks for making me aware of this problem. I've completely rewrote this code. |
![]() ![]() |
Great - thanx, seems to work fine! |




