diff options
author | Zach DeCook <zdecook@ccel.org> | 2019-02-19 17:29:07 -0500 |
---|---|---|
committer | Zach DeCook <zdecook@ccel.org> | 2019-02-19 17:29:07 -0500 |
commit | bb4eeb6c3ce10528f22269a022d713ce5f5a1841 (patch) | |
tree | fb5c3ae8c45811b5dcd3a3de248ef3e0f2f206fc /js | |
parent | 1efb8260af1c743713061821633e154602361d54 (diff) | |
download | perl-software-in-gnu-guix-bb4eeb6c3ce10528f22269a022d713ce5f5a1841.tar perl-software-in-gnu-guix-bb4eeb6c3ce10528f22269a022d713ce5f5a1841.tar.gz |
* Keyboard Shortcuts table: Dynamically fill object at configuration
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/js/reveal.js b/js/reveal.js index 237c0c4..6f572b0 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -361,20 +361,8 @@ threshold: 40 }, - // Holds information about the keyboard shortcuts - keyboardShortcuts = { - 'N , SPACE': 'Next slide', - 'P': 'Previous slide', - '← , H': 'Navigate left', - '→ , L': 'Navigate right', - '↑ , K': 'Navigate up', - '↓ , J': 'Navigate down', - 'Home , ⌘/CTRL ←': 'First slide', - 'End , ⌘/CTRL →': 'Last slide', - 'B , .': 'Pause', - 'F': 'Fullscreen', - 'ESC, O': 'Slide overview' - }, + // Holds information about the keyboard shortcuts (filled in on configuration). + keyboardShortcuts = {}, // Holds custom key code mappings registeredKeyBindings = {}; @@ -1386,6 +1374,25 @@ dom.wrapper.removeAttribute( 'data-navigation-mode' ); } + + if( config.navigationMode === 'linear' ) { + keyboardShortcuts['N , SPACE , → , L , ↓ , J'] = 'Next slide'; + keyboardShortcuts['P , ← , H , ↑ , K'] = 'Previous slide'; + } + else { + keyboardShortcuts['N , SPACE'] = 'Next slide'; + keyboardShortcuts['P'] = 'Previous slide'; + keyboardShortcuts['← , H'] = 'Navigate left'; + keyboardShortcuts['→ , L'] = 'Navigate right'; + keyboardShortcuts['↑ , K'] = 'Navigate up'; + keyboardShortcuts['↓ , J'] = 'Navigate down'; + } + keyboardShortcuts['Home , ⌘/CTRL ←'] = 'First slide'; + keyboardShortcuts['End , ⌘/CTRL →'] = 'Last slide'; + keyboardShortcuts['B , .'] = 'Pause'; + keyboardShortcuts['F'] = 'Fullscreen'; + keyboardShortcuts['ESC, O'] = 'Slide overview'; + sync(); } |