jQuery editInPlace

written by Martin Häcker on

Well, I just finished some major reworking of that jQuery plugin, so now it has [browser:/open-source/jquery-edit-in-place/trunk/spec/unit/spec.js a real testsuite] and conforms to the jQuery Plugin Guidelines and doesn't pollute the core prototypes (of String) anymore.

There are a few new features, most prominent the ability to define a class to apply for the hover effect (so you can style the hover in css instead of having to hand in the colors directly and more control over the way errors are presented so it is easier to embed into bigger applications.

So enjoy the demo and the download while they are hot, and keep a bookmark to the project homepage. :)

Stuff I'd like to note:

  • JSpec rocks, writing tests with it is a breeze. The DOM Testrunner they have could use some work though to become even more usefull
  • Writing the tests with no dom insertion is a great technique to get a fast testsuite where you can almost guarantee that it has no test-ordering issues.
  • jQuery allows you to almost completely drive the interaction with the editor as a user would, making it almost like an acceptance test (and with very little dependency on the internal working of the editor.
  • Refactoring JavaScript Code is hard if you don't have a testsuite. My Advice: Break it down into smaller bits. I found it incredibly hard to refactor larger pieces of the code, as not having a testsuite means there's no way you know what still works. :/