Attempt to get image streaming page back from the dead (untested).
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / static / mctx.gui.js
index 1007510..1c3eb1f 100644 (file)
@@ -138,6 +138,10 @@ function runBeforeLoad(isLoginPage) {
 
           $("#logout").click(function () {
             $("#logout").logout();
+          });\r
+          \r
+          $("#change-password").click(function () {\r
+            window.open("users/user_change_details.php");\r
           });
           
           //Enable the error log, if present
@@ -186,6 +190,7 @@ $.fn.login = function () {
 
     return $.ajax({
         url : mctx.api + "bind",
+        type : "POST",
         data : {user: username, pass : password}
     }).done(function (data) {
         if (data.status < 0) {
@@ -222,6 +227,40 @@ $.fn.logout = function () {
     });
 };
 
+/**
+* Sets the camera autoupdater
+* Obsolete?
+* @returns {$.fn}
+*/
+$.fn.setCamera = function () {
+  var url = mctx.api + "image"; //http://beaglebone/api/image
+  var update = true;
+
+  //Stop updating if we can't retrieve an image!
+  this.error(function() {
+    update = false;
+  });
+  
+  var parent = this;
+  
+  var updater = function() {
+    if (!update) {
+      parent.parent().text("Cam fail");
+      parent.attr("src", "");
+      return;
+    }
+    
+    parent.attr("src", url + "#" + (new Date()).getTime());
+    
+    setTimeout(updater, 2000);
+  };
+  
+  updater();
+  return this;
+};
+
+
+
 /**
 * Sets the error log to continuously update.
 * @returns itself */

UCC git Repository :: git.ucc.asn.au