From 5379f62c9017e09f40665df9da98dc18a16f8dc3 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 27 Aug 2022 21:57:14 +0300 Subject: [PATCH] add year selector in popup search (#1411) --- _locales/en/messages.json | 2 +- popup/popup.css | 4 +- popup/search.css | 27 ++++++--- popup/search.html | 12 ++++ popup/search.js | 121 +++++++++++++++++++++++++------------- 5 files changed, 113 insertions(+), 53 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index e302037b..b7c45fd6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1434,7 +1434,7 @@ "description": "Text for label that shows the number of times a search result was installed during last week" }, "searchStyleQueryHint": { - "message": "Search style names case-insensitively:\nsome words - all words in any order\n\"some phrase\" - this exact phrase without quotes\n2020 - a year like this also shows styles updated in 2020", + "message": "Search style names (case-sensitively if an uppercase letter is used):\nsome words - all these words in any order\n\"some phrase\" - this exact phrase without quotes\n/foo.*bar/i - regular expression without spaces (use \\s instead)", "description": "Tooltip shown for the text input in the popup's inline style finder" }, "searchStylesAll": { diff --git a/popup/popup.css b/popup/popup.css index 46b92d6c..82600261 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -624,11 +624,11 @@ a:hover .svg-icon { fill: transparent; stroke: currentColor; } -html:not(.styles-last) #popup-options .split-btn-menu { +html:not(.styles-last):not(.search-results-shown) #popup-options .split-btn-menu { bottom: 0; transform: translateY(-20px); /* global button style: 13(font) * 1.2(line) + 4(pad) + 2(border) */ } -html:not(.styles-last) .split-btn-pedal::after { +html:not(.styles-last):not(.search-results-shown) .split-btn-pedal::after { border-top: var(--side) solid transparent; border-bottom: calc(var(--side) * 1.3) solid currentColor; vertical-align: top; diff --git a/popup/search.css b/popup/search.css index a35f6471..53fd7115 100644 --- a/popup/search.css +++ b/popup/search.css @@ -2,7 +2,7 @@ This file is loaded dynamically when the inline search is invoked. So don't put main popup's stuff here. */ -body.search-results-shown { +.search-results-shown body { overflow-y: auto; overflow-x: hidden; } @@ -288,35 +288,39 @@ search-result-meta [data-type="rating"][data-class="none"] dd { flex-direction: row; text-align: center; word-break: keep-all; + line-height: 24px; + font-size: 16px; } - .search-results-nav[data-type="top"] { padding-top: 1em; margin-bottom: 1em; } - .search-results-nav[data-type="bottom"] { margin-top: -1em; margin-bottom: 1em; } - +.search-results-nav label { + vertical-align: middle; + -moz-user-select: none; + user-select: none; +} +.search-results-nav [data-type="page"] { + font-weight: bold; +} #search-results .search-results-nav button { background: none; border: none; - padding: 0 1rem; + padding: 0 .5rem; margin: 0 .5rem; - font-size: 150%; - line-height: 24px; + font-size: 18px; vertical-align: middle; cursor: pointer; } - #search-results .search-results-nav button:disabled { cursor: auto; opacity: .25; pointer-events: none; } - #search-results .search-results-nav button:not(:disabled):hover { text-shadow: 0 1px 4px rgba(0, 0, 0, .5); } @@ -338,3 +342,8 @@ search-result-meta [data-type="rating"][data-class="none"] dd { margin-right: .5em; flex: 1 1 0; } + +#search-years { + text-align: center; + width: 100%; +} diff --git a/popup/search.html b/popup/search.html index 3e451830..04c06d48 100644 --- a/popup/search.html +++ b/popup/search.html @@ -3,6 +3,17 @@