V
VK
Jorge said:Edit the regExp:javascriptfunction(s,i,e){i=(e=document.querySelectorAll
('.maincontoutboxatt')[0].firstElementChild.tBodies
[0].rows).length;while(i--){s.test(e.textContent)&&(e
.style.opacity='0.2');}})(/leather|wholesale|whoelsale|fjrjtrade|
peng Selina|dotradenow.com|toptradea.com/i);
Asen said:I use similar approach, but instead querySelectorAll i use XPATH and
document.evaluate:
var dictionary = /leather|wholesale|whoelsale|fjrjtrade|peng Selina|
dotradenow.com|toptradea.com/i,
xpath_rows = document.evaluate(
'//div[@class="maincontoutboxatt"][1]//tr',
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
),
curr_tr;
for (var i = 2, j = 0; curr_tr = xpath_rows.snapshotItem(i++)
{
if (dictionary.test(curr_tr.textContent))
{
curr_tr.parentNode.removeChild(curr_tr);
}
else {
curr_tr.bgColor = j++ % 2 == 0 ? '#f7f7f7' : '#ffffff';
}
}
Great compacting work! But what about the Summary view?
OK, I got my "IE's janitor" guy for an hour, so the next release works
for IE too. Honestly I didn't follow the IE's applied "logic"
throughout, I just said to him that this script has to do exactly the
same things as on other platforms and for the price of one Mac lunch
at Monday it does it.
ggNoSpam 0.6
Tested to work on: IE8, Firefox 3.5.3, Safari 4.0.3, Google Chrome
3.0.195.27, Opera 10.0
A note for purists: it doesn't mean that it doesn't work
on any other platform, it means what it means: that it was
physically seen working on the spelled platforms.
Greasemonkey script for Firefox, Safari, Google Chrome, Opera:
http://userscripts.org/scripts/show/59377
Greasemonkey add-on for Firefox:
https://addons.mozilla.org/en-US/firefox/addon/748
Greasemonkey add-on for Safari (Mac OS only):
http://8-p.info/greasekit/
Google Chrome used to have built-in support
over extra argument -enable-greasemonkey but
it seems to be blocked in the latest release.
Opera has built-in Greasemonkey support, see
http://groups.google.com/group/comp.lang.javascript/msg/65ba1be889c16a13
for details.
Greasemonkey script for IE:
http://www.iescripts.org/view-scripts-676p1.htm
Greasemonkey add-on for IE:
http://www.ie7pro.com
As usual any constructive comments and corrections are most welcome.