User:Blaze fire12/searchfix.js

//This script fixes the search for the Wikia skin, to go to the page immediately if it exists. var fixSearchLink = 'Go to the page automatically'; var backSearchLink = 'Always go to search page'; function fixSearchbar { if ($('#WikiaSearch, .WikiaSearch').length) { $('#WikiaSearch button.secondary, .WikiaSearch button.wikia-button').attr('name','go').val('Go'); }	$('a.fixSearchLink').replaceWith(backSearchLink); } function backSearchbar { if ($('#WikiaSearch, .WikiaSearch').length) { $('#WikiaSearch button.secondary, .WikiaSearch button.wikia-button').removeAttr('name').val('Search'); }	$('a.fixSearchLink').replaceWith(fixSearchLink); } if (getCookie('fixSearch') == 'true') { addOnloadHook(function {		var fixSearchInterval = setInterval(function { if ($('#WikiaSearch button.secondary, .WikiaSearch button.wikia-button').val != 'Go') { fixSearchbar; } else { clearInterval(fixSearchInterval); }		},200);	}) }