User:PleaseStand/Hide Vector sidebar: Difference between revisions
→top: add that ctr+opt+a is the shortcut for safari - thanks for the script! |
m Replaced deprecated <source> tags with <syntaxhighlight> |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
== Installation on the English Wikipedia == |
== Installation on the English Wikipedia == |
||
Add the following code to [[Special:MyPage/vector.js]]: |
Add the following code to [[Special:MyPage/vector.js]]: |
||
< |
<syntaxhighlight lang="JavaScript"> |
||
importScript("User:PleaseStand/hide-vector-sidebar.js"); |
importScript("User:PleaseStand/hide-vector-sidebar.js"); |
||
</syntaxhighlight> |
|||
</source> |
|||
== Installation on other Wikimedia projects == |
== Installation on other Wikimedia projects == |
||
Add the following code to your vector.js file on your project: |
Add the following code to your vector.js file on your project: |
||
< |
<syntaxhighlight lang="JavaScript"> |
||
mw.loader.load('//en.wikipedia.org/enwiki/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw&ctype=text/javascript'); |
mw.loader.load('//en.wikipedia.org/enwiki/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw&ctype=text/javascript'); |
||
</syntaxhighlight> |
|||
</source> |
|||
==Hiding only when editing== |
==Hiding only when editing== |
||
To hide the sidebar only while in edit mode, using the following instead: |
To hide the sidebar only while in edit mode, using the following instead: |
||
< |
<syntaxhighlight lang="javascript"> |
||
if ( document.getElementById( 'editform' ) ) { |
if ( document.getElementById( 'editform' ) ) { |
||
importScript( 'User:PleaseStand/hide-vector-sidebar.js' ); |
importScript( 'User:PleaseStand/hide-vector-sidebar.js' ); |
||
} |
} |
||
</syntaxhighlight> |
|||
</source> |
|||
==Source code== |
==Source code== |
||
Line 29: | Line 29: | ||
If you have any questions, please leave a message on [[User talk:PleaseStand|my talk page]]. |
If you have any questions, please leave a message on [[User talk:PleaseStand|my talk page]]. |
||
[[Category:Wikipedia scripts]] |
[[Category:Wikipedia scripts|Hide Vector sidebar]] |
Latest revision as of 17:40, 8 May 2022
Hide Vector sidebar is a user script by PleaseStand that hides the sidebar of the Vector skin. To access the navigation links, you can temporarily show the sidebar by choosing "Show sidebar" from Vector's drop-down menu. Firefox users should be able to press alt-shift-a to hide/show the sidebar, but users of other browsers such as Internet Explorer are out of luck. If you use one of those web browsers, I would appreciate it if you could suggest an alternative accesskey (alt-a conflicts with the shortcut for the Favorites menu). Alt-a appears to work with Chrome. Ctrl-opt-a for Safari.
A screenshot is coming soon, but it is not here yet. The script, however, should work exactly as I describe—I successfully have tested it on most of the big five web browsers. I don't know whether or not it works on Chrome, but if it works for you, please tell me.
Installation on the English Wikipedia
[edit]Add the following code to Special:MyPage/vector.js:
importScript("User:PleaseStand/hide-vector-sidebar.js");
Installation on other Wikimedia projects
[edit]Add the following code to your vector.js file on your project:
mw.loader.load('//en.wikipedia.org/enwiki/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw&ctype=text/javascript');
Hiding only when editing
[edit]To hide the sidebar only while in edit mode, using the following instead:
if ( document.getElementById( 'editform' ) ) {
importScript( 'User:PleaseStand/hide-vector-sidebar.js' );
}
Source code
[edit]The source code is available at User:PleaseStand/hide-vector-sidebar.js.
Any questions?
[edit]If you have any questions, please leave a message on my talk page.