All pastes #611790 Raw Edit

Bdragon

public javascript v1 · immutable
·published 2007-07-10 02:07 UTC
rendered paste body
// ==UserScript==// @name           Blocked Check// @namespace      drupal.org// @description    Adds blocked status to search results// @include        http://drupal.org/search/user/// ==/UserScript==var GM_JQ = document.createElement('script');GM_JQ.src = 'http://drupal.org/misc/jquery.js';GM_JQ.type = 'text/javascript';document.getElementsByTagName('head')[0].appendChild(GM_JQ);function GM_wait() {  if(typeof unsafeWindow.jQuery == 'undefined') {    window.setTimeout(GM_wait,100);  }  else {    jqcode(unsafeWindow.jQuery);  }}function jqcode($) {  $('.search-results a').each(function() {    var elem = this;    $.ajax({			url: this.href,      dataType: 'html',      error: function() {        $(elem).append(' <span style="background-color: red">BLOCKED</span>');			},      complete: function(o,st) {//        $(elem).append('<span>'+st+'</span>');			}    });  });}GM_wait();