Show
Ignore:
Timestamp:
05/21/07 08:51:36 (18 months ago)
Author:
mbonetti
Message:

Added: shift-m (mark all shown items as read)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/plugins/keyboardnavigation.php

    r1713 r1714  
    2424 
    2525/// Name: Keyboard naviation 
    26 /// Author: Marco Bonetti 
     26/// Author: Marco Bonetti & Chris J. Friesen 
    2727/// Description: Navigate between items without using your mouse. 
    2828/// Version: 0.4 
     
    5757        '__kbnav_ToggleFlag' => 'Toggle Flagged state of the current item', 
    5858        '__kbnav_NextMarkRead' => 'Mark current item as read, move to the next one', 
     59        '__kbnav_MarkAllRead' => 'Mark all shown items as read', 
    5960        '__kbnav_ScrollTop' => 'Scroll to the top of the window', 
    6061        '__kbnav_ToggleCollapse' => 'In the Lilina theme, toggle the collapsed state of the current item', 
     
    7374    if (!isset($kmap['__kbnav_ToggleFlag']['key'])) {$kmap['__kbnav_ToggleFlag']['key'] = 'f';} 
    7475    if (!isset($kmap['__kbnav_NextMarkRead']['key'])) {$kmap['__kbnav_NextMarkRead']['key'] = 'm';} 
     76    if (!isset($kmap['__kbnav_MarkAllRead']['key'])) { 
     77        $kmap['__kbnav_MarkAllRead']['key'] = 'm'; 
     78        $kmap['__kbnav_MarkAllRead']['modifier'] = 'shift'; 
     79    }    
    7580    if (!isset($kmap['__kbnav_ScrollTop']['key'])) {$kmap['__kbnav_ScrollTop']['key'] = 'h';} 
    7681    if (!isset($kmap['__kbnav_ToggleCollapse']['key'])) {$kmap['__kbnav_ToggleCollapse']['key'] = 'c';} 
     
    342347        return false; 
    343348    } 
     349    function __kbnav_MarkAllRead() { 
     350        var forms = document.getElementsByTagName('form'); 
     351        for(var i=0;i<forms.length;i++) { 
     352            if (forms[i].className == 'markReadForm') { 
     353                forms[i].submit(); 
     354                break; 
     355            } 
     356        } 
     357        return false; 
     358    } 
    344359     
    345360<?php