Clicking search result thumbnail (overlay) installs it. So does clicking "install" button.
Fixed author link installing the sytle.
Removed bg-color change on hover.
* i18n text and titles for all labels.
* Clicking a search result opens the page for that style.
* Descriptions are truncated with (i) info button; expands description when clicked
* Simplified/fixed setLoader() + lds-spinner functionality.
* Right-padding to account for scrollbar when showing search results.
* No 'max-width' anymore -- width adjusts to popup width.
* Description uses ellilpsis on overflow.
* Still needs info/expando (and need to remove title-text)
* Screenshots have 'object-fit:cover' to fill the space.
Unrelated: Hack for search category 'userstyles' (should be userstyles.org)
Unchecked => opens new tab for search page.
Checkbox hidden if inline results are shown (still shows link to "find styles" which opens a new tab by-default).
Main diff: Wrapped onDOMready() & SearchResults() function in IIFE closure.
* [X] const SearchResults = ... // should be inside a closure (IIFE @ Top)
* [X] SearchUserstyles should be firstLetterLowercase
* [X] Don't fetch category on load; use regexp to derive category. (left 'HEAD' code commented-out).
* [X] Don't use XMLHttpRequest() anymore (used in 3 places?): Use download() which accepts custom request params.
* [X] Remove unused getters ('getCurrentPage' & others?)
* [X] const BASE_USO_URL = 'https://userstyles.org'; @ top of searchResults closure. Refer elsewhere.
* [X] const searchUrl = new URL... should be a single multiline statement (new URL('...' +\ '...'
* [X] .innerHTML = ... // use .textContent = ... instead
* [X] Don't use `setAttribute` on 'disabled': $('..-prev').disabled = currentDisplayedPage <= 1 || loading
* [X] Don't use .indexOf() on strings, use .includes()
* [X] Move onDOMReady() code to top of file.
* Fetches 'category' for the current URL when popup is first loaded.
* Customizable styles have "Customize" button next to "Install"
* "Customize" button opens a new tab to the style page.
* Removed all console.log() statements (except when `catch()`ing errors).
* "Find more styles for this site" renamed to "Search on userstyles.org".
* Only appears below search results after "Find more styles" is clicked.
* When style is installed from serach results, it no longer appears in the results.
* "Install" uses already-fetched .JSON data. Avoiding useless call to download().
Fetches .json for each search result and asserts style applies to the page.
Still needs:
* Smarter search ("metacritic.com" = 0 results)
* Faster (or parallel) fetching of search result .json files
* Better feedback ("loading" messages)
* Detection of styles that can be Customized
* Install styles using searchResult.json (not downloading)