blob: 4e9e446204c9cee5c9fa49bb08244af634ea970e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="OutlineTest.js"></script>
<script>
function performTest()
{
Outline_init();
if (Outline_detectSectionNumbering())
setupOutlineNumbering();
PostponedActions_perform();
var figcaptions = document.getElementsByTagName("figcaption");
// Change figure caption
for (var i = 0; i < figcaptions.length; i++) {
DOM_insertCharacters(figcaptions[i].lastChild,2,"XYZ");
}
// Add another set of references
for (var i = 0; i < figcaptions.length; i++) {
var a = DOM_createElement(document,"A");
DOM_setAttribute(a,"href","#"+figcaptions[i].parentNode.getAttribute("id"));
var p = DOM_createElement(document,"P");
DOM_appendChild(p,a);
DOM_appendChild(document.body,p);
}
PostponedActions_perform();
return Outline_plainText()+PrettyPrinter.getHTML(document.documentElement);
}
</script>
</head>
<body>
<figure id="item1"><figcaption>Figure 9: First figure</figcaption></figure>
<figure id="item2"><figcaption>Figure 9: Second figure</figcaption></figure>
<figure id="item3"><figcaption>Third figure</figcaption></figure>
<figure id="item4"><figcaption>Fourth figure</figcaption></figure>
<p>First ref: Figure <a href="#item1"></a></p>
<p>Second ref: Figure <a href="#item2"></a></p>
<p>Third ref: Figure <a href="#item3"></a></p>
<p>Fourth ref: Figure <a href="#item4"></a></p>
</body>
</html>