Fix another graph bug + some more work on control page
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / static / mctx.gui.js
index 3198055..3130a18 100644 (file)
@@ -25,8 +25,12 @@ mctx.menu = [
     {'text' : 'Help', href : mctx.location + 'help.html'}
 ];
 
-mctx.statusCodes = {
-    STATUS_OK : 1
+mctx.status = {
+    OK : 1,
+    ERROR : -1,
+    UNAUTHORIZED : -2,
+    NOTRUNNING : -3,
+    ALREADYEXISTS : -4
 };
 
 mctx.statusCodesDescription = {
@@ -296,6 +300,14 @@ $.fn.setErrorLog = function () {
     return this;
 };
 
+$.fn.checkStatus = function(data) {
+  if (data.status !== mctx.status.OK) {
+    $(this).text(data.description).addClass("fail");
+    return false;
+  }
+  return true;
+};
+
 $(document).ready(function () {
   //Show the content!
   $("#content").css("display", "block");

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