* add Patch CSP option
* show style version, size, and update age in manager
* add scope selector to style search in manager
* keep scroll position and selections in tab's session
* directly install usercss from raw github links
* ditch localStorage, use on-demand SessionStore proxy
* simplify localization
* allow <code> tag in i18n-html
* keep nodes in HTML templates
* API.getAllStyles is actually faster with code untouched
* fix fitToContent when applies-to is taller than window
* dedupe linter.enableForEditor calls
* prioritize visible CMs in refreshOnViewListener
* don't scroll to last style on editing a new one
* delay colorview for invisible CMs
* eslint comma-dangle error + autofix files
* styleViaXhr: also toggle for disableAll pref
* styleViaXhr: allow cookies for sandbox CSP
* simplify notes in options
* simplify getStylesViaXhr
* oldUI fixups:
* remove separator before 1st applies-to
* center name bubbles
* fix updateToc focus on a newly added section
* fix fitToContent when cloning section
* remove CSS `contain` as it makes no difference
* replace overrides with declarative CSS + code cosmetics
* simplify adjustWidth and make it work in FF
* import options on demand
* auto-grant declarativeContent
* include lint configs and usercss template
* simplify exportFile as crbug.com/798705 was fixed
* section labels, TOC, speedups and fixes
* show section numbers in widgets
* debounce livePreview in usercss editor
* better fixed header and compact layout compatibility
* fix section sizing for compact layout + layout speedup
* DocFuncMapper + cosmetics + fix Clone button
* don't run linter during initSections
* remove unused/unnecessary DOM polyfills
* report invalid @document function as parser error
* rewrite section finder
* simplify focusedViaClick
* simplify setPreprocessor and make it synchronous
* throttle offscreen line widgets in usercss with lots of sections
* add on, off aliases for add/removeEventListener + onOff
* use on/off aliases in changed files
* use getters in more places
* don't run web-ext test as it fails on Chrome-only permissions
* generate stylus-firefox.zip without declarativeContent
* limit note's width in options
* run updateExposeIframes only in frames
* also apply live-preview if an unsaved style was disabled
* use box-shadow instead of outline for focus everywhere
* allow focus outline on click in text/search input or textarea
* search inputs should use the same style as text inputs
* also use box-shadow focus on delete buttons
* remove URLSearchParams workaround, not needed since Chrome 55
* use `once` in addEventListener, available since Chrome 55
* update USO bug workarounds, remove obsolete ones
* ping/pong to fix openURL with `message` in FF
* use unprefixed CSS filter, available since Chrome 53
* use unprefixed CSS user-select, available since Chrome 54
* focus tweaks
* also use text query in inline search for Stylus category
* use event.key, available since Chrome 51
Co-authored-by: narcolepticinsomniac
* rework and move newUI+theme to options.html
* rephrase/clarify the find styles label
* switch to USO-archive
* search for 'Stylus' keyword to filter out Stylish crud
* use archive's default search order
* use wrappedJSObject to create style elements in page context
* skip unnecessary polyfills in content scripts
* group all style management stuff in injector
* support all API methods in content scripts
* Add key
* Add: a second index uuid, push changes to sync controller
* Add: sync.js
* Add: tokenManager
* Change: log entire body for http error
* Add: token flow
* Fix: minor
* Fix: move cleanup to stop function
* Add: syncNow
* Update dependencies
* Fix: handle 401 error
* Add: handle 401 error
* Fix: then -> catch
* Add: sync options to options page
* Update db-to-cloud
* Change: make prefs.set return a promise
* Add: disble selector if connected
* Add: update selector state
* Fix: return promise in prefs.set
* Fix: manage complex state
* Fix: handle prefs change
* Change: manage sync status in background
* Add: show current status in the UI
* Add: schedule a faster sync when db changed
* Update dependencies
* Add: include progress in sync status
* Add: more detail status
* Show status text only
* Bump dependencies
* Change: show loaded and total
* Fix: syncTarget is undefined
* Add: google and onedrive
* Fix: token is not reused
* Bump dependencies
* Don't use minified version since it is hard to debug
* Fix: expire time is incorrect
* Change: switch google to code flow
* Bump dependencies
* Change: only modify pref if the initialization success?
* Don't stop the sync if the first sync is not triggered by the user
* Add: implement refresh token
* Change: switch microsoft to code flow
* Add: subtract expire with a latency
* Add: microsoft client secret
* Add: display error message
* Fix: fromPref is not used
* Change: try to revoke the token when log out
* Add: revoke dropbox token
* Fix: Google only generates one refresh token for one user by default
* Bump dependencies, fix onedrive list issue
* Fix: arguments sent to sync.put is wrong
* Fix: don't schedule a sync on db changed if not connected
* Bump dependencies. Fix issue of switching drives
* Bump db-to-cloud, fix switching drive issue
* Fix: only auth user on 401 error, don't display login window without user interaction
* Fix: don't call revoke() if token is undefined
* Add: login button to generate the access token interactively
* Fix: make addMissingProperties a local
* Fix: store missing props in an object
* Fix: sync.getStatus should be sync
* LATENCY -> NETWORK_LATENCY
* Fix: cache the token forever if there is no expire time e.g. dropbox
* Add some comments
* Fix: i18n
* Fix: i18n sync status
* fixup! Fix: i18n sync status
* Fix: 'sync to cloud' is displayed twice
* find @-moz-doc sections faster in the editor
* only recreate widgets if section data is changed
* CodeMirror speedup: reuse the old folding marks
* add a reminder to remove the CodeMirror hack in the future
* use precise getTokenAt
* check doc type for string/comment to be more mode-agnostic
* fix setGutterMarker hack
* fix skipSpace: EOL is a space too
* move deepEqual next to deepCopy
* fix getTokenTypeAt check for some cases
* remove the unnecessary \s*
* 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