none
Fixing the broken CSS RRS feed

  • General discussion

  • The last update severely crippled my ability to recognize interesting threads.  It took me a long time to develop sensitivity to bold vs italic vs normal, the font size change threw that out of the window.  I have whined about this before but that never made any difference.  Time to do something about it.  It cost me a pound of flesh but it was well worth it.  I'll post it here in case it is useful to somebody else.  Firefox required.

    Download and install the Greasemonkey addon.  Tools + Greasemonkey + New user script.  Type "Patch MSFT forum CSS", "http://example.com", "Repair Microsoft forum styles".  "Includes" must point to the home page of the forums you usually visit.  Mine is "http://social.msdn.microsoft.com/Forums/*".  Adjust as necessary, look at the address bar to be sure.  The * makes the patch active on any page of the forum.

    Click OK, it now wants to select the editor you use if this is the first time you ran it.  Select c:\windows\notepad.exe.  Next, your editor pops up, invariably with a broken user script comment (this is open source).  Make it look like this:

    // ==UserScript==

    // @name           Patch MSFT forum CSS

    // @namespace      http://example.com/msftforums

    // @include        http://social.msdn.microsoft.com/Forums/*
    // ==/UserScript==


    appendStyle(
    // Show threads I've read in gray
      'li.thread.viewed > h3 > a { color: #bbbbbb; }' +
    // Show threads with unread posts in red
      'li.thread.hasUnread > h3 > a { color: #ff0000; }' +
    // Show threads I've never read in red
      'li.thread > h3 > a { color: #ff0000; }' +
    // Fix font size and don't use bold
      'li.thread > h3 { font-size: 12pt; font-weight: normal; }' +
    // Fix vote count font size
      '.votecount { font-size: 11pt; }'
    );

    function appendStyle(css) {
        var body, style;
        body = document.getElementsByTagName('body')[0];
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        body.appendChild(style);
    }

    Ctrl+S to save, refresh a forum page in the browser and you should see the new styles in effect.  Lots more things you can do with this of course.  Basic tools you'll need are Tools + Error Console to see mistakes, GM_log() to send diagnostics to the console, a DOM browser like Firebug to see the web page structure.  Hope that's helpful.li.thread.viewed > h3 > a { color: #bbbbbb; }li.thread.hasUnread > h3 > a { color: #ff0000; }li.thread > h3 > a { color: #ff0000; }li.thread > h3 { font-size: 12pt; font-weight: normal; }.votecount { font-size: 11pt; }
    Hans Passant.
    Sunday, October 18, 2009 1:57 PM

All replies

  • Mental reminder: the blasted post editor ought to be next.  There are no empty lines in the script header.

    Hans Passant.
    Sunday, October 18, 2009 2:00 PM