Ajax undo and redo
Use back/forward buttons as undo/redo.
(21:39:47) Stuart Langridge: The killer is that we have no undo. (21:40:45) Dunstan: not without completely rethinking how the backend works and then passing identifying variables back to the js (21:42:14) Stuart Langridge: have thought about using back/forward as undo/redo (21:43:07) Stuart Langridge: so every ajax action loads a new page into an iframe, so back/forward will load the last page you loaded in there (21:43:19) Stuart Langridge: and then you get undo/redo for free. (21:43:38) Stuart Langridge: but it's a bit of a break with what they do now...and it's fiddly to do, in my testing. (21:44:01) Dunstan: not something to implement as an add-on to an exisiting system (21:44:38) Stuart Langridge: probably not, although you could do it. (21:44:43) Dunstan: yeah, it'll be intsersting to see if anyone comes up with a wiki-type undo thing for ajax stuff (21:44:55) Dunstan: if people change the way they work on the backend as well (21:45:23) Stuart Langridge: you just need a mediator. So instead of "front end calls back end function foo()", you have "front end adds a request for foo() to the queue", and then a separate procedure walks through the queue and does each call in it. (21:45:54) Stuart Langridge: because then "add X to the queue" becomes "load queue.php?js=foo() in an iframe" (21:46:23) Dunstan: too clever for me (21:46:25) Stuart Langridge: but I'm not sure how undo would work exactly, because when you go back you don't want to do action N-1 *again*, you want to undo action N. (21:47:23) Stuart Langridge: it'd be good if I could work it out. (21:47:52) Dunstan: yup :) (21:48:03) Stuart Langridge: I *think* that you either need to make all functions reversible, or you have to insist that every time the front end does a function, it submits that function *and* the reverse of that function to the queue. (21:48:21) Stuart Langridge: So if you wanted to, say, add 5 to a number, you'd submit two things to the queue (21:48:24) Stuart Langridge: n = n + 5 (21:48:27) Stuart Langridge: and n = n - 5 (21:48:32) Stuart Langridge: if you see what I mean. (21:48:37) Dunstan: yeah (21:48:50) Stuart Langridge: But it'd be a bark to have a "reverse" of a function which deletes a database row. (21:49:00) Stuart Langridge: because that data's *gone*. (21:49:32) Stuart Langridge: the reverse of "delete from mytable" is not "insert into mytable". :-) (21:50:01) Dunstan: yeah (21:50:12) Dunstan: that's where i guess you need a wiki-esque thing (21:50:15) Dunstan: to keep track (21:50:45) Stuart Langridge: yep. although then you have the problem that you have to run everything through the wiki backend and store all your data in it, which is no good if you are Amazon.