Closes#757
Mostly just the UI at this point. Centered the dropdown link and menu, and set up translations. Hooked up the menu click function, and I know we don't usually bother with auto-closing menus, but it felt kinda weird with this one, so I added scroll and click listeners to auto-close.
* linter and compact layout improvements
Closes#748
While investigating the best way to fix linter scrolling, when I double-checked the compact layout, an old bug I meant to fix a long time ago was immediately apparent. Basically, the linter adds/removes errors as you type, causing the editor to bounce up and down, making it practically unusable.
This PR fixes scrolling, and also collapses options and the linter in the compact layout, but always shows the collapsed linter so you're aware of the error count without the content jumping. It also collapses options in the non-compact layout if the viewport is too short to accommodate them, factoring in the min-height of the linter. All automatic collapsing factors in whether a linter is active so they can adjust accordingly, and disables the setting of collapsed state prefs, since we're deciding the pref anyway, and this allows for re-expanding on resize based on the previous pref.
It's quite possible I failed to account for certain scenarios, so try to break it. Also think it's problematic for the linter to not always be visible if enabled, so I hooked up a 40px fixed header on scroll with just the linter in it for the compact layout.
A few other little details are included. I removed redundant line and column numbers spelled out at the end of lint messages to prevent horizontal overflow. I noticed that the expand/collapse prefs do not toggle correctly when clicking directly on the details-marker arrow. Simplest solution was covering them with the `h2` (we may wanna hook up the manager as well). Also, unrelated, but I switched to opacity to hide resizing sectioned editors, because `visibility: hidden;` breaks editor auto-focus.
If either of you guys wanna fix any bugs, or improve any code, feel free to just commit to this PR directly.
* linter and compact layout improvements
* linter and compact layout improvements
* No usercss scroll listener and delay header check
* Some code tweaks
* menus as dialogs
I think it's better in general, and also eliminates the glitchiness of expandable menus in FF, not to mention possible scroll issues on long style lists with overflow, plus the fact that we could add many menu items in the future without the menu looking ridiculous.
IDEK how the formatting got screwed up and borked the diffs in the other PR. I updated my editor config plugin, so let's see if that helps. I restarted with a fresh master and copy/pasted the changes, so if it's still screwy, I guess my editor needs more help. If not, I'm not playing around with it anymore right now, and the other PR does at least work.
* menus as dialogs
* Add: auto resize section editor on init
* Fix: calculate cm height correctly
* Fix: query heights before set
* Fix: work with small layout, hide sections before ready
* Change: exclusion should match urlWithoutParams
Revert to eight04's initial two commits in #681 which make exclusion toggles domain and singular URLs only, plus reincorporate the js menu height calculation.
* Change: drop excludeStyleByUrlRedundant plus menu height
* menu item text
* Make exclusion rules work like match pattern and handle invalid URLs
* Exclude rules in tooltips
* Remove leftover code
* Cross-browser overflow consistency
* Improve height restriction for popup config dialog
Noticed unnecessary overflow in Github Dark's config dialog. We should allow it to utilize available height.
* Shave off 2px to allow for borders without overflow
* Prevent importing styles with no section. Fixes#687
And prevent issues with existing styles with no section
* Revert sections checks for empty array
* Add styleJSONseemsValid function
* Clean up
* Fix eslint nags
* Fix missing FF favicons Closes#683
I think the combo of swapping `window.prefs` for `prefs`, and moving the function inside `onDOMready()` does the trick.
@eight04 Any idea why `window.prefs` no longer works? Does the rest LGTY?
* Add suggestions
* Refactor: style injector/docRootObserver/docRewriteObserver
* Fix: minor
* Fix: disabled state
* Fix: use evade
* Fix: apply.js is broken in our pages
* Fix: transition patch is broken
* Fix: also check elements after the last userstyle
* Fix: remove outdated FIXME. styleInjector.toggle now toggle all styles
* Fix: call Object.keys twice
* Add a fixme
* Fix: typo
* Add a fixme
* Fix: don't argue for mutations generated by other extensions
* WIP: popup UI
* Fix: use simple menu toggle
* Add: inclusion/exclusion API
* Add: hook exclusion UI
* Fix: minor
* Fix: don't self-edit
* Icons and accessibility
* Icons and accessibility
* Fix: disable redundant exclude-by-url checkbox
* Disabled cursor and delete leftover code
* Generic menu button tooltip and tweak menu item cursors
* Generic menu button tooltip and tweak menu item cursors
* Generic menu button tooltip and tweak menu item cursors
* Add: use metadata.updateURL as style.updateUrl
* Change: only use the installation URL as the update URL if not specified in usercss
* Fix: hide live reload checkbox according to installationUrl