geops/ole — pull request #19 by justb4 (2013-04-07 19:34:18+00:00)
Title: New Editor widgets for Labels, Upload, Download and DeleteAll issue #17

This pull request contains edits as described in OLE issue #17 (https://github.com/geops/ole/issues/17). In short this comprises the following new functions:

- DrawText : draw simple text labels (extends DrawPoint)
- DeleteAllFeatures: delete all features from drawing without selection
- DownloadFeature: download drawn features into local file (GML, GeoJSON etc)
- UploadFeature: upload features from local file (GML, GeoJSON etc) into drawing

See example at: http://lib.heron-mc.org/heron/latest/examples/editorbasics/
Up/download are an almost local facility, i.e. no server-side storage is required, just a smal cgi script that echoes the feature data thereby forcing HTTP download via the "attachment" HTTP header. For upload the script will echo the data sent from a local file through a hidden form back into a hidden iframe, effectively uploading features into the current drawing.

This pull also contains some fixes and additions for the English and Dutch language files.

Just before this pull the latest version of the masterbranch was merged into my clone. The merge was easy to perform, mainly Editor.js was some work. Note that Editor.js may seem to have changed completely. This is the result of a code reformat triggered in my IDE. Sorry for that. To make the merge for Editor.js easy, I also exercised the code reformat on the Editor.js master version.

I also made fixes for building ole.min.js. In the Makefile I added not only the new .js files for the new widgets but also Drawtext.js. My example uses ole.min.js. As my example uses a toggle for the OLEditor toolbar, I had to change lifecycle code in some other widgets and Dialog.js. For example an open Dialog remained open after hiding the toolbar.

TODO:
- provide server script changes for Up/Download.
- more consistent code commenting JSDoc style