From 8da229aa9021f8721ddf327d42db9b2e2571f9b0 Mon Sep 17 00:00:00 2001 From: Brian Monroe Date: Thu, 30 Apr 2020 17:26:08 -0700 Subject: [PATCH 1/2] Adding a setting for the Camera Name --- index.html | 9 ++++++++- js/index.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7d8ee55..ab9d244 100755 --- a/index.html +++ b/index.html @@ -330,6 +330,13 @@ +
+
+ + +
+
+ +
+ + +
diff --git a/js/index.js b/js/index.js index b7c358e..c4fe9a3 100644 --- a/js/index.js +++ b/js/index.js @@ -43,7 +43,7 @@ function run_action (action_url) { type: 'GET', }) .done(function() { - // console.log("success"); + document.getElementById("camName").innerHTML = setCamName(); }) .fail(function(jqXHR, responseText, errorThrown) { // console.log("error"); @@ -191,6 +191,14 @@ function reload_cam () { } } +function reload_name () { + config.name = $('#cam_name').val(); + config.name = config.name; + save_config(); + document.getElementById("camName").innerHTML = setCamName(); + alert("Name Saved."); +} + function adjust_setting (action) { switch (action) { @@ -561,6 +569,12 @@ function clear_active_preset () { $('.preset_button').removeClass("active"); } +function setCamName() { + return config.name; +} + +document.getElementById("camName").innerHTML = setCamName(); + $('body').on('click', '.autopan', function(e) { e.preventDefault(); clear_active_preset(); @@ -623,6 +637,12 @@ $('body').on('click', '.reload_cam', function(e) { return false; }); +$('body').on('click', '.reload_name', function(e) { + e.preventDefault(); + reload_name(); + return false; +}); + $('body').on('mousedown', '.adjust_pantilt', function(e) { e.preventDefault(); stop_autopan();