mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Remote control custom prev + next keycode overrides.
This commit is contained in:
parent
23cad06a17
commit
915a7e8dc1
|
@ -323,6 +323,28 @@ public class SlideshowModel {
|
|||
return (_yOpts != null) ? _yOpts.fetchRemoteControl(params()) : false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return "remote-control-prevkey" defined in PITCHME.yaml.
|
||||
*/
|
||||
public int remoteControlPrevKey() {
|
||||
int prevKeyCode = DEFAULT_PREV_KEYCODE;
|
||||
if(_yOpts != null) {
|
||||
prevKeyCode = _yOpts.fetchRemoteControlPrevKey(params());
|
||||
}
|
||||
return prevKeyCode != 0 ? prevKeyCode : DEFAULT_PREV_KEYCODE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return "remote-control-nextkey" defined in PITCHME.yaml.
|
||||
*/
|
||||
public int remoteControlNextKey() {
|
||||
int nextKeyCode = DEFAULT_NEXT_KEYCODE;
|
||||
if(_yOpts != null) {
|
||||
nextKeyCode = _yOpts.fetchRemoteControlNextKey(params());
|
||||
}
|
||||
return nextKeyCode != 0 ? nextKeyCode : DEFAULT_NEXT_KEYCODE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return "rtl" defined in PITCHME.yaml.
|
||||
*/
|
||||
|
@ -533,6 +555,8 @@ public class SlideshowModel {
|
|||
* Model prefix identifier for cache key generator.
|
||||
*/
|
||||
private static final String MODEL_ID = "SSM:";
|
||||
private static final Integer DEFAULT_PREV_KEYCODE = 37;
|
||||
private static final Integer DEFAULT_NEXT_KEYCODE = 39;
|
||||
private static final String THEME_FONT_DEFAULT =
|
||||
"Source Sans Pro, Helvetica, sans-serif";
|
||||
private static final String THEME_DARK_COLOR_INVERSE = "white";
|
||||
|
|
|
@ -209,6 +209,14 @@ public final class YAMLOptions {
|
|||
return fetchBooleanOption(pp, REMOTE_CONTROL_OPTION);
|
||||
}
|
||||
|
||||
public Integer fetchRemoteControlPrevKey(PitchParams pp) {
|
||||
return fetchIntegerOption(pp, REMOTE_CONTROL_PREVKEY_OPTION);
|
||||
}
|
||||
|
||||
public Integer fetchRemoteControlNextKey(PitchParams pp) {
|
||||
return fetchIntegerOption(pp, REMOTE_CONTROL_NEXTKEY_OPTION);
|
||||
}
|
||||
|
||||
public Boolean fetchRTL(PitchParams pp) {
|
||||
return fetchBooleanOption(pp, RTL_OPTION);
|
||||
}
|
||||
|
@ -369,6 +377,10 @@ public final class YAMLOptions {
|
|||
private static final String AUTOSLIDE_OPTION = "autoslide";
|
||||
private static final String LOOP_OPTION = "loop";
|
||||
private static final String REMOTE_CONTROL_OPTION = "remote-control";
|
||||
private static final String REMOTE_CONTROL_PREVKEY_OPTION =
|
||||
"remote-control-prevkey";
|
||||
private static final String REMOTE_CONTROL_NEXTKEY_OPTION =
|
||||
"remote-control-nextkey";
|
||||
private static final String RTL_OPTION = "rtl";
|
||||
private static final String SHUFFLE_OPTION = "shuffle";
|
||||
private static final String MOUSE_WHEEL_OPTION = "mousewheel";
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
showNotes: @ssm.showNotes(),
|
||||
transition: '@ssm.fetchTransition()',
|
||||
backgroundTransition: '@ssm.fetchTransition()',
|
||||
autoSlide: 0, // autoSlide: @ssm.fetchAutoSlide(false),
|
||||
autoSlide: @ssm.fetchAutoSlide(false),
|
||||
loop: @ssm.fetchLoop(),
|
||||
center: @ssm.fetchVerticalCenter(),
|
||||
rtl: @ssm.fetchRTL(),
|
||||
|
@ -35,7 +35,8 @@
|
|||
config: '@ssm.fetchMathConfig()'
|
||||
},
|
||||
}
|
||||
@if(!(serverPrinting || webPrinting)) {
|
||||
@if(!(serverPrinting || webPrinting ||
|
||||
ssm.fetchAutoSlide(false) > 0)) {
|
||||
menu: {
|
||||
custom: [
|
||||
@if(offline) {
|
||||
|
@ -197,8 +198,8 @@
|
|||
<script>
|
||||
Reveal.configure({
|
||||
keyboard: {
|
||||
37: 'prev',
|
||||
39: 'next'
|
||||
@ssm.remoteControlPrevKey(): 'prev',
|
||||
@ssm.remoteControlNextKey(): 'next'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user