v2.12.4 - Normalizza separatori nella ricerca folder: >, / e › sono equivalenti
This commit is contained in:
parent
752a32cdfe
commit
507f4cb5b1
1 changed files with 5 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Checkmk SwissKnife
|
// @name Checkmk SwissKnife
|
||||||
// @namespace https://luigidacunto.com/
|
// @namespace https://luigidacunto.com/
|
||||||
// @version 2.12.3
|
// @version 2.12.4
|
||||||
// @checkmk 2.3.x
|
// @checkmk 2.3.x
|
||||||
// @description Raccolta di miglioramenti all'interfaccia di Checkmk WATO. Ogni fix o enhancement viene aggiunto qui come feature indipendente.
|
// @description Raccolta di miglioramenti all'interfaccia di Checkmk WATO. Ogni fix o enhancement viene aggiunto qui come feature indipendente.
|
||||||
// @author Luigi D'Acunto
|
// @author Luigi D'Acunto
|
||||||
|
|
@ -273,10 +273,13 @@
|
||||||
function renderDropdown(filter) {
|
function renderDropdown(filter) {
|
||||||
dropdown.innerHTML = '';
|
dropdown.innerHTML = '';
|
||||||
const term = filter.trim().toLowerCase();
|
const term = filter.trim().toLowerCase();
|
||||||
|
// Normalizza separatori: >, ›, / sono equivalenti nella ricerca
|
||||||
|
const normTerm = term.replace(/\s*[>/›]\s*/g, '/');
|
||||||
const filtered = term
|
const filtered = term
|
||||||
? options.filter(o =>
|
? options.filter(o =>
|
||||||
o.label.toLowerCase().includes(term) ||
|
o.label.toLowerCase().includes(term) ||
|
||||||
o.value.toLowerCase().includes(term) ||
|
o.label.toLowerCase().replace(/\s*›\s*/g, '/').includes(normTerm) ||
|
||||||
|
o.value.toLowerCase().includes(normTerm) ||
|
||||||
o.original.toLowerCase().includes(term)
|
o.original.toLowerCase().includes(term)
|
||||||
)
|
)
|
||||||
: options;
|
: options;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue