Skip to content

Commit

Permalink
Changes to allow barograph to fit 90% of window size
Browse files Browse the repository at this point in the history
  • Loading branch information
cunimb authored Sep 11, 2017
1 parent 3549390 commit 0dec63c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
3 changes: 3 additions & 0 deletions barogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ function baro_Init() {
Y_min = 0;

baroCanvas = document.getElementById("div_baro");
baroCanvas.height = parseInt(document.getElementById("dbaro").offsetHeight, 10);
baroCtx = baroCanvas.getContext("2d");
baroCtx.fillStyle = "#808080"; // color of text
baroCtx.font = "12px Arial";

baroScale = document.getElementById("div_baroScale");
baroScale.height = parseInt(document.getElementById("dbaro").offsetHeight, 10);
baroScaleCtx = baroScale.getContext("2d");
baroScaleCtx.fillStyle = "#808080"; // color of text
baroScaleCtx.font = "12px Arial";

baroMarker = document.getElementById("div_baroMark");
baroMarker.height = parseInt(document.getElementById("dbaro").offsetHeight, 10);
baroMarkCtx = baroMarker.getContext("2d");
baroMarkCtx.fillStyle = "#808080"; // color of text
baroMarkCtx.font = "12px Arial";
Expand Down
4 changes: 2 additions & 2 deletions cunimb.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ div.divInfoclass {
border-color: black;
border-width: 1px;
border-style: solid;
height: 605px;
/* height: 90%; */
/* height: 605px; */
height: 90%;
width: 155px;
overflow: hidden;
cursor: default;
Expand Down
4 changes: 3 additions & 1 deletion cunimb.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function chstick() { // change altitude stick
function chbaro() { // change barogram
if (document.getElementById('baro').checked === true) { // barogram visible
document.getElementById('dbaro').style.display = "block";
document.getElementById('dbaro').style.visibility = "visible";
barogram = 1;
hashg = "&g=1";
} else { // no barogram
Expand Down Expand Up @@ -579,7 +580,7 @@ function alist() {
document.getElementById('dlist').style.height = "90%";
if (lside == 1) document.getElementById('ac').style.left = "180px";
else document.getElementById('ac').style.right = "180px";
document.getElementById('dbaro').style.display = "block";
if (document.getElementById('baro').checked) document.getElementById('dbaro').style.display = "block";
aflist = true;
afftab();
hashn = "";
Expand Down Expand Up @@ -1876,6 +1877,7 @@ function initialize() {
if (parh.g == "1") {
document.getElementById('baro').checked = true;
document.getElementById('dbaro').style.display = "block";
document.getElementById('dbaro').style.visibility = "visible";
barogram = 1;
hashg = "&g=1";
}
Expand Down
18 changes: 9 additions & 9 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
var cxml1 = "livexml1.php";
var dxml = "dataxml.php";
var rxml = "rec.php";
var tld = "http://live.glidernet.org";
var tld = "http://<?php echo $_SERVER['HTTP_HOST'];?>";
var vlon = <?php echo $lon; ?>;
var vlat = <?php echo $lat; ?>;
var vlatmin = <?php echo $latmin;?>;
Expand Down Expand Up @@ -117,18 +117,18 @@

</head>
<body onload="initialize()">
<div id="popup" onclick="cp('popup');"></div>
<div id="popup" onclick="cp('popup');"></div>
<div id="map_canvas"></div>
<div id="ac" class="acright" onclick="this.style.display='none';"></div>
<div id="dlist" class="lright">
<DIV id="ett1" ></DIV>
<DIV id="ett2" ></DIV>
<DIV id="dtable"></DIV>
<DIV id="ett1" ></DIV>
<DIV id="ett2" ></DIV>
<DIV id="dtable"></DIV>
</div>
<div id="dbaro" class="baroleft" style="display:none">
<canvas id="div_baroScale" height="600" width="45"></canvas>
<canvas id="div_baro" height="600" width="70"></canvas>
<canvas id="div_baroMark" height="600" width="30"></canvas>
<div id="dbaro" class="baroleft" style="display:block; visibility:hidden;">
<canvas id="div_baroScale" width="45" ></canvas>
<canvas id="div_baro" width="70"></canvas>
<canvas id="div_baroMark" width="30" ></canvas>
</div>
</body>

Expand Down

0 comments on commit 0dec63c

Please sign in to comment.