Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 661:97ade670d7c1
Improved formatting for comment boxes
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 10 Apr 2015 12:59:23 +0100 |
parents | 44d281129d55 |
children | 2991b5476c7c |
comparison
equal
deleted
inserted
replaced
660:44d281129d55 | 661:97ade670d7c1 |
---|---|
135 | 135 |
136 // Create Pre-Test Box | 136 // Create Pre-Test Box |
137 if (preTest != undefined && preTest.children.length >= 1) | 137 if (preTest != undefined && preTest.children.length >= 1) |
138 { | 138 { |
139 | 139 |
140 var preTestHolder = document.createElement('div'); | 140 var popupHolder = document.createElement('div'); |
141 preTestHolder.id = 'preTestHolder'; | 141 popupHolder.id = 'popupHolder'; |
142 preTestHolder.className = 'popupHolder'; | 142 popupHolder.className = 'popupHolder'; |
143 preTestHolder.style.position = 'absolute'; | 143 popupHolder.style.position = 'absolute'; |
144 preTestHolder.style.left = (window.innerWidth/2)-250 + 'px'; | 144 popupHolder.style.left = (window.innerWidth/2)-250 + 'px'; |
145 preTestHolder.style.top = (window.innerHeight/2)-125 + 'px'; | 145 popupHolder.style.top = (window.innerHeight/2)-125 + 'px'; |
146 | |
146 // Parse the first box | 147 // Parse the first box |
147 var preTestOption = document.createElement('div'); | 148 var preTestOption = document.createElement('div'); |
148 preTestOption.id = 'preTest'; | 149 preTestOption.id = 'preTest'; |
149 preTestOption.style.marginTop = '25px'; | 150 preTestOption.style.marginTop = '25px'; |
150 preTestOption.align = "center"; | 151 preTestOption.align = "center"; |
166 nextButton.id = 'preTestNext'; | 167 nextButton.id = 'preTestNext'; |
167 nextButton.value = '0'; | 168 nextButton.value = '0'; |
168 nextButton.innerHTML = 'Next'; | 169 nextButton.innerHTML = 'Next'; |
169 nextButton.onclick = preTestButtonClick; | 170 nextButton.onclick = preTestButtonClick; |
170 | 171 |
171 preTestHolder.appendChild(preTestOption); | 172 popupHolder.appendChild(preTestOption); |
172 preTestHolder.appendChild(nextButton); | 173 popupHolder.appendChild(nextButton); |
173 insertPoint.appendChild(preTestHolder); | 174 insertPoint.appendChild(popupHolder); |
174 } | 175 } |
175 | 176 |
176 // Load the full interface | 177 // Load the full interface |
177 loadTest(testXMLSetups[0]); | 178 loadTest(testXMLSetups[0]); |
178 } | 179 } |
217 // Now load each audio sample. First create the new track by passing the full URL | 218 // Now load each audio sample. First create the new track by passing the full URL |
218 var trackURL = hostURL + this.attributes['url'].value; | 219 var trackURL = hostURL + this.attributes['url'].value; |
219 audioEngineContext.newTrack(trackURL); | 220 audioEngineContext.newTrack(trackURL); |
220 // Create document objects to hold the comment boxes | 221 // Create document objects to hold the comment boxes |
221 var trackComment = document.createElement('div'); | 222 var trackComment = document.createElement('div'); |
223 trackComment.className = 'comment-div'; | |
222 // Create a string next to each comment asking for a comment | 224 // Create a string next to each comment asking for a comment |
223 var trackString = document.createElement('span'); | 225 var trackString = document.createElement('span'); |
224 trackString.innerHTML = 'Comment on track '+index; | 226 trackString.innerHTML = 'Comment on track '+index; |
225 // Create the HTML5 comment box 'textarea' | 227 // Create the HTML5 comment box 'textarea' |
226 var trackCommentBox = document.createElement('textarea'); | 228 var trackCommentBox = document.createElement('textarea'); |
295 preTestOption.appendChild(br); | 297 preTestOption.appendChild(br); |
296 preTestOption.appendChild(textEnter); | 298 preTestOption.appendChild(textEnter); |
297 } | 299 } |
298 } else { | 300 } else { |
299 // Time to clear | 301 // Time to clear |
300 preTestHolder.style.zIndex = -1; | 302 preTestOption.innerHTML = null; |
301 preTestHolder.style.visibility = 'hidden'; | 303 hidePopup(); |
302 var blank = document.getElementsByClassName('testHalt')[0]; | |
303 blank.style.zIndex = -2; | |
304 blank.style.visibility = 'hidden'; | |
305 } | 304 } |
306 } | 305 } |
307 | 306 |
308 function showPopup() | 307 function showPopup() |
309 { | 308 { |
310 | 309 var popupHolder = document.getElementById('popupHolder'); |
310 popupHolder.style.zIndex = 2; | |
311 popupHolder.style.visibility = 'visible'; | |
312 var blank = document.getElementsByClassName('testHalt')[0]; | |
313 blank.style.zIndex = 2; | |
314 blank.style.visibility = 'visible'; | |
311 } | 315 } |
312 | 316 |
313 function hidePopup() | 317 function hidePopup() |
314 { | 318 { |
315 | 319 var popupHolder = document.getElementById('popupHolder'); |
320 popupHolder.style.zIndex = -1; | |
321 popupHolder.style.visibility = 'hidden'; | |
322 var blank = document.getElementsByClassName('testHalt')[0]; | |
323 blank.style.zIndex = -2; | |
324 blank.style.visibility = 'hidden'; | |
316 } | 325 } |
317 | 326 |
318 function dragEnd(ev) { | 327 function dragEnd(ev) { |
319 // Function call when a div has been dropped | 328 // Function call when a div has been dropped |
320 var slider = document.getElementById('slider'); | 329 var slider = document.getElementById('slider'); |