Mercurial > hg > index.fcgi > www > www-1
annotate pics3/static/np_keys.js @ 133:41a6e2d99f68
pics3: add blob cache
author | paulo |
---|---|
date | Thu, 03 Feb 2022 06:39:44 -0800 |
parents | |
children |
rev | line source |
---|---|
paulo@124 | 1 function getKeypress(e) { |
paulo@124 | 2 c = null |
paulo@124 | 3 |
paulo@124 | 4 if (e.which == null) |
paulo@124 | 5 c = String.fromCharCode(e.keyCode); // IE |
paulo@124 | 6 else if (e.which != 0 && e.charCode != 0) |
paulo@124 | 7 c = String.fromCharCode(e.which); // All others |
paulo@124 | 8 |
paulo@124 | 9 if (c != null) { |
paulo@124 | 10 if (c == 'n') |
paulo@124 | 11 goHref('next'); |
paulo@124 | 12 else if (c == 'p') |
paulo@124 | 13 goHref('prev'); |
paulo@124 | 14 else if (c == 'u') |
paulo@124 | 15 goHref('up'); |
paulo@124 | 16 } |
paulo@124 | 17 } |
paulo@124 | 18 |
paulo@124 | 19 function goHref(id) { |
paulo@124 | 20 window.location.href = document.getElementById(id).href; |
paulo@124 | 21 } |
paulo@124 | 22 |
paulo@124 | 23 document.onkeypress = getKeypress |