Difference between revisions of "MediaWiki:Common.js"

From RogueBasin
Jump to navigation Jump to search
m
Line 11: Line 11:
var bd=$('<div>').css({position:'absolute',top:0,left:0,width:'auto',height:'100%', backgroundColor:'red', padding:'0 2em'}).appendTo('body');
var bd=$('<div>').css({position:'absolute',top:0,left:0,width:'auto',height:'100%', backgroundColor:'red', padding:'0 2em'}).appendTo('body');
var bdp=$('<p>').text($('.abusefilter-blocked').text()).css({color:'white',fontSize:'2.5em'}).appendTo(bd);
var bdp=$('<p>').text($('.abusefilter-blocked').text()).css({color:'white',fontSize:'2.5em'}).appendTo(bd);
$.cookie('spambot','1',{expires:1e5});
$.get(wgScriptPath+'/api.php?action=logout');
$.get(wgScriptPath+'/api.php?action=logout');
setTimeout(function(){window.location.reload()},5000);
setTimeout(function(){window.location.reload()},5000);
}
}
if($('.rb-warning.abusefilter-blocked.cls32252181483950290572').length&&!wgCanonicalNamespace.toLowerCase().indexOf('user')) rbBMsg();
if($('.rb-warning.abusefilter-blocked.cls32252181483950290572').length&&!wgCanonicalNamespace.toLowerCase().indexOf('user')) rbBMsg();
if($.cookie('spambot')=='1')rbBMsg();

Revision as of 17:00, 11 June 2013

/* Any JavaScript here will be loaded for all users on every page load. */

// Site message hiding
if($.cookie('message') != 'hide' && wgUserName) $('.sitemessage').fadeIn(750);
else $('.sitemessage').hide();
$('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>');
$(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').fadeOut(750); $.cookie('message','hide',{expires:100})});

// Check for AF block message
function rbBMsg(){
var bd=$('<div>').css({position:'absolute',top:0,left:0,width:'auto',height:'100%', backgroundColor:'red', padding:'0 2em'}).appendTo('body');
var bdp=$('<p>').text($('.abusefilter-blocked').text()).css({color:'white',fontSize:'2.5em'}).appendTo(bd);
$.cookie('spambot','1',{expires:1e5});
$.get(wgScriptPath+'/api.php?action=logout');
setTimeout(function(){window.location.reload()},5000);
}
if($('.rb-warning.abusefilter-blocked.cls32252181483950290572').length&&!wgCanonicalNamespace.toLowerCase().indexOf('user')) rbBMsg();
if($.cookie('spambot')=='1')rbBMsg();