Commit Graph

638 Commits

Author SHA1 Message Date
tophf
0f8fd5c07c popup: refactor click handlers 2017-04-18 12:46:22 +03:00
tophf
b51c264c8b confirmDelete: extract, refactor, use in manage 2017-04-18 12:46:22 +03:00
tophf
8bcd7f60c5 Restore implicit handleUpdate in saveStyle 2017-04-18 12:46:22 +03:00
tophf
a6c3424b53 Move images into a separate directory 2017-04-18 12:46:22 +03:00
tophf
b1c19bdf3d Import styles: show report with Undo button 2017-04-18 12:46:22 +03:00
tophf
4bcfcb1503 Suppress out-of-order lint invocation errors 2017-04-18 12:46:22 +03:00
tophf
54171ea084 Optimize world_go with pngquant --quality 50-80 2017-04-18 12:46:21 +03:00
tophf
b5fa934652 confirmOK -> confirmDelete 2017-04-18 12:46:21 +03:00
tophf
5522b283ec Help link: http://add0n.com/stylus.html 2017-04-18 12:45:24 +03:00
tophf
26e1b67f44 Add <html id="stylus"> to all pages 2017-04-18 12:43:31 +03:00
tophf
49cba8cced apply.js: don't alter DOM stylesheet state if same 2017-04-18 12:43:31 +03:00
tophf
d53db2d45c Refactor & speed up styleSectionsEqual 2017-04-18 12:43:30 +03:00
tophf
19f1490f0a Add context menu 'delete' in editor for browsers without it 2017-04-18 12:43:30 +03:00
tophf
80130797ce Refactor contextMenus and commands 2017-04-18 12:43:30 +03:00
tophf
a717e632c6 Expose tDocLoader.stop() to prevent unneeded observation 2017-04-18 12:43:30 +03:00
tophf
c1338e63d1 Highlight updated/saved style in manage page 2017-04-18 12:43:30 +03:00
tophf
07bee69359 Fix deoptimization triggers 2017-04-18 12:43:30 +03:00
tophf
95e2263c10 Autocleanup cached filters when over 10k items (a few MB)
Precaution for the [rare but possible] case of users running Stylus for a very long time without restarting the browser.
2017-04-18 12:43:30 +03:00
tophf
c54e22ad64 Don't enforce non-native end_of_line in editorconfig 2017-04-18 12:43:30 +03:00
tophf
2f4da37fdb Refactor and speed up popup & manager
Popup:
* Enforce 200-800px range for the popup width option

Manage:
* faster search via cachedStyles.byId
* faster restoration of search results on history nav
* style name is clickable and opens the editor
* animated highlight of style element on update/add/save
* expandable extra applies-to targets
* remember scroll position on normal history navigation
* boz-sizing in #header, also in editor
* applies-to targets use structured markup
* get*Tab*, enableStyle and deleteStyle are promisified
2017-04-18 12:43:29 +03:00
tophf
9fd067c6e3 Switch editor to add style mode when id=nonexistentstyle 2017-04-18 12:43:29 +03:00
tophf
f746cb1581 Update lint report immediately on load 2017-04-18 12:43:29 +03:00
tophf
7a7c679811 Avoid flickering of editor header on load, also for manage<=>edit nav 2017-04-18 12:43:29 +03:00
tophf
8c7f7b81f8 Don't recreate editors after save 2017-04-18 12:43:29 +03:00
tophf
1dde91ea85 Global 'event' var is non-standard, FF doesn't support it 2017-04-18 12:43:29 +03:00
tophf
ba8301fdce Middle-click in popup on a style name to open the editor 2017-04-18 12:43:29 +03:00
tophf
b2e18177c3 Minimum Chrome version is 49 for ES6 stuff we use
Default function parameters were implemented in Chrome 49 and FF 15+
Stable Chrome is v57. One year has passed since v49.
2017-04-18 12:43:29 +03:00
tophf
f256f558dc IndexedDB getAll to read all styles in one op
Available since Chrome 48, FF44 (or FF27+ using dom.indexedDB.experimental flag)
2017-04-18 12:43:28 +03:00
tophf
f4e689721a Improve style caching, cache requests too, add code:false mode
Previously, when a cache was invalidated and every tab/iframe issued a getStyles request, we previous needlessly accessed IndexedDB for each of these requests. It happened because 1) the global cachedStyles was created only at the end of the async DB-reading, 2) and each style record is retrieved asynchronously so the single threaded JS engine interleaved all these operations. It could easily span a few seconds when many tabs are open and you have like 100 styles.

Now, in getStyles: all requests issued while cachedStyles is being populated are queued and invoked at the end.

Now, in filterStyles: all requests are cached using the request's options combined in a string as a key. It also helps on each navigation because we monitor page loading process at different stages: before, when committed, history traversal, requesting applicable styles by a content script. Icon badge update also may issue a copy of the just issued request by one of the navigation listeners.

Now, the caches are invalidated smartly: style add/update/delete/toggle only purges filtering cache, and modifies style cache in-place without re-reading the entire IndexedDB.

Now, code:false mode for manage page that only needs style meta. It reduces the transferred message size 10-100 times thus reducing the overhead caused by to internal JSON-fication in the extensions API.

Also fast&direct getStylesSafe for own pages; code cosmetics
2017-04-18 12:43:28 +03:00
tophf
df59fca29c Add match-highlighter of the word under cursor 2017-04-18 12:43:28 +03:00
tophf
b2e8bf02a9 CodeMirror 5.24
Notable change for css mode: Expose lineComment property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements.
2017-04-18 12:43:28 +03:00
tophf
df570dab9e Store SVG icons in a <symbol> collection
+preserve the page colors via fill:currentColor and opacity transition.
2017-04-18 12:43:28 +03:00
Jeremy Schomery
998aa2322d updating README.md; open a bug report to request translation merge 2017-04-18 08:46:55 +04:30
Jeremy Schomery
bc0c9cfe2a updating "de" locale. fixes #59 2017-04-18 08:38:07 +04:30
narcolepticinsomniac
f0eff5916f Merge pull request #58 from schomery/narcolepticinsomniac-icons
Switch info/external style link icons from img to svg
2017-03-31 22:05:25 -04:00
narcolepticinsomniac
e94f9d818e Get rid of text decoration in disabled styles
Fixes https://github.com/schomery/stylish-chrome/pull/58#issuecomment-290607298
2017-03-31 07:14:47 -04:00
narcolepticinsomniac
bab801f90b Correction 2017-03-30 23:00:35 -04:00
narcolepticinsomniac
df0f45dc06 Switch info/external style link icons from img to svg
Switched info to `i` and found a pretty nice external link icon imo. @tophf As for pixelation on the info icons, you mentioned maybe a lighter color would help. For all icons besides external links, I made them lighter with darker hovers. Besides a really high zoom, I never saw any issue to begin with, but let me know if they're alright. I also changed them to use their exact original dimensions, so maybe that helps.
2017-03-30 19:49:03 -04:00
tophf
4dd17c1caf Use "Stylish for Forefox" in styleToMozillaFormatHelp #33 2017-03-22 02:38:22 +03:00
narcolepticinsomniac
9dac68410d Handle popup overflow better
Max height is 600px for the popup, regardless of resolution (so says Google), so we can set the styles section to a max height in px and let the overflow scroll inside the div, instead of scrolling the whole popup. This way the other actions are always present at the bottom of the popup without needing to scroll to use them. I left a little breathing room for the rare instance when domain name in "write style for" is long enough to cause a line break, so there should never really be any overflow for the popup itself.

https://github.com/schomery/stylish-chrome/pull/50#issuecomment-287665085
2017-03-20 05:58:38 -04:00
tophf
ac2a1a1c48 Orphaned content script case self-destruction tweaks#2 for apply.js 2017-03-19 05:24:10 +03:00
tophf
b77823c365 Orphaned content script case self-destruction tweaks for apply.js 2017-03-19 04:59:28 +03:00
tophf
db560f3ede Orphaned content script case self-destruction for install.js 2017-03-19 04:58:16 +03:00
tophf
66a1c17847 Fix cascaded ternary condition 2017-03-19 02:00:03 +03:00
tophf
764cd1b6de Use the synced show-badge preference on startup 2017-03-19 01:57:19 +03:00
tophf
c815263671 moz-import: don't add an extra newline before the last line 2017-03-18 02:05:58 +03:00
tophf
3287b79f5e Support :any(), :-webkit-any(), :-moz-any() 2017-03-17 18:08:18 +03:00
tophf
4684016a47 Support @supports inside @-moz-document 2017-03-17 08:09:04 +03:00
Jeremy Schomery
ef8f507c50 Adding Opera to README.md 2017-03-16 18:31:03 +03:30
Jeremy Schomery
85a0ce52da Merge branch 'master' of github-jeremy:schomery/stylish-chrome 2017-03-16 17:17:00 +03:30