comparison js/specification.js @ 2777:72604c3a3ed9

Added schema layouts for #138
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Fri, 21 Apr 2017 14:46:16 +0100
parents 2fc62a50d593
children 9c031a976321
comparison
equal deleted inserted replaced
2776:d6e496b0a5a9 2777:72604c3a3ed9
413 }; 413 };
414 414
415 this.interfaceNode = function (specification) { 415 this.interfaceNode = function (specification) {
416 this.title = undefined; 416 this.title = undefined;
417 this.name = undefined; 417 this.name = undefined;
418 this.image = undefined;
418 this.options = []; 419 this.options = [];
419 this.scales = []; 420 this.scales = [];
420 this.schema = schemaRoot.getAllElementsByName('interface')[1]; 421 this.schema = schemaRoot.getAllElementsByName('interface')[1];
421 422
422 this.decode = function (parent, xml) { 423 this.decode = function (parent, xml) {
441 option[attributeName] = projectAttr; 442 option[attributeName] = projectAttr;
442 } 443 }
443 } 444 }
444 this.options.push(option); 445 this.options.push(option);
445 } 446 }
446 447 // Get the image node
448 var imageNode = xml.getElementsByTagName("image");
449 if (imageNode.length == 1) {
450 this.image = imageNode[0].getAttribute("src");
451 }
447 // Now the scales nodes 452 // Now the scales nodes
448 var scaleParent = xml.getElementsByTagName('scales'); 453 var scaleParent = xml.getElementsByTagName('scales');
449 if (scaleParent.length == 1) { 454 if (scaleParent.length == 1) {
450 scaleParent = scaleParent[0]; 455 scaleParent = scaleParent[0];
451 var scalelabels = scaleParent.getAllElementsByTagName('scalelabel'); 456 var scalelabels = scaleParent.getAllElementsByTagName('scalelabel');
788 this.gain = 0.0; 793 this.gain = 0.0;
789 this.label = undefined; 794 this.label = undefined;
790 this.startTime = undefined; 795 this.startTime = undefined;
791 this.stopTime = undefined; 796 this.stopTime = undefined;
792 this.sampleRate = undefined; 797 this.sampleRate = undefined;
798 this.image = undefined;
793 this.alternatives = []; 799 this.alternatives = [];
794 this.schema = schemaRoot.getAllElementsByName('audioelement')[0]; 800 this.schema = schemaRoot.getAllElementsByName('audioelement')[0];
795 this.parent = undefined; 801 this.parent = undefined;
796 this.decode = function (parent, xml) { 802 this.decode = function (parent, xml) {
797 this.parent = parent; 803 this.parent = parent;