# HG changeset patch # User Brecht De Man # Date 1457602711 -3600 # Node ID 6b2ae5d87a6470a19d8f6b3fc8e895d539cc80b1 # Parent 4594f5ebd758638c66c2af0cb9918e080a0345c0 Merge diff -r 4594f5ebd758 -r 6b2ae5d87a64 core.js --- a/core.js Wed Mar 09 15:44:47 2016 +0000 +++ b/core.js Thu Mar 10 10:38:31 2016 +0100 @@ -351,6 +351,7 @@ if (response.getAttribute("state") == "OK") { var file = response.getElementsByTagName("file")[0]; console.log("Save: OK, written "+file.getAttribute("bytes")+"B"); + popup.popupContent.textContent = "Thank you. Your session has been saved."; } else { var message = response.getElementsByTagName("message"); console.log("Save: Error! "+message.textContent); @@ -1916,6 +1917,7 @@ this.type = undefined; this.schema = specification.schema.getAllElementsByName('surveyentry')[0]; this.id = undefined; + this.name = undefined; this.mandatory = undefined; this.statement = undefined; this.boxsize = undefined; @@ -1971,34 +1973,32 @@ var statement = doc.createElement('statement'); statement.textContent = this.statement; node.appendChild(statement); - switch(this.type) - { - case "statement": - break; - case "question": + if (this.type != "statement") { node.id = this.id; + if (this.name != undefined) { node.setAttribute("name",this.name);} if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);} - if (this.boxsize != undefined) {node.setAttribute("boxsize",this.boxsize);} - break; - case "number": - node.id = this.id; - if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);} - if (this.min != undefined) {node.setAttribute("min", this.min);} - if (this.max != undefined) {node.setAttribute("max", this.max);} - break; - case "checkbox": - case "radio": - node.id = this.id; - for (var i=0; i