# HG changeset patch # User Nicholas Jillings # Date 1464343627 -3600 # Node ID 36934565bf6e8a082a3aab3b7ae0e5c13cd5cf5c # Parent de547cf9a4e7549a02e682ddbf460f819d2c8233# Parent c2db5860a247ab9c2fc65f127face11f9ad66603 Merge branch 'master' into Dev_main diff -r c2db5860a247 -r 36934565bf6e js/core.js --- a/js/core.js Fri May 27 11:05:30 2016 +0100 +++ b/js/core.js Fri May 27 11:07:07 2016 +0100 @@ -1677,7 +1677,7 @@ } else { this.outputGain.gain.setValueAtTime(0.0,startTime); } - this.bufferNode.start(startTime); + this.bufferNode.start(startTime,this.specification.startTime || 0, this.specification.stopTime-this.specification.startTime || this.buffer.buffer.duration); this.bufferNode.playbackStartTime = audioEngineContext.timer.getTestTime(); } }; @@ -2488,7 +2488,7 @@ this.outsideReferenceHolder = document.createElement('button'); this.outsideReferenceHolder.className = 'outside-reference'; this.outsideReferenceHolder.setAttribute('track-id',index); - this.outsideReferenceHolder.textContent = "Play Reference"; + this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference"; this.outsideReferenceHolder.disabled = true; this.outsideReferenceHolder.onclick = function(event) @@ -2511,7 +2511,7 @@ progress = progress.split('.')[0]; this.outsideReferenceHolder.textContent = progress+'%'; } else { - this.outsideReferenceHolder.textContent = "Play Reference"; + this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference"; } }; this.startPlayback = function() @@ -2536,7 +2536,7 @@ }; this.getPresentedId = function() { - return 'Reference'; + return this.parent.specification.label || "Reference"; }; this.canMove = function() { diff -r c2db5860a247 -r 36934565bf6e js/specification.js --- a/js/specification.js Fri May 27 11:05:30 2016 +0100 +++ b/js/specification.js Fri May 27 11:07:07 2016 +0100 @@ -626,6 +626,9 @@ this.marker = null; this.enforce = false; this.gain = 0.0; + this.label = null; + this.startTime = null; + this.stopTime = null; this.schema = specification.schema.getAllElementsByName('audioelement')[0];; this.parent = null; this.decode = function(parent,xml) diff -r c2db5860a247 -r 36934565bf6e test_create/test_core.js --- a/test_create/test_core.js Fri May 27 11:05:30 2016 +0100 +++ b/test_create/test_core.js Fri May 27 11:07:07 2016 +0100 @@ -1332,7 +1332,7 @@ span.textContent = "NOTE FOR SAFARI! You cannot right click on the below link and save it as a file, Safari does not like that at all. Instead click on it to open the XML, the Press Cmd+S to open the save dialogue. Make sure you have 'save as Page Source' selected on the bottom of the window. Currently Safari has no plans to support the HTML 'download' attribute which causes this problem"; obj.content.appendChild(span); var link = document.createElement("div"); - link.appendChild(doc.firstElementChild); + link.appendChild(doc.firstChild); var file = [link.innerHTML]; var bb = new Blob(file,{type : 'application/xml'}); var dnlk = window.URL.createObjectURL(bb); @@ -1946,6 +1946,21 @@ this.deleteNode.root.textContent = "Delete Entry"; this.deleteNode.root.addEventListener("click",this.deleteNode,false); this.buttonDOM.appendChild(this.deleteNode.root); + + this.getSurveyPosition = function() { + return this.parent.specification.options.findIndex(function(element){ + if (element == this) {return true;} + else {return false;} + },this.specification); + } + + this.swapOrder = function(other) { + // Enables two nodes to swap their respective positions + var other_pos = other.getSurveyPosition(); + var my_pos = this.getSurveyPosition(); + this.parent.specification.options[other_pos] = this.specification; + this.parent.specification.options[my_pos] = other.specification; + } } this.addNode = { root: document.createElement("button"), diff -r c2db5860a247 -r 36934565bf6e xml/test-schema.xsd --- a/xml/test-schema.xsd Fri May 27 11:05:30 2016 +0100 +++ b/xml/test-schema.xsd Fri May 27 11:07:07 2016 +0100 @@ -161,6 +161,7 @@ + @@ -184,6 +185,20 @@ + + + + + + + + + + + + + +