X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=1b1f05d5ca4e1ec8f6f39ad54f56453991dd8198;hp=b196a68f846dbe3222b3309ac46f4066735daedb;hb=a8c8bd8ee5c29db5512230eaeb65e44794e21b89;hpb=5bc350814a9426a89e8ab06728badad9430d4015 diff --git a/phpfspot.js b/phpfspot.js index b196a68..1b1f05d 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -160,10 +160,12 @@ function AskServerWhatToDo() return HTML_AJAX.grab(encodeURI('rpc.php?action=what_to_do')); } -function init_phpfspot() +function init_phpfspot(mode) { + /* always load list of available tags */ refreshAvailableTags(); + /* ask the server what we are currently displaying */ whattodo = AskServerWhatToDo(); if(whattodo == 'showpi' || whattodo == 'showpi_date') { @@ -179,7 +181,7 @@ function init_phpfspot() refreshSelectedTags(); } } -} +} // init_phpfspot() function setBackGrdColor(item, color) { @@ -416,6 +418,38 @@ function update_sort_order(obj) } // update_sort_order() +function keyDown(e) { + var evt = (e) ? e:(window.event) ? window.event:null; + + if(evt) { + var key = (evt.charCode) ? evt.charCode : + ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0)); + + + if(key == 37) /* left curosr */ { + if(document.getElementById('prev_link')) { + var prev_link = document.getElementById('prev_link').href; + window.location.href = prev_link; + } + return; + } + if(key == 38) /* up cursor */ { + } + if(key == 39) /* right curosr */ { + if(document.getElementById('next_link')) { + var next_link = document.getElementById('next_link').href; + window.location.href = next_link; + } + return; + } + } +} + +document.onkeydown=keyDown; +if(document.layers) { + document.captureEvents(Event.KEYDOWN); +} + var startup = 1; var calendar_shown = 0; var calendar_mode = '';