Wouldn’t it be neat if a Greasemonkey script existed that added a hyperlink to The Blue Alliance’s team page every time someone wrote “Team ####” on Chief Delphi?
I don’t have time right now, and I’ve never worked with Greasemonkey, but if anyone wants to give it a go…
Divergentdave wrote a Greasemonkey script to auto convert when someone writes “Team ####” in a Chief Delphi post to be a link to the corresponding team page on The Blue Alliance.
Would there be any way to have the javascript enable another tab to be opened in FF when you click the team number link instead of opening in the same tab?
var a = document.createElement("a");
a.setAttribute("href", 'http://www.thebluealliance.net/tbatv/team.php?team=' + match[2]);
a.appendChild(document.createTextNode(match[0]));
span.appendChild(a);
Add in one extra line:
var a = document.createElement(“a”);
a.setAttribute(“href”, ‘http://www.thebluealliance.net/tbatv/team.php?team=’ + match[2]);
a.setAttribute(“target”,‘_blank’);
a.appendChild(document.createTextNode(match[0]));
span.appendChild(a);
Note that I have not tested this yet.
This should force the browser to open the link in a new window, which Firefox should default to open in a new tab instead. (Yeah, yeah, I know the target attribute is depreciated in XHTML, but I really don’t care when it comes to Javascript until the new CSS3 standards come out, when they actually plan to implement a target-new: tab; CSS property for links.)
Is there any way to disable this feature in FTC forums on CD?
I recently saw & clicked a link to a team mentioned in the FTC forums, & it was linking to an FRC team with the same number as the FTC team the person was talking about. :eek: