Commit Graph

90 Commits

Author SHA1 Message Date
derv82
1c188f1f8d Only fetch style JSON during installation.
JSON is 'cached' within the userstyleSearchResult object,
so the JSON is only fetched once during the life of the popup window.
2017-12-09 00:25:47 -08:00
derv82
4732184670 10 results @ a time, floating Install button, fixed height while loading styles. 2017-12-08 01:44:55 -08:00
derv82
cab2345bc6 Merge branch 'master' of https://github.com/openstyles/stylus 2017-12-07 20:54:42 -08:00
derv82
308973cb13 Clicking thumbnail (above overlay) installs/uninstalls.
Same behavior as clicking overlay
2017-12-07 20:54:17 -08:00
derv82
e59dba54af Shrunk thumbnail overlay ~50%, smaller install/customize buttons. 2017-12-07 20:50:42 -08:00
tophf
fbcd3cc965 clarify the tooltip for USO userstyle "configure" icon 2017-12-07 20:58:02 +03:00
derv82
1f95fd3571 Search results show "uninstall" after installation.
* Not removed from search results
* Still shows "customize" button.
2017-12-07 02:06:44 -08:00
derv82
14ad748105 overflow-y:scroll when search results are displayed 2017-12-07 01:30:33 -08:00
derv82
7c1c9d0cce Search results at bottom, move lds-spinner over search results. 2017-12-07 00:56:33 -08:00
derv82
34ab1abd11 Search result only shows title & thumbnail, more info on hover.
Clicking search result thumbnail (overlay) installs it. So does clicking "install" button.
Fixed author link installing the sytle.
Removed bg-color change on hover.
2017-12-07 00:06:12 -08:00
derv82
8ec06d9830 Title above screenshot. Removed 'Results for...' header
Brought back 'Author' (was hidden before).
2017-12-06 23:33:42 -08:00
derv82
0e63896f4f Switch camelCase to dash-case in DOM classes and IDs 2017-12-06 22:38:35 -08:00
derv82
0c4f4844b6 Merge branch 'master' of https://github.com/openstyles/stylus 2017-12-06 22:21:59 -08:00
tophf
b96cee1012 use Event#key for hotkey recognition in manager and popup
should help #286
2017-12-07 02:11:50 +03:00
tophf
38e0937f45 config dialog tweaks
* same icon in manager
  (didn't change the editor config icons as those aren't for usercss)

* "external" icon for USO styles to avoid confusion
  (opening a tab is an extremely different action)

* smaller paddings in popup

* removed hover effect on label text
  (necause native <select> elements cannot be expanded from js)

* various fixups
2017-12-07 01:07:55 +03:00
derv82
826605242b Disable next/prev search result buttons when loading 2017-12-06 02:20:17 -08:00
derv82
da6ea2b69b 'Customize' button stops propagation & opens tab. 2017-12-06 01:40:39 -08:00
derv82
0366c8508f Merge branch 'master' of https://github.com/openstyles/stylus 2017-12-06 01:29:49 -08:00
derv82
0161df5af0 Addressed PR feedback: i18n, result.onlick, description-expander, loader fix
* 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.
2017-12-06 01:22:33 -08:00
eight
07a0518586 Add config dialog to popup (#283) 2017-12-06 00:14:21 +03:00
derv82
ca2050d549 Spinner while loading results. Description expando. 2017-12-05 00:41:16 -08:00
derv82
edbabb124a Adjust 'inline' checkbox per PR feedback. 2017-12-04 22:08:33 -08:00
derv82
3467d7e58b Fix position of 'inline' Find Styles w/ latest merge. 2017-12-04 20:18:02 -08:00
derv82
f580c10e85 Merge branch 'master' of https://github.com/openstyles/stylus 2017-12-04 20:10:52 -08:00
derv82
3cef5ad662 "Find styles Inline" checkbox svg positioned correctly 2017-12-04 20:08:51 -08:00
derv82
f4f5c47320 Single-line enable or disable of next/prev buttons 2017-12-04 20:01:34 -08:00
tophf
a6f63d096e extract checkboxes to global.css, fixes 2017-12-05 04:39:29 +03:00
narcolepticinsomniac
7339643ec3 Custom checkbox and select elements 2017-12-05 04:39:29 +03:00
derv82
4919cf0817 Fixing over-styling in search-results.css
* 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)
2017-12-04 00:30:06 -08:00
derv82
58f003392a Scroll up when search results options are clicked (find/next/prev) 2017-12-03 23:27:55 -08:00
tophf
c0c60fb7a2 add a terse invocation syntax for $element and rename it to $create 2017-12-04 08:57:12 +03:00
derv82
b3cd06bedd "inline" checkbox opens search results within popup.
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).
2017-12-03 20:24:39 -08:00
derv82
8d75042f02 Address part of PR feedback.
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.
2017-12-03 15:34:44 -08:00
derv82
6cdc442986 Resolve eslint warning (reason not used) 2017-12-02 23:19:23 -08:00
derv82
8ae669bd12 Detects Customization. Prefetches "category" when popup is loaded.
* 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).
2017-12-02 23:12:27 -08:00
derv82
4c5b858f08 Merge branch 'master' of https://github.com/openstyles/stylus 2017-12-02 22:05:17 -08:00
tophf
b4670f759a update #hotkey-info height calc 2017-12-03 08:19:31 +03:00
tophf
d9e3d15098 fix #no-styles margins; remove the hotkey number 2017-12-03 07:07:43 +03:00
tophf
e6e762505f FF: don't style checkboxes in FF < 57 2017-12-03 07:07:43 +03:00
tophf
e9a38c8eda fixup 387193d3: don't try to parse unsupported URLs 2017-12-03 06:15:03 +03:00
tophf
387193d347 popup: USO bug workaround for find-styles link url
fixes #273
2017-12-03 06:02:30 +03:00
derv82
02260ff65d Show rating & install counts in results. Remove artifical delays. 2017-12-02 17:25:01 -08:00
narcolepticinsomniac
a185b6b182
Another popup mockup (#271)
* Another popup mockup

This is a fraction of what I want to do with the popup, but these are improvements that can be made to the existing version without a complete overhaul. Should be no difference appearance-wise, only some simple enhancements to existing functionality in terms of click area and stylability. 

Eliminates ill-conceived `.left-gutter` altogether. Checkboxes and labels are now either parent/child or siblings, with no weird spaces between them, and their hovers can therefore be styled together. `entry` checkbox/label `.style-name` now occupies the entire height/width of the `.entry` to the left of the `.actions` icons, so no more errant clicks.

* Another popup mockup

* Delete popup.css

* Another popup mockup

* Custom checkboxes

* Custom checkboxes

* Subtlety

>an animated checkbox needlessly draws attention to itself

But... I feel the need. Drawing attention to the checkbox is intentional to indicate click action.

>In case the entire row is highlighted there will be no distraction

Clickable area isn't the entire row, it's everything left of action icons. Hovering background on part of the row will look odd, and it's also a less obvious indicator of click action IMO.

Didn't change "disable all" yet. It's a special kinda function, so maybe slightly more drastic is warranted, but I can tone that down too.
2017-12-02 18:55:23 -05:00
tophf
0de69e306d code refactor: add $.remove() and $$.remove() 2017-12-02 19:54:54 +03:00
derv82
0fcc6c3596 Merge branch 'master' of https://github.com/openstyles/stylus
Resolved to keep search-results.js
2017-12-02 04:41:10 -08:00
derv82
b16ee42deb Only one "find styles" link. Hides result after installing.
* "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().
2017-12-02 04:34:37 -08:00
derv82
1daa12b59f Search userstyles by-category. Fetch only when needed.
* Discovers category via userstyles request.
* Disables navigation while loading results.
* Navigation above search results
* Handles styles without screenshots (blank img).
2017-12-02 03:29:12 -08:00
tophf
f05debf686 popup: show hotkey info upon clicking the area on the right 2017-12-02 04:07:09 +03:00
derv82
e8f793b16a Refactor search-results: Only show applicable styles.
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)
2017-12-01 00:42:56 -08:00
tophf
c0a227fa39 popup: show style numbers, add more hotkeys
numpad 0-9 same as 0-9
numpad + enables all listed
numpad - disables all listed
numpad * and ` (backtick) - toggles initially enabled styles;
         doesn't apply to subsequently enabled styles while the popup is open
         so you can restore the initial selection after testing stuff:
         simply disable all, then toggle i.e. numpad -, numpad *
2017-11-29 17:59:02 +03:00