}
}
+/*
+ hide/show a div
+ */
+function hide_div(divname, hidden) {
+ var div = document.getElementById(divname);
+ if (hidden) {
+ writeDebug("hiding " + divname);
+ div.style.display = "none";
+ } else {
+ writeDebug("unhiding " + divname);
+ div.style.display = "block";
+ }
+}
+
/* unhide the loading div when busy */
loading_counter = 0;
if (busy) {
loading_counter++;
if (loading_counter == 1) {
- document.getElementById("loading").style.display = "block";
+ hide_div("loading", false);
}
} else {
loading_counter--;
if (loading_counter == 0) {
- document.getElementById("loading").style.display = "none";
+ hide_div("loading", true);
}
}
-
}
if (d[0] == undefined) {
writeDebug("unable to load file");
+ /* hide_div("nodata", false); */
loading(false);
return;
}
*/
function show_graphs() {
+ hide_div("nodata", true);
+
heading(3, "Total AC Power (W)");
graph_sum_csv_files("Total AC Power",
</form>
<div id="loading"><font color="red">Loading ....</font></div>
+<div id="nodata"><font color="red">No data available for chosen date</font></div>
<script type="text/javascript">
enableDebug(false);