Commit Graph

26 Commits

Author SHA1 Message Date
tophf
05d1013699 fixup 2e03c9c9: the element should be in DOM before reposition() 2017-12-02 17:18:58 +03:00
tophf
fad03fb7c9 colorpicker: invoke callback on first color change 2017-11-27 14:54:19 +03:00
tophf
06a2a4c04d constrain manually typed values in colorpicker 2017-11-27 14:54:18 +03:00
tophf
2e03c9c9c0 same colorpicker in the manager 2017-11-27 14:54:18 +03:00
tophf
326dc5fb86 don't autofocus colorpicker input fields on small touch devices 2017-11-25 16:47:05 +03:00
tophf
2dda22f700 fix color swatch glitch on lint markers 2017-11-25 04:28:55 +03:00
tophf
15c5df0e6e colorpicker always picks up the only color in a line 2017-11-24 13:19:19 +03:00
tophf
7c0d8f0841 prevent inline overlays from breaking color swatches 2017-11-24 13:19:19 +03:00
tophf
60247a6443 don't lowercase the original line! 2017-11-24 13:19:18 +03:00
tophf
7c746ab9a3 fix colorpicker keyboard increment with #HEX in CAPS 2017-11-24 13:19:18 +03:00
tophf
06cda0b2c1 fix colorpicker swatch glitches by monkeypatching match-highlighter 2017-11-24 13:19:14 +03:00
tophf
c1c61ed590 find more rgb/hsl colors near cursor in comments and strings 2017-11-24 13:19:14 +03:00
tophf
607160655d colorpicker shouldn't overwrite non-colors 2017-11-24 13:19:13 +03:00
tophf
0ed6e3d4bf don't reinsert reinterpreted color on start
do it only on the Enter key or once the user explicitly changed the color at least once
2017-11-24 13:19:10 +03:00
tophf
e0ea76a940 colorpicker hotkey: find color at cursor in strings/comments 2017-11-24 13:19:10 +03:00
tophf
5d00602ada switch colorpicker popup format on PgUp/PgDn only, not Tab 2017-11-24 13:19:09 +03:00
tophf
fc20479ab4 correctly unhook colorpicker in usercss#stylus mode 2017-11-24 13:19:08 +03:00
tophf
2c82cc3bbc fix glitching on highlighting of current token 2017-11-24 13:19:08 +03:00
tophf
75da5c50ce colorpicker Ctrl-up/down steps in 50 on S, L, .5 on alpha 2017-11-24 13:19:07 +03:00
tophf
2a0ecec28e show color swatches in usercss with stylus preprocessor 2017-11-24 13:19:07 +03:00
tophf
aa2fef7f72 more keyboard control in colorpicker popup
hex mode similar to chrome-devtools:
* Ctrl-Up/Down for R channel
* Shift-Up/Down for G channel
* Alt-Up/Down for B channel
* Up/Down treats the entire color as a hex integer e.g. #00f -> #010

rgb/hsl modes similar to chrome-devtools:
* Ctrl-Up/Down steps by 100 (alpha: by 1)
* Shift-Up/Down steps by 10 (alpha: by .1)
* Up/Down steps by 1  (alpha: by .01)

* PgUp/PgDn to switch format
* Tab to switch format when at the first/last input field
2017-11-24 13:19:06 +03:00
tophf
b99391887d add colorpicker hotkey config icon [default: none]
* uses the last submitted color by default
* doesn't insert the default color until a change or the Enter key
* fix a few bugs in colorpicker introduced in the rewrite
2017-11-24 13:19:06 +03:00
tophf
352846c8b4 fix and update ColorView.openPopup() 2017-11-24 13:19:06 +03:00
tophf
ce8a0a2d42 assign color swatches correctly: skip overlays in the middle 2017-11-24 13:19:05 +03:00
tophf
37a62b0407 fix/rewrite/integrate colorpicker
* full rewrite of colorview.js to make it 10-100 times faster (render on demand via extendMode)
* full rewrite of colorpicker.js to simplify CSS
* automatic light/dark theme based on current color of the editor
* fixes, tweaks, speedups
* color spot will always be on the left of its text i.e. no line break on wrapping
* support #RRGGBBAA and #RGBA hex colors
* support "transparent" as rgba(0, 0, 0, 0)
* HEX/hex toggle
* fix HSLA regexp
* Esc/Enter key to close
* innerHTML -> textContent
* toggle the feature correctly
* fade out before autohiding
* always show alpha 1 like devtools does
* set cursor:pointer only on the clickable part of the sliders
* bigger color format switcher with a tooltip
* autofocus input on open, disable spellcheck
* try not to obscure the source color spot & text
* restore focus without scrolling
2017-11-20 15:19:58 +03:00
tophf
c50b251ae4 add original colorpicker plugin 2017-11-19 15:55:35 +03:00