Browse Source

Rework settings Div content

main
Steven 1 year ago
parent
commit
84ec952fef
  1. 10
      README.md
  2. 25
      tampermonkey.js

10
README.md

@ -9,8 +9,8 @@ To load the Tampermonkey script:
## Wishlist / Todo ## Wishlist / Todo
### Functionality For Release ### Functionality For Release
- [ ] Add this link to the settings div: https://leads.needtosellmyhousefast.com/qhrei - [X] Add this link to the settings div: https://leads.needtosellmyhousefast.com/qhrei (added this instead because it made more sense:https://info.qhrei.com/temp/alwayswin-ntsmhf/index.htm)
- [ ] Add donation/support message to div - [X] Add donation/support message to div
- [ ] Read from /app/subscriptions to get list of initial counties - if county is missing it automatically gets added. - [ ] Read from /app/subscriptions to get list of initial counties - if county is missing it automatically gets added.
- [x] Expose Sitewide bidcap (if any county bid exceeds X only bid up to X for that county) - [x] Expose Sitewide bidcap (if any county bid exceeds X only bid up to X for that county)
- [x] Save button to persist changes (instead of waiting for refresh code to run) - [x] Save button to persist changes (instead of waiting for refresh code to run)
@ -29,7 +29,7 @@ To load the Tampermonkey script:
``` ```
Options = [General Cap, Row Cap, Highest Cap, Lowest Cap] Options = [General Cap, Row Cap, Highest Cap, Lowest Cap]
``` ```
- [ ] Apply presidence logic to get true cap - [X] Apply presidence logic to get true cap
### Feature Requests / Future Releases ### Feature Requests / Future Releases
- [ ] Post stats to API instead of storing in local storage - [ ] Post stats to API instead of storing in local storage
@ -47,9 +47,9 @@ To load the Tampermonkey script:
- [ ] cooloff time (auto drops all bids for a specified amount of time then continues to win again.) - [ ] cooloff time (auto drops all bids for a specified amount of time then continues to win again.)
- [ ] Add settings option on where to apply the GeneralBidCap - [ ] Add settings option on where to apply the GeneralBidCap
*SettingsBidCap [200] applies to [options🔽] rows* *General Cap [200] applies to [applyTo] rows. Presidence [presidence🔽]*
``` ```
Options = [None of the, All, Capped Only, Uncapped Only] applyTo Options = [None of the, All, Capped Only, Uncapped Only]
``` ```

25
tampermonkey.js

@ -796,20 +796,29 @@ jQuery(window).on('load',function() {
newHtml += '<input type="checkbox" name="isReloadEnabled" '+ getCheckedValue("isReloadEnabled") +'/><label for="isReloadEnabled">Auto Refresh</label> '; newHtml += '<input type="checkbox" name="isReloadEnabled" '+ getCheckedValue("isReloadEnabled") +'/><label for="isReloadEnabled">Auto Refresh</label> ';
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="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&apos;t bid more than</label> '; newHtml += '<label for="isGeneralCapEnabled" title="Check this box to enable the General Cap"><input type="checkbox" name="isGeneralCapEnabled" '+ getCheckedValue("isGeneralCapEnabled") +' />General Cap</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="2" name="generalCap" value="'+ generalCap+'" title="Don&apos;t bid more than this amount per county" /> ';
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 += '<label for="capPresidence" title="If a row cap and general cap are both enabled..."> presidence:</label><select id="capPresidence" name="capPresidence" title="This takes presidence over any caps that may exist." />'+ getCapPresidenceOptions(capPresidence) +'</select><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 id="support" class="alwaysWinSupport">Note: The bidcap functionality is currently under development is not being applied to any bids at the moment.</div>';
newHtml += '<div id="alwaysWinThanks" class="alwaysWinThanks">If you got any value out of this tool please feel free to show your support here: <a href="https://info.qhrei.com/temp/alwayswin-ntsmhf/index.htm" target="_blank">https://info.qhrei.com/tools/AlwaysWin-ntsmhf</a></div>';
newHtml += '<div id="buildNumber" class="buildNumber">v0.122</div>';
newHtml += '</div>'; newHtml += '</div>';
newDiv.innerHTML = newHtml; newDiv.innerHTML = newHtml;
addAlwaysWinStyle('.alwaysWin-ntsmhf {position: fixed; top: 0px; left: 0px; background-color: #DDDDDD; border-radius: 5px; padding:2px; box-shadow: 5px 5px 3px #777777;}'); addAlwaysWinStyle('.alwaysWin-ntsmhf {position: fixed; width:400px; top: 0px; left: 0px; background-color: #DDDDDD; border-radius: 5px; padding:2px; box-shadow: 5px 5px 3px #777777;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinLog {float:left; width:100%; overflow-y: auto; height: 100px; font-size: 0.75em; border-style:ridge; background-color:#FEFEFE;}'); addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinLog {float:left; width:100%; overflow-y: auto; height: 100px; font-size: 0.75em; border-style:ridge; background-color:#FEFEFE;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton { border: none; color: #333333; padding: 1px 2px; text-align: center; text-decoration: none; display: inline-block; font-size: 8x; margin: 1px 1px; cursor: pointer;}'); addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton { border: none; color: #333333; padding: 1px 2px; text-align: center; text-decoration: none; display: inline-block; font-size: 10px; margin: 1px 1px; cursor: pointer;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton:hover {box-shadow: 0 2px 2px 0}'); addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton:hover {box-shadow: 0 2px 2px 0}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton:active {position: relative; top: 1px;}'); addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinButton:active {position: relative; top: 1px;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinSupport {border: thick double #999999; width:100%; color: #111111; background-color: #44DDDD; padding: 1px 2px; text-align: left; text-decoration: none; display: inline-block; font-size: 12px; margin: 1px 1px; cursor: no-drop;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .buildNumber {position: absolute; top: 0; right: 0; text-align: left; color: #111111; font-size: 8px; padding:2px; cursor: context-menu;}');
addAlwaysWinStyle('.alwaysWin-ntsmhf .alwaysWinThanks {border: thick double #999999; width:100%; color: #CCCCCC; background-color: #444444; text-align: left; text-decoration: none; display: inline-block; font-size: 12px; padding: 2px; border-radius: 5px;}');
document.body.appendChild (newDiv); document.body.appendChild (newDiv);
const alwaysWinSave = document.getElementById("alwaysWin-ntsmhf-save"); const alwaysWinSave = document.getElementById("alwaysWin-ntsmhf-save");
@ -878,7 +887,9 @@ jQuery(window).on('load',function() {
//Start our ui feedback for the enduser //Start our ui feedback for the enduser
var reloadTimeleft = secondsBetweenReloads; var reloadTimeleft = secondsBetweenReloads;
var reloadTimer = setInterval(function() { var reloadTimer = setInterval(function() {
document.getElementById("countdown").innerHTML = "("+secondsBetweenReloads+") Next reload will occur in "+ reloadTimeleft +" seconds."; var countdownElement = document.getElementById("countdown");
countdownElement.innerHTML = "Next reload will occur in "+ reloadTimeleft +" seconds.";
countdownElement.title = "Refesh timer started at "+secondsBetweenReloads+" seconds";
var progressBarValue = 100 - Math.floor(100 * (reloadTimeleft / secondsBetweenReloads)); //Calculate percent complete var progressBarValue = 100 - Math.floor(100 * (reloadTimeleft / secondsBetweenReloads)); //Calculate percent complete
document.getElementById("progressBar").value = progressBarValue; document.getElementById("progressBar").value = progressBarValue;
if(reloadTimeleft <= 0){ if(reloadTimeleft <= 0){

Loading…
Cancel
Save