Source for "SU Blog Lite"

By Thlayli
Has 21 other scripts.


// ==UserScript==
// @name           SU Blog Lite
// @namespace      http://thlayli.detrave.net/su-bloglite.html
// @description    Removes unnecessary links and content from SU pages 
// @include        http://*.stumbleupon.com/*
// @exclude        http://www.stumbleupon.com/
// @version        1.3
// ==/UserScript==

/* Don't edit this line */ var prefsArray = new Array(

/* Edit the section below to control item visibility */
/* Set a line to 1 to remove an item */
/* Set a line to 0 to leave it unchanged */

/* Global items */
    /* Remove Matches ............ */ 1,
    /* Remove My Reviews ......... */ 1,
    /* Remove Preferences ........ */ 1,
    /* Remove Search ............. */ 1,
    /* Remove Help & Rules ....... */ 1,
/* Items on all blog pages */
    /* Remove Blog Links ......... */ 1,
/* Items on your blog Pages */
    /* Remove Audience link ...... */ 1,
    /* Remove Buzz ............... */ 1,
    /* Remove Explore ............ */ 1,
    /* Remove Sponsor ............ */ 1,
/* Items on other blog Pages */
    /* Remove 2nd navigation bar . */ 1,
    /* Remove other Reviews ...... */ 1,
    /* Remove Stumble Photo/Video  */ 1,
    /* Remove Stumble Through .... */ 1,
/* Items on your Network page */
    /* Remove Network People Bar . */ 1,
    /* Remove Social Network ..... */ 1,
/* Items on your Friends page */
    /* Remove Connect With Friends */ 1,
    /* Remove age/sex for Fans ... */ 1

/* Don't edit anything below this line */
)

var jobsDone = new Array(18);
// Check for ownReviewLink
var ownReviewLink = 1;
for(n=0;n<document.forms.length;n++){
	if(document.forms[n].action.indexOf("?addfriend") != -1){
		var ownReviewLink = 0;
	}
	// Search
	if(prefsArray[3] == 1 && jobsDone[3] != 1){
		if(document.forms[n].action == "http://search.stumbleupon.com/"){
			document.forms[n].innerHTML = "";
			jobsDone[3] = 1;
		}
	}
}
var dLinks = document.links;
for(i=0;i<dLinks.length;i++){
	// Prevent accidental forum thread removal
	if(dLinks[i].href.indexOf("group.stumbleupon.com")=="-1"){
	// Matches
	if(prefsArray[0] == 1 && jobsDone[0] != 1){
		if(dLinks[i].text == "Matches" && dLinks[i].pathname == "/matches/"){
			if(dLinks[i].parentNode){
				dLinks[i].parentNode.parentNode.removeChild(dLinks[i].parentNode);
				jobsDone[0] = 1;
			}
		}
	}
	// My Reviews
	if(prefsArray[1] == 1 && ownReviewLink == 1 && jobsDone[1]!=1){
		if(dLinks[i].textContent.indexOf(" reviews of ")!="-1" && dLinks[i].href.substr(0,31) == "http://www.stumbleupon.com/url/"){
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[1] = 1;
		}
	}
	// Preferences
	if(prefsArray[2] == 1 && jobsDone[2] != 1){
		if(dLinks[i].text == "Preferences" && dLinks[i].pathname == "/prefs/"){
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[2] = 1;
		}
	}
	// Help & Rules
	if(prefsArray[4] == 1){
		if(dLinks[i].text == "Help" && dLinks[i].href == "http://www.stumbleupon.com/help.html"){
			if(dLinks[i].nextSibling){
				dLinks[i].nextSibling.parentNode.removeChild(dLinks[i].nextSibling);
			}
			dLinks[i].parentNode.removeChild(dLinks[i]);
		}
		if(dLinks[i].href == "javascript:help_informants()"){
			dLinks[i].parentNode.removeChild(dLinks[i]);
		}
		if(dLinks[i].text == "Rules" && dLinks[i].pathname == "/rules.html"){
			dLinks[i].parentNode.removeChild(dLinks[i].previousSibling.previousSibling);
			dLinks[i].parentNode.removeChild(dLinks[i]);
		}
	}
	// Blog Links
	if(prefsArray[5] == 1 && jobsDone[5] != 1){
		if(dLinks[i].textContent == "Blog" && dLinks[i].href == "javascript:toblog()"){
			dLinks[i].parentNode.innerHTML='&nbsp;';
			jobsDone[5] = 1;
		}
	}
	// Audience
	if(prefsArray[6] == 1 && jobsDone[6] != 1){
		if(dLinks[i].text == "Audience" && dLinks[i].href == "http://www.stumbleupon.com/faq.html#audience"){
			var aud =  document.createElement("text");
			aud.innerHTML = "Audience:";
			dLinks[i].parentNode.insertBefore(aud,dLinks[i]);
			dLinks[i].removeChild(dLinks[i].firstChild);
			jobsDone[6] = 1;
		}
	}
	// Buzz
	if(prefsArray[7] == 1 && jobsDone[7] != 1){
		if(dLinks[i].text == "Buzz!" && dLinks[i].href == "http://buzz.stumbleupon.com/"){
			if(dLinks[i].previousSibling){
				dLinks[i].previousSibling.parentNode.removeChild(dLinks[i].previousSibling);
			}
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[7] = 1;
		}
	}
	// Explore
	if(prefsArray[8] == 1 && jobsDone[8] != 1){
		if(dLinks[i].text == "Explore" && dLinks[i].href == "http://www.stumbleupon.com/explore.php"){
			if(dLinks[i].nextSibling){
				dLinks[i].nextSibling.parentNode.removeChild(dLinks[i].nextSibling);
			}
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[8] = 1;
		}
	}
	// Sponsor
	if(prefsArray[9] == 1 && jobsDone[9] != 1){
		if(dLinks[i].textContent == "Sponsor " && dLinks[i].href == "http://www.stumbleupon.com/sponsors.php"){
			dLinks[i].nextSibling.parentNode.removeChild(dLinks[i].nextSibling);
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[9] = 1;
		}
	}
	// 2nd Navigation Bar
	if(prefsArray[10] == 1 && jobsDone[10] != 1){
		var rows = document.getElementsByTagName('tr');
		if(rows[4].firstChild.className == 'darkbg' && rows[7].firstChild.className == 'bg' && rows[5].textContent.substr(3,10) != "Reviews of"){
			rows[5].style.display='none';
			rows[4].style.display='none';
			rows[3].style.display='none';
			var name = rows[7].firstChild.nextSibling.firstChild.firstChild.firstChild.firstChild;
			name.firstChild.nextSibling.firstChild.nextSibling.nextSibling.size = '2';
			name.nextSibling.firstChild.nextSibling.lastChild.firstChild.firstChild.firstChild.size = '2';
			name.nextSibling.nextSibling.firstChild.nextSibling.lastChild.firstChild.size = '2';
			name.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.lastChild.firstChild.size = '2';
			jobsDone[10] = 1;
		}
	}
	// Other Reviews
	if(prefsArray[11] == 1 && ownReviewLink == 0 && jobsDone[11] != 1){
		if(dLinks[i].textContent.indexOf(" reviews of ")!="-1" && dLinks[i].href.substr(0,31) == "http://www.stumbleupon.com/url/"){
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[11] = 1;
		}
	}
	// Photo/Video
	if(prefsArray[12] == 1 && jobsDone[12] != 1){
		if(dLinks[i].pathname == "/through.php" && dLinks[i].textContent.substr(dLinks[i].textContent.length-6,7) == "Videos"){
				dLinks[i].parentNode.parentNode.parentNode.parentNode.removeChild(dLinks[i].parentNode.parentNode.parentNode);
				jobsDone[12] = 1;
		}
	}
	// Stumble Through
	if(prefsArray[13] == 1 && jobsDone[13] != 1){
		if(dLinks[i].pathname == "/through.php" && dLinks[i].textContent.substr(0,8) == "Stumble "){
				dLinks[i].parentNode.parentNode.parentNode.parentNode.removeChild(dLinks[i].parentNode.parentNode.parentNode);
				jobsDone[13] = 1;
		}
	}
	// Network People Bar
	if(prefsArray[14] == 1 && jobsDone[14] != 1){
		if(dLinks[i].text == "People Online Now" && dLinks[i].pathname == "/online_now.php"){
			dLinks[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = '<td colspan="2">&nbsp;<a href="" style="display:none;"></a></td>';
			jobsDone[14] = 1;
		}
	}
	// Social Network
	if(prefsArray[15] == 1 && jobsDone[15] != 1){
		if(dLinks[i].text == "Social Network" && dLinks[i].pathname == "/superfriends.php"){
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[15] = 1;
		}
	}
	// Connect With Friends
	if(prefsArray[16] == 1 && jobsDone[16] != 1){
		if(dLinks[i].text == "Connect with Friends" && dLinks[i].pathname == "/find_friends.php"){
			if(dLinks[i].previousSibling){
				dLinks[i].parentNode.removeChild(dLinks[i].previousSibling.previousSibling);
			}
			dLinks[i].parentNode.removeChild(dLinks[i]);
			jobsDone[16] = 1;
		}
	}
	// Age/sex for Fans
	if(prefsArray[17] == 1 && jobsDone[17] != 1){
		if(document.location.href.indexOf("stumbleupon.com/friends/") != -1){
			GM_addStyle('.text2.mini {display: none;}');
			GM_addStyle('.text2.mini + br {display: none;}');
		}
	}
	}
}