implemented full-text search

This commit is contained in:
Oleg Belyaev 2025-03-22 23:43:48 +03:00
parent 947fe623da
commit 9b42996cef
6 changed files with 203 additions and 15 deletions

View file

@ -89,7 +89,11 @@ body>header>nav,
body>footer>nav {
margin: auto;
--pico-primary: #8D0B02 !important;
--pico-primary-background: #8D0B02 !important;
--pico-primary-border: #8D0B02 !important;
--pico-primary-hover: #cd5c5c !important;
--pico-primary-hover-background: #cd5c5c !important;
--pico-primary-hover-border: #cd5c5c !important;
}
body>header>nav {
border-bottom-width: thin;
@ -305,6 +309,21 @@ legend {}
form {}
header form {
margin-bottom: 0 !important;
}
header form button {
padding-left: 1em !important;
padding-right: 1em !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
}
header form select {
max-width:35%;
}
label {}
::placeholder {}

View file

@ -45,7 +45,7 @@ $( document ).ready(function() {
if(glosses.length > 0) {
entrystring = `${glosses.join('; ')}: `
}
opt = $(`<option value="${out.xmlid}">${entrystring}<i>${out.form}</i>
opt = $(`<option value="${out.xmlid}" data-abv-xpath="${e.refs[0].path}">${entrystring}<i>${out.form}</i>
${out.glosses.map(g => `${g}`).join(', ')}</option>`);
$select_entry.append(opt)
})
@ -57,7 +57,8 @@ $( document ).ready(function() {
$('#abv-select-entry').on("dblclick", function() {
let $selected = $(this).children('option:selected');
let $entry = $selected.attr('value');
window.location.replace('./dict/' + $entry);
let entry = $selected.attr('value');
let path = $selected.attr('data-abv-xpath');
window.location.replace('./dict/' + entry + `?entry=${entry}&xpath=${path}`);
});
});