comparison core.js @ 890:716cd1efe64c

Added reference and anchor values to audioHolders in specificationNode.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 17 Jun 2015 15:53:57 +0100
parents a17a380e2469
children 8c44e2d0d6c4
comparison
equal deleted inserted replaced
889:804813c05761 890:716cd1efe64c
1244 this.commonInterface = new function() { 1244 this.commonInterface = new function() {
1245 this.OptionNode = function(child) { 1245 this.OptionNode = function(child) {
1246 this.type = child.nodeName; 1246 this.type = child.nodeName;
1247 if (this.type == 'check') { 1247 if (this.type == 'check') {
1248 this.check = child.getAttribute('name'); 1248 this.check = child.getAttribute('name');
1249 } 1249 } else if (this.type == 'anchor' || this.type == 'reference') {
1250 } 1250 this.value = Number(child.textContent);
1251 }
1252 };
1251 this.options = []; 1253 this.options = [];
1252 if (commonInterfaceNode != undefined) { 1254 if (commonInterfaceNode != undefined) {
1253 var child = commonInterfaceNode.firstElementChild; 1255 var child = commonInterfaceNode.firstElementChild;
1254 while (child != undefined) { 1256 while (child != undefined) {
1255 this.options.push(new this.OptionNode(child)); 1257 this.options.push(new this.OptionNode(child));
1425 this.repeatCount = xml.getAttribute('repeatCount'); 1427 this.repeatCount = xml.getAttribute('repeatCount');
1426 if (xml.getAttribute('loop') == 'true') {this.loop = true;} 1428 if (xml.getAttribute('loop') == 'true') {this.loop = true;}
1427 else {this.loop == false;} 1429 else {this.loop == false;}
1428 if (xml.getAttribute('elementComments') == "true") {this.elementComments = true;} 1430 if (xml.getAttribute('elementComments') == "true") {this.elementComments = true;}
1429 else {this.elementComments = false;} 1431 else {this.elementComments = false;}
1432
1433 this.anchor = xml.getElementsByTagName('anchor');
1434 if (this.anchor.length == 0) {
1435 // Find anchor in commonInterface;
1436 for (var i=0; i<parent.commonInterface.options.length; i++) {
1437 if(parent.commonInterface.options[i].type == 'anchor') {
1438 this.anchor = parent.commonInterface.options[i].value;
1439 break;
1440 }
1441 }
1442 if (typeof(this.anchor) == "object") {
1443 this.reference = null;
1444 }
1445 } else {
1446 this.anchor = this.anchor[0].textContent;
1447 }
1448
1449 this.reference = xml.getElementsByTagName('reference');
1450 if (this.reference.length == 0) {
1451 // Find anchor in commonInterface;
1452 for (var i=0; i<parent.commonInterface.options.length; i++) {
1453 if(parent.commonInterface.options[i].type == 'reference') {
1454 this.reference = parent.commonInterface.options[i].value;
1455 break;
1456 }
1457 }
1458 if (typeof(this.reference) == "object") {
1459 this.reference = null;
1460 }
1461 } else {
1462 this.reference = this.reference[0].textContent;
1463 }
1430 1464
1431 this.preTest = new parent.prepostNode('pretest',xml.getElementsByTagName('PreTest')); 1465 this.preTest = new parent.prepostNode('pretest',xml.getElementsByTagName('PreTest'));
1432 this.postTest = new parent.prepostNode('posttest',xml.getElementsByTagName('PostTest')); 1466 this.postTest = new parent.prepostNode('posttest',xml.getElementsByTagName('PostTest'));
1433 1467
1434 this.interfaces = []; 1468 this.interfaces = [];