# HG changeset patch # User Nicholas Jillings # Date 1433507191 -3600 # Node ID a2b30d251f011feecac963149918c5a902cf9586 # Parent 437f826a9a05a4bdf92338f9e1aa8fa627f20a2c Feature #1228: Added survey question box sizes diff -r 437f826a9a05 -r a2b30d251f01 core.js --- a/core.js Fri Jun 05 12:54:52 2015 +0100 +++ b/core.js Fri Jun 05 13:26:31 2015 +0100 @@ -116,6 +116,24 @@ var span = document.createElement('span'); span.textContent = node.question; var textArea = document.createElement('textarea'); + switch (node.boxsize) { + case 'small': + textArea.cols = "20"; + textArea.rows = "1"; + break; + case 'normal': + textArea.cols = "30"; + textArea.rows = "2"; + break; + case 'large': + textArea.cols = "40"; + textArea.rows = "5"; + break; + case 'huge': + textArea.cols = "50"; + textArea.rows = "10"; + break; + } var br = document.createElement('br'); this.popupContent.appendChild(span); this.popupContent.appendChild(br); @@ -1100,7 +1118,7 @@ this.id = element.id; this.name = element.getAttribute('name'); this.text = element.textContent; - } + }; this.type = child.nodeName; if (child.nodeName == "question") { @@ -1109,6 +1127,11 @@ if (child.getAttribute('mandatory') == "true") {this.mandatory = true;} else {this.mandatory = false;} this.question = child.textContent; + if (child.getAttribute('boxsize') == null) { + this.boxsize = 'normal'; + } else { + this.boxsize = child.getAttribute('boxsize'); + } } else if (child.nodeName == "statement") { this.statement = child.textContent; } else if (child.nodeName == "checkbox" || child.nodeName == "radio") { diff -r 437f826a9a05 -r a2b30d251f01 example_eval/project.xml --- a/example_eval/project.xml Fri Jun 05 12:54:52 2015 +0100 +++ b/example_eval/project.xml Fri Jun 05 13:26:31 2015 +0100 @@ -2,7 +2,7 @@ - Please enter your location. + Please enter your location. Check options which are relevant to you