Viewing 1 replies (of 1 total)
  • Plugin Author AntoineH

    (@antoineh)

    I know there are users that use the plugin for NFL, but the pick-em style format that is often used, is not supported by the plugin. So, it is not a perfect fit.

    There is a javascript extension that transforms the prediction sheet to a pick-em style format. This makes at least a small part of the plugin more usable for NFL. The script does not support predicting a draw, but can be altered if you have some jquery skills:

    <script type="text/javascript">
    jQuery( document ).ready( function() {
    	jQuery( 'table.matchinfo.input tr' ).filter( function() { 
    		$this = jQuery( this );
    		return $this.attr( 'id' ) && $this.attr( 'id' ).substr( 0, 5 ) === 'match';
    	} )
    	.each( function() {
    		jQuery( 'td.score', this ).each( function( index ) {
    			$this = jQuery( this );
    			value = $this.text();
    			if ( value == '' && $this.children().length > 0 ) {
    				$this.siblings( '.home, .away' )
    					.css( 'cursor', 'pointer' )
    					.bind( 'click', function() {
    						$this = jQuery( this );
    						team = $this.attr( 'class' ); // home or away
    						$this.siblings( '.score' ).find( 'input[name^="_' + team + '"]' ).val( '1' );
    						$this.siblings( '.score' ).find( ':not(input[name^="_' + team + '"])' ).val( '0' );
    						$this.css( 'font-weight', 'bold' ).css( 'color', 'orange' );
    						$this.siblings( ':not(.' + team + ')' ).css( 'font-weight', 'normal' ).css( 'color', '' );
    					} );
    				
    				value = jQuery( 'input', this ).val();
    			}
    			
    			selector = ( index == 0 ) ? '.home' : '.away';
    			if ( value == '1' ) $this.siblings( selector ).css( 'font-weight', 'bold' )
    															.css( 'color', 'orange' );
    			
    			$this.hide();
    		} );
    	} );
    	
    	jQuery( 'table.matchinfo.input' ).show();
    } );
    </script>
    
Viewing 1 replies (of 1 total)
  • The topic ‘Another Sport’ is closed to new replies.