MediaWiki:Gadget-fa-bid-calculator.js: Difference between revisions

Omit blank names, Points wording, copy button
Drop cap note, Salary label, new-topic link
Line 6: Line 6:
( function () {
( function () {
'use strict';
'use strict';
var NEW_POST_URL = 'https://2teams1cup.com/forum/index.php?act=post&do=new_post&f=67';


var MIN_OFFER = 500000,
var MIN_OFFER = 500000,
Line 55: Line 57:
} );
} );
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: Free Agency';
actions.appendChild( link );
 
var outer = document.createElement( 'div' );
outer.appendChild( wrap );
outer.appendChild( actions );
return outer;
}
}


Line 95: Line 110:
beat.type = 'number';
beat.type = 'number';
beat.step = '0.1';
beat.step = '0.1';
beat.placeholder = 'e.g. 8.5';
beat.placeholder = '8.5';


var name = document.createElement( 'input' );
var name = document.createElement( 'input' );
Line 122: Line 137:


row( 'Years', years );
row( 'Years', years );
row( 'Salary per year', salary );
row( 'Salary', salary );
var ageRow = row( 'Player is 35 or over', age35 );
var ageRow = row( 'Player is 35 or over', age35 );
ageRow.querySelector( 'label' ).style.fontWeight = 'normal';
ageRow.querySelector( 'label' ).style.fontWeight = 'normal';
Line 226: Line 241:
out.appendChild( postBlock( prefix ? prefix + ' ' + offer : offer ) );
out.appendChild( postBlock( prefix ? prefix + ' ' + offer : offer ) );


var note = document.createElement( 'div' );
note.className = 'tc-calc-note';
note.textContent = 'Check this against your cap space before posting — a bid over your ' +
'space costs 40% of the contract for a year, and you do not get the player.';
out.appendChild( note );
}
}