User:MarkvA/WikiFactoryEnable.js

/* Quick WikiFactory enabling */ $(document).ready(function {	var menuName = "Enable PI";	var menuTitle = "Enable the portable infobox and draft extensions";	var variables = 			[{ varName: 'wgEnableInsightsInfoboxes', varId: 1513, varValue: 1, varReason: 'Enabling insights infobox extension' }, 		{ varName: 'wgEnableTemplateDraftExt', varId: 1516, varValue: 1, varReason: 'Enabling template draft extension' }]

$('.AccountNavigation .user-menu').prepend('' + menuName + ''); $('.AccountNavigation .user-menu').on('click', '#quick-wf', function {		var cityID = mediaWiki.config.get('wgCityId');

$.each(variables, function(index, value) {					$.ajax({ type: "POST", url: 'http://community.wikia.com/index.php', data: { action: "ajax", rs: "axWFactorySaveVariable", cityid: cityID, varCityid: cityID, varType: 'boolean', varName: value.varName, varId: value.varId, varValue: value.varValue, reason: value.varReason, tagname: ''}, dataType: "jsonp", // The response will throw a JS error because of this, but it's the only way to circumvent cross-origin protection });				});		$('div.WikiaPageContentWrapper').prepend(' Extensions enabled. Please refresh the page to continue.'); }); });