Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   The Blue Alliance (http://www.chiefdelphi.com/forums/forumdisplay.php?f=174)
-   -   [TBA]: Greasemonkey Chief Delphi? (http://www.chiefdelphi.com/forums/showthread.php?t=65773)

Greg Marra 12-03-2008 01:02

[TBA]: Greasemonkey Chief Delphi?
 
A random idea:

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...

[Edit]
Testing:
Team 177
[/Edit]

divergentdave 17-03-2008 22:50

Re: [TBA]: Greasemonkey Chief Delphi?
 
Done, here you go.

http://divergentdave.googlepages.com/tbalinker.user.js

Greg Marra 18-03-2008 18:58

Re: [TBA]: Greasemonkey Chief Delphi?
 
Chief Delphi TBA Autolinker

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.

Installing
  1. Get or use Mozilla Firefox.
  2. Install Greasemonkey. It will make you restart Firefox.
  3. Click the link to divergentdave's Chief Delphi TBA Autolinker script.
  4. Greasemonkey will ask you if you want to install the script. Say yes to the default options.
  5. You're done! Any time someone says "team ####" on Chief Delphi, it will link to the corresponding team page on The Blue Alliance!

Thanks divergentdave!

Kristian Calhoun 18-03-2008 19:20

Re: [TBA]: Greasemonkey Chief Delphi?
 
The linker can also be used in Opera (v8.0 and higher)!

To install:
  • Save divergentdave's Chief Delphi TBA Autolinker script (Right click, Save target as)
  • In Opera, go to Tools -> Preferences
  • In the "Advanced" tab, select "Content"
  • Click the "Javascript Options" button, and enter the directory of the saved script under "User JavaScript Files"
  • Hit OK - no restart required! :)

Elgin Clock 15-04-2008 00:43

Re: [TBA]: Greasemonkey Chief Delphi?
 
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?

Other than that, it seems to be working fine!

artdutra04 15-04-2008 02:19

Re: [TBA]: Greasemonkey Chief Delphi?
 
Quote:

Originally Posted by Elgin Clock (Post 737266)
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?

Other than that, it seems to be working fine!

That would most likely be a very simple fix.

In this part of the script:

Code:

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:

Quote:

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.)

daltore 16-04-2008 23:52

Re: [TBA]: Greasemonkey Chief Delphi?
 
Yup, I added that line, works fine. Thanks divergentdave and artdutra04!

Elgin Clock 15-02-2009 18:36

Re: [TBA]: Greasemonkey Chief Delphi?
 
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:

Minor tweak... right?? ;)


All times are GMT -5. The time now is 19:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi