mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
3de084e41b
- fix single result submission, but still require that a user be logged in to submit a result Misc: - move testcase updating into show_tests.cgi from process_test.cgi - display all testcase info when editing tests (admin only) - can no longer edit testcase and submit results at the same time - add author info to testcases (Test.pm) - add extra checking to silence log errors originating from single_result.cgi and Litmus::DB::User::getDisplayName - update Litmus version number and last_updated field when editing testcases - use same testcase interface for viewing testcases and running testcases (test.html.tmpl)
65 lines
1.5 KiB
JavaScript
Executable File
65 lines
1.5 KiB
JavaScript
Executable File
var editedtests = new Array();
|
|
var fields = ["product", "summary", "testgroup", "subgroup",
|
|
"steps", "results", "admin"];
|
|
|
|
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));
|
|
|
|
document.getElementById("show_test_form").action = "show_test.cgi";
|
|
|
|
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;
|
|
|
|
document.getElementById("show_test_form").action = "process_test.cgi";
|
|
}
|
|
|
|
// 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";
|
|
}
|
|
}
|