All pastes #611803 Raw Edit

Bdragon

public javascript v1 · immutable
·published 2007-07-10 02:14 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).prepend('<span style="background: red; color: black;">Blocked</span>&nbsp;&nbsp;');			},      success: function() {        $(elem).prepend('<span style="background: green; color: white;">Active</span>&nbsp;&nbsp;');			}    });  });}GM_wait();