From ad1871f0555d8f67cf68c20a601a1eb71780d21e Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Mon, 9 Jan 2023 13:46:53 -0600 Subject: [PATCH] LP1970946 Adjust color contrast in result highlights Lowers the contrast on search result match highlights in the staff catalog, and changes the highlight tag from (PostgreSQL's default), to (new in HTML5). As an additional consequence, the color contrast for highlighted search terms in the Bootstrap OPAC (using default styles) improves from 4.38 to 17.12. Signed-off-by: Stephanie Leary Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../share/catalog/bib-display-field.component.css | 7 +- Open-ILS/src/sql/Pg/300.schema.staged_search.sql | 2 +- .../XXXX.schema.mark-tag-for-match-highlights.sql | 70 ++++++++++++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.mark-tag-for-match-highlights.sql diff --git a/Open-ILS/src/eg2/src/app/share/catalog/bib-display-field.component.css b/Open-ILS/src/eg2/src/app/share/catalog/bib-display-field.component.css index f4dfc11..bd8aa49 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/bib-display-field.component.css +++ b/Open-ILS/src/eg2/src/app/share/catalog/bib-display-field.component.css @@ -1,11 +1,12 @@ .oils_SH { font-weight: bolder; - background-color: #99ff99; + background: #B4F8D3; + border-bottom: 1px solid #20C997; } .oils_SH.identifier { - font-weight: bolder; - background-color: #42b0f4; + background: #C4F0F8; + border-bottom: 1px solid #3DD5F3; } diff --git a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql index 9533dcc..523e286 100644 --- a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql +++ b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql @@ -999,7 +999,7 @@ BEGIN v_css_class := 'oils_SH'; END IF; - opts := opts || $$, StopSel=, StartSel=", StartSel=""$xx$ -- "' + ) AS highlight + FROM metabib.display_entry de + JOIN config.metabib_field mf ON (mf.id = de.field) + JOIN search.best_tsconfig t ON (t.id = de.field) + WHERE de.source = $2 + AND field = ANY ($3) + ORDER BY de.id;$$; + + RETURN QUERY EXECUTE hl_query USING opts, rid, v_field_list; +END; +$f$ LANGUAGE PLPGSQL; + +COMMIT; -- 1.7.2.5