fix #116: show device name in browser title

pull/112/merge
Thorsten von Eicken 9 years ago
parent a3772fc0e9
commit 488c9b44e8
  1. 26
      html/ui.js

@ -273,6 +273,7 @@ onLoad(function() {
var v = $("#version"); var v = $("#version");
if (v != null) { v.innerHTML = data.version; } if (v != null) { v.innerHTML = data.version; }
$('title')[0].innerHTML = data["name"];
setEditToClick("system-name", data["name"]); setEditToClick("system-name", data["name"]);
}, function() { setTimeout(getMenu, 1000); }); }, function() { setTimeout(getMenu, 1000); });
}; };
@ -303,19 +304,6 @@ function getWifiInfo() {
//===== System info //===== System info
function setEditToClick(klass, value) {
domForEach($("."+klass), function(div) {
if (div.children.length > 0) {
domForEach(div.children, function(el) {
if (el.nodeName === "INPUT") el.value = value;
else if (el.nodeName !== "DIV") el.innerHTML = value;
});
} else {
div.innerHTML = value;
}
});
}
function showSystemInfo(data) { function showSystemInfo(data) {
Object.keys(data).forEach(function(v) { Object.keys(data).forEach(function(v) {
setEditToClick("system-"+v, data[v]); setEditToClick("system-"+v, data[v]);
@ -366,6 +354,18 @@ function makeAjaxInput(klass, field) {
}); });
} }
function setEditToClick(klass, value) {
domForEach($("."+klass), function(div) {
if (div.children.length > 0) {
domForEach(div.children, function(el) {
if (el.nodeName === "INPUT") el.value = value;
else if (el.nodeName !== "DIV") el.innerHTML = value;
});
} else {
div.innerHTML = value;
}
});
}
//===== Notifications //===== Notifications

Loading…
Cancel
Save