9

Want to browse Meta with the upcoming SuperUser stylesheet/logo?

// ==UserScript==
// @name           not-so super user
// @namespace      soflow
// @include        *meta.stackoverflow.com*
// ==/UserScript==

for( i = 0; (l = document.getElementsByTagName("link")[i]); i++ ) {
    if( l.getAttribute("rel").indexOf("style") >= 0 ) l.disabled = true;
}

var link = window.document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'http://dev.superuser.com/content/all.css?v=3959';
document.getElementsByTagName("HEAD")[0].appendChild(link);

var logoImage = document.getElementById("hlogo").getElementsByTagName("img")[0];

logoImage.src = "http://dev.superuser.com/content/img/su/logo.png";
logoImage.width = "250";
logoImage.height = "60";

alt text

24
  • How'd you do it?! I DEMAND TO KNOW.
    – Paolo Bergantino
    Commented Jul 14, 2009 at 19:21
  • 2
    He already has 2k rep!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    – Justin 'jjnguy' Nelson
    Commented Jul 14, 2009 at 19:22
  • 6
    @Paolo: I think that qualifies him for the Hacker badge :)
    – Eric
    Commented Jul 14, 2009 at 19:26
  • Way to rollback to a sentence that makes no sense at all.
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:33
  • 1
    I feel like I should start screaming "EDIT WAR!" while the rest of Meta crowds around. Sort of like grade school.
    – Eric
    Commented Jul 14, 2009 at 19:35
  • Eric: If you do I will imagine myself punching you in the junk so hard that I will hope you feel it.
    – TheTXI
    Commented Jul 14, 2009 at 19:38
  • @Eric: What edit war? We don't edit war anymore. We make valid edits, people rollback because they are uncomfortable with the rules of the site, and we inform the mods. No war needed.
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:39
  • @Rich: Thank goodness. That had all the inklings of one. @TXI: Please stay as far away from my junk as possible.
    – Eric
    Commented Jul 14, 2009 at 19:41
  • @Eric: Where are you seeing all of these edit wars you are so afraid of?
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:42
  • 5
    So, when are you just gonna change your user name to Greasemonkey? ;)
    – gnovice
    Commented Jul 14, 2009 at 19:43
  • 1
    @gnovice Hehe. I've abandoned nicknames long ago :)
    – Jonathan Sampson
    Commented Jul 14, 2009 at 19:46
  • 1
    @Rich: Afraid isn't the right word. Cynical is probably the right one. What with all the grand-standing and righteousness and whatnot. Also, I believe Jonathan created the "Ignore User" GreaseMonkey script just after one of thems.
    – Eric
    Commented Jul 14, 2009 at 19:47
  • 2
    @jjnguy - Rich didn't write that. I did. He merely migrated it from the body to the title.
    – Jonathan Sampson
    Commented Jul 14, 2009 at 19:52
  • 1
    @Jonathan: I think you've already GreaseMonkey'd yourself up a nickname that will be hard to get rid of. :)
    – Bill the Lizard
    Commented Jul 14, 2009 at 19:59
  • 3
    It looks 'shopped, I can see the pixels.
    – Dennis Williamson
    Commented Jul 14, 2009 at 21:01

6 Answers 6

7

I have to say, I'm really liking the new theme. From the slight blue highlight for interesting questions to the purple comment scores, I think that Jeff has a winner here. I like it so much that I don't want to go back to the cold gray that's the default here.

4
  • 1
    I agree. I like the lighter colors. Very uplifting. Although, I must say that I'd love to see native-support of user-themes too so I don't have to see the style-sheets swap each request :)
    – Jonathan Sampson
    Commented Jul 14, 2009 at 19:54
  • 1
    After spending so much time on Meta recently, it's going to be hard getting used to colors again.
    – TheTXI
    Commented Jul 14, 2009 at 19:54
  • 3
    Colors? What are those again? That's like, when something is extra gray, right?
    – Hilarious Comedy Pesto
    Commented Jul 14, 2009 at 20:00
  • I've been using the SO CSS since the first day I came here. The grey was way to bland and distracting. I have no idea how you cope with it.
    – Ian Elliott
    Commented Jul 14, 2009 at 21:06
3

Good find! But that black-backed "0 answers" thing sticks out like a sore thumb. Can you post some other pages as well (viewing a question, user list, etc)?

2
  • 3
    Shouldn't 0 answers stick out like a sore thumb?
    – Eric
    Commented Jul 14, 2009 at 19:20
  • Sure, but I think that in keeping with the rest of the site, they should be red text on a white background
    – Kyle Cronin
    Commented Jul 14, 2009 at 19:23
3

You'd better Greasemonkey up a way for me to get in there or I will cry.

7
  • 3
    To be fair, you will cry either way.
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:08
  • 1
    That is completely irrelevant.
    – TheTXI
    Commented Jul 14, 2009 at 19:09
  • 3
    It's my answer and I'll cry if I want to. Cry if I want to. Cry if I want to. You would cry too if it happened to you.
    – TheTXI
    Commented Jul 14, 2009 at 19:09
  • @TheTXI: I thought we weren't going to bring up the pony incident anymore?
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:12
  • 2
    Rich B: That's no need for you to be ashamed of your relationship with Sparkles.
    – TheTXI
    Commented Jul 14, 2009 at 19:13
  • 4
    Now it's Rich's turn to cry, Rich's turn to cry, Rich's turn to cry. 'Cause Sparkles came back, to me.
    – Joel Coehoorn
    Commented Jul 14, 2009 at 19:21
  • 2
    Wow Joel. Now I am truly disturbed.
    – Geoffrey Chetwood
    Commented Jul 14, 2009 at 19:24
3

Can you make this with a drop down so we can pick a theme for meta, so, sf, and su?

I don't know if I would change the logo in the script, but the colors, amazing!

2
  • I like having the logo changed - it really completes the design. It would be nice to have a dropdown though.
    – Kyle Cronin
    Commented Jul 14, 2009 at 19:48
  • I guess I don't want the site to lose its complete identity... I will use this for all of the sites in the triliogy and change everything to this stylesheet. So having the logos in place is a plus so I know which site I'm really on.
    – Chester
    Commented Jul 14, 2009 at 19:49
2

I've modified your script a weeeee bit and combined it with a modified navigation one... It'll default the theme to whatever the site's theme is, but clicking the colored boxes at the top of the screen changes themes accordingly...

function changeTheme(url)
{
    for( i = 0; (l = document.getElementsByTagName("link")[i]); i++ ) {
        if( l.getAttribute("rel").indexOf("style") >= 0 ) l.disabled = true;
    }

    var link = window.document.createElement('link');
    link.rel = 'stylesheet';
    link.type = 'text/css';
    link.href = url;
    document.getElementsByTagName("HEAD")[0].appendChild(link);
}

(function(){
  function GM_wait() {
    if(typeof unsafeWindow.jQuery == 'undefined') { 
      window.setTimeout(GM_wait,100); 
    } else { 
      $ = unsafeWindow.jQuery; letsJQuery(); 
    }
  }
  GM_wait();
  function letsJQuery() {
    $('#hlinks')
      .prepend('<span class="link-separator"> | </span>')
      .prepend("<a href='http://meta.stackoverflow.com'><img src='http://meta.stackoverflow.com/favicon.ico' title='Visit Meta Stack Overflow' style='padding:1px'></a>")
      .prepend('<span class="link-separator"> | </span>')
      .prepend("<a href='http://www.serverfault.com'><img src='http://serverfault.com/favicon.ico' title='Visit ServerFault' style='padding:1px'></a>")
      .prepend('<span class="link-separator"> | </span>')
      .prepend("<a href='http://dev.superuser.com'><img src='http://dev.superuser.com/favicon.ico' title='Visit SuperUser' style='padding:1px'></a>")
      .prepend('<span class="link-separator"> | </span>')
      .prepend("<a href='http://www.stackoverflow.com'><img src='http://stackoverflow.com/favicon.ico' title='StackOverflow' style='padding:1px'></a>")
      .prepend('<span class="link-separator"> | </span>')
      .prepend("<a id='mtheme' href='#' style='position:relative;top:1px;display:inline-block;width:10px;height:10px;background:#ccc;margin-right:1px;' title='Meta Theme'><span style='display:none'>meta.stackoverflow</span></a>")
      .prepend("<a id='sftheme' href='#' style='position:relative;top:1px;display:inline-block;width:10px;height:10px;background:#c99;margin-right:7px' title='Server Fault Theme'><span style='display:none'>serverfault</span></a>")
      .prepend("<a id='sutheme' href='#' style='position:relative;top:1px;display:inline-block;width:10px;height:10px;background:#00ADED;margin-right:7px' title='Super User Theme'><span style='display:none'>superuser</span></a>")
      .prepend("<a id='sotheme' href='#' style='position:relative;top:1px;display:inline-block;width:10px;height:10px;background:#f60;margin-right:7px' title='Stack Overflow Theme'><span style='display:none'>stackoverflow</span></a>")

    $('#sotheme').bind("click", function() {
        changeTheme('http://stackoverflow.com/content/all.css');
        return false;
    });
    $('#sftheme').bind("click", function() {
        changeTheme('http://serverfault.com/content/all.css');
        return false;
    });
    $('#mtheme').bind("click", function() {
        changeTheme('http://meta.stackoverflow.com/content/all.css');
        return false;
    });
    $('#sutheme').bind("click", function() {
        changeTheme('http://dev.superuser.com/content/all.css');
        return false;
    });
  }
})();

The ServerFault theme is currently not working very well... Not sure why... I would also like to figure out a way for the GM script to remember what your last theme selection was so it could persist for future clicks.

6
  • 3
    You misspelled it "servervault" :-)
    – Kyle Cronin
    Commented Jul 14, 2009 at 21:03
  • 1
    That would explain sooooooo much!
    – Chester
    Commented Jul 14, 2009 at 21:03
  • And the typo has been corrected...
    – Chester
    Commented Jul 14, 2009 at 21:04
  • you can also take out the ?v=3959 if you want
    – Kyle Cronin
    Commented Jul 14, 2009 at 21:05
  • out of curiosity, what does the ?v=#### actually do? Is that a version of some kind of the doc?
    – Chester
    Commented Jul 14, 2009 at 21:07
  • It's the SVN version, and it's used to get browsers to fetch a new version of the CSS if there are changes made.
    – Kyle Cronin
    Commented Jul 14, 2009 at 21:09
0

Anything would look like an improvement after looking at the metaSO theme for a few days. :)

You must log in to answer this question.