# HG changeset patch # User Nicholas Jillings # Date 1433757615 -3600 # Node ID b0d68351088179a0cdd0a335274d32e53a8bf1dd # Parent 566fc4fa2bea27a7e1d1d67eae8965757258d638 Feature #1208: Added radio box option to page 'commentQuestion'. Also commentQuestion nodes are now common to core.js. diff -r 566fc4fa2bea -r b0d683510881 ape.css --- a/ape.css Sat Jun 06 11:54:43 2015 +0100 +++ b/ape.css Mon Jun 08 11:00:15 2015 +0100 @@ -51,15 +51,11 @@ min-height: 30px; } -div.sliderScale span{ - font-size: 1.2em; -} - div.sliderScale span { /* Any formatting of text below scale */ + font-size: 1.2em; min-width: 5px; height: 20px; - height: 100%; position: absolute; } diff -r 566fc4fa2bea -r b0d683510881 ape.js --- a/ape.js Sat Jun 06 11:54:43 2015 +0100 +++ b/ape.js Mon Jun 08 11:00:15 2015 +0100 @@ -292,27 +292,9 @@ interfaceContext.showCommentBoxes(feedbackHolder,true); } - // Append any commentQuestion boxes $(audioHolderObject.commentQuestions).each(function(index,element) { - // Create document objects to hold the comment boxes - var trackComment = document.createElement('div'); - trackComment.className = 'comment-div commentQuestion'; - trackComment.id = element.id; - // Create a string next to each comment asking for a comment - var trackString = document.createElement('span'); - trackString.innerHTML = element.question; - // Create the HTML5 comment box 'textarea' - var trackCommentBox = document.createElement('textarea'); - trackCommentBox.rows = '4'; - trackCommentBox.cols = '100'; - trackCommentBox.name = 'commentQuestion'+index; - trackCommentBox.className = 'trackComment'; - var br = document.createElement('br'); - // Add to the holder. - trackComment.appendChild(trackString); - trackComment.appendChild(br); - trackComment.appendChild(trackCommentBox); - feedbackHolder.appendChild(trackComment); + var node = interfaceContext.createCommentQuestion(element); + feedbackHolder.appendChild(node.holder); }); @@ -484,19 +466,10 @@ var audioElement = audioEngineContext.audioObjects[i].exportXMLDOM(); xmlDoc.appendChild(audioElement); } - var commentQuestion = document.getElementsByClassName('commentQuestion'); - for (var i=0; i= this.options.length) { + break; + } + } + if (i >= this.options.length) { + response.textContent = 'null'; + } else { + response.textContent = this.options[i].getAttribute('setvalue'); + response.setAttribute('number',i); + } + root.appendChild(question); + root.appendChild(response); + return root; + }; + }; + + this.createCommentBox = function(audioObject) { - var node = new this.commentBox(audioObject); + var node = new this.elementCommentBox(audioObject); this.commentBoxes.push(node); audioObject.commentDOM = node; return node; @@ -1316,5 +1451,16 @@ inject.appendChild(this.commentBoxes[i].trackComment); } }; + + this.createCommentQuestion = function(element) { + var node; + if (element.type == 'text') { + node = new this.commentBox(element); + } else if (element.type == 'radio') { + node = new this.radioBox(element); + } + this.commentQuestions.push(node); + return node; + }; } diff -r 566fc4fa2bea -r b0d683510881 example_eval/project.xml --- a/example_eval/project.xml Sat Jun 06 11:54:43 2015 +0100 +++ b/example_eval/project.xml Mon Jun 08 11:00:15 2015 +0100 @@ -54,7 +54,15 @@ --> - What is your mixing experience + What is your mixing experience + + Please enter your ranking preference on this song + + + + + + Please enter the genre