|
|
@@ -331,6 +331,29 @@ function _update_login_time() {
|
|
|
|
|
|
//------------
|
|
|
|
|
|
+// value is from [0,1]
|
|
|
+//
|
|
|
+function _process_brightness(brightness) {
|
|
|
+
|
|
|
+ // 0 opacity is completely clear, so (1.0) brightness (100% brightness).
|
|
|
+ //
|
|
|
+ var f_brightness = parseFloat(brightness);
|
|
|
+ var opacity = 1.0 - f_brightness;
|
|
|
+
|
|
|
+ // fail
|
|
|
+ //
|
|
|
+ if ((opacity < 0.0) || (opacity > 1.0)) { return {"type":"error", "msg":"opacity out of range"}; }
|
|
|
+
|
|
|
+ var ele = document.getElementById("dim_overlay");
|
|
|
+ ele.style.opacity = opacity;
|
|
|
+
|
|
|
+ ele = document.getElementById("ui_configuration_displaybrightness");
|
|
|
+ ival = Math.floor(f_brightness*100.0);
|
|
|
+ ele.innerHTML = "" + ival + "%";
|
|
|
+}
|
|
|
+
|
|
|
+//------------
|
|
|
+
|
|
|
// volume is from [0,1]
|
|
|
//
|
|
|
function _process_volume(vol) {
|
|
|
@@ -347,6 +370,10 @@ function _slider_change(name) {
|
|
|
ivol = Math.floor(val*100.0);
|
|
|
_api_request("custom", {"function":"volume", "parameter":ivol});
|
|
|
}
|
|
|
+ else if (name == "configuration.brightness") {
|
|
|
+ var val = document.getElementById("ui_configuration_brightness").value;
|
|
|
+ _process_brightness(val);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function _volume_test() {
|
|
|
@@ -1256,9 +1283,14 @@ function _calculate_ui_main_status_width_height() {
|
|
|
return {"n_width": n_w, "n_height":n_h};
|
|
|
}
|
|
|
|
|
|
+function _init_dim_overlay() {
|
|
|
+ var ele = document.getElementById("ui_dim_overlay");
|
|
|
+}
|
|
|
+
|
|
|
function init() {
|
|
|
|
|
|
_init_websocket();
|
|
|
+ _init_dim_overlay();
|
|
|
|
|
|
window.setInterval(_update_display_time, 200);
|
|
|
window.setInterval(_update_login_time, 200);
|