GUI improvements
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>1.2.57</version>
|
||||
<version>1.2.58</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -348,4 +348,28 @@ svg.preview rect{
|
||||
|
||||
svg.Block text{
|
||||
fill: black;
|
||||
}
|
||||
}
|
||||
|
||||
.window > .tabs > legend {
|
||||
float:left;
|
||||
background: lightgray;
|
||||
padding: 5px;
|
||||
border: 1px solid black;
|
||||
border-radius: 5px 5px 0 0;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
.window legend.front{
|
||||
background: white;
|
||||
border-bottom-color: white;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.window fieldset {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
float: none;
|
||||
clear:both;
|
||||
border-radius: 0 5px 5px 5px;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,29 @@ function addTile(x,y){
|
||||
return request({realm:'plan',action:mode,tile:selected.id,x:x,y:y});
|
||||
}
|
||||
|
||||
function arrangeTabs(){
|
||||
var id = 0;
|
||||
var tabs = $('<div/>',{'class':'tabs'});
|
||||
tabs.insertAfter($('.swapbtn'));
|
||||
$('.window > fieldset > legend').each(function(){
|
||||
var fs = this.parentNode;
|
||||
if (!fs.id) fs.id = 'fieldset-'+id;
|
||||
$(this).appendTo(tabs).click(fs.id,clickLegend);
|
||||
if (id > 0) {
|
||||
$(fs).hide();
|
||||
} else $(this).addClass('front');
|
||||
id++;
|
||||
});
|
||||
}
|
||||
|
||||
function clickLegend(ev){
|
||||
var fieldsetId = ev.data;
|
||||
$('.window > .tabs > legend').removeClass('front');
|
||||
$(ev.target).addClass('front');
|
||||
$('.window > fieldset').hide();
|
||||
$('#'+fieldsetId).show();
|
||||
}
|
||||
|
||||
function clickTile(x,y){
|
||||
var id = x+"-"+y;
|
||||
var tiles = $('#'+id);
|
||||
@@ -177,6 +200,7 @@ function request(data){
|
||||
$(BODY).append($(resp));
|
||||
if (isWindow) {
|
||||
tileWindow();
|
||||
arrangeTabs();
|
||||
var win = $('.window');
|
||||
if (win.attr('id')==winId) win.scrollTop(scroll);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ Direction : Richtung
|
||||
Direction\: heading {} : Richtung: nach {}
|
||||
disabled : deaktiviert
|
||||
disable {} : {} deaktivieren
|
||||
Disabled routes using this tile : Deaktivierte Routen, die diesen Abschnitt verwenden
|
||||
disabled routes : deaktivierte Fahrstraßen
|
||||
Display "{}" on {}. : „{}“ auf {} anzeigen.
|
||||
Drop : Verwerfen
|
||||
Dropped destination of {}. : Ziel von {} verworfen.
|
||||
@@ -130,6 +130,7 @@ Length unit : Längeneinheit
|
||||
Locked by {} : Durch {} besetzt
|
||||
Locomotive manager : Lok-Verwaltung
|
||||
Locomotives\: : Lokomotiven:
|
||||
Locomotives and cars : Lokomotiven und Waggons
|
||||
Manage cars : Waggons verwalten
|
||||
Manage locos : Lokomotiven verwalten
|
||||
Manage trains : Züge verwalten
|
||||
@@ -183,6 +184,7 @@ Reversed {}. : {} umgedreht.
|
||||
RIGHT : rechts
|
||||
Right port\: : Port für rechts
|
||||
Route properties : Routen-Eigenschaften
|
||||
Routes : Fahrstraßen
|
||||
Routes using this tile : Fahrstraßen, die diesen Abschnitt verwenden
|
||||
Route will only be available, if all conditions are fulfilled. : Route ist nur verfügbar, wenn alle Bedingungen erfüllt sind.
|
||||
Save : speichern
|
||||
|
||||
@@ -438,6 +438,7 @@ public abstract class BaseClass implements Constants{
|
||||
postForm.forEach(fieldset -> fieldset.addTo(win));
|
||||
|
||||
Fieldset customFields = new Fieldset(t("custom fields"));
|
||||
customFields.attr("id", "custom");
|
||||
|
||||
Form customForm = new Form(CUSTOM_FIELDS);
|
||||
new Input(ACTION, ACTION_UPDATE).hideIn(customForm);
|
||||
|
||||
@@ -84,7 +84,7 @@ public class Route extends BaseClass {
|
||||
private Train train;
|
||||
private boolean aborted = false;
|
||||
private String brakeId;
|
||||
private static final int ENDSPEED = 5;
|
||||
private static final int ENDSPEED = 10;
|
||||
|
||||
public BrakeProcessor(Route route, Train train) {
|
||||
this.train = train;
|
||||
|
||||
@@ -235,7 +235,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
||||
}
|
||||
|
||||
private Tag carList() {
|
||||
Tag locoProp = new Tag("li").content(t("Locomotives and cars:"));
|
||||
Tag locoProp = new Tag("li").content(t("Locomotives and cars")+":");
|
||||
Tag carList = new Tag("ul").clazz("carlist");
|
||||
|
||||
for (Car car : this.cars) {
|
||||
|
||||
@@ -289,7 +289,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
|
||||
|
||||
if (!routes.isEmpty()) {
|
||||
fieldset = new Fieldset(t("Routes using this tile"));
|
||||
fieldset = new Fieldset(t("Routes"));
|
||||
Tag routeList = new Tag("ol");
|
||||
boolean empty = true;
|
||||
for (Route route : routes) {
|
||||
@@ -301,11 +301,11 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
empty = false;
|
||||
}
|
||||
if (!empty) {
|
||||
new Tag("h4").content(t("Routes using this tile")).addTo(fieldset);
|
||||
routeList.addTo(fieldset);
|
||||
postForm.add(fieldset);
|
||||
}
|
||||
|
||||
fieldset = new Fieldset(t("Disabled routes using this tile"));
|
||||
routeList = new Tag("ol");
|
||||
empty = true;
|
||||
for (Route route : routes) {
|
||||
@@ -317,8 +317,8 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
empty = false;
|
||||
}
|
||||
if (!empty) {
|
||||
new Tag("h4").content(t("disabled routes")).addTo(fieldset);
|
||||
routeList.addTo(fieldset);
|
||||
postForm.add(fieldset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user