# HG changeset patch # User Brecht De Man # Date 1457602711 -3600 # Node ID e4b37846858910ac9797c5a2271a8023cca59a9a # Parent cfbd8ff107572ad6c69313cd822146376f510e74 Merge diff -r cfbd8ff10757 -r e4b378468589 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