Mercurial > hg > webaudioevaluationtool
comparison interfaces/AB.js @ 2794:b4e91500891a
#133 Added individual images to AB
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Sun, 23 Apr 2017 11:10:38 +0100 |
parents | cae61c5bbed1 |
children | 64a5603831e2 |
comparison
equal
deleted
inserted
replaced
2793:1076ac62823f | 2794:b4e91500891a |
---|---|
211 this.box.className = 'comparator-holder'; | 211 this.box.className = 'comparator-holder'; |
212 this.box.setAttribute('track-id', audioElement.id); | 212 this.box.setAttribute('track-id', audioElement.id); |
213 this.box.id = 'comparator-' + text; | 213 this.box.id = 'comparator-' + text; |
214 this.selector = document.createElement('div'); | 214 this.selector = document.createElement('div'); |
215 this.selector.className = 'comparator-selector disabled'; | 215 this.selector.className = 'comparator-selector disabled'; |
216 if (audioElement.specification.image) { | |
217 this.selector.className += " comparator-image"; | |
218 var image = document.createElement("img"); | |
219 image.src = audioElement.specification.image; | |
220 image.className = "comparator-image"; | |
221 this.selector.appendChild(image); | |
222 } | |
216 var selectorText = document.createElement('span'); | 223 var selectorText = document.createElement('span'); |
217 selectorText.textContent = text; | 224 selectorText.textContent = text; |
218 this.selector.appendChild(selectorText); | 225 this.selector.appendChild(selectorText); |
219 this.playback = document.createElement('button'); | 226 this.playback = document.createElement('button'); |
220 this.playback.className = 'comparator-button'; | 227 this.playback.className = 'comparator-button'; |
261 if (event.currentTarget === this.selector) { | 268 if (event.currentTarget === this.selector) { |
262 this.selectorClicked(); | 269 this.selectorClicked(); |
263 } else if (event.currentTarget === this.playback) { | 270 } else if (event.currentTarget === this.playback) { |
264 this.playbackClicked(); | 271 this.playbackClicked(); |
265 } | 272 } |
266 } | 273 }; |
267 this.playback.addEventListener("click", this); | 274 this.playback.addEventListener("click", this); |
268 this.selector.addEventListener("click", this); | 275 this.selector.addEventListener("click", this); |
269 | 276 |
270 this.enable = function () { | 277 this.enable = function () { |
271 if (this.parent.state == 1) { | 278 if (this.parent.state == 1) { |