Mercedes-Benz Forum banner

1 - 4 of 4 Posts

·
Registered
1980 280e
Joined
·
670 Posts
Discussion Starter #1 (Edited)
edit: Look at the last post for latest scrip, this first scrip was just a test, basically for fun.

This changes all the links on the in the main forum index to point to the w123 section (atleast in chrome, should work with firefox (greasemonkey) also), I made it as a project to learn how to write extensions so it's fairly useless, but then I realized it would make a funny april fools joke or something for friend or whatever. Basically just unzip it and drag benzworld.user.js into the webbrowser and then an install prompt will show up.

Code:
run(); // execute's the "run()" function.

function run()
{
	// Determines if person is surfing benzworld.org then runs functions "a()" and "b()". 
	if (document.location.host.match(/www.benzworld.org/))
	{
		a();
		b();
	}
}
function a()
	//Adds the text "Adjusted for inflation value = ~$50,000 -> ~$71,000 (2010)" to the w123 table cell.
	{
		document.getElementById('f16').innerHTML = document.getElementById('f16').innerHTML + '<small><i>Adjusted for inflation value = ~$50,000 -> ~$71,000 (2010)</i></small>';
	}

function b()
	{
	// Finds all the anchor tags and changes the "href" attribute to point to http://www.benzworld.org/forums/w123-e-ce-d-cd-td/, 
	// only works in the forum section for some reason??
		var spanArray = document.getElementsByTagName('a'); //.innerHTML = this.innerHTML + 'W';
		for (var i = 0; i <spanArray.length; i++) 
		{
		spanArray[i].setAttribute('href','http://www.benzworld.org/forums/w123-e-ce-d-cd-td/');
		}
	}
 

Attachments

·
Registered
1980 280e
Joined
·
670 Posts
Discussion Starter #2 (Edited)
Heres another script, it actually does something usefull, basically it just removes a bunch of clutter from most of the pages (not all it isn't perfect), I think it makes benzworld look more modern and more inline with it's sort of "high tech" graphics. Not going to bother posting the code, it isn't pretty.

 

Attachments

·
Registered
1980 280e
Joined
·
670 Posts
Discussion Starter #3 (Edited)
Bump, did any one try it out? Anyone try it with grease monkey/firefox? I know the extensions are not super deluxe but nobody has made any extensions for benzword, there must be 1000+ extensions for Reddit.com thou lol.
 

·
Registered
1980 280e
Joined
·
670 Posts
Discussion Starter #4
Learned a couple more tricks, basically the "Automatically retrieve titles from external links" always bugged me so I set it to be unchecked by default, and deleted the whole left side which opens up the forums nicely I think. But still work in progress. As before just unzip and drag into browser.

 

Attachments

1 - 4 of 4 Posts
Top