Mercurial > hg > webaudioevaluationtool
comparison test_create/test_core.js @ 2566:172c76d9414b
Survey checkbox now supports min and max to define how many options should be selected #17
| author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
|---|---|
| date | Thu, 08 Sep 2016 16:20:18 +0100 |
| parents | bc6edd2c8772 |
| children | fddfb7c0b4fa |
comparison
equal
deleted
inserted
replaced
| 2565:bc6edd2c8772 | 2566:172c76d9414b |
|---|---|
| 884 urlInput.setAttribute("name","url"); | 884 urlInput.setAttribute("name","url"); |
| 885 urlInput.addEventListener("change",this,false); | 885 urlInput.addEventListener("change",this,false); |
| 886 this.dynamic.appendChild(url); | 886 this.dynamic.appendChild(url); |
| 887 break; | 887 break; |
| 888 case "checkbox": | 888 case "checkbox": |
| 889 var minimum = document.createElement("div"); | |
| 890 var minimumEntry = document.createElement("input"); | |
| 891 var minimumText = document.createElement("span"); | |
| 892 minimumText.textContent = "Minimum: "; | |
| 893 minimum.appendChild(minimumText); | |
| 894 minimum.appendChild(minimumEntry); | |
| 895 minimum.className = "survey-entry-attribute"; | |
| 896 minimumEntry.type = "number"; | |
| 897 minimumEntry.setAttribute("name","min"); | |
| 898 minimumEntry.addEventListener("change",this,false); | |
| 899 minimumEntry.value = this.option.min; | |
| 900 this.dynamic.appendChild(minimum); | |
| 901 | |
| 902 var maximum = document.createElement("div"); | |
| 903 var maximumEntry = document.createElement("input"); | |
| 904 var maximumText = document.createElement("span"); | |
| 905 maximumText.textContent = "Maximum: "; | |
| 906 maximum.appendChild(maximumText); | |
| 907 maximum.appendChild(maximumEntry); | |
| 908 maximum.className = "survey-entry-attribute"; | |
| 909 maximumEntry.type = "number"; | |
| 910 maximumEntry.setAttribute("name","max"); | |
| 911 maximumEntry.addEventListener("change",this,false); | |
| 912 maximumEntry.value = this.option.max; | |
| 913 this.dynamic.appendChild(maximum); | |
| 889 case "radio": | 914 case "radio": |
| 890 this.dynamic.appendChild(id); | 915 this.dynamic.appendChild(id); |
| 891 var optionHolder = document.createElement("div"); | 916 var optionHolder = document.createElement("div"); |
| 892 optionHolder.className = 'node'; | 917 optionHolder.className = 'node'; |
| 893 optionHolder.id = 'popup-option-holder'; | 918 optionHolder.id = 'popup-option-holder'; |
| 1926 this.attributes.push(max); | 1951 this.attributes.push(max); |
| 1927 break; | 1952 break; |
| 1928 case "checkbox": | 1953 case "checkbox": |
| 1929 this.titleDOM.textContent = "Checkbox"; | 1954 this.titleDOM.textContent = "Checkbox"; |
| 1930 var id = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("id")[0]); | 1955 var id = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("id")[0]); |
| 1956 var min = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("min")[0]); | |
| 1957 var max = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("max")[0]); | |
| 1931 this.attributeDOM.appendChild(id.holder); | 1958 this.attributeDOM.appendChild(id.holder); |
| 1932 this.attributes.push(id); | 1959 this.attributes.push(id); |
| 1960 this.attributeDOM.appendChild(min.holder); | |
| 1961 this.attributes.push(min); | |
| 1962 this.attributeDOM.appendChild(max.holder); | |
| 1963 this.attributes.push(max); | |
| 1933 break; | 1964 break; |
| 1934 case "radio": | 1965 case "radio": |
| 1935 this.titleDOM.textContent = "Radio"; | 1966 this.titleDOM.textContent = "Radio"; |
| 1936 var id = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("id")[0]); | 1967 var id = convert.convertAttributeToDOM(this.specification,specification.schema.getAllElementsByName("id")[0]); |
| 1937 this.attributeDOM.appendChild(id.holder); | 1968 this.attributeDOM.appendChild(id.holder); |
