Mercurial > hg > webaudioevaluationtool
comparison interfaces/AB.js @ 545:ada2ec131505 Dev_main
Bug #1615 Fixed. Also set hostURL in schema to default to an empty string if not specified in <page>
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Mon, 22 Feb 2016 15:05:39 +0000 |
parents | f81c46b294a9 |
children | df2d916fd9cf |
comparison
equal
deleted
inserted
replaced
544:e0f95b33ba31 | 545:ada2ec131505 |
---|---|
199 if (audioEngineContext.status == 0) | 199 if (audioEngineContext.status == 0) |
200 { | 200 { |
201 alert("Please listen to the samples before making a selection"); | 201 alert("Please listen to the samples before making a selection"); |
202 console.log("Please listen to the samples before making a selection"); | 202 console.log("Please listen to the samples before making a selection"); |
203 return; | 203 return; |
204 } | 204 } |
205 $(".comparator-selector").removeClass('selected'); | |
206 var id = event.currentTarget.parentElement.getAttribute('track-id'); | 205 var id = event.currentTarget.parentElement.getAttribute('track-id'); |
207 interfaceContext.comparator.selected = id; | 206 interfaceContext.comparator.selected = id; |
208 $(event.currentTarget).addClass('selected'); | 207 if ($(event.currentTarget).hasClass("selected")) { |
209 for (var i=0; i<interfaceContext.comparator.comparators.length; i++) | 208 $(".comparator-selector").removeClass('selected'); |
210 { | 209 for (var i=0; i<interfaceContext.comparator.comparators.length; i++) |
211 var obj = interfaceContext.comparator.comparators[i]; | 210 { |
212 if (i == id) { | 211 var obj = interfaceContext.comparator.comparators[i]; |
213 obj.value = 1; | 212 obj.parent.metric.moved(time,0); |
214 } else { | 213 } |
215 obj.value = 0; | 214 } else { |
216 } | 215 $(".comparator-selector").removeClass('selected'); |
217 obj.parent.metric.moved(time,obj.value); | 216 $(event.currentTarget).addClass('selected'); |
218 } | 217 for (var i=0; i<interfaceContext.comparator.comparators.length; i++) |
219 console.log("Selected "+id+' ('+time+')'); | 218 { |
219 var obj = interfaceContext.comparator.comparators[i]; | |
220 if (i == id) { | |
221 obj.value = 1; | |
222 } else { | |
223 obj.value = 0; | |
224 } | |
225 obj.parent.metric.moved(time,obj.value); | |
226 } | |
227 console.log("Selected "+id+' ('+time+')'); | |
228 } | |
220 }; | 229 }; |
221 this.playback.setAttribute("playstate","ready"); | 230 this.playback.setAttribute("playstate","ready"); |
222 this.playback.onclick = function(event) | 231 this.playback.onclick = function(event) |
223 { | 232 { |
224 var id = event.currentTarget.parentElement.getAttribute('track-id'); | 233 var id = event.currentTarget.parentElement.getAttribute('track-id'); |