An undo/redo library for your app

I wrote about undo before and I pushed it farther. What about an undo/redo system? I extended the v.01 of the undo and I now handle undo and redo in the same object.

Annoucing redo in jskata.undo

I made a new version of jskata.undo still hosted on GitHub. If you look closer, it is now part of a library called jskata that is not officially announced. My next post will talk about it in details.

Demo

Take a look at the demo. The javascript of the demo is available here. You can see the complete doc on GitHub.

How does it work?

Execute an action that you can undo/redo

Doing something requires calling execute with 2 functions as parameters : the do and the undo.

Undo and redo the last action

Very easy!

Events and properties

For the moment, jskata.undo has just one event : onChange.

There are 2 properties : canUndo() and canRedo().

  • http://twitter.com/KamiSLO Tomaž Muraus

    I don't want to be a party breaker, but the demo does not work in Chromium (version 5.0.342.9 – WebKit: 533.2, V8: 2.1.2.7).

    “Uncaught SyntaxError: Unexpected token do”

  • http://www.timmyontime.com Dan Simard

    Ho nooooooo… I knew that the new guy in the browser room would be trouble one day. I'm looking at it.

  • http://www.timmyontime.com Dan Simard

    Ok, it is now corrected. Tell me if everything is ok.

  • http://www.javascriptkata.com/2010/06/15/announcing-the-jskata-libraries/ Announcing the jsKata libraries » Javascript Kata

    [...] & redo I wrote about undo and undo & redo before. I took the code and put it in jsKata. You can look at the code or try the [...]

  • http://kalzdjsdcvi.com/ dYcxcgcvf

    2011…

    Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a bit, but other than that, this is magnificent blog. A fantastic read. I wi…

  • http://kalzggdjsdcvi.com/ dYcxcgcvfgg

    2011…

    Greetings! Very helpful advice on this article! It is the little changes that make the biggest changes. Thanks a lot for sharing!”…

  • http://www.sportspicksnation.com NFL picks against the spread

    2011…

    It is really a nice and helpful piece of information. I am glad that you shared this helpful information with us. Please keep us informed like this. Thanks for sharing….