- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 22 Aug 2010 10:11:01 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec-author-view
In directory hutz:/tmp/cvs-serv19632
Modified Files:
dfn.js patch.anolis style.css
Log Message:
some minor clean-up fixes and code comments for the dfnPanel stuff
Index: patch.anolis
===================================================================
RCS file: /sources/public/html5/spec-author-view/patch.anolis,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- patch.anolis 21 Aug 2010 11:26:44 -0000 1.10
+++ patch.anolis 22 Aug 2010 10:10:59 -0000 1.11
@@ -1,6 +1,6 @@
diff -r 16550726fd0d anolis
--- a/anolis Sun Aug 30 16:53:19 2009 -0500
-+++ b/anolis Sat Aug 21 20:25:39 2010 +0900
++++ b/anolis Sun Aug 22 18:54:43 2010 +0900
@@ -70,10 +70,10 @@
def getOptParser():
@@ -16,7 +16,7 @@
diff -r 16550726fd0d anolislib/processes/filter.py
--- a/anolislib/processes/filter.py Sun Aug 30 16:53:19 2009 -0500
-+++ b/anolislib/processes/filter.py Sat Aug 21 20:25:39 2010 +0900
++++ b/anolislib/processes/filter.py Sun Aug 22 18:54:43 2010 +0900
@@ -5,23 +5,4 @@
return
selector = cssselect.CSSSelector(kwargs["filter"])
@@ -44,8 +44,8 @@
+ element.drop_tree()
diff -r 16550726fd0d anolislib/processes/terms.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/anolislib/processes/terms.py Sat Aug 21 20:25:39 2010 +0900
-@@ -0,0 +1,362 @@
++++ b/anolislib/processes/terms.py Sun Aug 22 18:54:43 2010 +0900
+@@ -0,0 +1,378 @@
+# coding=UTF-8
+# Copyright (c) 2010 Michael(tm) Smith
+#
@@ -167,8 +167,19 @@
+ # heading, we are already listing it in the entry, to
+ # it'd be redundant to be it here too, so we don't
+ if len(dfnParentNode) > 1 and not re.match("^[hH][1-6]$",dfnParentNode.tag):
++ # we just drop all of the text in this parent up to
++ # the first child element, because it's often just
++ # part of phrase like "The foo attribute" or
++ # something, and we don't need that. But, after we
++ # drop it, we don't want the node to end up starting
++ # with no next at all (because it looks odd in our
++ # output), so we replace it with some characters to
++ # indicate that there's something been ellided
+ if not dfnParentNode[0].tag == "dfn":
+ dfnParentNode.text = "*** "
++ # ...except for the case where we know our current
++ # dfn is the first child element, and then we deal
++ # with handling of that a little further down
+ else:
+ dfnParentNode.text = ""
+ dfnParentNode.tag = "span"
@@ -191,6 +202,11 @@
+ descendant.clear()
+ descendant.text = "..."+tail
+ elif descendant == descendants[0]:
++ # if we get here it means that the first dfn
++ # child of this parent node is _not_ our
++ # current dfn, so we use some alternative
++ # characters (other than ellipses) to
++ # indicate that we've ellided something
+ dfnParentNode.text = "*** "
+ if "id" in descendant.attrib:
+ del descendant.attrib["id"]
Index: style.css
===================================================================
RCS file: /sources/public/html5/spec-author-view/style.css,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- style.css 21 Aug 2010 11:26:44 -0000 1.12
+++ style.css 22 Aug 2010 10:10:59 -0000 1.13
@@ -92,9 +92,6 @@
pre .dfnPanel {
white-space: normal;
}
-html.chapter #index-filecontents {
- display: none;
-}
.dfn-excerpt {
font-style: italic;
margin-left: 0;
@@ -104,3 +101,6 @@
overflow:hidden;
display:block;
}
+.dfnPanel .dfn-excerpt {
+ white-space: normal;
+}
Index: dfn.js
===================================================================
RCS file: /sources/public/html5/spec-author-view/dfn.js,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- dfn.js 20 Aug 2010 18:16:57 -0000 1.16
+++ dfn.js 22 Aug 2010 10:10:59 -0000 1.17
@@ -16,9 +16,25 @@
networkStatus.textContent = dots;
if (request.readyState == 4) {
panelDiv.innerHTML = request.responseText;
- if (panelDiv.firstChild.className == "has-norefs") {
- panel.removeChild(panel.firstChild.nextSibling);
- panelDiv.innerHTML = "<p class='norefs'>No references in this document.</p>"
+ var pfc = panelDiv.firstChild;
+ while (pfc && pfc.nodeType != pfc.ELEMENT_NODE) {
+ pfc = pfc.nextSibling;
+ }
+ if (pfc.className == "has-norefs") {
+ var pps = panelDiv.previousSibling;
+ while (pps && pps.nodeType != pps.ELEMENT_NODE) {
+ pps = pps.previousSibling;
+ }
+ panel.removeChild(pps);
+ panelDiv.innerHTML = "<p class='norefs'>No references in this document.</p>";
+ return;
+ }
+ var pfg = pfc.firstChild;
+ while (pfg && pfg.nodeType != pfg.ELEMENT_NODE) {
+ pfg = pfg.nextSibling;
+ }
+ if (pfg.className == "dfn-excerpt") {
+ pfc.removeChild(pfg);
}
}
};
Received on Sunday, 22 August 2010 10:11:03 UTC