- console.info( x, y, pk, id, name, content );
+ console.info( x, y, _row_id, name, new_content );
+
+ var update = $(this);
+
+ $.post( '/data/edit', {
+ path: document.title, _row_id: _row_id,
+ name: name, new_content: new_content
+ } , function(data, textStatus) {
+ console.debug( 'data:', data, 'status:', textStatus );
+ if ( ! data ) {
+ data = new_content; // fallback to submited data for 304
+ } else {
+ if ( $('a.save_actions').length == 0 )
+ $('a.actions').before('<a class=save_actions href="/data/save">save</a>')
+ }
+ var vals = data.split('¶');
+ data = vals.join('<span class=d>¶</span>');
+ update.replaceWith( data );
+ });