projects
/
MojoFacets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
example SQL file with dbi included in comment
[MojoFacets.git]
/
public
/
edit_table.js
diff --git
a/public/edit_table.js
b/public/edit_table.js
index
67ab62b
..
5c8d00d
100644
(file)
--- 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 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();
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,
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 ) {
} , 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 {
} else {
- if ( $('a.save_
change
s').length == 0 )
- $('a.
changes').before('<a class=save_change
s href="/data/save">save</a>')
+ if ( $('a.save_
action
s').length == 0 )
+ $('a.
actions').before('<a class=save_action
s href="/data/save">save</a>')
}
var vals = data.split('¶');
data = vals.join('<span class=d>¶</span>');
}
var vals = data.split('¶');
data = vals.join('<span class=d>¶</span>');
@@
-47,14
+47,14
@@
var cell_click = function(event) {
, event
, $(this).text()
);
, 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]+$/,'')
;
.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 = $('<textarea rows='+rows+'/>');
var textarea = $('<textarea rows='+rows+'/>');
- textarea.val( content );
+ textarea.val(
new_
content );
$(this).html( textarea );
textarea.focus();
textarea.blur( cell_blur )
$(this).html( textarea );
textarea.focus();
textarea.blur( cell_blur )