Как убрать левый столбик меню навигации в МедиаВики — различия между версиями

Материал из РБО
Перейти к: навигация, поиск
(Новая страница: «How do I hide the left vertical navigation toolbar In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, na…»)
 
Строка 3: Строка 3:
 
In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?
 
In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?
  
To hide it permanently, copy and paste the following into the MediaWiki:Common.css page:
+
To hide it permanently, copy and paste the following into the MediaWiki:Common.css page:<br><br>
  
<nowiki>#column-content { margin: 0 0 .6em 0; }
+
<nowiki>#column-content { margin: 0 0 .6em 0; }</nowiki><br>
#content { margin: 2.8em 0 0 0; }
+
<nowiki>#content { margin: 2.8em 0 0 0; }</nowiki><br>
#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }
+
<nowiki>#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }</nowiki><br>
#p-cactions { left: .1em; }</nowiki>
+
<nowiki>#p-cactions { left: .1em; }</nowiki><br><br>
  
 
To instead hide the toolbar when the user presses F11, enter this in your wiki's <nowiki>MediaWiki:Common.js</nowiki>:<br><br>
 
To instead hide the toolbar when the user presses F11, enter this in your wiki's <nowiki>MediaWiki:Common.js</nowiki>:<br><br>
  
<nowiki>document.onkeydown = function( e ) {
+
<nowiki>document.onkeydown = function( e ) {</nowiki><br>
if( e == null ) e = event
+
<nowiki>if( e == null ) e = event</nowiki><br>
if( testKey( e, 122 ) ) { //F11
+
<nowiki>if( testKey( e, 122 ) ) { //F11</nowiki><br>
appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
+
<nowiki>appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang,</nowiki><br>
return false;
+
<nowiki>#p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');</nowiki><br>
}
+
<nowiki> return false;</nowiki><br>
}
+
<nowiki>}</nowiki><br>
 +
<nowiki>}</nowiki><br><br>
  
function testKey( e, intKeyCode ) {
+
<nowiki>function testKey( e, intKeyCode ) {</nowiki><br><br>
if( window.createPopup )
+
<nowiki>if( window.createPopup )</nowiki><br>
return e.keyCode == intKeyCode
+
<nowiki>return e.keyCode == intKeyCode</nowiki><br>
else
+
<nowiki>else</nowiki><br>
return e.which == intKeyCode
+
<nowiki>return e.which == intKeyCode</nowiki><br>
}
+
<nowiki>}</nowiki><br>
</nowiki><br><br>
+
<br>
  
 
[[Категория:Содержание]] [[Категория:Техническая_помощь]]
 
[[Категория:Содержание]] [[Категория:Техническая_помощь]]

Версия 23:00, 15 июля 2016

How do I hide the left vertical navigation toolbar

In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?

To hide it permanently, copy and paste the following into the MediaWiki:Common.css page:

#column-content { margin: 0 0 .6em 0; }
#content { margin: 2.8em 0 0 0; }
#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }
#p-cactions { left: .1em; }

To instead hide the toolbar when the user presses F11, enter this in your wiki's MediaWiki:Common.js:

document.onkeydown = function( e ) {
if( e == null ) e = event
if( testKey( e, 122 ) ) { //F11
appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang,
#p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
return false;
}
}

function testKey( e, intKeyCode ) {

if( window.createPopup )
return e.keyCode == intKeyCode
else
return e.which == intKeyCode
}