W3C home > Mailing lists > Public > public-html-commits@w3.org > August 2010

html5/spec-author-view dfn.js,1.4,1.5

From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 19 Aug 2010 08:29:11 +0000
To: public-html-commits@w3.org
Message-Id: <E1Om0Up-0000qK-LB@lionel-hutz.w3.org>
Update of /sources/public/html5/spec-author-view
In directory hutz:/tmp/cvs-serv3226

Modified Files:
	dfn.js 
Log Message:
updated

Index: dfn.js
===================================================================
RCS file: /sources/public/html5/spec-author-view/dfn.js,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dfn.js	19 Aug 2010 08:07:29 -0000	1.4
+++ dfn.js	19 Aug 2010 08:29:09 -0000	1.5
@@ -1,12 +1,10 @@
 // No copyright is asserted on this file.
-var networkStatus;
+var networkStatus = document.createElement("i");
 function initDfn(node, panelDiv) {
   var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
   request.onreadystatechange = function () {
-    var loading = document.createElement("i");
-    loading.setAttribute("id","network-status");
-    panelDiv.appendChild(loading);
-    networkStatus = document.getElementById('network-status');
+    panelDiv.appendChild(networkStatus);
+    networkStatus.appendChild(document.createTextNode(' '));
     network('loading... ' + request.readyState + '/4');
     if (request.readyState == 4) {
       panelDiv.innerHTML = request.responseText;
@@ -20,16 +18,9 @@
     return -1;
   }
 }
-function network(s, a) {
+function network(s) {
   while (networkStatus.firstChild) networkStatus.removeChild(networkStatus.firstChild);
   networkStatus.appendChild(document.createTextNode(s));
-  if (a) {
-    networkStatus.appendChild(document.createTextNode(' '));
-    var link = document.createElement('a');
-    link.appendChild(document.createTextNode(a));
-    link.href = a;
-    networkStatus.appendChild(link);
-  }
 }
 var dfnPanel;
 document.addEventListener('click', dfnShow, false);
@@ -51,9 +42,9 @@
   if (node.tagName == "DFN") {
     dfnClicked = true;
   }
-  while (node && (node.nodeType != event.target.ELEMENT_NODE || node.tagName == "A" || !node.hasAttribute("id")))
+  while (node && node.parentNode && (node.nodeType != event.target.ELEMENT_NODE || node.tagName == "A" || !node.hasAttribute("id")))
     node = node.parentNode;
-    if (node.tagName == "DFN") {
+    if (node.nodeType == node.ELEMENT_NODE && node.tagName == "DFN") {
       dfnClicked = true;
     }
   var panel = document.createElement('div');
Received on Thursday, 19 August 2010 08:29:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:10:02 UTC