User:Fewfre/common.js

// $( function {	if (mw.config.get('wgPageName') != 'User:Fewfre/sandbox') return;	$("#test_cache_reset").click(function { // clearDisplayColor('ca-refresh-teamnames'); // var statuscolor = 'gadget-action-success'; var a = new mw.Api; console.log('Starting...'); a.get({			action : 'query',			prop : 'revisions',			titles : 'Module:Sandbox/Fewfre',			rvprop : 'content'		}).then(function(data) {			for (p in data.query.pages) {				content = data.query.pages[p].revisions[0]["*"];			}			var prefix = content.match(/PREFIX = '(.+?)'/)[1];			console.log(prefix);			a.get({ action : 'parse', // resetAll | DataModule | module=ModuleThatWillHandleData | f=functionThatWillBeCalled | prefix= prefix for all this data in the cache - loaded from page via code above text : '' }).then(function(data) { console.log('Done!', data); alert('Done!'); // displayColor(statuscolor, 'ca-refresh-teamnames'); });		});	});	moveToPViews($('#ca-refresh-teamnames')); }); //