|
1 | 1 | // ==UserScript== |
2 | 2 | // @name HD-Encode Search+ |
3 | 3 | // @namespace https://hdencode.org/ |
4 | | -// @version 1.0.8 |
| 4 | +// @version 1.0.9 |
5 | 5 | // @description Filtering, advanced sorting, live custom search, custom pagination, category switching, quick links, NFO panel, settings, presets, bulk copy, and sticky UI for HDEncode.org |
6 | 6 | // @author xXSalamanderXx |
7 | 7 | // @homepage https://github.com/xXSalamanderXx/HDEncode-Search-Plus/ |
|
144 | 144 | #${SCRIPT_ID}-bar .fs-search-input { flex: 1 1 340px; min-width: 240px; max-width: 100%; } |
145 | 145 | #${SCRIPT_ID}-bar .fs-section-line { border-top: 1px solid #21262d; } |
146 | 146 |
|
| 147 | + /* Remove default spin buttons for a cleaner look on numbers */ |
| 148 | + #${SCRIPT_ID}-bar input[type=number]::-webkit-inner-spin-button, |
| 149 | + #${SCRIPT_ID}-bar input[type=number]::-webkit-outer-spin-button { |
| 150 | + opacity: 0.5; /* Keeping them visible but less intrusive */ |
| 151 | + } |
| 152 | +
|
147 | 153 | #f-progress-bar { width: 0%; transition: width 0.3s ease-out; } |
148 | 154 | #f-progress-bar.fs-active { |
149 | 155 | background: linear-gradient(90deg, rgba(229, 9, 20, 0.08) 0%, rgba(229, 9, 20, 0.24) 18%, rgba(229, 9, 20, 0.55) 36%, #E50914 50%, rgba(229, 9, 20, 0.55) 64%, rgba(229, 9, 20, 0.24) 82%, rgba(229, 9, 20, 0.08) 100%); |
|
368 | 374 | else positiveTokens.push(normalizeSearchText(t)); |
369 | 375 | } |
370 | 376 |
|
371 | | - // Must NOT contain negative tokens |
372 | 377 | for (const neg of negativeTokens) { |
373 | 378 | if (normalizedText.includes(neg)) return false; |
374 | 379 | } |
375 | 380 |
|
376 | 381 | if (!positiveTokens.length) return true; |
377 | 382 |
|
378 | | - // Must contain positive tokens |
379 | 383 | const squeezedText = squeezeSearchText(text); |
380 | 384 | const squeezedQuery = positiveTokens.map(squeezeSearchText).join(''); |
381 | 385 | if (squeezedQuery && squeezedText.includes(squeezedQuery)) return true; |
|
394 | 398 | const h5 = item.querySelector('h5 a'); |
395 | 399 | if (!h5) return ''; |
396 | 400 | let text = h5.textContent || h5.innerText; |
397 | | - text = text.replace(/\[.*?\]/g, ''); // Strip resolutions like [2160p] |
398 | | - text = text.replace(/\(\d{4}\)/g, ''); // Strip (YYYY) |
399 | | - text = text.replace(/[–-]\s*[\d.]+\s*(GB|MB).*$/i, ''); // Strip size blocks |
| 401 | + text = text.replace(/\[.*?\]/g, ''); |
| 402 | + text = text.replace(/\(\d{4}\)/g, ''); |
| 403 | + text = text.replace(/[–-]\s*[\d.]+\s*(GB|MB).*$/i, ''); |
400 | 404 | return text.trim(); |
401 | 405 | } |
402 | 406 |
|
|
644 | 648 | // Apply Sorting |
645 | 649 | if (f.sort && f.sort !== 'default') { |
646 | 650 | const grid = getActiveResultsGrid(container); |
647 | | - // Sort items and append them back (this reorders them in the DOM) |
648 | 651 | items.sort((a, b) => { |
649 | 652 | if (f.sort === 'rating-desc') return getRating(b) - getRating(a); |
650 | 653 | if (f.sort === 'size-desc') return (getSize(b) || 0) - (getSize(a) || 0); |
|
970 | 973 | <div style="display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px;"> |
971 | 974 | <div style="display:flex; align-items:center; gap: 10px;"> |
972 | 975 | <strong class="fs-brand-text">${SCRIPT_NAME}</strong> |
973 | | - <button id="fs-settings-btn" title="Filter Settings" style="background:transparent; border:none; color:#8b949e; cursor:pointer; font-size:16px; padding:0; transition:color 0.2s;">⚙️</button> |
| 976 | + <button id="fs-settings-btn" title="Persistence Settings" style="background:transparent; border:none; color:#8b949e; cursor:pointer; font-size:16px; padding:0; transition:color 0.2s;">⚙️</button> |
974 | 977 | <button id="fs-save-preset-btn" title="Save current filters as Preset" style="background:transparent; border:1px solid #30363d; border-radius: 6px; color:#8b949e; cursor:pointer; font-size:12px; padding:4px 8px; transition:all 0.2s;">💾 Save Preset</button> |
975 | 978 | </div> |
976 | 979 | <div style="display:flex; gap: 8px;"> |
|
988 | 991 | </div> |
989 | 992 |
|
990 | 993 | <div id="fs-settings-panel" style="display:none; margin-bottom: 12px; padding: 12px; border-radius: 8px; background: #161b22; border: 1px solid #30363d; font-size: 12px; color: #8b949e;"> |
991 | | - <div style="font-weight: 600; margin-bottom: 10px; color: #e6edf3;">Save Filters Between Visits:</div> |
| 994 | + <div style="font-weight: 600; margin-bottom: 10px; color: #e6edf3;">💾 Persistence Settings: Choose which filters should be remembered next time you visit the site:</div> |
992 | 995 | <div style="display: flex; flex-wrap: wrap; gap: 14px;"> |
993 | 996 | <label style="cursor:pointer;"><input type="checkbox" data-setting="f-dv"> Dolby Vision</label> |
994 | 997 | <label style="cursor:pointer;"><input type="checkbox" data-setting="f-hdr"> HDR</label> |
|
1020 | 1023 | <option value="720p">720p</option> |
1021 | 1024 | </select> |
1022 | 1025 |
|
1023 | | - <input type="number" id="f-rating" placeholder="Min Rating" step="0.1" min="0" max="10" style="${INPUT_STYLE} width:95px;"> |
1024 | | - <input type="number" id="f-minsize" placeholder="Min GB" min="0" style="${INPUT_STYLE} width:75px;"> |
1025 | | - <input type="number" id="f-maxsize" placeholder="Max GB" min="0" style="${INPUT_STYLE} width:75px;"> |
| 1026 | + <input type="number" id="f-rating" placeholder="Min Rating" step="0.1" min="0" max="10" style="${INPUT_STYLE} width:100px; padding-right: 4px;"> |
| 1027 | + <input type="number" id="f-minsize" placeholder="Min GB" min="0" style="${INPUT_STYLE} width:85px; padding-right: 4px;"> |
| 1028 | + <input type="number" id="f-maxsize" placeholder="Max GB" min="0" style="${INPUT_STYLE} width:85px; padding-right: 4px;"> |
1026 | 1029 | |
1027 | 1030 | <select id="f-group" class="fs-search-select" style="${INPUT_STYLE} width:165px;"> |
1028 | 1031 | <option value="">All Release Groups</option> |
|
0 commit comments