add: populateBranches(productBox); var branchBox = document.getElementById('editform_branch'); var options = branchBox.getElementsByTagName('option'); var found_branch = 0; for (var i=0; i<options.length; i++) { if (options[i].value == subgroup.branch_id.branch_id) { options[i].selected = true; document.getElementById('branch_text').innerHTML = options[i].text; found_branch=1; } else { options[i].selected = false; } } if (found_branch == 0) { document.getElementById('branch_text').innerHTML = '<em>No branch set for this subgroup.</em>'; options[0].selected = true; } 
context: function populateSubgroup(data) {  subgroup=data;  document.getElementById('editform_subgroup_id').value = subgroup.subgroup_id;  document.getElementById('editform_subgroup_id_display').innerHTML = subgroup.subgroup_id;  document.getElementById('editform_name').value = subgroup.name;  document.getElementById('name_text').innerHTML = subgroup.name;  document.getElementById('subgroup_id_display').innerHTML = subgroup.subgroup_id;  var productBox = document.getElementById('product');  var options = productBox.getElementsByTagName('option');    var found_product = 0;  for (var i=0; i<options.length; i++) {    if (options[i].value == subgroup.product_id.product_id) {      options[i].selected = true;      document.getElementById('product_text').innerHTML = options[i].text;      found_product=1;    } else {      options[i].selected = false;    }        }  if (found_product == 0 && options) {    options[0].selected = true;  }  changeProduct();  var testgroups_text = "";  var testgroups_link_text = "";  for (var i in subgroup.testgroups) {    if (subgroup.testgroups[i].name != '') {      testgroups_text = testgroups_text + subgroup.testgroups[i].name + ', ';      testgroups_link_text = testgroups_link_text + '<a target="manage_testgroups" href="manage_testgroups.cgi?testgroup_id=' + subgroup.testgroups[i].testgroup_id + '">'+ subgroup.testgroups[i].name + '</a>, ';    }  }  if (testgroups_text != '') {    testgroups_text = testgroups_text.replace(/, $/g,'');    testgroups_link_text = testgroups_link_text.replace(/, $/g,'');    document.getElementById('testgroups_display').innerHTML = testgroups_text;    document.getElementById('testgroups_link_display').innerHTML = testgroups_link_text;  } else {    document.getElementById('testgroups_display').innerHTML = '<span class="errorHeading">This subgroup does not belong to any testgroups that are currently enabled.</span>';    document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This subgroup does not belong to any testgroups that are currently enabled &rArr;&nbsp;<a target="manage_testgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>';  }  var enabled_em = document.getElementById('editform_enabled')  if (subgroup.enabled == 1) {    enabled_em.checked = true;  } else {    enabled_em.checked = false;  }   document.getElementById('editform_testrunner_group_id').innerHTML = subgroup.testrunner_group_id;  populateAllTestcases();  var selectBoxSubgroup = document.getElementById('editform_subgroup_testcases');  selectBoxSubgroup.options.length = 0;  for (var i=0; i<subgroup.testcases.length; i++) {    var optionText = subgroup.testcases[i].testcase_id + ': ' + subgroup.testcases[i].summary;    selectBoxSubgroup.options[selectBoxSubgroup.length] = new Option(optionText,                                                     subgroup.testcases[i].testcase_id);  }  document.getElementById('editform_div').style.display = 'none';  document.getElementById('subgroup_display_div').style.display = 'block';  enableModeButtons();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/38cc2c83c0a981088028f4bb46905c61fc4ecda5/ManageSubgroups.js/clean/webtools/litmus/js/ManageSubgroups.js