implemented storing of tiling layout on device
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.srsoftware</groupId>
|
<groupId>de.srsoftware</groupId>
|
||||||
<artifactId>web4rail</artifactId>
|
<artifactId>web4rail</artifactId>
|
||||||
<version>0.6.8</version>
|
<version>0.6.9</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ function fadeMessage(){
|
|||||||
$('#messages').css('opacity',o/OPAC);
|
$('#messages').css('opacity',o/OPAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCookie(key) {
|
||||||
|
var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
|
||||||
|
return keyValue ? keyValue[2] : null;
|
||||||
|
}
|
||||||
|
|
||||||
function heartbeat(data){
|
function heartbeat(data){
|
||||||
$('#heartbeat').show().fadeOut(2000);
|
$('#heartbeat').show().fadeOut(2000);
|
||||||
return false;
|
return false;
|
||||||
@@ -162,12 +167,9 @@ function request(data){
|
|||||||
$(PLAN).append($(resp));
|
$(PLAN).append($(resp));
|
||||||
} else if (resp.startsWith('<')) {
|
} else if (resp.startsWith('<')) {
|
||||||
var isWindow = $(resp).attr('class') == 'window';
|
var isWindow = $(resp).attr('class') == 'window';
|
||||||
if (isWindow){
|
if (isWindow) $('.window').remove();
|
||||||
$('.window').remove();
|
$(BODY).append($(resp));
|
||||||
$('#plan').css('height','50%');
|
if (isWindow) tileWindow();
|
||||||
}
|
|
||||||
$(BODY).append($(resp));
|
|
||||||
$('.window').css('height','50%');
|
|
||||||
} else {
|
} else {
|
||||||
addMessage(resp);
|
addMessage(resp);
|
||||||
}
|
}
|
||||||
@@ -202,15 +204,18 @@ function stream(ev){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function swapTiling(ev){
|
function swapTiling(ev){
|
||||||
if ($('.swapbtn').text() == '◧'){
|
var vertical = getCookie("tiling") == 'v';
|
||||||
$('.swapbtn').text('⬒');
|
document.cookie = "tiling="+(vertical?'h':'v');
|
||||||
$('.window').css('height','').css('width','50%');
|
tileWindow();
|
||||||
$(PLAN).css('height','').css('width','50%');
|
}
|
||||||
} else {
|
|
||||||
$('.swapbtn').text('◧');
|
function tileWindow(){
|
||||||
$('.window').css('height','50%').css('width','');
|
var vertical = getCookie("tiling") == 'v';
|
||||||
$(PLAN).css('height','50%').css('width','');
|
var width = vertical ? '50%':'';
|
||||||
}
|
var height = vertical ? '' : '50%';
|
||||||
|
$(PLAN).css('width',width).css('height',height);
|
||||||
|
$('.window').css('width',width).css('height',height);
|
||||||
|
$('.swapbtn').text(vertical ? '⇩' : '⇨');
|
||||||
}
|
}
|
||||||
|
|
||||||
function train(id,action){
|
function train(id,action){
|
||||||
|
|||||||
Reference in New Issue
Block a user