- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 04 Mar 2009 10:42:59 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/autotest/client In directory hutz:/tmp/cvs-serv26347 Modified Files: buildtest.js Log Message: added <li> with links to all tables Index: buildtest.js =================================================================== RCS file: /sources/public/2002/css-validator/autotest/client/buildtest.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- buildtest.js 3 Mar 2009 22:27:41 -0000 1.2 +++ buildtest.js 4 Mar 2009 10:42:57 -0000 1.3 @@ -72,6 +72,26 @@ return table; } +function generateLinkToTable(tableId) { + var controldiv = document.getElementById("controldiv"); + if (controldiv) { + var divul = controldiv.getElementsByTagName("ul"); + if (divul.length > 0) { + divul = divul[0]; + } else { + divul = document.createElement("ul"); + controldiv.appendChild(divul); + } + var li = document.createElement("li"); + var anc = document.createElement("a"); + anc.setAttribute("href", "#"+tableId); + var tnode = document.createTextNode(tableId); + anc.appendChild(tnode); + li.appendChild(anc); + divul.appendChild(li); + } +} + function getTestTable(typetag) { var tableId = "default"; if (typetag) { @@ -82,6 +102,7 @@ table = createTableFromID(tableId); var tableanchor = document.getElementById("tableanchor"); tableanchor.appendChild(table); + generateLinkToTable(tableId); } // and attach the newly created table at the right place return table;
Received on Wednesday, 4 March 2009 10:43:08 UTC