home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / joshneal / consuhater.user.js < prev    next >
Text File  |  2006-06-04  |  2KB  |  37 lines

  1. // ==UserScript==
  2. // @name            Consuhater
  3. // @namespace       tag:consumating.com,2006:Consuhater
  4. // @description     Thumb-bomber, ahoy
  5. // @include         http://consumating.com/profiles/*
  6. // @include         http://www.consumating.com/profiles/*
  7. // @exclude         http://consumating.com/profiles/*/*
  8. // @exclude         http://www.consumating.com/profiles/*/*
  9. // ==/UserScript==
  10.  
  11.  
  12.  
  13. (function() {
  14.     function selectNodes(doc, context, xpath) 
  15.     {
  16.        var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  17.        var result = new Array( nodes.snapshotLength );
  18.        for (var x=0; x<result.length; x++) {
  19.           result[x] = nodes.snapshotItem(x);
  20.        }
  21.        return result;
  22.     }    
  23.     var doc = window.document;
  24.     var origthumbs = selectNodes(doc, doc.body, "//div[@class='qow_answerBar']//a[contains(@title,'Thumbs')]/img[contains(@src,'up-small')][starts-with(@id,'bling')]");
  25.     var origthumb,testthumb,qnamem,qname;
  26.     if (origthumbs) {
  27.         for (var x=0; x<origthumbs.length; x++) {
  28.             origthumb = origthumbs[x];
  29.             testthumb = document.createElement("span");
  30.             qnamem = origthumbs[x].id.match(/bling(.*)-up$/);
  31.             qname = qnamem[1];
  32.             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>';
  33.             origthumb.parentNode.parentNode.insertBefore(testthumb, origthumb.parentNode.nextSibling);
  34.         }
  35.     }
  36. })();
  37.