Mercurial > hg > webaudioevaluationtool
changeset 396:76638abe1414 Dev_main
Bug #1490: Popup button 'enter' key grab only bound once. APE Multi-interface has default metric response if only one axis used.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 11 Dec 2015 11:42:28 +0000 |
parents | 629b96c14ee1 |
children | 32cf73391f31 |
files | ape.js core.js |
diffstat | 2 files changed, 21 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ape.js Fri Dec 11 11:19:11 2015 +0000 +++ b/ape.js Fri Dec 11 11:42:28 2015 +0000 @@ -313,6 +313,7 @@ // Create a slider per track audioObject.interfaceDOM = new sliderObject(audioObject,interfaceObj); + audioObject.metric.initialPosition = convSliderPosToRate(audioObject.interfaceDOM.trackSliderObjects[0]); if (audioObject.state == 1) { audioObject.interfaceDOM.enable(); @@ -667,16 +668,24 @@ // Saves a specific test page // You can use this space to add any extra nodes to your XML <audioHolder> saves // Get the current <audioHolder> information in store (remember to appendChild your data to it) + if (interfaceContext.interfaceSliders.length == 1) + { + // If there is only one axis, there only needs to be one metric return + return; + } var audioelements = store.getElementsByTagName("audioelement"); for (var i=0; i<audioelements.length; i++) { // Have to append the metric specific nodes - for (var k=0; k<interfaceContext.interfaceSliders.length; k++) + if (testXML.outsideReference == null || testXML.outsideReference.id != audioelements[i].id) { - var node = interfaceContext.interfaceSliders[k].metrics[i].exportXMLDOM(); - node.setAttribute("interface-name",interfaceContext.interfaceSliders[k].name); - node.setAttribute("interfaceid",interfaceContext.interfaceSliders[k].id); - audioelements[i].appendChild(node); + for (var k=0; k<interfaceContext.interfaceSliders.length; k++) + { + var node = interfaceContext.interfaceSliders[k].metrics[i].exportXMLDOM(); + node.setAttribute("interface-name",interfaceContext.interfaceSliders[k].name); + node.setAttribute("interfaceid",interfaceContext.interfaceSliders[k].id); + audioelements[i].appendChild(node); + } } } } \ No newline at end of file
--- a/core.js Fri Dec 11 11:19:11 2015 +0000 +++ b/core.js Fri Dec 11 11:42:28 2015 +0000 @@ -228,6 +228,13 @@ this.popupOptions = null; this.currentIndex = null; this.responses = null; + $(window).keypress(function(e){ + if (e.keyCode == 13 && popup.popup.style.visibility == 'visible') + { + console.log(e); + popup.buttonProceed.onclick(); + } + }); this.createPopup = function(){ // Create popup window interface @@ -305,12 +312,6 @@ var blank = document.getElementsByClassName('testHalt')[0]; blank.style.zIndex = 2; blank.style.visibility = 'visible'; - $(window).keypress(function(e){ - if (e.keyCode == 13 && popup.popup.style.visibility == 'visible') - { - popup.buttonProceed.onclick(); - } - }); }; this.hidePopup = function(){ @@ -320,7 +321,6 @@ blank.style.zIndex = -2; blank.style.visibility = 'hidden'; this.buttonPrevious.style.visibility = 'inherit'; - $(window).keypress(function(e){}); }; this.postNode = function() {