Browse Source

added help menu

lookup-tables
Stephan Richter 5 years ago
parent
commit
cfd6960375
  1. 2
      pom.xml
  2. 1
      src/main/java/de/srsoftware/web4rail/Constants.java
  3. 10
      src/main/java/de/srsoftware/web4rail/Plan.java

2
pom.xml

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>0.8.3</version>
<version>0.8.4</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

1
src/main/java/de/srsoftware/web4rail/Constants.java

@ -52,4 +52,5 @@ public interface Constants { @@ -52,4 +52,5 @@ public interface Constants {
public static final String TYPE = "type";
public static final String NBSP = "&nbsp;";
public static final String CONTEXT = "context";
public static final String GITHUB_URL = "https://github.com/srsoftware-de/Web4Rail";
}

10
src/main/java/de/srsoftware/web4rail/Plan.java

@ -112,6 +112,7 @@ public class Plan implements Constants{ @@ -112,6 +112,7 @@ public class Plan implements Constants{
private static final String DIRECTION = "direction";
private static final HashMap<OutputStreamWriter,Integer> clients = new HashMap<OutputStreamWriter, Integer>();
private static final String ACTION_QR = "qrcode";
private static final String HELP = "help";
public HashMap<String,Tile> tiles = new HashMap<String,Tile>(); // The list of tiles of this plan, i.e. the Track layout
private HashSet<Block> blocks = new HashSet<Block>(); // the list of tiles, that are blocks
@ -351,6 +352,14 @@ public class Plan implements Constants{ @@ -351,6 +352,14 @@ public class Plan implements Constants{
stream("heartbeat @ "+new Date().getTime());
}
private Tag help() {
Tag help = new Tag("div").clazz("help").content(t("Help"));
Tag list = new Tag("div").clazz("list").content("");
new Tag(HELP).content(t("Online Documentation")).attr("onclick", "window.open('"+GITHUB_URL+"')").addTo(list);
new Tag(HELP).content(t("Report Issue")).attr("onclick", "window.open('"+GITHUB_URL+"/issues')").addTo(list);
return list.addTo(help);
}
/**
* generates a html document of this plan
* @return
@ -429,6 +438,7 @@ public class Plan implements Constants{ @@ -429,6 +438,7 @@ public class Plan implements Constants{
tileMenu().addTo(menu);
trainMenu().addTo(menu);
hardwareMenu().addTo(menu);
help().addTo(menu);
return menu;
}

Loading…
Cancel
Save