Userscripts.org Extended Style

By jerone Last update Nov 21, 2008 — Installed 109 times. Daily Installs: 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1

There are 7 previous versions of this script.

// ==UserScript==
// @name           Userscripts.org Extended Style
// @namespace      namespace
// @description    Userscripts.org Extended Style
// @copyright     jerone & Jesse A.
// @include        http://userscripts.org/*
// ==/UserScript==

var css = <><![CDATA[
	/* hover for tabs */
	#script-nav{
		padding-bottom: 1px;
	}
	#script-nav li{
		border-style: solid;
		border-width: 1px;
		border-color: #F8F8F8;
		border-bottom: 0px none;
	}
	#script-nav li:hover{
		background-color: #e8e8e8;
		border-color: #999999;
		border-style: solid;
		border-width: 1px 1px 0;
	}
	#script-nav li a {
		display: inline !important;
	}
	#script-nav .current{
		padding-bottom: 1px !important;
	}
	
	/* override font-size difference between links and normal text in table header on /home/scripts */
	th a{
		font-size: inherit !important;
	}
	
	/* cursor for help */
	.help{
		cursor: help;
	}
	
	/* normalize "(Un)favorite this script" */
	a.remove{
		color: #0066BB !important;
	}
	.favorite a {
		color: #0066BB !important;
		font-weight: inherit !important;
	}
	.favorite a:hover {
	  color: inherit !important;
	}
	
	/* mainmenu same style as homemenu */
	#mainmenu a {
		text-decoration:none;
	}
	#mainmenu a:hover {
		text-decoration:underline;
	}
	
	/* pagination in forum, better visual current page */
	.pagination .current{
		border: 1px solid #888;
		font-weight: bold;
	}
	
	/* remove the unneeded big space between posts in the forum */
	.spacer a{
		line-height: 0px;
	}
	
	/* line between summary and full description */
	#full_description{
		border-top: 1px solid lightGrey;
	}
	]]></>.toString();
GM_addStyle(css);

/* add link to current tab */
if((cur = document.getElementById("script-nav"))){
	if((cur = cur.getElementsByClassName("current")[0])){
		var curTN = cur.firstChild, curA = cur.insertBefore(document.createElement("A"),curTN);
		curA.innerHTML = curTN.nodeValue;
		curA.href = "/scripts/"+(function(val){switch(val.toLowerCase().replace(/^\s\s*/,'').replace(/\s\s*$/,'')){
			case"about":default:return"show";break;
			case"source code":return"review";break;
			case"reviews":return"reviews";break;
			case"discussions":return"discuss";break;
			case"fans":return"fans";break;
		}})(curTN.nodeValue)+"/37212";
		cur.removeChild(curTN);
}	}

/* select discussions tab when in script topic */
if(location.href.match(/\/topics\//gi) && document.getElementById("script-nav")){
	var result = [], next, items = document.evaluate(".//ul[@id='script-nav']/li",document,null,null,null);
	while(next = items.iterateNext()){
		result.push(next);
	}
	Array.forEach(result,function(item){
		if(item.textContent.match(/discussions/gi)){
			item.className="current";
}   });	}