home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
linuxmafia.com 2016
/
linuxmafia.com.tar
/
linuxmafia.com
/
joshneal
/
consuhater.user.js
< prev
next >
Wrap
Text File
|
2006-06-04
|
2KB
|
37 lines
// ==UserScript==
// @name Consuhater
// @namespace tag:consumating.com,2006:Consuhater
// @description Thumb-bomber, ahoy
// @include http://consumating.com/profiles/*
// @include http://www.consumating.com/profiles/*
// @exclude http://consumating.com/profiles/*/*
// @exclude http://www.consumating.com/profiles/*/*
// ==/UserScript==
(function() {
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );
for (var x=0; x<result.length; x++) {
result[x] = nodes.snapshotItem(x);
}
return result;
}
var doc = window.document;
var origthumbs = selectNodes(doc, doc.body, "//div[@class='qow_answerBar']//a[contains(@title,'Thumbs')]/img[contains(@src,'up-small')][starts-with(@id,'bling')]");
var origthumb,testthumb,qnamem,qname;
if (origthumbs) {
for (var x=0; x<origthumbs.length; x++) {
origthumb = origthumbs[x];
testthumb = document.createElement("span");
qnamem = origthumbs[x].id.match(/bling(.*)-up$/);
qname = qnamem[1];
testthumb.innerHTML = '<A href="#' + qname + '" onClick="return bling(' + qname + ',\'D\');" title="Thumbs Down!"><img id="bling' + qname + '-down" src="http://img.consumating.com/img/down-small.gif" border=0 width=25 align="middle" id="bling' + qname + '-down"></a>';
origthumb.parentNode.parentNode.insertBefore(testthumb, origthumb.parentNode.nextSibling);
}
}
})();