diff --git a/css/main.css b/css/main.css index f082ec2..38977ce 100644 --- a/css/main.css +++ b/css/main.css @@ -780,6 +780,34 @@ header .search form input[type='submit'] { border: none !important; } +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + width: 120px; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + text-transform: none !important; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} + + @media only screen and (min-width: 900px) { } diff --git a/js/tracker.js b/js/tracker.js index 4960c2c..5e3f665 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -1012,6 +1012,11 @@ function habitat_data(jsondata, alternative) { "xdata": "XDATA" }; + var tooltips = { + "burst_timer": "If active, this indicates the time (HH:MM:SS) until the radiosonde will automatically power-off.", + "xdata": "Raw auxiliary data (as hexadecimal) from an external sensor package (often an Ozone sensor)." + } + var hide_keys = { "spam": true, "battery_millivolts": true, @@ -1068,11 +1073,14 @@ function habitat_data(jsondata, alternative) { if (hide_keys[k] === true) continue; - var name = "", suffix = ""; + var name = "", suffix = "", tooltip = ""; if (keys[k] !== undefined) name = keys[k]; else name = guess_name(k); + + if (tooltips[k] !== undefined) + tooltip = tooltips[k]; if (suffixes[k] !== undefined) suffix = suffixes[k]; @@ -1104,7 +1112,11 @@ function habitat_data(jsondata, alternative) { if(typeof alternative == 'boolean' && alternative) { output += "
" + name + ": " + v + suffix + "
"; } else { - output += "
" + v + suffix + "
" + name + "
"; + if (tooltip != "") { + output += "
" + v + suffix + "
" + name + '
🛈' + tooltip + '
'; + } else { + output += "
" + v + suffix + "
" + name + "
"; + } } } return output;