User:Technical 13/Scripts/ACCHelp/Block list.js

if(mw.config.get("wgCanonicalSpecialPageName") === "BlockList"){ $("p:contains(\"The requested IP address or username is not blocked.\")").addClass("error"); if(typeof($("p:contains(\"The requested IP address or username is not blocked.\")").html) === "undefined"){ var blocklistTable = '\n\t \n\t\t\n\t\t\t Admin \n\t\t\t blocked \n\t\t\t Target \n\t\t\t because \n\t\t\t expires \n\t\t \n\t \n\t '; $('table.mw-blocklist tbody').find('tr').each(function{			var blocklistAdmin = $(this).find('td.TablePager_col_ipb_by').html;			blocklistAdmin = blocklistAdmin.replace(/(\(|\))/ig, '$1').replace(/ \| /ig, '|').replace('>talk', '>t').replace('>contribs', '>c');			var blocklistTimestamp = $(this).find('td.TablePager_col_ipb_timestamp').html;			var blocklistTimestampISO = new Date(blocklistTimestamp);			blocklistTimestampISO = blocklistTimestampISO.toISOString;			blocklistTimestampReturn = '' + blocklistTimestamp + '';			blocklistTimestamp = new Date(blocklistTimestamp);			var blocklistTarget = $(this).find('td.TablePager_col_ipb_target').html;			if(blocklistTarget.indexOf("") === -1){				blocklistTarget = '' + blocklistTarget + ' '; } else { blocklistTarget = blocklistTarget.replace(/(\(|\))/ig, '1').replace(/ \| /ig, '|').replace('>talk', '>t'); }			var blocklistReason = $(this).find('td.TablePager_col_ipb_reason').html; if(blocklistReason.search(/\{\{(.*?)\}\}/) !== -1){ blocklistReason = $(this).find('td.TablePager_col_ipb_reason').html.match(/\{\{(.*?)\}\}(.*?)/); blocklistReason = '{'+'{' + blocklistReason[1].charAt(0).toUpperCase + blocklistReason[1].substr(1) + '}'+'}' + blocklistReason[2]; } //			var blocklistExpires = new Date($(this).find('td.TablePager_col_ipb_expiry').html); var blocklistParameters = $(this).find('td.TablePager_col_ipb_params').html; blocklistParameters = blocklistParameters.split(", ").sort.join(", "); //			var blocklistExpiresIn = new Date; //			blocklistExpiresIn = blocklistExpires.getTime - Date.now; var			blocklistExpires = $(this).find('td.TablePager_col_ipb_expiry').html; blocklistTable += '\n\t\t\n\t\t\t' + blocklistAdmin + ' \n\t\t\t<td class="TablePager_col_ipb_timestamp">' + blocklistTimestampReturn + ' \n\t\t\t<td class="TablePager_col_ipb_target">' + blocklistTarget + ' \n\t\t\t<td class="TablePager_col_ipb_reason TablePager_col_ipb_params">' + blocklistReason + ', ' + blocklistParameters + ' \n\t\t\t<td class="TablePager_col_ipb_expiry">' + blocklistExpires + ' \n\t\t '; });		blocklistTable += '\n\t ';		$('table.TablePager').css({"border": "", "width": "100%"});		$('table.TablePager').html(blocklistTable);		$("h1#firstHeading").html(tickBad + " " + $("h1#firstHeading").html);		document.title = Ucross + document.title;		var blocklistTimestampWeek = blocklistTimestamp.valueOf+(7*24*60*60*1000);		if(blocklistTimestampWeek >= Date.now){			alert('WARNING!\n\t\tThe local block on:\n\n\t\t\t\t' + $("input#mw-input-wpTarget").val + '\n\n\t\t... is less than a week old.');		}	} else {		$("h1#firstHeading").html(tickGood + " " + $("h1#firstHeading").html);		document.title = Ucheck + document.title;	} }