Alright, here's the code that can be put in the ACA Pair footer:
<script>
$(document).ready(function(){
var cond1 = setAcaConditionalText(1);
var cond2 = setAcaConditionalText(2);
if (cond1 !== '' || cond2 !== '') {
// Stretch middle column
var rowspan = parseInt($('.acapair .acapair_table > tbody > tr:first-child > td:nth-child(2)').attr('rowspan'));
$('.acapair .acapair_table > tbody > tr:first-child > td:nth-child(2)').attr('rowspan', rowspan + 1);
// Determine alternating colors
var leftColor = $('.left_concept').first().hasClass('alt_color1') ? 'alt_color1' : 'alt_color2';
var rightColor = $('.right_concept').first().hasClass('alt_color1') ? 'alt_color1' : 'alt_color2';
// Append new row
$('.acapair .acapair_table > tbody').append(`
<tr>
<td class="level_text_cell left_concept ` + leftColor + `" width="45%">
<div class="level_text">
` + cond1 + `
</div>
</td>
<td class="level_text_cell right_concept ` + rightColor + `" width="45%">
<div class="level_text">
` + cond2 + `
</div>
</td>
</tr>
`);
}
})
function setAcaConditionalText(pair) {
var attr1 = getAcaLevel(pair, 1);
var attr2 = getAcaLevel(pair, 2);
if (attr1 == 'att 1 - lev 1' && attr2 == 'att 2 - lev 1') {
return 'text 1';
}
if (attr1 == 'att 1 - lev 2' && attr2 == 'att 2 - lev 2') {
return 'text 2';
}
if (attr1 == 'att 1 - lev 3' && attr2 == 'att 2 - lev 3') {
return 'text 3';
}
return '';
}
function getAcaLevel(pair, attr) {
var td = (pair == 2 && attr == 1) ? 3 : pair;
return $('.acapair .acapair_table > tbody > tr:nth-child(' + attr + ') > td:nth-child(' + td + ') .level_text').text().trim();
}
</script>
Currently, this code reads the first and second attributes, then sets the conditional text to "text 1," "text 2", or "text 3" under certain circumstances. You can adjust this to meet your needs by modifying the region from line 34 to line 45.