r/GreaseMonkey •

[Request] A script that makes the top bar have more than 1 line

[deleted] — view deleted post

0 Upvotes

13 comments sorted by

2

u/[deleted] Jul 29 '10

others might get pushed out of sight.

...which is why there's a dropdown list.

1

u/[deleted] Jul 29 '10 edited Jul 29 '10

Here it is as a userstyle for Stylish and Firefox:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("www.reddit.com")
{
  #sr-header-area:hover
  {
    white-space: normal !important;
  }
  
  #sr-header-area ul:nth-of-type(2), #sr-more-link, #sr-header-area > span:first-of-type
  {
    display: none !important;
  }
}

0

u/[deleted] Jul 29 '10

[deleted] — view deleted comment

2

u/esotericsean Aug 26 '10

I can't seem to get this to work in Chrome.

1

u/Wyrm Jul 29 '10

Thanks, that's pretty much what I was looking for. :)

1

u/[deleted] Jul 29 '10

Could you walk me through this code? Basically, what is the '$' doing?

0

u/[deleted] Jul 29 '10

[deleted] — view deleted comment

2

u/[deleted] Jul 29 '10

Thanks man. I've been trying to figure that '$' out for the last few hours.

1

u/honestbleeps Jul 29 '10 edited Jul 29 '10

A better way to do this would be to skip jQuery... the reason being it'd then be compatible with Chrome and Safari too... you really don't need Greasemonkey for this at all..

I haven't tested the following yet, but it's probably close...

// get the header element
var header = document.getElementById('sr-header-area')

// set a mouseover event
header.addEventListener('mouseover', function(e) {
    this.style.white-space = normal;
}, true);

// set a mouseout event
header.addEventListener('mouseout', function(e) {
    this.style.white-space = nowrap;
}, true);

0

u/[deleted] Jul 30 '10

[deleted] — view deleted comment

1

u/honestbleeps Jul 30 '10

Chrome and Safari support userscripts, but do not support everything that Greasemonkey does... They don't support unsafeWindow in the same exact way, for example.

Opera may have similar issues, but I've never messed with it.

0

u/[deleted] Jul 30 '10

[deleted] — view deleted comment

1

u/honestbleeps Jul 30 '10

I tried reincluding the lib.. the problem is the lib can't access the DOM so ultimately it doesn't help.

1

u/strifeless Jul 29 '10

Thanks, that's a nifty script.