[WTF CVS] wtf/static tracking.js,1.7,1.8
Brought to you by:
gryphonshafer
|
From: Gryphon S. <gry...@us...> - 2006-11-28 18:47:57
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/static Modified Files: tracking.js Log Message: Changes to support full Table Data administration features Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tracking.js 20 Nov 2006 03:19:12 -0000 1.7 --- tracking.js 28 Nov 2006 18:47:50 -0000 1.8 *************** *** 507,511 **** } ! function editTableData( id, name, parentId, description ) { ! alert("This doesn't work yet. Be patient."); } --- 507,582 ---- } ! var skipEditTableDataFunction = false; ! ! function editTableData( url, table, id, name, ordering, parentId, description ) { ! if (skipEditTableDataFunction) { ! skipEditTableDataFunction = false; ! return; ! } ! ! var originalName = name; ! name = prompt( ! "What name should this " + table + " record have:", ! unescape(name), ! "Name" ! ); ! if ( name == null ) return; ! ! while ( name.length == 0 ) { ! alert("The name of this " + table + " record cannot be blank."); ! name = prompt( ! "What name should this " + table + " record have:", ! unescape(originalName), ! "Name" ! ); ! if ( name == null ) return; ! } ! ! if ( parentId > 0 || parentId == "NULL" ) { ! parentId = prompt( ! "What parent ID number should \"" + name + "\" have:\n" + ! "(Enter \"NULL\" or \"0\" for a null value.)", ! parentId, ! "Parent ID #" ! ); ! if ( parentId == null ) return; ! ! parentId = ( ! parseInt(parentId) == 0 || ! parentId.toLowerCase() == "null" || ! parentId.toLowerCase() == "none" ! ) ? "NULL" : parseInt(parentId); ! if ( isNaN(parentId) ) parentId = "NULL"; ! } ! ! if ( ordering > -1 ) { ! ordering = prompt( ! "What order number should \"" + name + "\" have:", ! ordering, ! "Order #" ! ); ! if ( ordering == null ) return; ! ordering = parseInt(ordering); ! if ( isNaN(ordering) ) ordering = 0; ! } ! ! if ( description != -1 ) { ! description = prompt( ! "What description should \"" + name + "\" have:", ! unescape(description), ! "Description" ! ); ! if ( description == null ) return; ! description = encodeURIComponent(description); ! } ! ! name = encodeURIComponent(name); ! ! document.location.href = url + "?" + ! "table=" + table + "&" + ! "id=" + id + "&" + ! "name=" + name + "&" + ! "ordering=" + ordering + "&" + ! "pid=" + parentId + "&" + ! "description=" + description; } |