Mercurial > hg > webaudioevaluationtool
changeset 826:1b6fa37d46a4
Merge
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Wed, 25 Nov 2015 09:27:05 +0000 |
parents | 3b0770e1e616 (diff) 8fb8f3c1acf8 (current diff) |
children | 1db3dd91fb26 |
files | .hgignore README.txt ape.css ape.js core.js docs/Instructions/ListeningTestInstructions.pdf docs/Instructions/ListeningTestInstructions.tex example_eval/project.xml pythonServer.py save.php scripts/comment_parser.py scripts/evaluation_stats.py scripts/score_parser.py scripts/score_plot.py scripts/timeline_view.py test_create/test_create.html |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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); }