ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
User:John Broughton/monobook.js - Wikipedia, the free encyclopedia

User:John Broughton/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// Checks edits to talk pages; warns if no signature
 
importScript("User:John Broughton/sign.js");
 
// [[User:Lupin/Anti-vandal tool]]
 
importScript("User:Lupin/recent2.js");
 
// [[User:Lupin/popups.js]]
 
importScript('User:Lupin/popups.js');
 
// Adds replace option to editing window - from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
 
function wpTextboxReplace()
{
    var s = prompt("Search regexp:");
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
        if(!r && r != '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}
addOnloadHook(function () {
    if (document.forms.editform) {
        addPortletLink('p-cactions', 'javascript:wpTextboxReplace()', 'Replace', 'ca-replace',
                       'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});
 
//From [[User:Dschwen/highlightredirects.js]]; highlights (in green) redirects on a page, after (added) tab is clicked
var highlightRedirects = {
 
 tab_redirects : null,
 status: null,
 xhr : null,
 todo : null,
 num : { total:0, done:0, redir:0 },
 
 //
 // Try to create an XMLHTTP request object for each tile
 // with maximum browser compat.
 // code adapted from http://jibbering.com/2002/4/httprequest.html
 //
 createXMLHTTP : function()
 {
  var i, xhr;
 
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
  // Internet Explorer (uses Conditional compilation)
  // traps security blocked creation of the objects.
   wmaDebug('Microsoft section');
   try {
    xhr = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
    try {
     xhr = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
     xhr = false;
    }
   }
  @end @*/
 
  // Firefox, Konqueror, Safari, Mozilla
  if (!xhr && typeof(XMLHttpRequest) != 'undefined') {
   try {
    xhr = new XMLHttpRequest();
   } catch (e) {
    xhr = false;
   }
  }
 
  // ICE browser
  if (!xhr && window.createRequest) {
   try {
    xhr = new window.createRequest();
   } catch (e) {
    xhr = false;
   }
  }
 
  return xhr;
 },
 
 updateStatus : function()
 {
  with( highlightRedirects )
  {
   status.nodeValue = ' (' + num.redir + '/' + num.done + '/' + num.total + ')';
  }
 },
 
 // cross-browser event attachment (John Resig)
 // http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
 addEvent : function ( obj, type, fn )
 {
  if (obj.addEventListener)
   obj.addEventListener( type, fn, false );
  else if (obj.attachEvent)
  {
   obj["e"+type+fn] = fn;
   obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
   obj.attachEvent( "on"+type, obj[type+fn] );
  }
 },
 
 run : function()
 {
  var links = document.getElementById('bodyContent').getElementsByTagName('a');
  var len = links.length;
  var local = window.location.href + '#'
 
  if( highlightRedirects.todo != null ) return;
 
  highlightRedirects.todo = new Array();
 
  for( var key = 0; key < len; key++ )
  {
   if( links[key].href && 
       links[key].pathname &&
       links[key].pathname.substr(0,6) == '/wiki/' &&
       !( links[key].href.substr(0,local.length) == local ) &&
       !( links[key].pathname.substr(6,8) == 'Special:' ) )
   {
    highlightRedirects.todo[highlightRedirects.num.total] =
    {
     link : links[key],
     xhr  : highlightRedirects.createXMLHTTP(),
     func : new Function(
       'var me = highlightRedirects.todo['+highlightRedirects.num.total+'];' + 
       'if(me.xhr.readyState==4) {' +
        'var ro=eval("("+me.xhr.responseText+")");' +
        'var redir=false;' +
        'for( var k in ro.query.pages ) {' + 
         'if( typeof(ro.query.pages[k].redirect) != "undefined" ) redir=true;' +
        '}' +
        'if(redir) {' + 
         'me.link.style.color="green";' +
         'highlightRedirects.num.redir++;' +
        '}' + 
        'else me.link.style.color="blue";' +
        'highlightRedirects.num.done++; highlightRedirects.updateStatus();' +
       '}' 
     )
    }
 
    links[key].style.color = 'gray';
 
    with(highlightRedirects.todo[highlightRedirects.num.total])
    {
     xhr.open("GET", 
      "/w/api.php?action=query&prop=info&format=json&titles=" +
      links[key].pathname.substr(6), true);
 
     xhr.onreadystatechange = func;
     xhr.send( null ); 
    }
 
    highlightRedirects.num.total++;
   }
  }
 },
 
 install : function()
 {
  with(highlightRedirects)
  {
   tab_redirects = document.createElement('li');
   tab_redirects.style.cursor = 'pointer';
   tab_redirects.style.padding = '0pt 0.8em 0pt 0.8em';
   tab_redirects.style.color = 'blue';
 
   status = document.createTextNode('');
   tab_redirects.appendChild( document.createTextNode('redirects') );
   tab_redirects.appendChild( status );
 
   if( document.getElementById('ca-history') ) 
    document.getElementById('ca-history').parentNode.appendChild( tab_redirects  );
 
   addEvent( tab_redirects, 'click', run );
  }
 }
 
};
 
//
// Hook up installation function
//
addOnloadHook(highlightRedirects.install);
 
// End


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -