diff --git a/tampermonkey.js b/tampermonkey.js index 55a37c0..2adadf9 100644 --- a/tampermonkey.js +++ b/tampermonkey.js @@ -74,10 +74,6 @@ function saveSettings() { let bidCap = document.querySelector("[name='bidCap']").value; let oversight = {}; - //oversight.win = [];//["84035","87833"]; //win - //oversight.tie = [];//["84034"]; //tie - //oversight.watch = [];//["84038"]; //watch - //oversight.ignore = [];//["84037"]; //ignore oversight.all = []; var latestSettings = alwaysWinSettings; @@ -89,8 +85,6 @@ function saveSettings() { if(latestSettings.oversight == null || latestSettings == undefined) { latestSettings.oversight = oversight; } - //console.log("latestSettings"); - //console.log(latestSettings); const latestSettingsString = JSON.stringify(latestSettings); localStorage.setItem('alwayswin_settings',latestSettingsString); @@ -337,47 +331,11 @@ function countyFound(countyValue) { function upsertOversight(countyOversightJson) { //console.log(countyOversightJson); const countyId = countyOversightJson.id; - //console.log("checking "+countyOversightJson.action+" for "+countyId); - /* - var countyValue; - switch (countyOversightJson.action) { - case "win": - countyValue = alwaysWinSettings.oversight.win.find((value, index) => value === countyId); - if(!countyFound){ - alwaysWinSettings.oversight.win.push(countyId); - } - break; - case "tie": - countyValue = alwaysWinSettings.oversight.tie.find((value, index) => value === countyId); - if(!countyFound){ - alwaysWinSettings.oversight.tie.push(countyId); - } - break; - case "watch": - countyValue = alwaysWinSettings.oversight.watch.find((value, index) => value === countyId); - if(!countyFound){ - alwaysWinSettings.oversight.watch.push(countyId); - } - break; - case "ignore": - countyValue = alwaysWinSettings.oversight.ignore.find((value, index) => value === countyId); - if(!countyFound){ - alwaysWinSettings.oversight.ignore.push(countyId); - } - break; - default: - break; - } -*/ - var countyFoundAt = alwaysWinSettings.oversight.all.findIndex(({ id }) => id === countyId); - console.log(countyId +" countyFoundAt: "+countyFoundAt); if(countyFoundAt == -1) { alwaysWinSettings.oversight.all.push(countyOversightJson); countyFoundAt = alwaysWinSettings.oversight.all.length; } - //console.log(alwaysWinSettings.oversight.all[countyFoundAt]); - } function convertToOversightJson(countyInfoJson, action, isBidCapEnabled){ @@ -496,9 +454,8 @@ jQuery(window).on('load',function() { injectOversight("84037","watch"); //clackamas, OR injectOversight("84038","watch"); //benton, OR - //// Now do the winning + //// Now do the work let newStats = []; - let countiesToWinCount = alwaysWinSettings.oversight.all.length; awLog("Checking "+ countiesToWinCount +" counties"); for(let i = 0; i < countiesToWinCount; i++) { @@ -521,35 +478,6 @@ jQuery(window).on('load',function() { newStats.push(countyInfoJson); } -/* - let okToSaveChanges = true; - let countiesToWinCount = alwaysWinSettings.oversight.win.length; - awLog("Checking "+ countiesToWinCount +" countiesToWin"); - for(let i = 0; i < countiesToWinCount; i++) { - let currentEntity = getCountyInfo(alwaysWinSettings.oversight.win[i]) - winCounty(currentEntity,okToSaveChanges); - newStats.push(currentEntity); - } - - okToSaveChanges = true; - let countiesToTieCount = alwaysWinSettings.oversight.tie.length; - awLog("Checking "+ countiesToTieCount +" countiesToTie"); - for(let i = 0; i < countiesToTieCount; i++) { - let currentEntity = getCountyInfo(alwaysWinSettings.oversight.tie[i]) - tieCounty(currentEntity,okToSaveChanges); - newStats.push(currentEntity); - } - - okToSaveChanges = false; - let countiesToWatchCount = alwaysWinSettings.oversight.watch.length; - awLog("Checking "+ countiesToWatchCount +" countiesToWatch"); - for(let i = 0; i < countiesToWatchCount; i++) { - let currentEntity = getCountyInfo(alwaysWinSettings.oversight.watch[i]) - watchCounty(currentEntity,okToSaveChanges); - newStats.push(currentEntity); - } -*/ - //console.log("Saving county info stats"); const countyInfoStats = saveCountyInfoStats(newStats);