I’ve been getting lots of great feedback on Edit In Place. As time permits I hope to fix problems and round out the feature set a bit more. To that end I’ve rolled out version 0.2.1. Here’s a list of what has changed since version 0.2.0:
- The bundled version of Prototype is now 1.5.0_rc0. This was mostly to make sure that my code still worked with 1.5.0_rc0.
- Attempt to deal with editing, updating and saving empty strings in a reasonable way
I’ve updated the example page to include editing a string that starts out empty. The example now has a link to my Edit In Place blog entries, the edit.php source (assuming your web server knows what to do with .phps files) and the main link at the top now goes http://josephscott.org/code/js/eip/.
Two new options have been introduced to format empty strings: empty (which is the css class to apply to empty strings, defaults to .eip_empty) and empty_text (the text to put in place of empty strings, defaults to ‘Click To Edit’). These options are valid for all types (text and textarea).
So go to the example page and click on the grey ‘Click To Edit’ string and you’ll get an empty text box. Type in something and you’ll get the new string instead. Then delete the string and you’ll get the grey ‘Click To Edit’ string again. You can do the same thing with the original text and textarea examples.
I think that I’ve covered the empty string condition, but if you find a bug please drop me a note. Include a patch if you are really feeling generous 🙂