-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedditToggleSideBarAndFooter.user.js
More file actions
30 lines (27 loc) · 1.11 KB
/
RedditToggleSideBarAndFooter.user.js
File metadata and controls
30 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==UserScript==
// @name Reddit: Toggle Side Bar and Footer
// @author OriginalSyn - modified by theplaceboeffect
// @namespace http://greasemonkey.theplaceboeffect.com
// @description Hides the Reddit side bar and adds a toggle link in the user control panel area on the header. Modified to also hide the Footer from http://userscripts.org/scripts/show/66935.
// @include http://www.reddit.com/*
// @include https://www.reddit.com/*
// ==/UserScript==
// Check if jQuery's loaded
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined') {
window.setTimeout(GM_wait,100);
}else{
letsJQuery();
}
}
GM_wait();
// All your GM code must be inside this function
function letsJQuery() {
unsafeWindow.jQuery('.side').hide();
unsafeWindow.jQuery('.footer-parent').hide();
unsafeWindow.jQuery("#header-bottom-right").append(" | <a href='#' id='toggleSideBar'>SF Toggle</a>");
unsafeWindow.jQuery("#toggleSideBar").click(function(){
unsafeWindow.jQuery(".side").slideToggle();
unsafeWindow.jQuery(".footer-parent").slideToggle();
});
}