mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Added controls-layout setting support.
This commit is contained in:
parent
401dcd2030
commit
19cf18816e
|
@ -265,7 +265,6 @@ public class SlideshowModel {
|
|||
return LOGO_POSITIONS.get(position);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return true if "footnote" defined in PITCHME.yaml.
|
||||
*/
|
||||
|
@ -304,6 +303,25 @@ public class SlideshowModel {
|
|||
YAMLOptions.DEFAULT_TRANSITION;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return "controls-layout" defined in PITCHME.yaml.
|
||||
*/
|
||||
public String fetchControlsLayout() {
|
||||
|
||||
String layout = (_yOpts != null) ?
|
||||
_yOpts.fetchControlsLayout(params()) :
|
||||
YAMLOptions.DEFAULT_CONTROLS_LAYOUT;
|
||||
|
||||
// Auto-relocate controls to 'edges' if logo-position is bottom-right.
|
||||
if(_yOpts != null && hasLogoPosition()) {
|
||||
String position = _yOpts.fetchLogoPosition(params());
|
||||
if(YAMLOptions.DEFAULT_CONTROLS_LAYOUT.equals(position)) {
|
||||
layout = YAMLOptions.EDGES_CONTROLS_LAYOUT;
|
||||
}
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return "autoslide" defined in PITCHME.yaml.
|
||||
*/
|
||||
|
|
|
@ -241,6 +241,16 @@ public final class YAMLOptions {
|
|||
return DEFAULT_TRANSITION;
|
||||
}
|
||||
|
||||
public String fetchControlsLayout(PitchParams pp) {
|
||||
|
||||
String layout = _yProps.get(CONTROLS_LAYOUT_OPTION);
|
||||
|
||||
if (CONTROL_LAYOUTS.contains(layout))
|
||||
return layout;
|
||||
else
|
||||
return DEFAULT_CONTROLS_LAYOUT;
|
||||
}
|
||||
|
||||
public Integer fetchAutoSlide(PitchParams pp) {
|
||||
return fetchIntegerOption(pp, AUTOSLIDE_OPTION);
|
||||
}
|
||||
|
@ -411,6 +421,8 @@ public final class YAMLOptions {
|
|||
public static final String DEFAULT_BG_POSITION = "center";
|
||||
public static final String DEFAULT_BG_REPEAT = " ";
|
||||
public static final String DEFAULT_TRANSITION = "slide";
|
||||
public static final String DEFAULT_CONTROLS_LAYOUT = "bottom-right";
|
||||
public static final String EDGES_CONTROLS_LAYOUT = "edges";
|
||||
public static final String MATHJAX_DEFAULT = "TeX-MML-AM_CHTML";
|
||||
public static final String HIGHLIGHT_DARK_DEFAULT = "github-gist.css";
|
||||
public static final String HIGHLIGHT_LIGHT_DEFAULT = "hybrid.css";
|
||||
|
@ -428,6 +440,7 @@ public final class YAMLOptions {
|
|||
private static final String IMAGE_BG_POSITION_OPTION = "background-position";
|
||||
private static final String IMAGE_BG_REPEAT_OPTION = "background-repeat";
|
||||
private static final String TRANSITION_OPTION = "transition";
|
||||
private static final String CONTROLS_LAYOUT_OPTION = "controls-layout";
|
||||
private static final String AUTOSLIDE_OPTION = "autoslide";
|
||||
private static final String LOOP_OPTION = "loop";
|
||||
private static final String REMOTE_CONTROL_OPTION = "remote-control";
|
||||
|
@ -456,6 +469,8 @@ public final class YAMLOptions {
|
|||
private static final List<String> TRANSITIONS =
|
||||
Arrays.asList("default", "none", "fade", "slide",
|
||||
"convex", "conconcave", "zoom");
|
||||
private static final List<String> CONTROL_LAYOUTS =
|
||||
Arrays.asList("bottom-left", "edges");
|
||||
private static final List<String> MATHJAX_CONFIGS =
|
||||
Arrays.asList("default",
|
||||
"TeX-MML-AM_CHTML", "TeX-MML-AM_HTMLorMML",
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
} else {
|
||||
controls: false,
|
||||
}
|
||||
controlsLayout: '@ssm.fetchControlsLayout()',
|
||||
progress: true,
|
||||
embedded: true,
|
||||
margin: 0.0,
|
||||
|
|
Loading…
Reference in New Issue
Block a user