Jump to content

Temporary GreaseMonkey fix for My Profile page


Chrysalides
Followers 4

Recommended Posts

We have to, it is the only way to get the song by palmetto out of our heads. Jim
Guess what was going through my head as I opened this thread. Aarrgghhhh!! :P

I'm afraid to ask... what song? I saw something about "scrollin'" but don't know what music is supposed to go with it.

 

Is ignorance bliss?

Sorry, but I cannot resist... Pants on the Ground! Pants on the Ground!

That will get any other song you had in your head out.

 

Back on topic, thanks for the help. Nice scripting work.

Link to comment

in case it saves someone else a few mins...

 

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

@-moz-document
 url-prefix("http://www.geocaching.com/")
{
 body {line-height:1em !important;}
}

@-moz-document
 url-prefix("http://www.geocaching.com/map")
{
 #cacheListTable {font-size: 10px !important; }
 .LabeledMarker_markerLabel {font-size: 8px !important;
						  padding:0px !important;}
 #uxPremiumFeatures {margin-top:5px !important;}
 #filterLegend>p {margin-top:5px !important;}
 .FilterContainer {margin:0 !important;}
 #uxSideBar>p {margin-top:5px !important;}
 #cacheListBounding {margin-top:5px !important;}
}

 

tidies up the right hand side of maps a bit (and reduces line spacing... a bit too liberally really)

Edited by aB5dEglYeS5P
Link to comment

Straying off topic from the My / Your Profile page changes, I started looking at the cache page itself.

 

Two things annoy me there:

 

* Disclaimer : why does it display after I've already agreed to it? This is especially annoying in the print view. Fortunately I hardly ever print any more, or I'd be more annoyed at wasting ink.

* Why is there a line break between "Print:" and the print options?

 

Then there's the extra line space at the top even when there's no related web page, but I figure I'll tackle that another time.

 

I'm not sure if Groundspeak would object to the removal of disclaimer from the cache listing. Seems like something a lawyer would object to, and I don't want to be the target of a C&D letter. I'd like to know, however, if the text has always been there, or I have somehow trained my eyes to just slide over it?

 

The extra line break in "Print:" seems like just a minor bug in the HTML and should be fixed by Groundspeak, but in the meantime, a simple replace() gets rid of it easily:

 

// ==UserScript==
// @name		   Nix Line Break
// @namespace	  chrysalides
// @description	Remove extra line break from cache page
// @include		http://www.geocaching.com/seek/cache_details.aspx?*
// ==/UserScript==

document.body.innerHTML= document.body.innerHTML.replace(/Print:<\/strong><br>/g,"Print:</strong>");

 

Seems like there should be a more efficient method of getting rid of it... but whatever works :P I won't post the Disclaimer fix unless someone can assure me it is kosher, but you can probably use the techniques from the Profile fix to modify it for yourself if you feel like it without help from me.

Link to comment

Seems like there should be a more efficient method of getting rid of it... but whatever works :P I won't post the Disclaimer fix unless someone can assure me it is kosher, but you can probably use the techniques from the Profile fix to modify it for yourself if you feel like it without help from me.

If you are referring to the disclaimer on the main cache page, Lil Devil's Bag O Tricks already has that option (as a User Script Command).
Link to comment
in case it saves someone else a few mins...

 

tidies up the right hand side of maps a bit (and reduces line spacing... a bit too liberally really)

Thanks. Looks a little too severe to me, actually. Using part of yours and rob3k's style, I came up with this for Your Profile:

 

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

@-moz-document url-prefix("http://www.geocaching.com/my") {
.WidgetBody { line-height: 110% ! important; }
 body {line-height:1.25em ! important; }
}

 

Now the Profile page looks almost like it used to :P

Link to comment
If you are referring to the disclaimer on the main cache page, Lil Devil's Bag O Tricks already has that option (as a User Script Command).

Ah, that must be why I didn't see the disclaimer before.. thanks. Still in the process of updating all the broken scripts.

 

I had hoped that these scripts wouldn't be necessary after the update, but sadly this is not so.

Edited by Chrysalides
Link to comment

For anyone who would like to see the before and after of applying the GreaseMonkey script as well as the Stylish CSS change :

 

Before :

 

765051010_D2J5e-O.jpg

 

After :

 

765051007_oHa3T-O.jpg

 

Convinced?

 

GreaseMonkey

GM Script for Profile Page

Stylish

My style from a few posts above (profile page only)

aB5dEglYeS5P's style from above (addresses many pages on site)

 

Thanks to everyone who contributed to this thread, especially Lil Devil, rob3k and aB5dEglYeS5P

Edited by Chrysalides
Link to comment

Big thanks for getting the ball rolling on this, my profile looks pretty much the same as yours. I like seeing more info without scrolling...

 

I also used the replace trick to add a custom link bar under the current Quick View with links to Field Notes, PQs, Bookmarks, Recent Finds, a preview of a PQ that gives me caches published within the last week, a few other odds and ends.

Link to comment

Ah, the userstyles site is responsive for me today and I uploaded my CSS changes as one big Stylish style here:

 

http://userstyles.org/styles/24193

 

It's commented so you can tweak it to remove bits or whatever.

 

Nice thing with Stylish - if you don't like what this does just disable the script and you're back to where you were before loading it up.

 

I use this along with the greasemonkey scripts Chrysalides created, this doesn't fix the 'Visit Log' wrapping problem for example.

Link to comment
One question... what happened to your three pending caches? They're all blurry!! :unsure:

It can be explained by Heisenberg's Uncertainty Principle. As it is unfinished and unpublished, it only exists as a probability waveform at this point in time, hence the blurriness.

 

rob3k : I installed your style, it has even less whitespace than before the site change :) I'll try it out to see if I like it better. Thanks for sharing!

Link to comment

For anyone who would like to see the before and after of applying the GreaseMonkey script as well as the Stylish CSS change :

 

[images snipped]

 

Convinced?

 

GreaseMonkey

GM Script for Profile Page

Stylish

My style from a few posts above (profile page only)

aB5dEglYeS5P's style from above (addresses many pages on site)

 

Thanks to everyone who contributed to this thread, especially Lil Devil, rob3k and aB5dEglYeS5P

These changes are great - they make the site usable again. Thanks to everyone who contributed. Any word from Prime Suspect on when his excellent scripts will be updated?

 

Am I the only one who finds it ironic that one of Groundspeak's intentions for the recent update is to make Greasemonkey scripts obsolete? :unsure:

Link to comment
Am I the only one who finds it ironic that one of Groundspeak's intentions for the recent update is to make Greasemonkey scripts obsolete?

You should read the release notes again. That may be a plan for the future, but they did not say it was the intent now. :unsure:

 

We recognize that the GreaseMonkey scripts in particular serve a legitimate need in many cases, so we plan to integrate the most popular scripts wherever possible to render them obsolete (with kind regards to their creators).

 

And for the record, before anyone starts down that road again, as an author of several GM scripts, I would be flattered if they were to implement any of my scripts or ideas into the website. Of course, attribution would be nice to see in the release notes :)

Link to comment

document.body.innerHTML= document.body.innerHTML.replace(/<\/li><li>/g,"</a> - ");

 

nicely shortens up the list of links under '* Find...' and *For online maps...' on cache pages.

I've found that the innerHTML replace messes up some Javascript even when only text is replaced. Evident in the cache listing page. More details to follow... but check to see if you can close the map on top when expanded, and whether clicking on map at bottom open google map view.

Link to comment

I'm a little bit (in fact, a lot) confused.

 

None of the MonkeyGrease scripts works for me (I understand they don't recognise GC pages as such so don't get activated). So ... what's the point in modifying some lines of scripts that don't work?

 

What am I missing? :):shocked:

 

In fact, I don't care about reverting to old GC look, I have no problems at all with the new one, but I would like to format my logs again!!! :huh:

Link to comment
I'm a little bit (in fact, a lot) confused.

 

None of the MonkeyGrease scripts works for me (I understand they don't recognise GC pages as such so don't get activated). So ... what's the point in modifying some lines of scripts that don't work?

 

What am I missing? :):shocked:

 

In fact, I don't care about reverting to old GC look, I have no problems at all with the new one, but I would like to format my logs again!!! :huh:

Not sure what you're referring to. Do you mean the old scripts no longer work? Groundspeak has renamed some of the elements of the html so many (all?) of Prime Suspect's script no longer works. Lil Devil has fixed most of his scripts.

Link to comment
I'm a little bit (in fact, a lot) confused.

 

None of the MonkeyGrease scripts works for me (I understand they don't recognise GC pages as such so don't get activated). So ... what's the point in modifying some lines of scripts that don't work?

 

What am I missing? :):shocked:

 

In fact, I don't care about reverting to old GC look, I have no problems at all with the new one, but I would like to format my logs again!!! :huh:

Not sure what you're referring to. Do you mean the old scripts no longer work? Groundspeak has renamed some of the elements of the html so many (all?) of Prime Suspect's script no longer works. Lil Devil has fixed most of his scripts.

Where can I find the "fixed" ones???? FF search for update complements shows the same old version I have.

Link to comment

Wow ...

 

I tried adding a script with your sugestion:

 

// ==UserScript==
// @name		   My Profile Fix
// @namespace	  chrysalides
// @description	Change "Visit Log" (2 lines) to "Log"
// @include		http://www.geocaching.com/my/
// ==/UserScript==

document.body.innerHTML= document.body.innerHTML.replace(/Visit Log/g,"Log");

It works, but I get a black column all the page high, from top to bottom, the size of the advertisement. It goes "under" the table, so it's visible only on the top and on the bottom.

 

Any idea?

 

dibujogd.jpg

Edited by DeepButi
Link to comment

OMG doing any changes to body.innerHTML is just asking for side-effect problems. Don't do it. Really.

 

There are much more reliable ways to accomplish what you want. Just off the top of my head, here's one way:

 

GM_AddStyle('a[title="Visit Log"] { white-space: nowrap; }');

 

Edit to say you could also add the part inside the single-quotes with Stylish.

Edited by Lil Devil
Link to comment
It works, but I get a black column all the page high, from top to bottom, the size of the advertisement. It goes "under" the table, so it's visible only on the top and on the bottom.

The updated script from userscripts.org does not use innerHTML.replace(). Lil Devil's suggestion looks good as well - you can combine it with the Stylish changes above and have no need for GreaseMonkey. The GM script does allow for customizing the number of widgets on the right column though.

Link to comment
It works, but I get a black column all the page high, from top to bottom, the size of the advertisement. It goes "under" the table, so it's visible only on the top and on the bottom.

The updated script from userscripts.org does not use innerHTML.replace(). Lil Devil's suggestion looks good as well - you can combine it with the Stylish changes above and have no need for GreaseMonkey. The GM script does allow for customizing the number of widgets on the right column though.

Thanks. It's ok now.

 

And thanks to Find Counts & Quick Hint fixes also. Great job.

 

Now waiting for Maximize Logs one! I'm back to stone age without formating my logs :).

Link to comment
http://gmscripts.locusprime.net/ - Some have been updated and more will be soon.

Seems I cannot get the correct ones installed. I must be doing something wrong but I find only old ones.

I think Prime answered your question in another thread, but not all have been updated yet. He's working on it, though.

 

Before installing you can check to see what it was last updated by clicking on the Show Source button in Greasemonkey. Most authors put the version/last update date somewhere in the top of the script.

Link to comment
And thanks to Find Counts & Quick Hint fixes also. Great job.

Quick hint was updated? I'm showing it was still the old version. Can you direct me to a link for it? I use that one a lot.

Read posts #35 & #37 of this same thread for Quick Hint & Find Counter. They are not oficcialy updated but it's easy to repair them. Both are working for me now.

 

Need Log Maximizerrrrrrr :ph34r: (and will wait patiently for it).

Link to comment

Read posts #35 & #37 of this same thread for Quick Hint & Find Counter. They are not oficcialy updated but it's easy to repair them. Both are working for me now.

 

Hi Guys,

 

How are you editing the GreaseMonkey scripts? I've got as far as the Manage User Script window, and pressed 'Edit', then been asked to select my editing program. I chose Notepad as the least likely to mess up the format of the script but this just presents the script as a jumble of characters not as lines of text. Which program do you use to edit the scripts please??

 

Chris

Edited by Matthew 7:7 Too
Link to comment

document.body.innerHTML= document.body.innerHTML.replace(/<\/li><li>/g,"</a> - ");

 

nicely shortens up the list of links under '* Find...' and *For online maps...' on cache pages.

I've found that the innerHTML replace messes up some Javascript even when only text is replaced. Evident in the cache listing page. More details to follow... but check to see if you can close the map on top when expanded, and whether clicking on map at bottom open google map view.

 

Ooo, I hadn't noticed that. I had the GM script running to remove the linebreak from after Print:, but I disabled it.

 

I still use this to create a custom navigation bar at the top of my profile page, but I'll either work out how to do it walking through the DOM or leave it as is. I'm finding the custom links too handy to take them out. :ph34r:

Link to comment

Read posts #35 & #37 of this same thread for Quick Hint & Find Counter. They are not oficcialy updated but it's easy to repair them. Both are working for me now.

 

Hi Guys,

 

How are you editing the GreaseMonkey scripts? I've got as far as the Manage User Script window, and pressed 'Edit', then been asked to select my editing program. I chose Notepad as the least likely to mess up the format of the script but this just presents the script as a jumble of characters not as lines of text. Which program do you use to edit the scripts please??

 

Chris

 

Try wordpad.

Link to comment

Read posts #35 & #37 of this same thread for Quick Hint & Find Counter. They are not oficcialy updated but it's easy to repair them. Both are working for me now.

 

Hi Guys,

 

How are you editing the GreaseMonkey scripts? I've got as far as the Manage User Script window, and pressed 'Edit', then been asked to select my editing program. I chose Notepad as the least likely to mess up the format of the script but this just presents the script as a jumble of characters not as lines of text. Which program do you use to edit the scripts please??

 

Chris

 

Try wordpad.

No, you want to use Notepad. Wordpad may add extra characters. Notepad is a pure text editor.

 

I use Notepad and have never seen any of the jumbled stuff. Maybe you need to turn on or off the word wrap feature?

Link to comment

Hi,

 

Thanks guys,

 

Turning word wrap off in WinXP's Notepad just gives me 4 or 5 lines of continuous text. With word wrap on, I still get the text flowing along in long continuous lines. Copying the text into WinXP's Wordpad gives me properly formatted nested lines of code which looks much easier to understand. I was worried about adding extra format codes with this - but can I use it and save to a text file??

 

Chris

Link to comment

Hi,

 

Thanks guys,

 

Turning word wrap off in WinXP's Notepad just gives me 4 or 5 lines of continuous text. With word wrap on, I still get the text flowing along in long continuous lines. Copying the text into WinXP's Wordpad gives me properly formatted nested lines of code which looks much easier to understand. I was worried about adding extra format codes with this - but can I use it and save to a text file??

 

Chris

Yes, I suppose you could edit it in Wordpad and then copy and paste it into Notepad. I wouldn't trust saving the Wordpad file directly for fear it would add extra stuff.

Link to comment
Ooo, I hadn't noticed that. I had the GM script running to remove the linebreak from after Print:, but I disabled it.

 

I still use this to create a custom navigation bar at the top of my profile page, but I'll either work out how to do it walking through the DOM or leave it as is. I'm finding the custom links too handy to take them out. :ph34r:

I have a safe method of removing two lines of whitespace from the cache page - the one after terrain, and the one after "Print:". Unfortunately I left the script on my home machine and not my work laptop. I'll upload it tonight and you can use it as a template for making other changes you want. But if you're impatient, I believe I use document.getElementById(), then elem.parentNode, elem.previousSibling / elem.nextSibling and to check that I'm deleting the right thing, test for elem.nodeName == "BR". And to delete it, elem.parentNode.removeChild(elem). If you have a HTML or XML formatter, it makes figuring out which parent / sibling to get to much easier.

Link to comment
Yes, I suppose you could edit it in Wordpad and then copy and paste it into Notepad. I wouldn't trust saving the Wordpad file directly for fear it would add extra stuff.

Yeah, there are two types of 'new line' character codes, and notepad by default handles the windows standard... so lots of plaintext (I find usually created in linux) is strung together in notepad when pasted. Wordpad understands it, so my standard practice is also just that - copy and paste mis-formatted notepad text into wordpad, then re-paste it into notepad; that should fix it 99% of the time :huh:

Link to comment

 

I'm new to greasemonkey, driven by tidying up the new pages.

 

I use Chrome rather than FF as a browser, and this does support much of the GM script. One feature that doesn't seem to appear however is the opportunity to select which features of the GM script to enable (e.g. the bag 'o tricks has various options).

 

I'm happy to manually edit the code (I've worked with other scripts in the past), if someone can point me to the sort of lines that are likely to help me out here.

 

Or alternatively, perhaps the way for me to do it is to just lift the elements from other's scripts that do the "work"?

 

Guidance gratefully received! TIA!

 

Matt

Link to comment

Sadly this script is still necessary as the latest changes only involve CSS.

 

Here's the script that removes two of the extra line breaks in the cache description page. It also hides the disclaimer and the ROT13 decryption key.

 

http://userscripts.org/scripts/show/66749

 

Just turned off GM and Stylish to view the untampered site and it still has that line wrap for Vist Log... B)

 

The line spacing is a lot better, the CSS changes aren't needed all that much now. They tightened up some things more than my CSS did and some things slightly less and there a few other subtle things the stylish script does, but overall not much difference.

Link to comment
I'm new to greasemonkey, driven by tidying up the new pages.

 

I use Chrome rather than FF as a browser, and this does support much of the GM script. One feature that doesn't seem to appear however is the opportunity to select which features of the GM script to enable (e.g. the bag 'o tricks has various options).

 

I'm happy to manually edit the code (I've worked with other scripts in the past), if someone can point me to the sort of lines that are likely to help me out here.

 

Or alternatively, perhaps the way for me to do it is to just lift the elements from other's scripts that do the "work"?

My scripts are fairly basic. Few lines and divided into functional blocks, and just reading you should have a good idea of what they do. The only complicated part is the document.evaluate XPath stuff that frankly is also quite mysterious to me.

 

To remove an element from a page, you can either do:

 

elem.parentNode.removeChild(elem);

 

or:

 

elem.parentNode.style.display = "none";

 

Both works in Firefox, you have to experiment with Chrome.

 

If you need any clarification go ahead and e-mail me your question.

Link to comment

If you need any clarification go ahead and e-mail me your question.

 

THanks for the generous offer - in fact, you are right your scripts were nice and easy to modify (and work fine in Chrome). My profile page is now much tidier, especially as I've removed some of the other elements on the right hand side specifically with the aim of bringing the "pocket queries" link higher up the page. On a netbook with a widescreen resolution that has made a load of difference.

 

It was lil devil's scripts that were baffling me - I'm sure the content would work, but Chrome doesn't seem to offer the ability to select which parts of the script to enable. However, I'm going to have a play with notepad and see what I can achieve!

 

Cheers!

 

Matt

Link to comment

New Feature:

 

I've added the ability to customize the display of widgets on the right hand column. You can remove them individually, and a cookie will remember the state (those diasbled will remain disabled). There's a link at the end of the page to enable them all.

 

In addition, I added 2 more links to Field Notes so that you can now go directly to the Upload a Field Note page, as well as to the register your Trimble device page.

 

Still not very proficient in Javascript, so pardon the ugly code in some parts. Please post bugs / suggestions to this page.

Link to comment
To remove an element from a page, you can either do:

 

elem.parentNode.removeChild(elem);

 

or:

 

elem.parentNode.style.display = "none";

 

Both works in Firefox, you have to experiment with Chrome.

Where possible, I suggest sticking with the display=none method. Some other GM script may depend on that element being there, and if your script removes it, the other script may break. Hiding it should have no effect on other scripts.

 

It was lil devil's scripts that were baffling me - I'm sure the content would work, but Chrome doesn't seem to offer the ability to select which parts of the script to enable. However, I'm going to have a play with notepad and see what I can achieve!

After I finish updating my VIP List script, one of the next projects I intend to tackle will be making all of my scripts cross-browser compatible. Chrome looks like the toughest, however, because of it's minimalist support for user scripts. I keep hoping Google will release a newer version with more support.

Link to comment
Guest
This topic is now closed to further replies.
Followers 4
×
×
  • Create New...