UI work
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>0.11.9</version>
|
||||
<version>0.11.10</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -15,7 +15,13 @@ button{
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
#plan,
|
||||
#plan{
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#scroll,
|
||||
.window{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
@@ -87,9 +93,9 @@ svg circle{
|
||||
.menu{
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
padding: 10px;
|
||||
bottom: 0;
|
||||
background: rgba(0,0,0,0.1);
|
||||
padding: 10px 0;
|
||||
bottom: 10px;
|
||||
background: rgba(0,0,0,0.5);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -243,6 +249,12 @@ h4,ul{
|
||||
background: #ffb561;
|
||||
}
|
||||
|
||||
.window .disabled{
|
||||
background: red;
|
||||
padding: 3px;
|
||||
display: table;
|
||||
}
|
||||
|
||||
svg.disabled circle,
|
||||
svg.disabled line,
|
||||
svg.disabled polygon,
|
||||
|
||||
@@ -129,13 +129,13 @@ function moveTile(x,y){
|
||||
function place(data){
|
||||
var tag = $(data);
|
||||
$('#'+tag.attr('id')).remove();
|
||||
$(PLAN).append(tag);
|
||||
$('#scroll').append(tag);
|
||||
return false;
|
||||
}
|
||||
|
||||
function planClick(ev){
|
||||
//console.log('planClick:',ev);
|
||||
var plan=$(PLAN).get(0);
|
||||
var plan=$('#scroll').get(0);
|
||||
var x = Math.floor((plan.scrollLeft+ev.clientX)/SQUARE);
|
||||
var y = Math.floor((plan.scrollTop+ev.clientY)/SQUARE);
|
||||
|
||||
@@ -246,4 +246,5 @@ window.onload = function () {
|
||||
$(PLAN).click(planClick);
|
||||
$(document).keyup(keypress);
|
||||
(new EventSource("stream")).onmessage = stream;
|
||||
$('#plan').click(function(){ document.documentElement.requestFullscreen(); });
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
Actions : Aktionen
|
||||
Actions\: : Aktionen:
|
||||
Actions and contacts : Aktionen und Kontakte
|
||||
Action type\: : Aktions-Typ
|
||||
ActivateRoute : Route aktivieren
|
||||
add : hinzufügen
|
||||
Added {} : {} hinzugefügt
|
||||
add action : Aktion hinzufügen
|
||||
add car\: : Waggon hinzufügen:
|
||||
@@ -25,7 +27,6 @@ Conditions : Bedingungen
|
||||
Condition type\: : Bedingungs-Typ:
|
||||
Control unit : Zentrale
|
||||
Current location\: : Aktueller Ort:
|
||||
Actions and contacts : Aktionen und Kontakte
|
||||
[Click here to select block!] : [Hier klicken, um Block auszuwählen!]
|
||||
[Click here to select train!] : [Hier klicken, um Zug auszuwählen!]
|
||||
click here to setup contact : Hier klicken, um Kontakt auszuwählen
|
||||
@@ -33,6 +34,7 @@ click here to setup relay : Hier klicken, um Relais einzurichten
|
||||
Command to send to control unit\: : Kommando, welches zur Zentrale gesendet werden soll:
|
||||
Create action : Aktion erzeugen
|
||||
Current location\: {} : Aufenthaltsort: {}
|
||||
Delay : Verzögerung
|
||||
DelayedAction : verzögerte Aktion
|
||||
delete : entfernen
|
||||
delete route : Route löschen
|
||||
@@ -52,7 +54,7 @@ FreeStartBlock : Start-Block freigeben
|
||||
Hardware settings : Hardware-Einstellungen
|
||||
Height : Höhe
|
||||
Help : Hilfe
|
||||
if ({})\: {} : falls ({}): {}
|
||||
if ({})\: : falls ({}):
|
||||
inverted : invertiert
|
||||
learn : lernen
|
||||
LEFT : links
|
||||
@@ -116,6 +118,7 @@ SOUTH : Süden
|
||||
Started {} : {} gestartet
|
||||
StopAllTrains : Alle Züge stoppen
|
||||
StopAuto : Automatikmodus abschalten
|
||||
{} stopping at next block. : {} hält im nächsten Block.
|
||||
Stopsettings : Halte-Einstellungen
|
||||
Straight port\: : Port für gerade
|
||||
STRAIGHT : gerade
|
||||
@@ -145,9 +148,11 @@ Turn allowed : Wenden erlaubt
|
||||
{} turned. : {} gewendet.
|
||||
Turnouts : Weichen
|
||||
TurnTrain : Fahrtrichtung umkehren
|
||||
turn within train : innerhalb des Zugs drehen
|
||||
Unknown action\: {} : Unbekannte Aktion: {}
|
||||
unset : ungesetzt
|
||||
Wait {} ms, then\: {} : {} ms warten, dann: {}
|
||||
Wait {} ms, then\: : {} ms warten, dann:
|
||||
{} waiting {} secs... : {} wartet {} Sekunden...
|
||||
Was not able to assign {} to {}! : Konnte {} nicht an {} zuweisen!
|
||||
Was not able to lock {} : Konnte {} nicht reservieren
|
||||
Was not able to set all signals! : Konnte nicht alle Signale stellen!
|
||||
|
||||
@@ -355,12 +355,13 @@ public class Plan extends BaseClass{
|
||||
* @throws IOException
|
||||
*/
|
||||
public Page html() throws IOException {
|
||||
Page page = new Page().append("<div id=\"plan\">");
|
||||
Page page = new Page().append("<div id=\"plan\"><div id=\"scroll\">");
|
||||
for (Tile tile: tiles.values()) {
|
||||
if (tile == null) continue;
|
||||
page.append("\t\t"+tile.tag(null)+"\n");
|
||||
}
|
||||
return page
|
||||
.append("</div>")
|
||||
.append(menu())
|
||||
.append(messages())
|
||||
.append(heartbeat())
|
||||
|
||||
@@ -89,7 +89,7 @@ public class DelayedAction extends Action {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return t("Wait {} ms, then: ",delay);
|
||||
return t("Wait {} ms, then:",delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -207,7 +207,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
Tag li = new Tag("li");
|
||||
car.link("span").addTo(li).content(NBSP);
|
||||
Map<String, Object> params = Map.of(REALM,REALM_TRAIN,ID,id,ACTION,ACTION_DROP,CAR_ID,car.id());
|
||||
new Button("delete",params).addTo(li);
|
||||
new Button(t("delete"),params).addTo(li);
|
||||
li.addTo(locoList);
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
Map<String, Object> props = Map.of(REALM,REALM_LOCO,ID,loco.id(),ACTION,ACTION_TURN);
|
||||
new Button(t("turn within train"),props).addTo(li).addTo(locoList);
|
||||
Map<String, Object> params = Map.of(REALM,REALM_TRAIN,ID,id,ACTION,ACTION_DROP,LOCO_ID,loco.id());
|
||||
new Button("delete",params).addTo(li);
|
||||
new Button(t("delete"),params).addTo(li);
|
||||
}
|
||||
|
||||
Tag addLocoForm = new Form().content(t("add locomotive:")+" ");
|
||||
|
||||
@@ -230,7 +230,9 @@ public abstract class Tile extends BaseClass{
|
||||
new Tag("h4").content(t("Length")).addTo(form);
|
||||
new Input(LENGTH,length).numeric().addTo(new Label(t("Length")+":"+NBSP)).addTo(form);
|
||||
new Tag("h4").content(t("Availability")).addTo(form);
|
||||
new Checkbox(DISABLED, t("disabled"), disabled).addTo(form);
|
||||
Checkbox cb = new Checkbox(DISABLED, t("disabled"), disabled);
|
||||
if (disabled) cb.clazz("disabled");
|
||||
cb.addTo(form);
|
||||
new Button(t("Apply"),form).addTo(form);
|
||||
form.addTo(window);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user