News for hackers. Stuff that matters.
Re:Leo Laporte loses it with Mike Arrington on the Gillmor Gang by axod on Sunday June 07, 2009 @09:48AM (#645900)
More specifically, something like this, will add kinda functional downmod arrows:

  // Find all <a> links with an id of up_* then add a downmod arrow which upvotes everything apart from this article on the page.
	
  var links = document.getElementsByTagName("a");     // Look at all links...
	
  for (var i=0;i<links.length;i++) {
    var alink = links.item(i);
    if (alink.id.substring(0,3)=="up_") {
	        // We found one...
            
    var downer = document.createElement("a");
    var img = document.createElement("img");
    img.src = "/graydown.gif";
    img.style.border = "0";
    downer.appendChild(img);
    alink.parentNode.appendChild(document.createElement("br"));
    alink.parentNode.appendChild(downer);
    downer.href = "#";
    downer.onclick = function(n) {
        return function() {
            downmod(n);
        }
    }(alink);
  }

  // Downmod by upvoting everything else...
  function downmod(node) {
    var links = document.getElementsByTagName("a");     // Look at all links...
	
    for (var i=0;i<links.length;i++) {
      var alink = links.item(i);
      if (alink.id.substring(0,3)=="up_") {
        // We found one...
        if (alink!=node) vote(alink);               // Vote for it...
      }
    }
  }

There are no comments on this comment yet.