Commit Graph

63 Commits

Author SHA1 Message Date
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
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
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
tophf
a64dc26dd7 popup: toggle/edit styles from keyboard
1-9, 0 - toggles Nth displayed style (0 is 10)
a-z:   - toggles first style with a name that starts with the letter
Shift  - opens editor instead of toggling
2017-11-28 20:37:53 +03:00
tophf
b63449f299 show tooltips in popup on ellipsized names 2017-11-26 15:31:00 +03:00
tophf
978e5ca9f0 sendMessage()
Promise mode [default]:
  - rejects on receiving {__ERROR__: message} created by
    background.js::onRuntimeMessage
  - suppresses chrome.runtime.lastError
    by browserAction.setText which lacks a callback param in chrome API

Callback mode:
  - enabled by passing a second param
  - doesn't suppress chrome.runtime.lastError
2017-11-25 18:00:38 +03:00
tophf
8f04e17d27 fix #223 - Android compatibility 2017-11-25 16:25:20 +03:00
derv82
696b6f97c3 Hides installed styles from search results.
Also:
1. Dims search result during installation.
2. Removes the search result after installation.
2017-11-24 01:57:42 -08:00
derv82
98c9024eb9 It works! "Install" installs the style.
Added an 'error' container for search-related errors.
2017-11-20 01:11:32 -08:00
derv82
16d32c40f5 Resolve eslint errs/warnings in search-results.js 2017-11-19 22:55:07 -08:00
derv82
c9e894f670 Rename searchResults -> search-results, replaced double quotes with single-quotes 2017-11-19 22:28:54 -08:00
derv82
b3a6bddd48 Removing unused loadRemoteStyles event 2017-11-19 19:41:09 -08:00
derv82
c0b48ab548 Encapsulating searchResults.js per feedback in #243 2017-11-19 19:36:43 -08:00
derv82
1da3027f8b More comments before attempting to install the style 2017-11-19 14:03:54 -08:00
derv82
0a8274a04f Cleaning things up; still doesn't install but does everything else. 2017-11-19 02:54:20 -08:00
derv82
f1830c3768 Popup doesn't overflow-x anymore. Formatting seems... okay. 2017-11-18 13:45:32 -08:00
derv82
f35271f6de Some styling on search results. New EOL 2017-11-18 04:32:16 -08:00
derv82
764d7f627e Loads styles from userstyles.org - Cannot 'install', needs cosmetic improvements 2017-11-18 03:03:29 -08:00
derv82
d23342b171 'Load styles' link below 'Find styles for this site' -- does nothing 2017-11-17 00:17:23 -08:00
tophf
0ed37c2667 popup: add side borders in Chrome 62+
fixes #226
2017-11-14 11:20:49 +03:00
tophf
8b28262fe7 emphasize disableAll mode: make the label red and bold
fixes #227 which is quite typical for new users
2017-11-13 20:42:35 +03:00
tophf
d053d78c8f popup: use "height: min-content" instead of the hack 2017-11-08 06:54:30 +03:00
Sebastian Reuße
033269ac9b popup: don’t assume the browser styles text in black
Fixes #218.
2017-10-28 10:47:30 +03:00
tophf
7cf27601ae popup: USO workaround for finding extension styles 2017-09-30 03:19:27 +03:00
tophf
4c616442f6 correctly show/hide #no-styles message in the popup 2017-08-31 13:42:30 +03:00
tophf
fa5ebb8958 use callbacks in animateElement to avoid re-animation 2017-08-31 13:42:30 +03:00
tophf
58b52b0bf0 make #confirm popup more flexible
kinda fixes #175
2017-08-31 13:42:30 +03:00
Rob Garrison
d563495c26 Fix no-inline-comments issues 2017-08-27 17:20:45 -05:00
tophf
320ea3485a hyphenate blocked-info in FF 2017-08-27 13:02:58 +03:00
tophf
90ab2959a6 abandon automatic translation in CSS
* it fails with some languages in some versions of FF
* it's not as flexible as HTML templates
* we were only using it for a few messages
2017-08-27 13:02:17 +03:00