- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 06 Aug 2010 12:47:54 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/js In directory hutz:/tmp/cvs-serv31688/js Modified Files: dfn.js jump-indexes.js Log Message: build fix for problems with dfn pop-ups Index: jump-indexes.js =================================================================== RCS file: /sources/public/html5/markup/js/jump-indexes.js,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- jump-indexes.js 5 Aug 2010 07:42:17 -0000 1.7 +++ jump-indexes.js 6 Aug 2010 12:47:52 -0000 1.8 @@ -63,6 +63,12 @@ itemName = "Overview.html"; if (window.location.hash) { var fragID = window.location.hash.substring(1,window.location.hash.length); + var elementName = ""; + if (fragID.indexOf('-') != -1) { + elementName = fragID.substring(0,fragID.indexOf('-')); + } else if (fragID.indexOf('.attrs.') != -1) { + elementName = fragID.substring(0,fragID.indexOf('.attrs.')); + } if (fragID == 'index') { itemName = "index.html"; } @@ -85,6 +91,9 @@ if (document.getElementById('elements').childNodes[i].id == fragID) { itemName = window.location.hash.substring(1,window.location.hash.length) + ".html"; } + if (elementName != "" && document.getElementById('elements').childNodes[i].id == elementName) { + itemName = elementName + ".html" + window.location.hash; + } } } } Index: dfn.js =================================================================== RCS file: /sources/public/html5/markup/js/dfn.js,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- dfn.js 29 Apr 2009 16:17:56 -0000 1.5 +++ dfn.js 6 Aug 2010 12:47:52 -0000 1.6 @@ -90,7 +90,10 @@ ul.appendChild(li); } else { n += 1; - a.appendChild(document.createTextNode('(' + n + ')')); + var span = document.createElement('span'); + span.appendChild(document.createTextNode('[' + n + ']')); + span.setAttribute("class", "index-counter"); + a.appendChild(span); lastLi.appendChild(document.createTextNode(' ')); lastLi.appendChild(a); } @@ -109,9 +112,10 @@ function dfnGetCaption(link) { var node = link; - while (node && node.getAttribute('class')!= "section") { + while (node && (!node.getAttribute('class') || node.getAttribute('class').indexOf("section") == -1)) { node = node.parentNode; - if (node.tagName == "DIV" && node.getAttribute('class') == "section") { +// if (node.tagName == "DIV" && (node.getAttribute('class') == "section" || node.getAttribute('class') == "no-number elementpage section")) { + if (node.tagName == "DIV" && (node.getAttribute('class') && node.getAttribute('class').indexOf("section") != -1)) { return node.childNodes[1]; } }
Received on Friday, 6 August 2010 12:47:55 UTC