User:Proteins/unindent.js: Difference between revisions

Content deleted Content added
Proteins (talk | contribs)
fix acknowledgment string
Proteins (talk | contribs)
another step
Line 18:
var DD_element_index = 0;
var num_unindented_DD_elements = 0;
 
var parent_node;
 
// Colors to help sighted people after the unindenting
Line 29 ⟶ 31:
 
indent_level = 0;
 
// Find the parental DL element for this DD node
parent_node = temp_DD_element.parentNode;
if (!parent_node) { continue; }
while (parent_node.nodeName != "DL") {
parent_node = parent_node.parentNode;
if (!parent_node) { break; }
}
if (!parent_node) { continue; }
 
// Check whether that DL element has any DT elements
num_DT_elements = parent_node.getElementsByTagName("DT");
if (num_DT_elements > 0) { continue; } // if so, don't unindent to the higher level
 
} // closes loop over the DD elements of the document