Użytkownik:Nux/hideSidebar.js

Z Fedora Wiki
Skocz do: nawigacji, wyszukiwania

Uwaga: aby zobaczyć zmiany po zapisaniu, 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: Przytrzymaj Ctrl jednocześnie klikając Odśwież lub naciśnij klawisze Ctrl+F5
  • Opera: Wyczyść pamięć podręczną w Narzędzia → Preferencje
/*
---------------------------------------------------------------------------
Instrukcja:
http://pl.wikipedia.org/wiki/Wikipedia:Narz%C4%99dzia/Schowaj_menu_boczne
---------------------------------------------------------------------------
/* ======================================================================== *\
	Adds a link that will allow one to show/hide sidebar
 
	version:		1.8.1.fedora
	copyright:		(C) 2006-2009 Maciej Jaros (pl:User:Nux, en:User:EcceNux)
	licence:		GNU General Public License v2,
				http://opensource.org/licenses/gpl-license.php
\* ======================================================================== */
 
//
// Cookie hidding + default hidding management
//
// whole sidebar
"js_hideSidebarByDefault=0""js_hideSidebarByDefault=1"// left panel (vector only)
"js_hideSidebarPanelByDefault=0""js_hideSidebarPanelByDefault=1"//
// CSS settings for skins...
//
'vector' : {
		'hide' : {
			 'div#content' : 'margin-left: 0px; ; z-index: 100;'
			,'div#panel' : 'float:left; position:static; background-image:url(/skins-1.5/vector/images/border.png);background-position:left top;background-repeat:repeat-x;'
			,'div#head' : 'margin-left: 0px; ; z-index: 101;'
			,'div#head-base' : 'margin-left: 0px;'
			,'div#p-logo' : 'display: none;'
			,'div#left-navigation' : 'left: 0px;'
		}
	}
	,'monobook' : {
		'hide' : {
			 '#content' : 'margin-left: 0px; z-index: 100;'
			,'#p-cactions' : 'left: 0px;'
			,'#p-cactions a:hover' : 'position:relative !important; z-index:101 !important;'
			,'#p-logo' : 'display: none;'
			,'#p-search' : 'position:relative; z-index:0;'
		}
	}
	,'fedora' : {
		'hide' : {
			 'div#sidebar' : 'display:none;'
			,'div#content' : 'margin-left: 0px;'
		}
	}
}
// css skin chooser
// known
"fedora""vector""monobook"// fall back CSS
'vector'//
// Fast CSS init (faster because not run on load)
//
''' '' {''}''<style id="hideSidebar_css" type="text/css">''</style>'// General CSS
/\s*hidden_sidebar_panel\s*/g'<style id="hideSidebar_css2" type="text/css">div.hidden_sidebar_panel div {display:none} </style>'//
// initialization function
//
'body''div''absolute'// for IE.ver<7
'hideSidebarElement'''
		+'cursor:pointer;'
		+'color:#696; font-weight:bold; font-size:20px;'
		+'padding:2px; display:inline-block;'
		+'left:0px; bottom:0px; z-index:2000; position:fixed;'//
	// mange hidding by deafault
'»''«'// hide left panel with an additional button
'vector''panel'// show/hide button
'img''hideSidebar_close_lpanel''float:right; margin:1px; padding:1px; cursor:pointer'// funs for show/hide while sidebar not hidden
//this.lpanel_el.style.display = 'block';
' ''hidden'//this.lpanel_el.style.display = this.lpanel_el_tmp_display;
'visible'// click fun
// show
			//if (this.lpanel_el.style.display=='none')
'js_hideSidebarPanelByDefault=0; path=/'//this.lpanel_el.style.display='block';
' ''http://commons.wikimedia.org/w/thumb.php?f=Edit%20remove.svg&width=15px''[-]'// hide
'js_hideSidebarPanelByDefault=1; path=/'//this.lpanel_el.style.display='none';
' hidden_sidebar_panel''http://commons.wikimedia.org/w/thumb.php?f=Edit%20add.svg&width=15px''[+]'// hide
//close_el.lpanel_el.style.display='none';
' hidden_sidebar_panel''http://commons.wikimedia.org/w/thumb.php?f=Edit%20add.svg&width=15px''[+]'// show
//close_el.lpanel_el.style.display='block';
' ''[-]''http://commons.wikimedia.org/w/thumb.php?f=Edit%20remove.svg&width=15px'//
// Main show/hide function
//
//
	// hidding
	//
'hideSidebar_css'// style element not availble yet
//
			// create style element
			//
'style'"hideSidebar_css"'head'//
			// add rules
			//
			//el.innerHTML = '...';	// yeah would nice right?... FF and Opera only
 
			// the DOM way...
// nonIE
' '' {''}'// at the end
// IE (+some friends)
// at the end
				}
			}
		}
		// already created
'head''»''js_hideSidebarByDefault=1; path=/'// restore left panel state
'hideSidebar_close_lpanel'//
	// showing
	//
'hideSidebar_css''«''js_hideSidebarByDefault=0; path=/'// show left panel even if hidden
'hideSidebar_close_lpanel'
Osobiste
Przestrzenie nazw

Warianty
Działania
Wiki
Nawigacja
Inne
Narzędzia