annotate pics/np_keys.js @ 141:df18c9d8857c

myrss2: FEEDS: Add theconversation.com, remove Coding Horror
author paulo
date Sun, 06 Aug 2023 17:34:26 +0000
parents
children
rev   line source
paulo@25 1 function getKeypress(e) {
paulo@25 2 c = null
paulo@25 3
paulo@25 4 if (e.which == null)
paulo@25 5 c = String.fromCharCode(e.keyCode); // IE
paulo@25 6 else if (e.which != 0 && e.charCode != 0)
paulo@25 7 c = String.fromCharCode(e.which); // All others
paulo@25 8
paulo@25 9 if (c != null) {
paulo@25 10 if (c == 'n')
paulo@25 11 goHref('next');
paulo@25 12 else if (c == 'p')
paulo@25 13 goHref('prev');
paulo@25 14 else if (c == 'u')
paulo@25 15 goHref('up');
paulo@25 16 }
paulo@25 17 }
paulo@25 18
paulo@25 19 function goHref(id) {
paulo@25 20 window.location.href = document.getElementById(id).href;
paulo@25 21 }
paulo@25 22
paulo@25 23 document.onkeypress = getKeypress