$("#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
return $.ajax({
url : mctx.api + "bind",
+ type : "POST",
data : {user: username, pass : password}
}).done(function (data) {
if (data.status < 0) {
});
};
+/**
+* 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 */