diff --git a/JS/browserChromeBookmarkKeywords.uc.js b/JS/browserChromeBookmarkKeywords.uc.js index 0244ded..b155360 100644 --- a/JS/browserChromeBookmarkKeywords.uc.js +++ b/JS/browserChromeBookmarkKeywords.uc.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Browser Chrome Bookmark Keywords -// @version 1.0 +// @version 1.0.1 // @author aminomancer // @homepage https://github.com/aminomancer/uc.css.js // @description Allow the creation of special keyword bookmarks with @@ -255,6 +255,7 @@ let title; let prefix; let icon; + let inputHighlight; if (ucjs) { let bm = await PlacesUtils.bookmarks.fetch({ url: uri }); @@ -266,31 +267,35 @@ } if (prefix && searchString && (hadPlaceholder || !ucjs)) { - // If we have a search string, the result has the title - // "host: searchString". - title = UrlbarUtils.strings.formatStringFromName("bookmarkKeywordSearch", [ - prefix, - queryContext.tokens - .slice(1) - .map(t => t.value) - .join(" "), - ]); + let format = (val1, val2) => + UrlbarUtils.strings.formatStringFromName("bookmarkKeywordSearch", [val1, val2]); + let typedValue = queryContext.tokens + .slice(1) + .map(t => t.value) + .join(" "); + title = format(prefix, typedValue); + inputHighlight = { title: [[prefix.length + format("", "").length, typedValue.length]] }; } else { title = ucjs && prefix ? prefix : UrlbarUtils.unEscapeURIForUI(url); } - let result = new UrlbarResult( - UrlbarUtils.RESULT_TYPE.KEYWORD, - UrlbarUtils.RESULT_SOURCE.BOOKMARKS, + let [payload, highlights] = [ ...UrlbarResult.payloadAndSimpleHighlights(queryContext.tokens, { title: [title, UrlbarUtils.HIGHLIGHT.TYPED], url: [url, UrlbarUtils.HIGHLIGHT.TYPED], - keyword: [keyword, UrlbarUtils.HIGHLIGHT.TYPED], + keyword, input: queryContext.searchString, postData, icon, ucjs, - }) + }), + ]; + + let result = new UrlbarResult( + UrlbarUtils.RESULT_TYPE.KEYWORD, + UrlbarUtils.RESULT_SOURCE.BOOKMARKS, + payload, + inputHighlight ?? highlights ); result.heuristic = true; addCallback(this, result); diff --git a/resources/in-content/site-github.css b/resources/in-content/site-github.css index 219415b..3999736 100644 --- a/resources/in-content/site-github.css +++ b/resources/in-content/site-github.css @@ -17,6 +17,10 @@ which requires Stylus. don't use this stylesheet if you don't have that theme, i font-size: 14px !important; } + .previewable-comment-form textarea { + min-height: 350px !important; + } + tt, code, samp, .input-monospace { font-family: Fira Code UC, Fira Code, SF Mono, ui-monospace, SFMono-Regular, SF Mono, Menlo, diff --git a/uc-urlbar-results.css b/uc-urlbar-results.css index cb473cf..fbd01b5 100644 --- a/uc-urlbar-results.css +++ b/uc-urlbar-results.css @@ -478,6 +478,7 @@ by underlining them (requires urlbarMods.uc.js) */ .urlbarView-row[has-action] .urlbarView-title strong, .urlbarView-row[has-action] .urlbarView-title[isurl], +.urlbarView-row[type="bookmark"]:not([has-url]) .urlbarView-title, .urlbarView-row[has-url] .urlbarView-title, .urlbarView-row .urlbarView-tag, .urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"]) .urlbarView-title, @@ -497,6 +498,7 @@ by underlining them (requires urlbarMods.uc.js) */ .urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"])[selected] .urlbarView-title, .urlbarView-row[has-action][selected] .urlbarView-title strong, .urlbarView-row[has-action][selected] .urlbarView-title[isurl], +.urlbarView-row[type="bookmark"][selected]:not([has-url]) .urlbarView-title, .urlbarView-row[has-url][selected] .urlbarView-title, .urlbarView-row[selected] .urlbarView-tag, .urlbarView-row[selected]:not([has-url]) @@ -512,6 +514,7 @@ by underlining them (requires urlbarMods.uc.js) */ } .urlbarView-row[has-action] .urlbarView-title[isurl] strong, +.urlbarView-row[type="bookmark"]:not([has-url]) .urlbarView-title strong, .urlbarView-row[has-url] .urlbarView-title strong, .urlbarView-row .urlbarView-tag strong { font-weight: var(--urlbar-result-strong-font-weight, 500) !important; @@ -651,7 +654,7 @@ by underlining them (requires urlbarMods.uc.js) */ padding-inline-start: 16px; } -.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"]):not([selected], [show-action-text], :hover) +.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"], [type="bookmark"]:not([has-url])):not([selected], [show-action-text], :hover) > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action {