Website Styler

Last update on Oct 7, 2008

Several customizable options. Special support for Userscripts.org (new interface, fix for pre tags, and allows you to hide the install warning box and footer) Changes text fields, buttons, links, selects, and text areas.

Userscripts.org screenshot - Before and After
Screenshot 2 of forums

Version History
1.0 - Created script
1.1 - Added support for Userscripts.org
1.2 - Added warning box hiding for Userscripts.org
1.3 - Added several changeable options inside the script
1.4 - Added textarea (and textarea hover) changing option
1.5 - Changed the warning box hiding function to ID specific
1.6 - Fixed black text problem
1.7 - Added a background for select inputs (same one as text fields)
1.8 - Added options to turn off styling of certain elements (links, selects, textareas, buttons/text fields)
1.9 - Fixed a small bug in the select tags' background color
2.0 - Hid footer on Userscripts.org
2.1 - Changed Userscripts.org's style
2.2 - Added padding fix on posts
2.3 - Replaced data uri's with online URLs to make the run-time shorter
2.4 - Expanded tables on Userscripts.org forums

Set the script's include to http://userscripts.org/* and remove * if you only want the Userscripts.org style.




You could comment on this script if you were logged in.

8 comments Feed-icon

1 point
login to vote
JoeSimmons script's author
Posted Sep 28, 2008

It's cool but I like mine.
Check out my new script and see if you have any suggestions.

1 point
login to vote
avg scriptwright
Posted Sep 28, 2008

Hey joe I improved my function:

      $x=function() {
      	for (var i=0;i<arguments.length;i++) {
      		switch(typeof arguments[i]) {
      			case "string":var x=arguments[i];break;
      			case "number":var type=arguments[i];break;
      			case "object":var node=arguments[i];break;
      		}
      	}
      	return (!type) ? document.evaluate(x,(!node?document:node),null,9,null).singleNodeValue : document.evaluate(x,(!node?document:node),null,type,null)
      };
      

It's overloaded and accepts arguments on type, not order. So $x(".//text()", document.links[0]) or $x(document.links[0],".//text()") would work.

Tell me if it works / needs more features please.

Assumptions:

  1. That if the Result Type isn't supplied, you want to get the first result.
  2. That if the Node isn't supplied, it will be checked against the document.

1 point
login to vote
JoeSimmons script's author
Posted Sep 28, 2008

Thanks. but actually I have one...

      // XPath by JoeSimmons
      function xp(_exp, t, n) {
      var exp = _exp || "//*"; // XPath Expression
      var type = t || 6; // XPath type (e.g., 6=unordered node snapshot)
      var node = n || document; // XPath search node (only for advanced users; research it)
      return(type==9)?document.evaluate(exp, node, null, 9, null).singleNodeValue:document.evaluate(exp, node, null, type, null);
      }
      

So if I want one result, I can just do xp("id('some_id')",9);
If I want text inside of the first link, I do xp(".//text()", 9, document.links[0]);
If I want all tags, I just do xp();

1 point
login to vote
avg scriptwright
Posted Sep 28, 2008

Joe, I made an overloaded XPath function, wanted to share it with you. Here it is:

      $x=function(x,type) {
      	return (!type) ? document.evaluate(x,document,null,9,null).singleNodeValue : document.evaluate(x,document,null,type,null)
      };
      

So if you want only the first result, don't supply the second part:

$x("//div[@class='header']")

or if you want all the results, just specify the type:

$x("//div[@id='footer']//a",7)

1 point
login to vote
JoeSimmons script's author
Posted Sep 1, 2008

I want to do both. but I don't have much time lately. I will sometime.

1 point
login to vote
avg scriptwright
Posted Sep 1, 2008

Yeah, instead of writing a greasemonkey script, you should just write the CSS for Stylish, then post it up on UserStyles.

1 point
login to vote
Sebastian Pa... scriptwright
Posted Jul 27, 2008

You should take a look at Stylish. ;)

1 point
login to vote
nathaniel_hi... scriptwright
Posted Jun 25, 2008

Seems nice! Thanks!

You could comment on this script if you were logged in.