MediaWiki:Gadget-vector4monobookies.js

Z Wikipedii, wolnej encyklopedii

Uwaga: aby zobaczyć zmiany po opublikowaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.

  • Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5, lub Ctrl+R (⌘-R na komputerze Mac)
  • Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
  • Internet Explorer / Edge: Przytrzymaj Ctrl, jednocześnie klikając Odśwież, lub naciśnij klawisze Ctrl+F5
  • Opera: Naciśnij klawisze Ctrl+F5.
/*
    copyright:  (C) 2010 Maciej Jaros (pl:User:Nux, en:User:EcceNux)
    licence:    GNU General Public License v2,
                http://opensource.org/licenses/gpl-license.php
            OR
                CC-BY-SA
                http://creativecommons.org/licenses/by-sa/3.0/deed.pl
*/

// go back 2 monobook like layout

$(document).ready( function ()
{
	// move search box to sidebar
	try
	{
		var searchPanel;
		searchPanel = document.getElementById('p-search');
		var navigationPanel = document.getElementById('p-navigation');
		navigationPanel.parentNode.insertBefore(searchPanel, navigationPanel);
		document.getElementById('mw-panel').style.cssText = 'padding-top:0';
		document.getElementById('p-search').style.cssText = "float:none;";
		//document.getElementById('searchInput').style.cssText = 'width:75%';
		//document.getElementById('searchButton').style.cssText = 'float:right;position:relative;right:3px';
	} catch(e) {}

	// move dropdown menu to plain
	try
	{
		var menu_roz = document.getElementById('p-views').getElementsByTagName('ul')[0];
		var menu_zwi_els = document.getElementById('p-cactions').getElementsByTagName('li');
		var before_el = document.getElementById('ca-history').nextSibling;
		while (menu_zwi_els.length)
		{
			menu_zwi_els[0].className += ' moved_from_dropdown';
			if (menu_zwi_els[0].firstChild.nodeName.toLowerCase()!='span')
			{
				var nel = document.createElement('span');
				nel.appendChild(menu_zwi_els[0].getElementsByTagName('a')[0]);
				menu_zwi_els[0].appendChild(nel);
			}
			menu_roz.insertBefore(menu_zwi_els[0], before_el);
		}
		document.getElementById('p-cactions').style.display = 'none';
	} catch(e) {}
} );