Skip to content

Commit 2312e6e

Browse files
author
Matthew Matz
authored
Merge pull request #6 from parallaxinc/demo
Update local repo
2 parents e51bc83 + 9a7ba48 commit 2312e6e

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

src/main/java/com/parallax/server/blocklyprop/jsp/Properties.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,18 @@ public static boolean isOauthEnabled(String oauthProvider) {
4141
return configuration.getBoolean("oauth." + oauthProvider + ".enabled", true);
4242
}
4343
}
44+
45+
// Use experimental menu items in test environment
46+
public static boolean isExperimentalMenu(Boolean state) {
47+
try {
48+
if (configuration.getBoolean("experimental.menu") == true) {
49+
return true;
50+
}
51+
} catch (java.util.NoSuchElementException ex) {
52+
return false;
53+
}
54+
55+
return false;
56+
}
4457

4558
}

src/main/webapp/WEB-INF/properties.tld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@
2222
<function-class>com.parallax.server.blocklyprop.jsp.Properties</function-class>
2323
<function-signature>boolean isOauthEnabled(java.lang.String)</function-signature>
2424
</function>
25-
</taglib>
25+
26+
<!-- Return flag to indicate if experimental menus are enabled -->
27+
<function>
28+
<name>experimentalmenu</name>
29+
<function-class>com.parallax.server.blocklyprop.jsp.Properties</function-class>
30+
<function-signature>boolean isExperimentalMenu(java.lang.Boolean)</function-signature>
31+
</function>
32+
</taglib>

src/main/webapp/frame/framec.jsp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<%@page contentType="text/html" pageEncoding="UTF-8"%>
22
<%@ include file="/WEB-INF/includes/include.jsp"%>
33

4+
<!-- Support for experimental blocks in Demo builds -->
5+
<!-- See developer notes to use this feature -->
6+
<c:set var="experimental" scope="page" value="${properties:experimentalmenu(false)}" />
7+
48
<html>
59
<head>
610
<meta charset="utf-8">
@@ -606,7 +610,8 @@
606610
</value>
607611
</block>
608612
</category>
609-
613+
<c:choose>
614+
<c:when test="${experimental == true}">
610615
<category name="WX Module">
611616
<category name="Simple">
612617
<block type="wx_init"></block>
@@ -674,6 +679,8 @@
674679
<block type="wx_ip"></block>
675680
</category>
676681
</category>
682+
</c:when>
683+
</c:choose>
677684

678685
<category name="<fmt:message key="category.communicate.xbee" />">
679686
<block type="xbee_setup"></block>
@@ -949,6 +956,9 @@
949956
<category name="<fmt:message key="category.sensor-input.ping" />">
950957
<block type="sensor_ping"></block>
951958
</category>
959+
960+
<c:choose>
961+
<c:when test="${experimental == true}">
952962
<category name="<fmt:message key="category.sensor-input.fingerprint" />">
953963
<block type="fp_scanner_init"></block>
954964
<block type="fp_scanner_add">
@@ -960,6 +970,9 @@
960970
</block>
961971
<block type="fp_scanner_scan"></block>
962972
</category>
973+
</c:when>
974+
</c:choose>
975+
963976
<category name="<fmt:message key="category.sensor-input.hmc5883l" />">
964977
<block type="HMC5883L_init"></block>
965978
<block type="HMC5883L_read"></block>

0 commit comments

Comments
 (0)