Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2972:1ba905b737aa
#262 SessionKey refactoring issues
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 12 Jan 2018 13:22:32 +0000 |
parents | d962cce75063 |
children | 2d39ee05a5dc |
comparison
equal
deleted
inserted
replaced
2971:d962cce75063 | 2972:1ba905b737aa |
---|---|
3755 throwerror(); | 3755 throwerror(); |
3756 } | 3756 } |
3757 if (xml.getElementsByTagName("state").length > 0) { | 3757 if (xml.getElementsByTagName("state").length > 0) { |
3758 if (xml.getElementsByTagName("state")[0].textContent == "OK") { | 3758 if (xml.getElementsByTagName("state")[0].textContent == "OK") { |
3759 sessionKey = xml.getAllElementsByTagName("key")[0].textContent; | 3759 sessionKey = xml.getAllElementsByTagName("key")[0].textContent; |
3760 this.parent.root.setAttribute("key", this.key); | 3760 parent.root.setAttribute("key", sessionKey); |
3761 this.parent.root.setAttribute("state", "empty"); | 3761 parent.root.setAttribute("state", "empty"); |
3762 this.update(); | |
3763 return (true); | 3762 return (true); |
3764 } else if (xml.getElementsByTagName("state")[0].textContent == "ERROR") { | 3763 } else if (xml.getElementsByTagName("state")[0].textContent == "ERROR") { |
3765 sessionKey = null; | 3764 sessionKey = null; |
3766 console.error("Could not generate server key. Server responded with error message: \"" + xml.getElementsByTagName("message")[0].textContent + "\""); | 3765 console.error("Could not generate server key. Server responded with error message: \"" + xml.getElementsByTagName("message")[0].textContent + "\""); |
3767 return (false); | 3766 return (false); |