[Debian-iot-packaging] [openzwave-controlpanel] 27/81: Add new notification. Minor UI adjustment. Update javascript for modern AJAX.

Dara Adib daradib-guest at moszumanska.debian.org
Thu Dec 22 16:57:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.

commit c728e9067265a303f3e03c1b1918c62ea357fe92
Author: glsatz at gmail.com <glsatz at gmail.com>
Date:   Sat Nov 10 08:17:07 2012 +0000

    Add new notification.
    Minor UI adjustment.
    Update javascript for modern AJAX.
---
 cp.html   |  7 ++++---
 cp.js     | 44 +++++++++++---------------------------------
 ozwcp.cpp | 11 ++++++++++-
 3 files changed, 25 insertions(+), 37 deletions(-)

diff --git a/cp.html b/cp.html
index cb533d5..30c25f7 100644
--- a/cp.html
+++ b/cp.html
@@ -225,8 +225,8 @@
 	      </table>
 	    </div>
 	  </div>
-	  <div id="topocntl" name="topocntl" class="rsb" style="display: none; margin-right: 10px;">
-	    <div class="rsb" style="margin-left: 10px;">
+	  <div id="topocntl" name="topocntl" class="rsb" style="display: none; margin-right: 5px;">
+	    <div class="rsb" style="margin-left: 5px;">
 	      <button id="refreshtopo" name="refreshtopo" onclick="return TopoLoad('load');" type="submit">Refresh</button>
 	    </div>
 	  </div>
@@ -234,7 +234,8 @@
 	    <span id="netinfo" name="netinfo" class="admmsg" style="display: none;"></span>
 	  </div>
 	  <br>
-	  <div id="topo" style="float: left; width: 65%; display: none;"><br><br>
+	  <br>
+	  <div id="topo" style="float: left; margin-left: 5px; width: 98%; display: none; overflow="scroll";">
 	    <table border="0" cellpadding="1" cellspacing="0" style="text-align: center;">
 	      <thead id="topohead">
 		<tr>
diff --git a/cp.js b/cp.js
index 39ae28d..8b6c541 100644
--- a/cp.js
+++ b/cp.js
@@ -479,10 +479,8 @@ function DoValue(id)
     } else {
       posthttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
-    posthttp.open('POST','valuepost.html',false);
+    posthttp.open('POST','valuepost.html', true);
     posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-    posthttp.setRequestHeader("Content-length", params.length);
-    posthttp.setRequestHeader("Connection", "close");
     posthttp.send(params);
   }
   return false;
@@ -504,10 +502,8 @@ function DoButton(id,pushed)
     } else {
       posthttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
-    posthttp.open('POST','buttonpost.html',false);
+    posthttp.open('POST','buttonpost.html', true);
     posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-    posthttp.setRequestHeader("Content-length", params.length);
-    posthttp.setRequestHeader("Connection", "close");
     posthttp.send(params);
   }
   return false;
@@ -529,10 +525,8 @@ function DoDevPost(fun)
     } else {
       posthttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
-    posthttp.open('POST','devpost.html',false);
+    posthttp.open('POST','devpost.html', true);
     posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-    posthttp.setRequestHeader("Content-length", params.length);
-    posthttp.setRequestHeader("Connection", "close");
     posthttp.send(params);
     if (fun == 'close') {
       document.DevPost.devname = '';
@@ -618,10 +612,8 @@ function DoAdmPost(can)
   } else {
     posthttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
-  posthttp.open('POST','admpost.html',false);
+  posthttp.open('POST','admpost.html', true);
   posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  posthttp.setRequestHeader("Content-length", params.length);
-  posthttp.setRequestHeader("Connection", "close");
   posthttp.send(params);
   if (fun == 'remc' || fun == 'remd') {
     document.getElementById('divconfigcur').innerHTML = '';
@@ -718,10 +710,8 @@ function DoNodePost(val)
   } else {
     posthttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
-  posthttp.open('POST','nodepost.html',false);
+  posthttp.open('POST','nodepost.html', true);
   posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  posthttp.setRequestHeader("Content-length", params.length);
-  posthttp.setRequestHeader("Connection", "close");
   posthttp.send(params);
   return false;
 }
@@ -790,10 +780,8 @@ function DoGrpPost()
   } else {
     posthttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
-  posthttp.open('POST','grouppost.html',false);
+  posthttp.open('POST','grouppost.html', true);
   posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  posthttp.setRequestHeader("Content-length", params.length);
-  posthttp.setRequestHeader("Connection", "close");
   posthttp.send(params);
 
   return false;
@@ -830,10 +818,8 @@ function DoPollPost()
   } else {
     posthttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
-  posthttp.open('POST','pollpost.html',false);
+  posthttp.open('POST','pollpost.html', true);
   posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  posthttp.setRequestHeader("Content-length", params.length);
-  posthttp.setRequestHeader("Connection", "close");
   posthttp.send(params);
 
   return false;
@@ -848,10 +834,8 @@ function DoSavePost()
   } else {
     posthttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
-  posthttp.open('POST','savepost.html',false);
+  posthttp.open('POST','savepost.html', true);
   posthttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  posthttp.setRequestHeader("Content-length", params.length);
-  posthttp.setRequestHeader("Connection", "close");
   posthttp.send(params);
 
   return false;
@@ -969,11 +953,9 @@ function SceneLoad(fun)
     params=params+'&id='+curscene+'&vid='+vals[0]+'-'+vals[1]+'-'+vals[2]+'-'+vals[3]+'-'+vals[4]+'-'+vals[5];
     DisplaySceneSceneValue(null);
   }
-  scenehttp.open('POST','scenepost.html',false);
+  scenehttp.open('POST','scenepost.html', true);
   scenehttp.onreadystatechange = SceneReply;
   scenehttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  scenehttp.setRequestHeader("Content-length", params.length);
-  scenehttp.setRequestHeader("Connection", "close");
   scenehttp.send(params);
 
   return false;
@@ -1145,11 +1127,9 @@ function DisplaySceneSceneValue(opt)
 function TopoLoad(fun)
 {
   var params='fun='+fun;
-  topohttp.open('POST','topopost.html',false);
+  topohttp.open('POST','topopost.html', true);
   topohttp.onreadystatechange = TopoReply;
   topohttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  topohttp.setRequestHeader("Content-length", params.length);
-  topohttp.setRequestHeader("Connection", "close");
   topohttp.send(params);
 
   return false;
@@ -1210,11 +1190,9 @@ function TopoReply()
 function RequestAllConfig(n)
 {
   var params='fun=racp&node='+n;
-  racphttp.open('POST','confparmpost.html',false);
+  racphttp.open('POST','confparmpost.html', true);
   racphttp.onreadystatechange = PollReply;
   racphttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-  racphttp.setRequestHeader("Content-length", params.length);
-  racphttp.setRequestHeader("Connection", "close");
   racphttp.send(params);
 
   return false;
diff --git a/ozwcp.cpp b/ozwcp.cpp
index d5982c2..bad6453 100644
--- a/ozwcp.cpp
+++ b/ozwcp.cpp
@@ -464,6 +464,15 @@ void OnNotification (Notification const* _notification, void* _context)
     nodes[_notification->GetNodeId()]->saveValue(id);
     pthread_mutex_unlock(&nlock);
     break;
+  case Notification::Type_ValueRefreshed:
+    Log::Write(LogLevel_Info, "Notification: Value Refreshed Home 0x%08x Node %d Genre %s Class %s Instance %d Index %d Type %s",
+	       _notification->GetHomeId(), _notification->GetNodeId(),
+	       valueGenreStr(id.GetGenre()), cclassStr(id.GetCommandClassId()), id.GetInstance(),
+	       id.GetIndex(), valueTypeStr(id.GetType()));
+    pthread_mutex_lock(&nlock);
+    nodes[_notification->GetNodeId()]->setChanged(true);
+    pthread_mutex_unlock(&nlock);
+    break;
   case Notification::Type_Group:
     {
       Log::Write(LogLevel_Info, "Notification: Group Home 0x%08x Node %d Group %d",
@@ -672,7 +681,7 @@ int32 main(int32 argc, char* argv[])
   for (i = 0; i < MAX_NODES; i++)
     nodes[i] = NULL;
 
-  Options::Create("./config/", "", "--SaveConfiguration=true");
+  Options::Create("./config/", "", "--SaveConfiguration=true --DumpTriggerLevel=0");
   Options::Get()->Lock();
 
   Manager::Create();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git



More information about the Debian-iot-packaging mailing list