diff --git a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java index 281c3249535ff1e4804bc6b3b178028e670cc721..560813c41f7cf9ca9ee63af07b50fcc256a5d0c0 100644 --- a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java +++ b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java @@ -41,23 +41,43 @@ public class ConfigurationController extends AbstractController { @Value("${customization.path}") private String customizationPath; + @Value("${mobile.path}") private String mobilePath; + @Value("${presenter.path}") private String presenterPath; + @Value("${links.overlay.url}") private String overlayUrl; + @Value("${links.organization.url}") private String organizationUrl; + @Value("${links.imprint.url}") private String imprintUrl; + @Value("${links.privacy-policy.url}") private String privacyPolicyUrl; - + + @Value("${features.mathjax.enabled:true}") + private String mathJaxEnabled; + + @Value("${features.markdown.enabled:false}") + private String markdownEnabled; + + @Value("${features.question-format.flashcard.enabled:false}") + private String flashcardEnabled; + + @Value("${features.question-format.grid-square.enabled:false}") + private String gridSquareEnabled; + @RequestMapping(value = { "/" }, method = RequestMethod.GET) @ResponseBody - public final HashMap<String, String> getConfiguration(HttpServletRequest request) { - HashMap<String, String> config = new HashMap<String, String>(); + public final HashMap<String, Object> getConfiguration(HttpServletRequest request) { + HashMap<String, Object> config = new HashMap<String, Object>(); + HashMap<String, Boolean> features = new HashMap<String, Boolean>(); + /* The API path could be unknown to the client in case the request was forwarded */ config.put("apiPath", request.getContextPath()); @@ -82,7 +102,14 @@ public class ConfigurationController extends AbstractController { if (!"".equals(privacyPolicyUrl)) { config.put("privacyPolicyUrl", privacyPolicyUrl); } - + + config.put("features", features); + + features.put("mathJax", "true".equals(mathJaxEnabled)); + features.put("markdown", "true".equals(markdownEnabled)); + features.put("flashcard", "true".equals(flashcardEnabled)); + features.put("gridSquare", "true".equals(gridSquareEnabled)); + return config; } } diff --git a/src/main/webapp/arsnova.properties.example b/src/main/webapp/arsnova.properties.example index 9fa91c0b6001648560e0fdf8ca60d7599a149e55..5a0bca24444391e405d3acbeb1051f08c0aa0c42 100644 --- a/src/main/webapp/arsnova.properties.example +++ b/src/main/webapp/arsnova.properties.example @@ -75,3 +75,13 @@ socketio.port=10443 connector.uri=http://localhost:8080/connector-service connector.username=test connector.password=test + +# Enable MathJax to allow the use of Math formulas written in TeX syntax in text fields. +features.mathJax.enabled=true + +# The following features are considered experimental because they have not been +# tested in a production environment over a longer time frame and/or their behavior +# will change in future releases. +features.markdown.enabled=false +features.question-format.flashcard.enabled=false +features.question-format.grid-square.enabled=false diff --git a/src/test/resources/arsnova.properties.example b/src/test/resources/arsnova.properties.example index 9fa91c0b6001648560e0fdf8ca60d7599a149e55..5a0bca24444391e405d3acbeb1051f08c0aa0c42 100644 --- a/src/test/resources/arsnova.properties.example +++ b/src/test/resources/arsnova.properties.example @@ -75,3 +75,13 @@ socketio.port=10443 connector.uri=http://localhost:8080/connector-service connector.username=test connector.password=test + +# Enable MathJax to allow the use of Math formulas written in TeX syntax in text fields. +features.mathJax.enabled=true + +# The following features are considered experimental because they have not been +# tested in a production environment over a longer time frame and/or their behavior +# will change in future releases. +features.markdown.enabled=false +features.question-format.flashcard.enabled=false +features.question-format.grid-square.enabled=false