aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-04-01 13:01:29 +0200
committerGitHub <noreply@github.com>2019-04-01 13:01:29 +0200
commit94cbfcbdf62da9a10c5d6c3c90e2e8fc65b8b95b (patch)
tree6a798d92b6c1e21ab08e8e2bf007b23094b2c0a5 /js
parent29ea072ddffdd454b3b00ba02aa650349e949dc4 (diff)
parentbb4eeb6c3ce10528f22269a022d713ce5f5a1841 (diff)
downloadperl-software-in-gnu-guix-94cbfcbdf62da9a10c5d6c3c90e2e8fc65b8b95b.tar
perl-software-in-gnu-guix-94cbfcbdf62da9a10c5d6c3c90e2e8fc65b8b95b.tar.gz
Merge pull request #2326 from earboxer/2313-navigation-mode-shortcuts-table
Allow Navigation Mode setting to change the shortcuts table
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js35
1 files changed, 21 insertions, 14 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 09f3af7..0eebeb6 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -374,20 +374,8 @@
threshold: 40
},
- // Holds information about the keyboard shortcuts
- keyboardShortcuts = {
- 'N , SPACE': 'Next slide',
- 'P': 'Previous slide',
- '&#8592; , H': 'Navigate left',
- '&#8594; , L': 'Navigate right',
- '&#8593; , K': 'Navigate up',
- '&#8595; , J': 'Navigate down',
- 'Home , &#8984;/CTRL &#8592;': 'First slide',
- 'End , &#8984;/CTRL &#8594;': '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 = {};
@@ -1444,6 +1432,25 @@
dom.wrapper.removeAttribute( 'data-navigation-mode' );
}
+
+ if( config.navigationMode === 'linear' ) {
+ keyboardShortcuts['N , SPACE , &#8594; , L , &#8595; , J'] = 'Next slide';
+ keyboardShortcuts['P , &#8592; , H , &#8593; , K'] = 'Previous slide';
+ }
+ else {
+ keyboardShortcuts['N , SPACE'] = 'Next slide';
+ keyboardShortcuts['P'] = 'Previous slide';
+ keyboardShortcuts['&#8592; , H'] = 'Navigate left';
+ keyboardShortcuts['&#8594; , L'] = 'Navigate right';
+ keyboardShortcuts['&#8593; , K'] = 'Navigate up';
+ keyboardShortcuts['&#8595; , J'] = 'Navigate down';
+ }
+ keyboardShortcuts['Home , &#8984;/CTRL &#8592;'] = 'First slide';
+ keyboardShortcuts['End , &#8984;/CTRL &#8594;'] = 'Last slide';
+ keyboardShortcuts['B , .'] = 'Pause';
+ keyboardShortcuts['F'] = 'Fullscreen';
+ keyboardShortcuts['ESC, O'] = 'Slide overview';
+
sync();
}