Commit Graph

52 Commits (main)

Author SHA1 Message Date
Isaiah Odhner 355fba3ee2 Wrap many modules in IIFEs to track their exports 2022-01-19 00:17:32 -05:00
Isaiah Odhner 8053b38e58 Auto-format code with VS Code
Format JS and HTML using VS Code extension: https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files

Dedented some files for now to make the diff intelligible:
- tools.js
- menus.js
- speech-recognition.js
- simulate-random-gestures.js
2022-01-18 19:40:58 -05:00
Isaiah Odhner 0e7dde674f Unify todos 2021-02-15 13:02:39 -05:00
Isaiah Odhner 60e6dfc69f Rename selected colors global 2021-02-12 10:13:53 -05:00
Isaiah Odhner 3c7ae6ce44 Handle RTL layout for component drag and drop system 2020-12-17 13:36:21 -05:00
Isaiah Odhner 7a89690409 Fix error after palette is rerendered
In cases where the palette is rerendered - switching themes, toggling vertical color box mode, loading a palette, etc.,
a leaked event listener or other places could throw an error similar to:

    Uncaught TypeError: $foreground_color.data(...) is not a function

- If you opened the Edit Colors dialog, but changed the UI theme before hitting OK, it would fail to update the color or close the dialog. This is fixed. It now uses an index into the palette so it even works if you change the palette completely while the dialog is open. Differently sized palettes are also handled.
- If you opened the Edit Colors dialog, but switched to monochrome mode in Image > Attributes before hitting OK, it would partially fail to update the color - it would visually change the color cell, but if you selected it, it would select the old pattern. This is fixed.
- If you toggled Vertical Color Box mode, the palette broke - you could no longer select colors. This is fixed.
- I haven't fixed the event listener leak itself.
2020-12-11 12:20:40 -05:00
Isaiah Odhner 0d1a2cd813 Reduce tech debt
Localizations shouldn't map from a hotkeyless string to a string with a hotkey hint.
2020-12-07 18:56:43 -05:00
Isaiah Odhner 5817307cc4 Get most things localized! 2020-12-07 18:56:43 -05:00
Isaiah Odhner dbcd4cba1f WIP localization 2020-12-07 00:35:13 -05:00
Isaiah Odhner 68f00203b0 Fix error when changing themes 2020-06-03 06:54:27 -04:00
Isaiah Odhner 75f8d3f736 WIP: add to custom colors
fix

simpler
2020-06-03 06:54:26 -04:00
Isaiah Odhner d62d244777 WIP: implement Edit Colors dialog
Fixes https://github.com/1j01/jspaint/issues/114 and makes opening the color dialog work with Eye Gaze Mode dwell clicks and Speech Recognition as well (which can't trigger a "user gesture" as far as the browser's security model is concerned).
2020-06-03 00:32:34 -04:00
Isaiah Odhner 2c1a30222c Refactor a thing 2020-06-02 23:35:55 -04:00
Isaiah Odhner 13a633ab35 Improve colors box layout
under various combinations of vertical color box, eye gaze mode, and the modern theme
2020-04-29 18:09:23 -04:00
Isaiah Odhner 31edf30064 Unify TODO comments 2020-04-27 20:45:47 -04:00
Isaiah Odhner 2ec4c2795a Toggle eye gaze and vertical color box modes from Extras menu 2020-04-27 14:18:11 -04:00
Isaiah Odhner e1bc566858 Enlarge and re-center swatch swapper 2020-04-19 12:10:07 -04:00
Isaiah Odhner e0f176e2e5 Measure button width when calculating palette layout 2020-04-19 11:23:47 -04:00
Isaiah Odhner 8a1fb1730c DRY testing of URL 2020-04-18 15:27:57 -04:00
Isaiah Odhner d28240d246 Add vertical colors box & eye gaze mode 2020-04-10 01:24:28 -04:00
Isaiah Odhner 8df211c04d Support HSL-defined colors for color editing 2019-12-23 15:11:26 -05:00
Isaiah Odhner d19d2a80d5 Clean up and guard console logs 2019-12-21 00:38:00 -05:00
Isaiah Odhner 82b5425334 Don't use $.each or $().each 2019-10-29 21:38:32 -04:00
Isaiah Odhner adc524e241 Fix colors box 2019-10-29 20:41:45 -04:00
Isaiah Odhner 83dd05c1b0 Clean up canvas creation
Don't pretend the canvas making helper is a class
2019-10-29 17:49:17 -04:00
Isaiah Odhner 6e130de69e Use template strings
lebab --replace src/ --transform template
2019-10-29 17:16:33 -04:00
Isaiah Odhner af6e9a1242 Convert var to let and const
$ lebab --replace src/ --transform let
src/$Component.js:
59:   warning  Unable to transform var  (let)
60:   warning  Unable to transform var  (let)
97:   warning  Unable to transform var  (let)
138:  warning  Unable to transform var  (let)
src/$Window.js:
74:   warning  Unable to transform var  (let)
src/app.js:
662:  warning  Unable to transform var  (let)
460:  warning  Unable to transform var  (let)
612:  warning  Unable to transform var  (let)
613:  warning  Unable to transform var  (let)
614:  warning  Unable to transform var  (let)
src/functions.js:
756:  warning  Unable to transform var  (let)
src/image-manipulation.js:
245:  warning  Unable to transform var  (let)
826:  warning  Unable to transform var  (let)
src/imgur.js:
48:   warning  Unable to transform var  (let)
173:  warning  Unable to transform var  (let)
2019-10-29 16:46:51 -04:00
Isaiah Odhner d0e722d12c Convert to arrow functions with lebab
npm install -g lebab@3.1.0

lebab --replace src/ --transform arrow
2019-10-29 14:46:29 -04:00
Isaiah Odhner a1f9b59bd7 Add command key support for macOS 2019-10-28 12:57:56 -04:00
Isaiah Odhner 874e50fc3e Go thru eslint problems
- And pull maximal stuff out of most try-catches (with empty catches)
- Simplify Firebase event cleanup by structuring data
2019-09-20 13:15:21 -04:00
Isaiah Odhner af7995df77 Disable image smoothing everywhere 2018-01-21 21:02:45 +00:00
Isaiah Odhner 4a2c9ace59 Fix Colors box in modern theme
And when switching themes
2017-06-29 04:35:46 +00:00
Isaiah Odhner 7cecb3f3c8 Fix editing colors
Either of these changes should fix it. But why not both?
2017-06-24 19:58:51 +00:00
Isaiah Odhner fd89eb8b1d Display patterns when selected 2017-06-24 19:35:49 +00:00
Isaiah Odhner c108c894a3 Switch back to color palette
Switch back to the polychrome palette when turning monochrome mode off.

Also refactor towards displaying selected patterns.
2017-06-24 18:28:23 +00:00
Isaiah Odhner c9b1578735 Add black outline for patterns 2017-06-24 15:23:13 +00:00
Isaiah Odhner 949b18d23b Partially implement B&W mode 2017-06-24 06:22:29 +00:00
Isaiah Odhner d92054dfd1 Remove all .jspaint-* prefixes 2017-05-23 06:04:23 +00:00
Isaiah Odhner 5d919a32de Remove .jspaint-button class 2017-05-23 03:58:35 +00:00
Isaiah Odhner aa4364ddf9 Improve opening files and error handling
Use URL.createObjectURL() instead of creating a FileReader and reading as a data URL

Add a bunch of error handling around opening files

Make GIF rendering errors use new show_error_message function

Remove some old bits from intending to use Web Intents
2017-01-31 22:37:07 +00:00
Isaiah Odhner 2175e94397 Fix selected color overlapping menu 2017-01-29 20:48:50 +00:00
Isaiah Odhner ba1392ea3c Add Extras menu 2017-01-29 20:19:43 +00:00
Isaiah Odhner e17112baba Fix <input> elements getting in the way 2016-09-19 17:05:49 -04:00
Isaiah Odhner bce5b5984d Fix space at bottom of app in Edge 2016-05-04 18:32:26 -04:00
Isaiah Odhner df0218a3c4 Mobile support 2015-06-21 20:01:12 -04:00
Isaiah Odhner 3f0cbc32f7 Colors > Get Colors 2015-06-15 21:29:30 -04:00
Isaiah Odhner 4c99759ac5 Make Edit Colors work when the Colors box is hidden 2015-06-14 22:47:08 -04:00
Isaiah Odhner 3b33e7c2ff Store current colors in an object (not an array) 2015-02-23 19:18:07 -05:00
Isaiah Odhner cfbf8a6241 Supersede $colorbox.update_colors 2014-11-20 15:11:36 -05:00
Isaiah Odhner fdd53db192 Many minor code changes
I hope this doesn't break anything
2014-10-28 22:54:55 -04:00