MediaWiki:Gadget-resign-calculator.js: Difference between revisions

Default the first season to the upcoming season
Drop duplicated hint, add new-topic link
Line 9: Line 9:
// The league numbers a season by the year it ends in, so the season being
// The league numbers a season by the year it ends in, so the season being
// signed for is always the next one up from the current calendar year.
// signed for is always the next one up from the current calendar year.
var NEW_POST_URL = 'https://2teams1cup.com/forum/index.php?act=post&do=new_post&f=70';
var UPCOMING_SEASON = new Date().getFullYear() + 1,
var UPCOMING_SEASON = new Date().getFullYear() + 1,
MAX = 11500000,
MAX = 11500000,
Line 66: Line 68:
} );
} );
wrap.appendChild( btn );
wrap.appendChild( btn );
return wrap;
 
var actions = document.createElement( 'div' );
actions.className = 'tc-calc-actions';
var link = document.createElement( 'a' );
link.href = NEW_POST_URL;
link.target = '_blank';
link.rel = 'noopener';
link.textContent = 'Start a new topic in NBA: Re-Signing';
actions.appendChild( link );
 
var outer = document.createElement( 'div' );
outer.appendChild( wrap );
outer.appendChild( actions );
return outer;
}
}


Line 101: Line 116:
form.appendChild( scoreRow );
form.appendChild( scoreRow );


var hint = document.createElement( 'div' );
hint.className = 'tc-calc-note';
hint.textContent = 'Only seasons with 40+ games played count. If he has never had three, ' +
'fill in the ones he did reach 40 games in and leave the rest blank.';
form.appendChild( hint );


// --- term ---
// --- term ---
Line 229: Line 239:
var note = document.createElement( 'div' );
var note = document.createElement( 'div' );
note.className = 'tc-calc-note';
note.className = 'tc-calc-note';
note.textContent = years + ' years, ' + first + ' through ' + endYear +
note.textContent = years + ' years, ' + first + ' through ' + endYear + '.';
'. Post this in the NBA: Re-Signing forum.';
out.appendChild( note );
out.appendChild( note );
}
}