comparison js/core.js @ 2357:66cbd68a4ed0

Fix for #67
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Mon, 16 May 2016 15:06:34 +0100
parents ce406455f25b
children c812d5cc2dc6
comparison
equal deleted inserted replaced
2356:dee115f3efee 2357:66cbd68a4ed0
1042 }; 1042 };
1043 this.advanceState = function(){ 1043 this.advanceState = function(){
1044 if (this.stateIndex == null) { 1044 if (this.stateIndex == null) {
1045 this.initialise(); 1045 this.initialise();
1046 } 1046 }
1047 storage.update(); 1047 if (this.stateIndex > -2) {
1048 storage.update();
1049 }
1048 if (this.stateIndex == -2) { 1050 if (this.stateIndex == -2) {
1049 this.stateIndex++; 1051 this.stateIndex++;
1050 if (this.preTestSurvey != null) 1052 if (this.preTestSurvey != null)
1051 { 1053 {
1052 popup.initState(this.preTestSurvey,storage.globalPreTest); 1054 popup.initState(this.preTestSurvey,storage.globalPreTest);
2988 this.request.open("GET",returnURL+"php/keygen.php?key="+temp_key,true); 2990 this.request.open("GET",returnURL+"php/keygen.php?key="+temp_key,true);
2989 this.request.addEventListener("load",this); 2991 this.request.addEventListener("load",this);
2990 this.request.send(); 2992 this.request.send();
2991 }, 2993 },
2992 update: function() { 2994 update: function() {
2995 if (this.key == null) {
2996 console.log("Cannot save as key == null");
2997 return;
2998 }
2993 this.parent.root.setAttribute("state","update"); 2999 this.parent.root.setAttribute("state","update");
2994 var xmlhttp = new XMLHttpRequest(); 3000 var xmlhttp = new XMLHttpRequest();
2995 var returnURL = ""; 3001 var returnURL = "";
2996 if (typeof specification.projectReturn == "string") { 3002 if (typeof specification.projectReturn == "string") {
2997 if (specification.projectReturn.substr(0,4) == "http") { 3003 if (specification.projectReturn.substr(0,4) == "http") {