Dyskusja MediaWiki:Gadget-vector4monobookies.js

Treść strony nie jest dostępna w innych językach.
Z Wikipedii, wolnej encyklopedii

Aktualizacja[edytuj kod]

Poproszę o podmianę css i js :-) --Nux (dyskusja) 10:59, 30 lip 2017 (CEST)[odpowiedz]

CSS[edytuj kod]

MediaWiki:Gadget-vector4monobookies.css

/* move tabs and content top higher */
body #mw-page-base {height:4em}
body #p-personal {font-size:90%}
body #left-navigation {margin-top:1.5em!important}
body #right-navigation {margin-top:1.5em}

/* old pl.wiki logo */
body #p-logo a {background-image:url(https://upload.wikimedia.org/wikipedia/commons/a/a8/Wikipedia-logo-pl.png) !important;}

/* search box fix for long suggestions */
body .suggestions {left:8px !important; right:auto !important;}

/* new, wider search box */
body #simpleSearch {width:auto;}

/* in case moving dropdown menu to plain won't work */
body #p-cactions {position:relative}
body #p-cactions .menu {position:absolute;left:-128px;top:40px;}
body #p-cactions .menu li {width:150px;}

JS[edytuj kod]

MediaWiki:Gadget-vector4monobookies.js

/*
    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) {}
} );