// Javascript functions needed by the db page.
// Make this class of elements editable
function makeEditable(table, cellclass, imgclass, linkclass) {
// Make all the cells editable
//todo: figure out how to make the tab key commit the current cell and edit the next
$(cellclass).editable('change.php?tab=' + table, {
indicator : "",
type : 'text',
tooltip : 'Click to edit...',
style : 'inherit',
cssclass : 'inherit',
placeholder : ''
// callback : function(value,settings) { alert(dump(settings)); }
});
// Set up rollover and action for red x to delete row
$(imgclass).hover(function() { $(this).attr('src','../images/red-x2.gif'); },
function() { $(this).attr('src','../images/red-x2-light.gif'); }
);
$(linkclass).click(function() {
var tr = $(this).parent().parent();
var rowid = tr.attr('id');
var match = rowid.match(/\d+/);
$.get('change.php?tab=' + table + '&delrow=' + match[0]);
tr.remove();
});
}
// Form a table row to add to the table
function formRow(linenum, numCells, ooe) {
var newrow = '