// ==UserScript== // @name Yahoo Baseball Team Subnavigation Links // @namespace http://glenncarr.com/greasemonkey/yahoofantasy // @description Adds subnavigation links to opposing team pages // @include *baseball.fantasysports.yahoo.com* // @author Glenn Carr (glenn at glenncarr dot com) // $LastChangedRevision$ // $LastChangedDate$ // ==/UserScript== /* Updates: 19-Sep-2007 - Get rid of extra whitespace at top of page */ (function(){ if (!location.href.match(/baseball\.fantasysports\.yahoo\.com\/b\d\/\d+\/(team(log)?\?mid=)?\d+.*/i)) return; var yspsubnav = document.getElementById( 'yspsubnav' ); if ( yspsubnav ) return; var yspnav = document.getElementById( 'yspnav' ); if ( !yspnav ) return; GM_addStyle( '#team-nav .wrapper { min-height: 0px }' ); yspsubnav = document.createElement( 'div' ); yspsubnav.id = 'yspsubnav'; yspsubnav.setAttribute( 'class', 'navlist' ); var myTeamUrl = document.evaluate( "//div[@id='yspnav']//a[contains(.,'My Team')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem( 0 ); var matches = location.href.match( /(^.+baseball\.fantasysports\.yahoo\.com\/b\d\/\d+\/)(?:team(?:log)?\?mid=)?(\d+).*/i ); var teamUrl = matches[ 1 ] + matches[ 2 ]; yspsubnav.innerHTML = '