Simple quality of life update that would make selecting pollers feel closer to 2025 and further from 2005. Was able to get this working by pasting this snippet in the Chrome console. (Thanks Gemini)
This makes it so when you click a checkbox, you can hold shift and click a checkbox below it to select everything in between. No more selecting dozens of pollers one at a time?
(function() {
// Prevents the script from being initialized multiple times if pasted again
if (window.customShiftClickCheckboxesInitialized) {
console.log("Shift+Click checkbox selection has already been initialized.");
return;
}
let lastClickedCheckboxInputElement = null;
const checkboxInputSelector = 'input[type="checkbox"].igt_align'; // Your specific checkbox input selector
// Selector for the clickable label associated with the checkbox,
// based on your provided HTML structure (span with igtxt='1' immediately after the input)
const checkboxLabelSelector = 'span[igtxt="1"]';
// Listen for clicks on the entire document to catch clicks on checkboxes or their labels
document.addEventListener('click', function(event) {
let currentTargetCheckboxInputElement = null;
// Determine if the click was on a checkbox input itself
if (event.target.matches(checkboxInputSelector) && event.target.type === 'checkbox') {
currentTargetCheckboxInputElement = event.target;
}
// Else, check if the click was on its associated label (span after input)
else if (event.target.matches(checkboxLabelSelector)) {
const associatedInput = event.target.previousElementSibling;
if (associatedInput && associatedInput.matches(checkboxInputSelector) && associatedInput.type === 'checkbox') {
currentTargetCheckboxInputElement = associatedInput;
// Note: Most browsers will automatically toggle the 'associatedInput' checkbox
// when its label (this span, if correctly acting as one) is clicked.
// If not, an explicit 'associatedInput.click()' might be needed here for non-shift clicks on labels,
// but for this script, we rely on the state of 'currentTargetCheckboxInputElement.checked'
// *after* the browser has processed the click on the label/input.
}
}
// If the click wasn't on a target checkbox or its specifically identified label, do nothing.
if (!currentTargetCheckboxInputElement) {
return;
}
// --- Shift+Click Logic ---
if (event.shiftKey && lastClickedCheckboxInputElement && lastClickedCheckboxInputElement !== currentTargetCheckboxInputElement) {
// This is a shift-click to select a range.
// The 'currentTargetCheckboxInputElement' has already had its state toggled by the browser's default action
// for the click event (whether it was on the input or its label that toggles it).
const targetState = currentTargetCheckboxInputElement.checked; // This is the state all checkboxes in the range should adopt.
// Get all relevant checkboxes in DOM order
const allCheckboxes = Array.from(document.querySelectorAll(checkboxInputSelector));
const startIndex = allCheckboxes.indexOf(lastClickedCheckboxInputElement);
const endIndex = allCheckboxes.indexOf(currentTargetCheckboxInputElement);
// If for some reason one of the checkboxes isn't found (e.g., it was dynamically removed),
// treat the current click as a normal click.
if (startIndex === -1 || endIndex === -1) {
console.warn("Shift-click error: An endpoint checkbox was not found in the master list. Resetting anchor.");
lastClickedCheckboxInputElement = currentTargetCheckboxInputElement; // Treat as a normal click
return;
}
const minIdx = Math.min(startIndex, endIndex);
const maxIdx = Math.max(startIndex, endIndex);
console.log(`Shift-click detected. Applying state '${targetState}' to checkboxes from index ${minIdx} to ${maxIdx}.`);
for (let i = minIdx; i <= maxIdx; i++) {
const checkboxInRange = allCheckboxes[i];
// If the checkbox in the range doesn't already match the target state, simulate a click on it.
// This ensures any event listeners on the checkbox are triggered.
if (checkboxInRange.checked !== targetState) {
checkboxInRange.click();
// Add a small delay if clicks happen too fast for the UI to keep up or for dependent actions
// await new Promise(resolve => setTimeout(resolve, 10)); // Optional: uncomment if needed
console.log(` Simulated click on checkbox (index ${i}, ID: ${checkboxInRange.id || 'N/A'}) to set state to ${targetState}.`);
}
}
// The current checkbox becomes the new anchor for the next shift-click.
lastClickedCheckboxInputElement = currentTargetCheckboxInputElement;
} else {
// This is a normal click (not a shift-click, or it's the first click in a potential shift-click sequence).
lastClickedCheckboxInputElement = currentTargetCheckboxInputElement;
const id = lastClickedCheckboxInputElement.id || 'N/A (no ID)';
const name = lastClickedCheckboxInputElement.name || 'N/A (no name)';
console.log(`Anchor checkbox set to: ID='${id}', Name='${name}'. Checked state: ${lastClickedCheckboxInputElement.checked}`);
}
}, false); // Use the bubbling phase for the event listener.
window.customShiftClickCheckboxesInitialized = true;
console.log("Shift+Click checkbox selection is now ENABLED.");
console.log(`It applies to checkboxes matching: "${checkboxInputSelector}" (and their adjacent span labels: "${checkboxLabelSelector}").`);
console.log("How to use: \n1. Click one checkbox (this is your starting point).\n2. Hold down the SHIFT key.\n3. Click another checkbox (this is your ending point).\nAll checkboxes between these two (inclusive) will be set to the same checked state as the second checkbox you clicked.");
})();