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

Stack calculator rows on narrow screens
The league is NBA RealGM
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
/**
/**
  * 1TC RealGM — re-sign salary calculator.
  * NBA RealGM — re-sign salary calculator.
  * Implements the formula on [[NBA:Re-Signing]]. If the two ever disagree,
  * Implements the formula on [[NBA:Re-Signing]]. If the two ever disagree,
  * the wiki page is the rule and this script is the bug.
  * the wiki page is the rule and this script is the bug.
Line 156: Line 156:
var team = document.createElement( 'input' );
var team = document.createElement( 'input' );
team.type = 'text';
team.type = 'text';
team.placeholder = 'Celtics';
team.placeholder = 'Sonics';
team.className = 'tc-calc-wide';
team.className = 'tc-calc-wide';
row( 'Your team (optional)', [ team ] );
row( 'Your team (optional)', [ team ] );
Line 234: Line 234:
var endYear = first + years - 1;
var endYear = first + years - 1;


// "Celtics offer Larry Bird 5 years" — team and player drop out if blank.
// "Sonics offer Larry Bird 5 years" — team and player drop out if blank.
var tm = team.value.trim(),
var tm = team.value.trim(),
term_ = years + ( years === 1 ? ' year' : ' years' ),
term_ = years + ( years === 1 ? ' year' : ' years' ),