jspaint/CONTRIBUTING.md

45 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2018-01-23 23:31:03 +00:00
# Contributing
2020-12-17 22:25:21 +00:00
## Pull Requests
2018-01-23 23:56:55 +00:00
Let me know before you work on something by opening an issue or commenting on an existing one.
2020-12-17 22:25:21 +00:00
Someone may be already working on it, or I may have specific plans or requirements.
I don't want your effort to be wasted!
2018-01-23 23:31:03 +00:00
2020-12-17 22:25:21 +00:00
## Issues
2018-01-23 23:31:03 +00:00
2020-12-17 22:25:21 +00:00
[Bugs and feature requests are tracked on GitHub.](https://github.com/1j01/jspaint/issues)
2018-01-23 23:56:55 +00:00
2020-12-17 22:25:21 +00:00
Before opening an issue for a bug or feature request, search to see if it's already been reported.
2018-01-23 23:56:55 +00:00
2020-12-17 22:25:21 +00:00
You can also [email me](mailto:isaiahodhner@gmail.com) if you prefer.
2018-01-23 23:56:55 +00:00
2020-12-17 22:25:21 +00:00
## Windows 98
2018-01-23 23:56:55 +00:00
2020-12-17 22:25:21 +00:00
Note: JS Paint's GUI is primarily based on Paint from Windows 98.
There's a nice [online emulator](https://copy.sh/v86/?profile=windows98)
that you can play around with and use as a reference.
2018-01-23 23:56:55 +00:00
## Dev Setup
2020-12-17 22:25:21 +00:00
See [**Development Setup**](./README.md#Development-Setup) on the readme.
2018-01-23 23:56:55 +00:00
2018-01-23 23:31:03 +00:00
### Project Structure
2020-12-17 22:25:21 +00:00
- `index.html` and `app.js` are the main entry points for the app.
- `functions.js` has functions that shouldn't own any global state, altho they very much modify global state, and there may be a few stateful global variables defined in there.
- The project uses [jQuery](https://jquery.com/), and a convention of prefixing variables that hold jQuery objects with `$`
- There are also some weird pseudo-classes like `$ColorBox` which extend and return jQuery objects. I don't recommend this pattern for new code.
- Menu code and windowing code is in `lib/os-gui/` and should be kept in sync with the [os-gui](https://github.com/1j01/os-gui) project.
- (Maybe I should version this using git-subrepo?)
- Some window behavior specific to jspaint is in `$ToolWindow.js` and `$Component.js`
2020-12-17 22:25:21 +00:00
- `image-manipulation.js` should contain just rendering related code, and ideally no dialogs except maybe some error messages.
- Some image manipulation code is also in `tools.js` and `functions.js`
- CSS is in `styles/`
- Layout-important CSS is kept separate from theme CSS
- Localization data is in `localization/`
- As of writing there's no good way to contribute translations, but [get in touch!](https://github.com/1j01/jspaint/issues/80)
Any good IDE or code editor has a project-wide search (often with <kbd>Ctrl+Shift+F</kbd>). I use this all the time.
I also use the "Intellisense" feature of [VS Code](https://code.visualstudio.com/) to jump to function definitions (an extra convenience over searching for function names).