- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 19 Aug 2010 08:07:31 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec-author-view In directory hutz:/tmp/cvs-serv1348 Modified Files: dfn.js Log Message: attempt to show a loading indicator Index: dfn.js =================================================================== RCS file: /sources/public/html5/spec-author-view/dfn.js,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dfn.js 19 Aug 2010 07:51:15 -0000 1.3 +++ dfn.js 19 Aug 2010 08:07:29 -0000 1.4 @@ -1,8 +1,13 @@ // No copyright is asserted on this file. - +var networkStatus; 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'); + network('loading... ' + request.readyState + '/4'); if (request.readyState == 4) { panelDiv.innerHTML = request.responseText; } @@ -15,6 +20,17 @@ return -1; } } +function network(s, a) { + 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); document.addEventListener("keyup", function(e) { @@ -43,9 +59,6 @@ var panel = document.createElement('div'); panel.className = 'dfnPanel'; if (node && dfnClicked) { - console.log("success") - console.log(node) - console.log(dfnClicked) var permalinkP = document.createElement('p'); var permalinkA = document.createElement('a'); permalinkA.href = '#' + node.id;
Received on Thursday, 19 August 2010 08:07:33 UTC