diff --git a/js/9.8/buildForm.js b/js/9.8/buildForm.js index 11cd932..4e563e1 100644 --- a/js/9.8/buildForm.js +++ b/js/9.8/buildForm.js @@ -220,17 +220,22 @@ function buildField(obj, form, sidebarList) { if (obj.listCount == 0) { select3 = document.createElement("button"); select3.setAttribute("value", "!none"); - select3.classList.add("w3-button", "w3-grey", "w3-left-align"); + select3.classList.add("w3-button", "w3-grey", "w3-left-align", "w3-padding-16"); select3.id = obj.word.replace(/ /g, "_"); - select3.innerHTML = "Show"; + select3.innerHTML = connectedListsArray[0].word; select3.setAttribute("name", "clM-"+obj.word.replace(/ /g, "_")); select3.setAttribute("data-word", connectedListsArray[0].word); - } + label.innerHTML = ''; + //div.classList.add("w3-center"); + div.classList.replace("w3-flat-silver", "w3-flat-clouds"); + div.appendChild(label); + div.appendChild(select3); + } else { + div.appendChild(label); + div.appendChild(document.createElement("br")); + div.appendChild(select3); + } - div.appendChild(label); - div.appendChild(document.createElement("br")); - - div.appendChild(select3); break; diff --git a/js/9.8/parseTemplate.js b/js/9.8/parseTemplate.js index f639c2a..9e88d67 100644 --- a/js/9.8/parseTemplate.js +++ b/js/9.8/parseTemplate.js @@ -9,10 +9,24 @@ function parseInput(wordArray, objects, i) { //init Word Object var wordObj = {}; + let w = word.substring(1); + + //bugfix if the title of an input has no space in it ex: %test=l:first word;l:second word;%1 + let oneWordFlag = false; + if (word.substring(0, 1) == "%" && word.indexOf('=') != -1) { + oneWordFlag = true; + } + //for loop to escape spaces in simple input - for (let j = i + 1; j < wordArray.length; j++) { - w = w + " " + wordArray[j]; + for (let j = i+1; j < wordArray.length; j++) { + //if title has no space then go back one word to include "=" ex: + if (oneWordFlag) { + j = i; + oneWordFlag = false; + } else { + w = w + " " + wordArray[j]; + } //invoke look for gender specific template i = findGenderSpecificInput(wordArray, wordObj, j); //invoke look for list template diff --git a/template/testing.txt b/template/testing.txt index 82eb39e..985d6fc 100644 --- a/template/testing.txt +++ b/template/testing.txt @@ -2,4 +2,4 @@ #connected list test %Con List Selection=h:Die Patientin ist erwerbstätig:longText:!ls;h:Der Patient ist erwerbstätig auf dem 2. AM:longText:!ls;h: Der Patient ist nicht erwerbstätig:longText:!ls;h:Andere:simpleInput:!ls;%1 #connected list one item test -%Con List Button=h:Lebensmittelpunkt:longText:!ls;%2 +%ConListButton=h:Lebensmittelpunkt:longText;%2