# HG changeset patch # User Nicholas Jillings # Date 1434465842 -3600 # Node ID 28525223b3c090d72093c2cb96b5905e9f5a542b # Parent 5d251b4aabd61495da1daf272bbaba0a06e9b519 Added common interface to specification to handle global interface-specific functions such as checks for playback. diff -r 5d251b4aabd6 -r 28525223b3c0 core.js --- a/core.js Tue Jun 16 14:38:47 2015 +0100 +++ b/core.js Tue Jun 16 15:44:02 2015 +0100 @@ -1201,6 +1201,7 @@ // Handles the decoding of the project specification XML into a simple JavaScript Object. this.interfaceType; + this.commonInterface; this.projectReturn; this.randomiseOrder; this.collectMetrics; @@ -1233,6 +1234,30 @@ } } + var commonInterfaceNode = setupNode.getElementsByTagName('interface'); + if (commonInterfaceNode.length > 0) { + commonInterfaceNode = commonInterfaceNode[0]; + } else { + commonInterfaceNode = undefined; + } + + this.commonInterface = new function() { + this.OptionNode = function(child) { + this.type = child.nodeName; + if (this.type == 'check') { + this.check = child.getAttribute('name'); + } + } + this.options = []; + if (commonInterfaceNode != undefined) { + var child = commonInterfaceNode.firstElementChild; + while (child != undefined) { + this.options.push(new this.OptionNode(child)); + child = child.nextElementSibling; + } + } + }; + var audioHolders = projectXML.getElementsByTagName('audioHolder'); for (var i=0; ielementFlagMoved elementListenTracker + + + + +