comparison interfaces/ABX.js @ 2806:ee3059744a6e

Add fixed images to ABX with an example
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 25 Apr 2017 10:30:52 +0100
parents cae61c5bbed1
children 64a5603831e2
comparison
equal deleted inserted replaced
2805:622671f2ac13 2806:ee3059744a6e
206 this.selector.appendChild(selectorText); 206 this.selector.appendChild(selectorText);
207 this.playback = document.createElement('button'); 207 this.playback = document.createElement('button');
208 this.playback.className = 'comparator-button'; 208 this.playback.className = 'comparator-button';
209 this.playback.disabled = true; 209 this.playback.disabled = true;
210 this.playback.textContent = "Listen"; 210 this.playback.textContent = "Listen";
211 if (element.specification.image) {
212 this.selector.className += " comparator-image";
213 var image = document.createElement("img");
214 image.src = element.specification.image;
215 image.className = "comparator-image";
216 this.selector.appendChild(image);
217 } else if (label === "X") {
218 this.selector.classList.add('inactive');
219 }
211 this.box.appendChild(this.selector); 220 this.box.appendChild(this.selector);
212 this.box.appendChild(this.playback); 221 this.box.appendChild(this.playback);
213 this.selectorClicked = function (event) { 222 this.selectorClicked = function (event) {
214 if (label == "X" || label == "x") { 223 if (label == "X" || label == "x") {
215 return; 224 return;
389 root.appendChild(aeNode); 398 root.appendChild(aeNode);
390 // Build the 'X' element 399 // Build the 'X' element
391 var label; 400 var label;
392 var audioObject = audioEngineContext.newTrack(element); 401 var audioObject = audioEngineContext.newTrack(element);
393 node = buildElement.call(this, 3, audioObject); 402 node = buildElement.call(this, 3, audioObject);
394 node.box.children[0].classList.add('inactive');
395 audioObject.bindInterface(node); 403 audioObject.bindInterface(node);
396 this.X = node; 404 this.X = node;
397 this.boxHolders.appendChild(node.box); 405 this.boxHolders.appendChild(node.box);
398 } 406 }
399 407