# HG changeset patch # User Nicholas Jillings # Date 1470149273 -3600 # Node ID 026ec377f5bc925b3bfc13b494f8d3149772f2a6 # Parent 72c741b27cc68fda658e1511ea066f5f46e9a471 Fixed #61 diff -r 72c741b27cc6 -r 026ec377f5bc interfaces/AB.js --- a/interfaces/AB.js Tue Aug 02 16:00:34 2016 +0200 +++ b/interfaces/AB.js Tue Aug 02 15:47:53 2016 +0100 @@ -109,6 +109,10 @@ submit.style.left = (window.innerWidth-250)/2 + 'px'; feedbackHolder.appendChild(boxes); + + // Create holder for comment boxes + var comments = document.createElement("div"); + comments.id = "comment-box-holder"; // Inject into HTML testContent.appendChild(title); // Insert the title @@ -117,6 +121,7 @@ testContent.appendChild(outsideRef); testContent.appendChild(feedbackHolder); testContent.appendChild(submit); + testContent.appendChild(comments); interfaceContext.insertPoint.appendChild(testContent); // Load the full interface @@ -134,6 +139,9 @@ } interfaceObj = interfaceObj[0]; + var commentHolder = document.getElementById('comment-box-holder'); + commentHolder.innerHTML = ""; + // Delete outside reference var outsideReferenceHolder = document.getElementById("outside-reference-holder"); outsideReferenceHolder.innerHTML = ""; @@ -197,9 +205,6 @@ } break; case "comments": - var commentHolder = document.createElement('div'); - commentHolder.id = 'commentHolder'; - document.getElementById('testContent').appendChild(commentHolder); // Generate one comment box per presented page for (var element of audioEngineContext.audioObjects) { @@ -213,7 +218,7 @@ $(audioHolderObject.commentQuestions).each(function(index,element) { var node = interfaceContext.createCommentQuestion(element); - document.getElementById('testContent').appendChild(node.holder); + commentHolder.appendChild(node.holder); }); resizeWindow(null); diff -r 72c741b27cc6 -r 026ec377f5bc interfaces/ABX.js --- a/interfaces/ABX.js Tue Aug 02 16:00:34 2016 +0200 +++ b/interfaces/ABX.js Tue Aug 02 15:47:53 2016 +0100 @@ -110,6 +110,10 @@ submit.style.left = (window.innerWidth-250)/2 + 'px'; feedbackHolder.appendChild(boxes); + + // Create holder for comment boxes + var comments = document.createElement("div"); + comments.id = "comment-box-holder"; // Inject into HTML testContent.appendChild(title); // Insert the title @@ -117,6 +121,7 @@ testContent.appendChild(interfaceButtons); testContent.appendChild(feedbackHolder); testContent.appendChild(submit); + testContent.appendChild(comments); interfaceContext.insertPoint.appendChild(testContent); // Load the full interface @@ -136,6 +141,9 @@ } interfaceObj = interfaceObj[0]; + var commentHolder = document.getElementById("comment-box-holder"); + commentHolder.innerHTML = ""; + // Set the page title if (typeof page.title == "string" && page.title.length > 0) { document.getElementById("test-title").textContent = page.title @@ -184,9 +192,6 @@ } break; case "comments": - var commentHolder = document.createElement('div'); - commentHolder.id = 'commentHolder'; - document.getElementById('testContent').appendChild(commentHolder); // Generate one comment box per presented page for (var element of audioEngineContext.audioObjects) { @@ -200,7 +205,7 @@ $(page.commentQuestions).each(function(index,element) { var node = interfaceContext.createCommentQuestion(element); - document.getElementById('testContent').appendChild(node.holder); + commentHolder.appendChild(node.holder); }); resizeWindow(null);