nickjillings@1289: /** nickjillings@1289: * mushra.js nickjillings@1289: * Create the MUSHRA interface nickjillings@1289: */ nickjillings@1289: nickjillings@1289: // Once this is loaded and parsed, begin execution nickjillings@1289: loadInterface(); nickjillings@1289: nickjillings@1289: function loadInterface() { nickjillings@1289: // Get the dimensions of the screen available to the page nickjillings@1289: var width = window.innerWidth; nickjillings@1289: var height = window.innerHeight; nickjillings@1289: nickjillings@1289: // The injection point into the HTML page nickjillings@1289: interfaceContext.insertPoint = document.getElementById("topLevelBody"); nickjillings@1289: var testContent = document.createElement('div'); nickjillings@1289: testContent.id = 'testContent'; nickjillings@1289: nickjillings@1289: // Create the top div for the Title element nickjillings@1289: var titleAttr = specification.title; nickjillings@1289: var title = document.createElement('div'); nickjillings@1289: title.className = "title"; nickjillings@1289: title.align = "center"; nickjillings@1289: var titleSpan = document.createElement('span'); nickjillings@1289: nickjillings@1289: // Set title to that defined in XML, else set to default nickjillings@1289: if (titleAttr != undefined) { nickjillings@1289: titleSpan.textContent = titleAttr; nickjillings@1289: } else { nickjillings@1289: titleSpan.textContent = 'Listening test'; nickjillings@1289: } nickjillings@1289: // Insert the titleSpan element into the title div element. nickjillings@1289: title.appendChild(titleSpan); nickjillings@1289: nickjillings@1289: var pagetitle = document.createElement('div'); nickjillings@1289: pagetitle.className = "pageTitle"; nickjillings@1289: pagetitle.align = "center"; nickjillings@1289: var titleSpan = document.createElement('span'); nickjillings@1289: titleSpan.id = "pageTitle"; nickjillings@1289: pagetitle.appendChild(titleSpan); nickjillings@1289: nickjillings@1289: // Create Interface buttons! nickjillings@1289: var interfaceButtons = document.createElement('div'); nickjillings@1289: interfaceButtons.id = 'interface-buttons'; nickjillings@1289: interfaceButtons.style.height = '25px'; nickjillings@1289: nickjillings@1289: // Create playback start/stop points nickjillings@1289: var playback = document.createElement("button"); nickjillings@1289: playback.innerHTML = 'Stop'; nickjillings@1289: playback.id = 'playback-button'; nickjillings@1289: playback.style.float = 'left'; nickjillings@1289: // onclick function. Check if it is playing or not, call the correct function in the nickjillings@1289: // audioEngine, change the button text to reflect the next state. nickjillings@1289: playback.onclick = function() { nickjillings@1289: if (audioEngineContext.status == 1) { nickjillings@1289: audioEngineContext.stop(); nickjillings@1289: this.innerHTML = 'Stop'; nickjillings@1289: var time = audioEngineContext.timer.getTestTime(); nickjillings@1289: console.log('Stopped at ' + time); // DEBUG/SAFETY nickjillings@1289: } nickjillings@1289: }; nickjillings@1289: // Create Submit (save) button nickjillings@1289: var submit = document.createElement("button"); nickjillings@1289: submit.innerHTML = 'Submit'; nickjillings@1289: submit.onclick = buttonSubmitClick; nickjillings@1289: submit.id = 'submit-button'; nickjillings@1289: submit.style.float = 'left'; nickjillings@1289: // Append the interface buttons into the interfaceButtons object. nickjillings@1289: interfaceButtons.appendChild(playback); nickjillings@1289: interfaceButtons.appendChild(submit); nickjillings@1289: nickjillings@1289: // Create a slider box nickjillings@1289: var sliderBox = document.createElement('div'); nickjillings@1289: sliderBox.style.width = "100%"; nickjillings@1289: sliderBox.style.height = window.innerHeight - 200+12 + 'px'; nickjillings@1289: sliderBox.style.marginBottom = '10px'; nickjillings@1289: sliderBox.id = 'slider'; nickjillings@1289: var scaleHolder = document.createElement('div'); nickjillings@1289: scaleHolder.id = "scale-holder"; nickjillings@1289: sliderBox.appendChild(scaleHolder); nickjillings@1289: var scaleText = document.createElement('div'); nickjillings@1289: scaleText.id = "scale-text-holder"; nickjillings@1289: scaleHolder.appendChild(scaleText); nickjillings@1289: var scaleCanvas = document.createElement('canvas'); nickjillings@1289: scaleCanvas.id = "scale-canvas"; nickjillings@1289: scaleHolder.appendChild(scaleCanvas); nickjillings@1289: var sliderObjectHolder = document.createElement('div'); nickjillings@1289: sliderObjectHolder.id = 'slider-holder'; nickjillings@1289: sliderObjectHolder.align = "center"; nickjillings@1289: sliderBox.appendChild(sliderObjectHolder); nickjillings@1289: nickjillings@1289: // Global parent for the comment boxes on the page nickjillings@1289: var feedbackHolder = document.createElement('div'); nickjillings@1289: feedbackHolder.id = 'feedbackHolder'; nickjillings@1289: nickjillings@1289: testContent.style.zIndex = 1; nickjillings@1289: interfaceContext.insertPoint.innerHTML = null; // Clear the current schema nickjillings@1289: nickjillings@1289: // Inject into HTML nickjillings@1289: testContent.appendChild(title); // Insert the title nickjillings@1289: testContent.appendChild(pagetitle); nickjillings@1289: testContent.appendChild(interfaceButtons); nickjillings@1289: testContent.appendChild(sliderBox); nickjillings@1289: testContent.appendChild(feedbackHolder); nickjillings@1289: interfaceContext.insertPoint.appendChild(testContent); nickjillings@1289: nickjillings@1289: // Load the full interface nickjillings@1289: testState.initialise(); nickjillings@1289: testState.advanceState(); nickjillings@1289: } nickjillings@1289: nickjillings@1289: function loadTest(audioHolderObject) nickjillings@1289: { nickjillings@1289: var id = audioHolderObject.id; nickjillings@1289: nickjillings@1289: var feedbackHolder = document.getElementById('feedbackHolder'); nickjillings@1289: feedbackHolder.innerHTML = null; nickjillings@1289: var interfaceObj = audioHolderObject.interfaces; nickjillings@1289: if (interfaceObj.length > 1) nickjillings@1289: { nickjillings@1289: console.log("WARNING - This interface only supports one node per page. Using first interface node"); nickjillings@1289: } nickjillings@1289: interfaceObj = interfaceObj[0]; nickjillings@1289: if(interfaceObj.title != null) nickjillings@1289: { nickjillings@1289: document.getElementById("pageTitle").textContent = interfaceObj.title; nickjillings@1289: } nickjillings@1289: var interfaceOptions = specification.interfaces.options.concat(interfaceObj.options); nickjillings@1289: for (var option of interfaceOptions) nickjillings@1289: { nickjillings@1289: if (option.type == "show") nickjillings@1289: { nickjillings@1289: switch(option.name) { nickjillings@1289: case "playhead": nickjillings@1289: var playbackHolder = document.getElementById('playback-holder'); nickjillings@1289: if (playbackHolder == null) nickjillings@1289: { nickjillings@1289: playbackHolder = document.createElement('div'); nickjillings@1289: playbackHolder.style.width = "100%"; nickjillings@1289: playbackHolder.align = 'center'; nickjillings@1289: playbackHolder.appendChild(interfaceContext.playhead.object); nickjillings@1289: feedbackHolder.appendChild(playbackHolder); nickjillings@1289: } nickjillings@1289: break; nickjillings@1289: case "page-count": nickjillings@1289: var pagecountHolder = document.getElementById('page-count'); nickjillings@1289: if (pagecountHolder == null) nickjillings@1289: { nickjillings@1289: pagecountHolder = document.createElement('div'); nickjillings@1289: pagecountHolder.id = 'page-count'; nickjillings@1289: } nickjillings@1289: pagecountHolder.innerHTML = 'Page '+(testState.stateIndex+1)+' of '+testState.stateMap.length+''; nickjillings@1289: var inject = document.getElementById('interface-buttons'); nickjillings@1289: inject.appendChild(pagecountHolder); nickjillings@1289: break; nickjillings@1289: case "volume": nickjillings@1289: if (document.getElementById('master-volume-holder') == null) nickjillings@1289: { nickjillings@1289: feedbackHolder.appendChild(interfaceContext.volume.object); nickjillings@1289: } nickjillings@1289: break; nickjillings@1289: } nickjillings@1289: } nickjillings@1289: } nickjillings@1289: nickjillings@1289: // Delete outside reference nickjillings@1289: var outsideReferenceHolder = document.getElementById('outside-reference'); nickjillings@1289: if (outsideReferenceHolder != null) { nickjillings@1289: document.getElementById('interface-buttons').removeChild(outsideReferenceHolder); nickjillings@1289: } nickjillings@1289: nickjillings@1289: var sliderBox = document.getElementById('slider-holder'); nickjillings@1289: sliderBox.innerHTML = null; nickjillings@1289: nickjillings@1289: var commentBoxPrefix = "Comment on track"; nickjillings@1289: if (interfaceObj.commentBoxPrefix != undefined) { nickjillings@1289: commentBoxPrefix = interfaceObj.commentBoxPrefix; nickjillings@1289: } nickjillings@1289: var loopPlayback = audioHolderObject.loop; nickjillings@1289: nickjillings@1289: currentTestHolder = document.createElement('audioHolder'); nickjillings@1289: currentTestHolder.id = audioHolderObject.id; nickjillings@1289: currentTestHolder.repeatCount = audioHolderObject.repeatCount; nickjillings@1289: nickjillings@1289: // Find all the audioElements from the audioHolder nickjillings@1289: var label = 0; nickjillings@1289: $(audioHolderObject.audioElements).each(function(index,element){ nickjillings@1289: // Find URL of track nickjillings@1289: // In this jQuery loop, variable 'this' holds the current audioElement. nickjillings@1289: nickjillings@1289: var audioObject = audioEngineContext.newTrack(element); nickjillings@1289: if (element.type == 'outside-reference') nickjillings@1289: { nickjillings@1289: // Construct outside reference; nickjillings@1289: var orNode = new outsideReferenceDOM(audioObject,index,document.getElementById('interface-buttons')); nickjillings@1289: audioObject.bindInterface(orNode); nickjillings@1289: } else { nickjillings@1289: // Create a slider per track nickjillings@1289: var sliderObj = new sliderObject(audioObject,label); nickjillings@1289: nickjillings@1289: if (typeof audioHolderObject.initialPosition === "number") nickjillings@1289: { nickjillings@1289: // Set the values nickjillings@1289: sliderObj.slider.value = audioHolderObject.initalPosition; nickjillings@1289: } else { nickjillings@1289: // Distribute it randomnly nickjillings@1289: sliderObj.slider.value = Math.random(); nickjillings@1289: } nickjillings@1289: sliderBox.appendChild(sliderObj.holder); nickjillings@1289: audioObject.bindInterface(sliderObj); nickjillings@1289: interfaceContext.commentBoxes.createCommentBox(audioObject); nickjillings@1289: label += 1; nickjillings@1289: } nickjillings@1289: nickjillings@1289: }); nickjillings@1289: nickjillings@1289: if (audioHolderObject.showElementComments) { nickjillings@1289: interfaceContext.commentBoxes.showCommentBoxes(feedbackHolder,true); nickjillings@1289: } nickjillings@1289: nickjillings@1289: $(audioHolderObject.commentQuestions).each(function(index,element) { nickjillings@1289: var node = interfaceContext.createCommentQuestion(element); nickjillings@1289: feedbackHolder.appendChild(node.holder); nickjillings@1289: }); nickjillings@1289: nickjillings@1289: // Auto-align nickjillings@1289: resizeWindow(null); nickjillings@1289: } nickjillings@1289: nickjillings@1289: function sliderObject(audioObject,label) nickjillings@1289: { nickjillings@1289: // Constructs the slider object. We use the HTML5 slider object nickjillings@1289: this.parent = audioObject; nickjillings@1289: this.holder = document.createElement('div'); nickjillings@1289: this.title = document.createElement('span'); nickjillings@1289: this.slider = document.createElement('input'); nickjillings@1289: this.play = document.createElement('button'); nickjillings@1289: nickjillings@1289: this.holder.className = 'track-slider'; nickjillings@1289: this.holder.style.height = window.innerHeight-200 + 'px'; nickjillings@1289: this.holder.appendChild(this.title); nickjillings@1289: this.holder.appendChild(this.slider); nickjillings@1289: this.holder.appendChild(this.play); nickjillings@1289: this.holder.align = "center"; nickjillings@1289: if (label == 0) nickjillings@1289: { nickjillings@1289: this.holder.style.marginLeft = '0px'; nickjillings@1289: } nickjillings@1289: this.holder.setAttribute('trackIndex',audioObject.id); nickjillings@1289: nickjillings@1289: this.title.textContent = label; nickjillings@1289: this.title.style.width = "100%"; nickjillings@1289: this.title.style.float = "left"; nickjillings@1289: nickjillings@1289: this.slider.type = "range"; nickjillings@1289: this.slider.className = "track-slider-range track-slider-not-moved"; nickjillings@1289: this.slider.min = "0"; nickjillings@1289: this.slider.max = "1"; nickjillings@1289: this.slider.step = "0.01"; nickjillings@1289: this.slider.setAttribute('orient','vertical'); nickjillings@1289: this.slider.style.height = window.innerHeight-250 + 'px'; nickjillings@1289: this.slider.onchange = function() nickjillings@1289: { nickjillings@1289: var time = audioEngineContext.timer.getTestTime(); nickjillings@1289: var id = Number(this.parentNode.getAttribute('trackIndex')); nickjillings@1289: audioEngineContext.audioObjects[id].metric.moved(time,this.value); nickjillings@1289: console.log('slider '+id+' moved to '+this.value+' ('+time+')'); nickjillings@1289: $(this).removeClass('track-slider-not-moved'); nickjillings@1289: }; nickjillings@1289: nickjillings@1289: this.play.textContent = "Loading..."; nickjillings@1289: this.play.value = audioObject.id; nickjillings@1289: this.play.style.float = "left"; nickjillings@1289: this.play.style.width = "100%"; nickjillings@1289: this.play.disabled = true; nickjillings@1289: this.play.setAttribute("playstate","ready"); nickjillings@1289: this.play.onclick = function(event) nickjillings@1289: { nickjillings@1289: var id = Number(event.currentTarget.value); nickjillings@1289: //audioEngineContext.metric.sliderPlayed(id); nickjillings@1289: if (event.currentTarget.getAttribute("playstate") == "ready") nickjillings@1289: {audioEngineContext.play(id);} nickjillings@1289: else if (event.currentTarget.getAttribute("playstate") == "playing") nickjillings@1289: {audioEngineContext.stop();} nickjillings@1289: }; nickjillings@1289: nickjillings@1289: this.enable = function() { nickjillings@1289: this.play.disabled = false; nickjillings@1289: this.play.textContent = "Play"; nickjillings@1289: $(this.slider).removeClass('track-slider-disabled'); nickjillings@1289: }; nickjillings@1289: nickjillings@1289: this.exportXMLDOM = function(audioObject) { nickjillings@1289: // Called by the audioObject holding this element. Must be present nickjillings@1289: var node = storage.document.createElement('value'); nickjillings@1289: node.textContent = this.slider.value; nickjillings@1289: return node; nickjillings@1289: }; nickjillings@1289: this.startPlayback = function() nickjillings@1289: { nickjillings@1289: // Called when playback has begun nickjillings@1289: this.play.setAttribute("playstate","playing"); nickjillings@1289: $(".track-slider").removeClass('track-slider-playing'); nickjillings@1289: $(this.holder).addClass('track-slider-playing'); nickjillings@1289: var outsideReference = document.getElementById('outside-reference'); nickjillings@1289: if (outsideReference != null) { nickjillings@1289: $(outsideReference).removeClass('track-slider-playing'); nickjillings@1289: } nickjillings@1289: this.play.textContent = "Stop"; nickjillings@1289: }; nickjillings@1289: this.stopPlayback = function() nickjillings@1289: { nickjillings@1289: // Called when playback has stopped. This gets called even if playback never started! nickjillings@1289: this.play.setAttribute("playstate","ready"); nickjillings@1289: $(this.holder).removeClass('track-slider-playing'); nickjillings@1289: this.play.textContent = "Play"; nickjillings@1289: }; nickjillings@1289: this.getValue = function() { nickjillings@1289: return this.slider.value; nickjillings@1289: }; nickjillings@1289: nickjillings@1289: this.resize = function(event) nickjillings@1289: { nickjillings@1289: this.holder.style.height = window.innerHeight-200 + 'px'; nickjillings@1289: this.slider.style.height = window.innerHeight-250 + 'px'; nickjillings@1289: }; nickjillings@1289: this.updateLoading = function(progress) nickjillings@1289: { nickjillings@1289: progress = String(progress); nickjillings@1289: progress = progress.substr(0,5); nickjillings@1289: this.play.textContent = "Loading: "+progress+"%"; nickjillings@1289: }; nickjillings@1289: nickjillings@1289: if (this.parent.state == 1) nickjillings@1289: { nickjillings@1289: this.enable(); nickjillings@1289: } nickjillings@1289: this.getPresentedId = function() nickjillings@1289: { nickjillings@1289: return this.title.textContent; nickjillings@1289: }; nickjillings@1289: this.canMove = function() nickjillings@1289: { nickjillings@1289: return true; nickjillings@1289: }; nickjillings@1289: this.error = function() { nickjillings@1289: // audioObject has an error!! nickjillings@1289: this.playback.textContent = "Error"; nickjillings@1289: $(this.playback).addClass("error-colour"); nickjillings@1289: } nickjillings@1289: } nickjillings@1289: nickjillings@1289: function outsideReferenceDOM(audioObject,index,inject) nickjillings@1289: { nickjillings@1289: this.parent = audioObject; nickjillings@1289: this.outsideReferenceHolder = document.createElement('button'); nickjillings@1289: this.outsideReferenceHolder.id = 'outside-reference'; nickjillings@1289: this.outsideReferenceHolder.className = 'outside-reference'; nickjillings@1289: this.outsideReferenceHolder.setAttribute('track-id',index); nickjillings@1289: this.outsideReferenceHolder.textContent = "Play Reference"; nickjillings@1289: this.outsideReferenceHolder.disabled = true; nickjillings@1289: nickjillings@1289: this.outsideReferenceHolder.onclick = function(event) nickjillings@1289: { nickjillings@1289: audioEngineContext.play(event.currentTarget.getAttribute('track-id')); nickjillings@1289: }; nickjillings@1289: inject.appendChild(this.outsideReferenceHolder); nickjillings@1289: this.enable = function() nickjillings@1289: { nickjillings@1289: if (this.parent.state == 1) nickjillings@1289: { nickjillings@1289: this.outsideReferenceHolder.disabled = false; nickjillings@1289: } nickjillings@1289: }; nickjillings@1289: this.updateLoading = function(progress) nickjillings@1289: { nickjillings@1289: if (progress != 100) nickjillings@1289: { nickjillings@1289: progress = String(progress); nickjillings@1289: progress = progress.split('.')[0]; nickjillings@1289: this.outsideReferenceHolder[0].children[0].textContent = progress+'%'; nickjillings@1289: } else { nickjillings@1289: this.outsideReferenceHolder[0].children[0].textContent = "Play Reference"; nickjillings@1289: } nickjillings@1289: }; nickjillings@1289: this.startPlayback = function() nickjillings@1289: { nickjillings@1289: // Called when playback has begun nickjillings@1289: $('.track-slider').removeClass('track-slider-playing'); nickjillings@1289: $('.comment-div').removeClass('comment-box-playing'); nickjillings@1289: $(this.outsideReferenceHolder).addClass('track-slider-playing'); nickjillings@1289: }; nickjillings@1289: this.stopPlayback = function() nickjillings@1289: { nickjillings@1289: // Called when playback has stopped. This gets called even if playback never started! nickjillings@1289: $(this.outsideReferenceHolder).removeClass('track-slider-playing'); nickjillings@1289: }; nickjillings@1289: this.exportXMLDOM = function(audioObject) nickjillings@1289: { nickjillings@1289: return null; nickjillings@1289: }; nickjillings@1289: this.getValue = function() nickjillings@1289: { nickjillings@1289: return 0; nickjillings@1289: }; nickjillings@1289: this.getPresentedId = function() nickjillings@1289: { nickjillings@1289: return 'reference'; nickjillings@1289: }; nickjillings@1289: this.canMove = function() nickjillings@1289: { nickjillings@1289: return false; nickjillings@1289: }; nickjillings@1289: this.error = function() { nickjillings@1289: // audioObject has an error!! nickjillings@1289: this.outsideReferenceHolder.textContent = "Error"; nickjillings@1289: $(this.outsideReferenceHolder).addClass("error-colour"); nickjillings@1289: } nickjillings@1289: } nickjillings@1289: nickjillings@1289: function resizeWindow(event) nickjillings@1289: { nickjillings@1289: // Function called when the window has been resized. nickjillings@1289: // MANDATORY FUNCTION nickjillings@1289: nickjillings@1289: var outsideRef = document.getElementById('outside-reference'); nickjillings@1289: if(outsideRef != null) nickjillings@1289: { nickjillings@1289: outsideRef.style.left = (window.innerWidth-120)/2 + 'px'; nickjillings@1289: } nickjillings@1289: nickjillings@1289: // Auto-align nickjillings@1289: var numObj = document.getElementsByClassName('track-slider').length; nickjillings@1289: var totalWidth = (numObj-1)*150+100; nickjillings@1289: var diff = (window.innerWidth - totalWidth)/2; nickjillings@1289: document.getElementById('slider').style.height = window.innerHeight - 180 + 'px'; nickjillings@1289: if (diff <= 0){diff = 0;} nickjillings@1289: document.getElementById('slider-holder').style.marginLeft = diff + 'px'; nickjillings@1289: for (var i in audioEngineContext.audioObjects) nickjillings@1289: { nickjillings@1289: if (audioEngineContext.audioObjects[i].specification.type != 'outside-reference'){ nickjillings@1289: audioEngineContext.audioObjects[i].interfaceDOM.resize(event); nickjillings@1289: } nickjillings@1289: } nickjillings@1289: document.getElementById('scale-holder').style.marginLeft = (diff-100) + 'px'; nickjillings@1289: document.getElementById('scale-text-holder').style.height = window.innerHeight-194 + 'px'; nickjillings@1289: var canvas = document.getElementById('scale-canvas'); nickjillings@1289: canvas.width = totalWidth; nickjillings@1289: canvas.height = window.innerHeight-194; nickjillings@1289: drawScale(); nickjillings@1289: } nickjillings@1289: nickjillings@1289: function drawScale() nickjillings@1289: { nickjillings@1289: var interfaceObj = testState.currentStateMap.interfaces[0]; nickjillings@1289: var scales = testState.currentStateMap.interfaces[0].scales; nickjillings@1289: scales = scales.sort(function(a,b) { nickjillings@1289: return a.position - b.position; nickjillings@1289: }); nickjillings@1289: var canvas = document.getElementById('scale-canvas'); nickjillings@1289: var ctx = canvas.getContext("2d"); nickjillings@1289: var height = canvas.height; nickjillings@1289: var width = canvas.width; nickjillings@1289: var draw_heights = [24, height-34]; nickjillings@1289: var textHolder = document.getElementById('scale-text-holder'); nickjillings@1289: textHolder.innerHTML = null; nickjillings@1289: var lastHeight = 0; nickjillings@1289: for (var scale of scales) nickjillings@1289: { nickjillings@1289: var posPercent = scale.position / 100.0; nickjillings@1289: var posPix = (1-posPercent)*(draw_heights[1]-draw_heights[0])+draw_heights[0]; nickjillings@1289: ctx.fillStyle = "#000000"; nickjillings@1289: ctx.setLineDash([1,2]); nickjillings@1289: ctx.moveTo(0,posPix); nickjillings@1289: ctx.lineTo(width,posPix); nickjillings@1289: ctx.stroke(); nickjillings@1289: var text = document.createElement('div'); nickjillings@1289: text.align = "right"; nickjillings@1289: var textC = document.createElement('span'); nickjillings@1289: textC.textContent = scale.text; nickjillings@1289: text.appendChild(textC); nickjillings@1289: text.className = "scale-text"; nickjillings@1289: textHolder.appendChild(text); nickjillings@1289: text.style.top = (posPix-9) + 'px'; nickjillings@1289: text.style.left = 100 - ($(text).width()+3) + 'px'; nickjillings@1289: lastHeight = posPix; nickjillings@1289: } nickjillings@1289: } nickjillings@1289: nickjillings@1289: function buttonSubmitClick() // TODO: Only when all songs have been played! nickjillings@1289: { nickjillings@1289: var checks = []; nickjillings@1289: checks = checks.concat(testState.currentStateMap.interfaces[0].options); nickjillings@1289: checks = checks.concat(specification.interfaces.options); nickjillings@1289: var canContinue = true; nickjillings@1289: nickjillings@1289: // Check that the anchor and reference objects are correctly placed nickjillings@1289: if (interfaceContext.checkHiddenAnchor() == false) {return;} nickjillings@1289: if (interfaceContext.checkHiddenReference() == false) {return;} nickjillings@1289: nickjillings@1289: for (var i=0; i saves nickjillings@1289: // Get the current information in store (remember to appendChild your data to it) nickjillings@1289: // pageSpecification is the current page node configuration nickjillings@1289: // To create new XML nodes, use storage.document.createElement(); nickjillings@1289: }