Categories
josephscott

Edit In Place: Version 0.2.1

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 🙂

3 replies on “Edit In Place: Version 0.2.1”

Joseph,

I’m having issues on the example page with the Color dropdown. Just the Save/Cancel buttons are showing up. (along with a Javascript error: $(element) has no propertiesprototype.js (line 1384))

I’m using Firefox 1.5.0.4 on WinXP if that’s any help.

Keep up the great work!

Bofe –

My bad, I had accidently posted the development version of EditInPlace example page. The color selector example will make use of a feature that will be available in the next release (hopefully). Sorry about that.

Thanks for letting me know about this.

Just a quick heads-up, but you may want to strip any input strings (and do any other validation you deem necessary) because right now, if you enter a bunch of spaces, the data is saved, but there is no link to go back and edit your text with.

Leave a Reply

Your email address will not be published. Required fields are marked *