W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2011

html5/spec-author-view jump-indexes.js,NONE,1.1

From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 09 May 2011 05:01:41 +0000
To: public-html-commits@w3.org
Message-Id: <E1QJIbF-0004PB-FB@lionel-hutz.w3.org>
Update of /sources/public/html5/spec-author-view
In directory hutz:/tmp/cvs-serv16913

Added Files:
	jump-indexes.js 
Log Message:
updated

--- NEW FILE: jump-indexes.js ---
var
  jumpIndexAbutton = document.getElementById('jumpIndexA-button'),
  jumpIndexA = document.getElementById('jumpIndexA');
document.addEventListener('click', window.showjumpIndexA , false);
document.addEventListener("keydown", function (e) {
  if (!e) {
    e = window.event;
  }
  var key = e.keyCode ? e.keyCode : e.which;
  if (key === 27 && jumpIndexA) {
    jumpIndexAbutton.firstChild.textContent = "jump";
    jumpIndexA.style.display = "none";
  }
  if (key === 32 || key === 13) {
    window.showjumpIndexA(e);
    if (e.target.id === "jumpIndexA-button") {
      e.preventDefault();
      e.stopPropagation();
      e.returnValue = false;
      e.cancelBubble = true;
      return false;
    }
  }
}, true);
function showjumpIndexA(event) {
  if (jumpIndexA.style.display === "block") {
    jumpIndexA.style.display = "none";
    jumpIndexAbutton.firstChild.textContent = "jump";
  } else {
    jumpIndexA.style.display = "block";
    jumpIndexAbutton.firstChild.textContent = "(ESC to close)";
  }
}
Received on Monday, 9 May 2011 05:01:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 May 2011 05:01:50 GMT