User:GangBunTu/common.js

importScriptPage('Project:JS/ShowHideHC.js', 'keroro'); importScriptPage('Project:JS/hide.js', 'keroro'); importScriptPage('Project:JS/tabber.js', 'keroro');

$(document).ready(function {	if (document.getElementById('qstats') != null) {		// http://api.jquery.com/jquery.get/		var jqxhr = $.get( "/wiki/Special:AdminDashboard", function(data) { console.log( "db_c_success1" ); var tbody = $(data).find('#QuickStatsWidget .WikiaDataTable tbody'); $(tbody).children('tr').each(function(i) {			       console.log( i );				if (i != 0) { // skip header					var col1 = this.cells[0].innerHTML;					var col2 = this.cells[1].innerHTML;					var width = Math.round(parseInt(col2.replace(',',''))/10);					var content = $(" " + col1 + " - " + col2 + " ");					$(content).css('background-color', '#C9DBFF');					$(content).css('width', width + 'px');					$(content).css('margin', '2px');					$("#qstats").append(content);				}			}); }, "html")		.done(function { console.log( "db_c_success2" ); })		.fail(function { console.log( "db_c_error1" ); })		.always(function { console.log( "db_c_finished1" ); });

// Perform other work here ... console.log( "db_c_something1" );

// Set another completion function for the request above jqxhr.always(function {			console.log( "db_c_finished2" );		}); } else { console.log( "db_c_nothing1" ); } });