comparison core.js @ 804:0f7b9ac48364

Fix Bug #1500: Error caused by buffer not being loaded into the pool and then not linking once downloaded.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 18 Dec 2015 17:50:14 +0000
parents 947ef5412d22
children e7ea0686b094
comparison
equal deleted inserted replaced
803:947ef5412d22 804:0f7b9ac48364
1930 this.commentBoxPrefix = this.commentBoxPrefix[0].textContent; 1930 this.commentBoxPrefix = this.commentBoxPrefix[0].textContent;
1931 } else { 1931 } else {
1932 this.commentBoxPrefix = "Comment on track"; 1932 this.commentBoxPrefix = "Comment on track";
1933 } 1933 }
1934 var audioElementsDOM = xml.getElementsByTagName('audioElements'); 1934 var audioElementsDOM = xml.getElementsByTagName('audioElements');
1935 var outsideReferenceHolder = null;
1935 for (var i=0; i<audioElementsDOM.length; i++) { 1936 for (var i=0; i<audioElementsDOM.length; i++) {
1936 var node = new this.audioElementNode(); 1937 var node = new this.audioElementNode();
1937 node.decode(this,audioElementsDOM[i]); 1938 node.decode(this,audioElementsDOM[i]);
1938 if (audioElementsDOM[i].getAttribute('type') == 'outsidereference') { 1939 if (audioElementsDOM[i].getAttribute('type') == 'outsidereference') {
1939 if (this.outsideReference == null) { 1940 if (this.outsideReference == null) {
1940 this.outsideReference = node; 1941 outsideReferenceHolder = node;
1942 this.outsideReference = i;
1941 } else { 1943 } else {
1942 console.log('Error only one audioelement can be of type outsidereference per audioholder'); 1944 console.log('Error only one audioelement can be of type outsidereference per audioholder');
1943 this.audioElements.push(node); 1945 this.audioElements.push(node);
1944 console.log('Element id '+audioElementsDOM[i].id+' made into normal node'); 1946 console.log('Element id '+audioElementsDOM[i].id+' made into normal node');
1945 } 1947 }
1950 1952
1951 if (this.randomiseOrder == true && typeof randomiseOrder === "function") 1953 if (this.randomiseOrder == true && typeof randomiseOrder === "function")
1952 { 1954 {
1953 this.audioElements = randomiseOrder(this.audioElements); 1955 this.audioElements = randomiseOrder(this.audioElements);
1954 } 1956 }
1957 if (outsideReferenceHolder != null)
1958 {
1959 this.audioElements.push(outsideReferenceHolder);
1960 this.outsideReference = this.audioElements.length-1;
1961 }
1962
1955 1963
1956 var commentQuestionsDOM = xml.getElementsByTagName('CommentQuestion'); 1964 var commentQuestionsDOM = xml.getElementsByTagName('CommentQuestion');
1957 for (var i=0; i<commentQuestionsDOM.length; i++) { 1965 for (var i=0; i<commentQuestionsDOM.length; i++) {
1958 var node = new this.commentQuestionNode(); 1966 var node = new this.commentQuestionNode();
1959 node.decode(commentQuestionsDOM[i]); 1967 node.decode(commentQuestionsDOM[i]);