You should contribute to [iD] (https://github.com/systemed/iD) unless your modifications are explictly for customizations made by ofp-editor.
We'd love to hear what you think about ofp-editor, about any specific problems or concerns you have. Here's a quick list of things to consider:
Please search for your issue before filing it: many bugs and improvements have already been reported
To report a bug:
- Write specifically what browser (type and version, like Firefox 22), OS, and browser extensions you have installed
- Write steps to replicate the error: when did it happen? What did you expect to happen? What happened instead?
- Please keep bug reports professional and straightforward: trust us, we share your dismay at software breaking.
- If you can, enable web developer extensions and report the Javascript error message.
When in doubt, be over-descriptive of the bug and how you discovered it.
To request a feature:
- If the feature is available in some other software (like Potlatch), link to that software and the implementation. We care about prior art.
- Understand that ofp-editor is meant to be a simple editor and doesn't aim to be as complete or complicated as JOSM or similar.
Documentation is maintained as a series of Markdown
documents in the data/doc/
path. The first line of each page of documentation
should be of the form
We use the Airbnb style for Javascript with only one difference:
4 space soft tabs always for Javascript, not 2.
No aligned =
, no aligned arguments, spaces are either indents or the 1
space between expressions. No hard tabs, ever.
Javascript code should pass through JSHint with no warnings.
There isn't much HTML in ofp-editor, but what there is is similar to JS: 4 spaces always, indented by the level of the tree:
<div>
<div></div>
</div>
Just like HTML and Javascript, 4 space soft tabs always.
.radial-menu-tooltip {
background: rgba(255, 255, 255, 0.8);
}
We write vanilla CSS with no preprocessing step. Since ofp-editor targets modern browsers, feel free to use newer features wisely.
Test your code and make sure it passes. Our testing harness requires node.js and a few modules:
- Install node.js - 'Install' will download a package for your OS
- Go to the directory where you have checked out
ofp-editor
- Run
npm install
- Run
npm test
to see whether your tests pass or fail.
You can build a concatenated and minified version of ofp-editor with the command make
. Node.js is
required for this.
ofp-editor will be built to the dist
directory. This directory is self-contained; you can copy it
into the public directory of your webserver to deploy ofp-editor.
ofp-editor is dual licensed under the MIT License or the WTFPL. Some of the libraries it uses are under different licenses. If you're contributing to ofp-editor, you're contributing MIT/WTFPL code.
Let's say that you've thought of a great improvement to ofp-editor - a change that turns everything red (please do not do this, we like colors other than red).
In your local copy, make a branch for this change:
git checkout -b make-red
Make your changes to source files. By source files we mean the files in js/
.
the ofp-editor.js
and ofp-editor.min.js
files in this project are autogenerated - don't edit
them.
So let's say you've changed js/ui/confirm.js
.
- Run
jshint js/ofp-editor
to make sure your code is clean - Run tests with
npm test
- Commit your changes with an informative commit message
- Submit a pull request to the
openfloorplan\ofp-editor
project.