X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=public%2Fedit_table.js;h=5c8d00dbe7f9058378debdc55393ff31b01f2a1e;hb=9ac1d740a46a578e224c1be1b2f564e264d6463e;hp=67ab62b2fbd95e76c894d27842fc8e8d9ef62d5d;hpb=f604318699230cd8cc72ce207550daa08ffcc5ef;p=MojoFacets.git diff --git a/public/edit_table.js b/public/edit_table.js index 67ab62b..5c8d00d 100644 --- a/public/edit_table.js +++ b/public/edit_table.js @@ -16,24 +16,24 @@ var cell_blur = function() { var x = $(this).parent().attr('cellIndex'); var y = $(this).parent().parent().attr('rowIndex'); - var content = $(this).val(); -// $(this).replaceWith( content ); + var new_content = $(this).val(); +// $(this).replaceWith( new_content ); var name = $('table tr th:nth('+x+') > a').text(); - console.info( x, y, _row_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, content: content + name: name, new_content: new_content } , function(data, textStatus) { console.debug( 'data:', data, 'status:', textStatus ); if ( ! data ) { - data = content; // fallback to submited data for 304 + data = new_content; // fallback to submited data for 304 } else { - if ( $('a.save_changes').length == 0 ) - $('a.changes').before('save') + if ( $('a.save_actions').length == 0 ) + $('a.actions').before('save') } var vals = data.split('¶'); data = vals.join('¶'); @@ -47,14 +47,14 @@ var cell_click = function(event) { , event , $(this).text() ); - var content = $(this).text() // we don't want para markup + var new_content = $(this).text() // we don't want para markup .replace(/^[ \n\r]+/,'') .replace(/[ \n\r]+$/,'') ; -console.debug( 'content', content ); - var rows = content.split('¶').length * 2 + 1; +console.debug( 'new_content', new_content ); + var rows = new_content.split('¶').length * 2 + 1; var textarea = $('