# HG changeset patch # User Nicholas Jillings # Date 1448443625 0 # Node ID 1b6fa37d46a44748e74eb870e5e856f0e6fe7d46 # Parent 3b0770e1e616f736d817e53c9cf040962c80c940# Parent 8fb8f3c1acf8dd26a4d070d11bfcd978fe921ac5 Merge diff -r 8fb8f3c1acf8 -r 1b6fa37d46a4 test_create/test_create.html --- a/test_create/test_create.html Mon Nov 23 16:04:47 2015 +0000 +++ b/test_create/test_create.html Wed Nov 25 09:27:05 2015 +0000 @@ -1821,6 +1821,19 @@ this.preTest = new this.prepostNode("pretest"); this.postTest = new this.prepostNode("posttest"); } + + function createDeleteNodeButton(node) + { + var button = document.createElement("button"); + button.textContent = "Delete"; + button.onclick = function(event) + { + var node = event.target.parentElement; + node.parentElement.removeChild(node); + } + return button; + } + function SpecficationToHTML() { // Take information from Specification Node and format it into an HTML layout @@ -1990,6 +2003,7 @@ var node = PPSurveyToHTML(specificationNode.preTest.options[j]); node.className = "SecondLevel"; node.id = preTest.id+"-"+j; + node.appendChild(createDeleteNodeButton()); preTest.appendChild(node); } setupNode.appendChild(preTest); @@ -2009,6 +2023,7 @@ var node = PPSurveyToHTML(specificationNode.postTest.options[j]); node.className = "SecondLevel"; node.id = postTest.id+"-"+j; + node.appendChild(createDeleteNodeButton()); postTest.appendChild(node); } @@ -2024,6 +2039,7 @@ aHTML.name = "audioHolder"; aHTML.id = "audioHolder-"+aH.id; aHTML.className = "topLevel"; + aHTML.appendChild(createDeleteNodeButton()); destination.appendChild(aHTML); var title = document.createElement("h2"); title.textContent = "Audio Holder "+aH.id; @@ -2099,6 +2115,7 @@ var node = PPSurveyToHTML(aH.preTest.options[j]); node.className = "SecondLevel"; node.id = preTest.id+"-"+j; + node.appendChild(createDeleteNodeButton()); preTest.appendChild(node); } @@ -2119,6 +2136,7 @@ var node = PPSurveyToHTML(aH.postTest.options[j]); node.className = "SecondLevel"; node.id = postTest.id+"-"+j; + node.appendChild(createDeleteNodeButton()); postTest.appendChild(node); } @@ -2154,9 +2172,9 @@ input.style.margin = "5px"; entry.appendChild(text); entry.appendChild(input); + entry.appendChild(createDeleteNodeButton()); audioElems.appendChild(entry); } - aHTML.appendChild(audioElems); }