fix #116: show device name in browser title

pull/140/merge
Thorsten von Eicken 9 years ago
parent df2f36b8ef
commit a770d0293d
  1. 26
      html/ui.js

@ -273,6 +273,7 @@ onLoad(function() {
var v = $("#version");
if (v != null) { v.innerHTML = data.version; }
$('title')[0].innerHTML = data["name"];
setEditToClick("system-name", data["name"]);
}, function() { setTimeout(getMenu, 1000); });
};
@ -303,19 +304,6 @@ function getWifiInfo() {
//===== 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) {
Object.keys(data).forEach(function(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

Loading…
Cancel
Save