@ -148,7 +148,7 @@ function generalCapIsEnabled () {
return retVal ;
return retVal ;
}
}
function getBidCap ( countyId ) {
function getBidCapForCountyId ( countyId ) {
//Get the default bidcap from settings
//Get the default bidcap from settings
var bidCap = alwaysWinSettings . generalCap ;
var bidCap = alwaysWinSettings . generalCap ;
const countyOversight = alwaysWinSettings . oversight . find ( ( { id } ) => id === countyId ) ;
const countyOversight = alwaysWinSettings . oversight . find ( ( { id } ) => id === countyId ) ;
@ -184,7 +184,7 @@ function getCountyInfo(countyId){
num_clicksToMinWin = ( winGap + bidIncriment ) / bidIncriment ;
num_clicksToMinWin = ( winGap + bidIncriment ) / bidIncriment ;
}
}
let num_bidCap = getBidCap ( countyId ) ;
let num_bidCap = getBidCapForCountyId ( countyId ) ;
let num_clicksToBidCap = num_clicksToMinWin ;
let num_clicksToBidCap = num_clicksToMinWin ;
bidController . readTimestamp = new Date ( ) ;
bidController . readTimestamp = new Date ( ) ;
@ -526,14 +526,14 @@ function getBidCapReasonIcon(reason) {
}
}
function getBidCapReason ( tieBid , myBid , oversightAction , rowCapIsEnabled , rowCap , generalCapIsEnabled , generalCap , capPresidence , applyPresidenceTo ) {
function getBidCapReason ( tieBid , myBid , oversightAction , rowCapIsEnabled , rowCap , generalCapIsEnabled , generalCap , capPresidence , applyPresidenceTo ) {
let tieBidNum = n umber( tieBid ) ;
let tieBidNum = N umber( tieBid ) ;
let winBidNum = n umber( tieBid ) + 25 ;
let winBidNum = N umber( tieBid ) + 25 ;
let generalCapNum = n umber( generalCap ) ;
let generalCapNum = N umber( generalCap ) ;
let rowCapNum = n umber( rowCap ) ;
let rowCapNum = N umber( rowCap ) ;
let myBidNum = n umber( myBid ) ;
let myBidNum = N umber( myBid ) ;
//Build our response object
//Build our response object
let bidCapData = { } ;
let results = { } ;
results . shouldApplyCap = false ; //Flag to indicate if the cap should be applied
results . shouldApplyCap = false ; //Flag to indicate if the cap should be applied
results . reason = 0 ; //No Cap to start of with
results . reason = 0 ; //No Cap to start of with
results . trueCap = null ; //Default to no true cap
results . trueCap = null ; //Default to no true cap
@ -790,15 +790,14 @@ jQuery(window).on('load',function() {
//Inject our controls
//Inject our controls
var newDiv = document . createElement ( 'div' ) ;
var newDiv = document . createElement ( 'div' ) ;
var newHtml = '<div class="alwaysWin-ntsmhf" id="alwaysWin-ntsmhf">' ;
var newHtml = '<div class="alwaysWin-ntsmhf" id="alwaysWin-ntsmhf">' ;
newHtml += '<input type="checkbox" name="isReloadEnabled" ' + getCheckedValue ( "isReloadEnabled" ) + '/><label for="isReloadEnabled">Auto Refresh</label> | ' ;
newHtml += '<input type="checkbox" name="isAutoLoginEnabled" ' + getCheckedValue ( "isAutoLoginEnabled" ) + '/><label for="isAutoLoginEnabled">Auto Login</label> | ' ;
newHtml += '<input type="checkbox" name="isAutoLoginEnabled" ' + getCheckedValue ( "isAutoLoginEnabled" ) + '/><label for="isAutoLoginEnabled">Auto Login</label> | ' ;
newHtml += '<button class="alwaysWinButton" id="alwaysWin-ntsmhf-save" type="button">Save</button><br />' ;
newHtml += '<button class="alwaysWinButton" id="alwaysWin-ntsmhf-save" type="button">Save</button><br />' ;
newHtml += '<input type="checkbox" name="isReloadEnabled" ' + getCheckedValue ( "isReloadEnabled" ) + '/><label for="isReloadEnabled">Auto Refresh</label> ' ;
newHtml += '<label for="minSecondsBetweenReloads">Reload Every</label>:<input id="minSecondsBetweenReloads" type="text" size="3" name="minSecondsBetweenReloads" value="' + minSecondsBetweenReloads + '" /> to <input id="maxSecondsBetweenReloads" type="text" size="3" name="maxSecondsBetweenReloads" value="' + maxSecondsBetweenReloads + '" /> seconds <br/>' ;
newHtml += '<label for="minSecondsBetweenReloads">Every</label>:<input id="minSecondsBetweenReloads" type="text" size="3" name="minSecondsBetweenReloads" value="' + minSecondsBetweenReloads + '" /> to <input id="maxSecondsBetweenReloads" type="text" size="3" name="maxSecondsBetweenReloads" value="' + maxSecondsBetweenReloads + '" /> seconds <br/>' ;
newHtml += '<label for="isGeneralCapEnabled"><input type="checkbox" name="isGeneralCapEnabled" ' + getCheckedValue ( "isGeneralCapEnabled" ) + '/>Don't bid more than</label> ' ;
newHtml += '<label for="isGeneralCapEnabled"><input type="checkbox" name="isGeneralCapEnabled" ' + getCheckedValue ( "isGeneralCapEnabled" ) + '/>Don't bid more than</label> ' ;
newHtml += '<label for="generalCap">:</label><input id="generalCap" type="text" size="5" name="generalCap" value="' + generalCap + '"/> per county<br />' ;
newHtml += '<label for="generalCap">:</label><input id="generalCap" type="text" size="5" name="generalCap" value="' + generalCap + '"/> per county<br />' ;
newHtml += '<label for="capPresidence">If a row and general cap are enabled then <select id="capPresidence" name="capPresidence" />' + getCapPresidenceOptions ( capPresidence ) + '</select> takes presidence</label><br/>' ;
newHtml += '<label for="capPresidence" title="If a row and general cap are enabled"> <select id="capPresidence" name="capPresidence" />' + getCapPresidenceOptions ( capPresidence ) + '</select> takes presidence</label><br/>' ;
newHtml += '<div id="reloaderData"><div id="countdown"></div><progress value="0" max="100" id="progressBar" style="width: 100%;"></progress></div><div id="awLog" class="alwaysWinLog"></div>' ;
newHtml += '<div id="reloaderData"><div id="countdown"></div><progress value="0" max="100" id="progressBar" style="width: 100%;"></progress></div><div id="awLog" class="alwaysWinLog"></div>' ;
newHtml += '</div>' ;
newHtml += '</div>' ;