2005-10-11 18:44:16 +00:00
|
|
|
var editedtests = new Array();
|
|
|
|
var fields = ["product", "summary", "testgroup", "subgroup",
|
2006-06-15 18:54:15 +00:00
|
|
|
"steps", "results", "admin", "formatting"];
|
2005-10-11 18:44:16 +00:00
|
|
|
|
|
|
|
function MM_findObj(n) {
|
|
|
|
var x = document.getElementById(n);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
function showEdit(testid) {
|
|
|
|
for (var i=0; i<fields.length; i++) {
|
|
|
|
show(getField(fields[i]+"_edit",testid));
|
|
|
|
hide(getField(fields[i]+"_text",testid));
|
|
|
|
}
|
|
|
|
|
|
|
|
hide(getField("editlink", testid));
|
|
|
|
show(getField("canceleditlink", testid));
|
2006-02-07 18:20:53 +00:00
|
|
|
|
|
|
|
document.getElementById("show_test_form").action = "show_test.cgi";
|
|
|
|
|
2005-10-11 18:44:16 +00:00
|
|
|
editedtests.push(testid);
|
|
|
|
}
|
|
|
|
|
|
|
|
function findEdited() {
|
|
|
|
MM_findObj("editingTestcases").value = editedtests.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
function cancelEdit(testid) {
|
|
|
|
for (var i=0; i<fields.length; i++) {
|
|
|
|
hide(getField(fields[i]+"_edit",testid));
|
|
|
|
show(getField(fields[i]+"_text",testid));
|
|
|
|
}
|
|
|
|
|
|
|
|
show(getField("editlink", testid));
|
|
|
|
hide(getField("canceleditlink", testid));
|
|
|
|
|
|
|
|
// remove testid from the editedtests array:
|
|
|
|
var newarray = new Array();
|
|
|
|
for (var i=0; i<editedtests.length; i++) {
|
|
|
|
if (editedtests[i] != testid) {
|
|
|
|
newarray.push(testid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
editedtests=newarray;
|
2006-02-07 18:20:53 +00:00
|
|
|
|
|
|
|
document.getElementById("show_test_form").action = "process_test.cgi";
|
2005-10-11 18:44:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// fields are in the format fieldname_testid
|
|
|
|
function getField(fieldname, testid) {
|
|
|
|
return MM_findObj(fieldname+"_"+testid);
|
|
|
|
}
|
|
|
|
|
|
|
|
function show(obj) {
|
|
|
|
if (obj) {
|
|
|
|
obj.style.display = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide(obj) {
|
|
|
|
if (obj) {
|
|
|
|
obj.style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
2006-06-05 01:22:25 +00:00
|
|
|
|
|
|
|
function tc_init() {
|
|
|
|
if (document.getElementById("testconfig")) {
|
|
|
|
testConfigHeight = new fx.Height('testconfig', {duration: 400});
|
|
|
|
testConfigHeight.toggle();
|
|
|
|
}
|
|
|
|
}
|