added stop/resume on found the first item
This commit is contained in:
@@ -186,6 +186,11 @@
|
||||
<input id="cfg-target-url" type="url" placeholder="https://example.com" />
|
||||
</div>
|
||||
|
||||
<div class="fg" style="display:flex;align-items:center;gap:10px;margin-bottom:14px">
|
||||
<input id="cfg-stop-on-first-click" type="checkbox" style="width:16px;height:16px;accent-color:var(--accent);cursor:pointer" />
|
||||
<label for="cfg-stop-on-first-click" style="margin:0;cursor:pointer;color:var(--text)">Stop after first successful click</label>
|
||||
</div>
|
||||
|
||||
<div class="fg" style="margin-top:6px">
|
||||
<label>Search Texts <span style="color:var(--muted)">(one per line)</span></label>
|
||||
<textarea id="cfg-search-texts" placeholder="shoes blue sneakers running shoes"></textarea>
|
||||
@@ -1028,6 +1033,7 @@ function openNewForm() {
|
||||
document.getElementById('cfg-target-url').value = '';
|
||||
document.getElementById('cfg-search-texts').value = '';
|
||||
document.getElementById('cfg-item-ids').value = '';
|
||||
document.getElementById('cfg-stop-on-first-click').checked = false;
|
||||
_resetAdvanced();
|
||||
document.getElementById('adv-details').removeAttribute('open');
|
||||
_applyScenario('dynamic');
|
||||
@@ -1069,6 +1075,7 @@ function openEditForm(id) {
|
||||
// DigiPay fields
|
||||
const dpMatch = (scenario === 'digipay') ? (_ist || 'onclick') : 'onclick';
|
||||
document.getElementById('cfg-digipay-match').value = dpMatch;
|
||||
document.getElementById('cfg-stop-on-first-click').checked = c.stop_on_first_click !== 0;
|
||||
document.getElementById('cfg-dp-max-scrolls').value = c.max_scrolls ?? 20;
|
||||
document.getElementById('cfg-dp-scroll-pause').value = c.scroll_pause_ms ?? 1500;
|
||||
document.getElementById('digipay-onclick-hint').style.display = dpMatch === 'onclick' ? '' : 'none';
|
||||
@@ -1090,6 +1097,7 @@ function collectForm() {
|
||||
target_url: document.getElementById('cfg-target-url').value.trim(),
|
||||
search_texts: document.getElementById('cfg-search-texts').value.split('\n').map(s => s.trim()).filter(Boolean),
|
||||
target_item_ids: document.getElementById('cfg-item-ids').value.split('\n').map(s => s.trim()).filter(Boolean),
|
||||
stop_on_first_click: document.getElementById('cfg-stop-on-first-click').checked,
|
||||
};
|
||||
|
||||
if (scenario === 'digipay') {
|
||||
|
||||
Reference in New Issue
Block a user