Jump to content

User:PleaseStand/Hide Vector sidebar: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
hide sidebar only when editing
Line 6: Line 6:
Add the following code to [[Special:MyPage/vector.js]]:
Add the following code to [[Special:MyPage/vector.js]]:
<source lang="JavaScript">
<source lang="JavaScript">
importScript("User:PleaseStand/hide-vector-sidebar.js");
if importScript("User:PleaseStand/hide-vector-sidebar.js");
</source>
</source>


Line 13: Line 13:
<source lang="JavaScript">
<source lang="JavaScript">
importScriptURI("http://en.wikipedia.org/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw");
importScriptURI("http://en.wikipedia.org/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw");
</source>

==Hiding only when editing==
To hide the sidebar only while in edit mode, using the following instead:
<source lang="javascript">
if ( document.getElementById( 'editform' ) ) {
importScript( 'User:PleaseStand/hide-vector-sidebar.js' );
}
</source>
</source>



Revision as of 01:26, 21 June 2012

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).

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

Add the following code to Special:MyPage/vector.js:

if importScript("User:PleaseStand/hide-vector-sidebar.js");

Installation on other Wikimedia projects

Add the following code to your vector.js file on your project:

importScriptURI("http://en.wikipedia.org/w/index.php?title=User:PleaseStand/hide-vector-sidebar.js&action=raw");

Hiding only when editing

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

The source code is available at User:PleaseStand/hide-vector-sidebar.js.

Any questions?

If you have any questions, please leave a message on my talk page.