Jump to content

User:Jackmcbarn/hhvm.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 22:41, 17 September 2014 (use hhvm by "default"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
(function(){
	'use strict';
	var isHHVM = $.cookie('hhvm') === 'true';
	if ( !isHHVM && $.cookie('hhvm') !== 'false' ) {
		$.cookie('hhvm', 'true');
		location.reload(true);
	}
	var portletLink = mw.util.addPortletLink( 'p-tb', '#', isHHVM ? 'Disable HHVM' : 'Enable HHVM', 't-hhvm-toggle' );
	$( portletLink ).click( function ( e ) {
		e.preventDefault();
		$.cookie('hhvm', isHHVM ? 'false' : 'true');
		location.reload(true);
	});
})()