comparison interfaces/discrete.js @ 2793:1076ac62823f

#133 Add element specific images to musher, horizontal and discrete
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Sun, 23 Apr 2017 10:39:02 +0100
parents cae61c5bbed1
children 50bc3d714601
comparison
equal deleted inserted replaced
2792:2adc6d20ac0b 2793:1076ac62823f
135 135
136 if (interfaceObj.title !== null) { 136 if (interfaceObj.title !== null) {
137 document.getElementById("pageTitle").textContent = interfaceObj.title; 137 document.getElementById("pageTitle").textContent = interfaceObj.title;
138 } 138 }
139 139
140 if (interfaceObj.image !== undefined) { 140 if (interfaceObj.image !== undefined || audioHolderObject.audioElements.some(function (elem) {
141 return elem.image !== undefined;
142 })) {
141 document.getElementById("testContent").insertBefore(interfaceContext.imageHolder.root, document.getElementById("slider")); 143 document.getElementById("testContent").insertBefore(interfaceContext.imageHolder.root, document.getElementById("slider"));
142 interfaceContext.imageHolder.setImage(interfaceObj.image); 144 interfaceContext.imageHolder.setImage(interfaceObj.image);
143 } 145 }
144 146
145 // Delete outside reference 147 // Delete outside reference
342 if (this.parent.specification.parent.playOne || specification.playOne) { 344 if (this.parent.specification.parent.playOne || specification.playOne) {
343 $('.track-slider-button').text = "Wait"; 345 $('.track-slider-button').text = "Wait";
344 $('.track-slider-button').attr("disabled", "true"); 346 $('.track-slider-button').attr("disabled", "true");
345 } 347 }
346 interfaceContext.commentBoxes.highlightById(audioObject.id); 348 interfaceContext.commentBoxes.highlightById(audioObject.id);
349 if (audioObject.specification.image !== undefined) {
350 interfaceContext.imageHolder.setImage(audioObject.specification.image);
351 }
347 }; 352 };
348 this.stopPlayback = function () { 353 this.stopPlayback = function () {
349 // Called by audioObject when playback stops 354 // Called by audioObject when playback stops
350 if (this.play.getAttribute("playstate") == "playing") { 355 if (this.play.getAttribute("playstate") == "playing") {
351 this.play.setAttribute("playstate", "ready"); 356 this.play.setAttribute("playstate", "ready");
356 var box = interfaceContext.commentBoxes.boxes.find(function (a) { 361 var box = interfaceContext.commentBoxes.boxes.find(function (a) {
357 return a.id === audioObject.id; 362 return a.id === audioObject.id;
358 }); 363 });
359 if (box) { 364 if (box) {
360 box.highlight(false); 365 box.highlight(false);
366 }
367 if (audioObject.specification.parent.interfaces[0].image !== undefined) {
368 interfaceContext.imageHolder.setImage(audioObject.specification.parent.interfaces[0].image);
369 } else {
370 interfaceContext.imageHolder.setImage("");
361 } 371 }
362 } 372 }
363 }; 373 };
364 374
365 this.getValue = function () { 375 this.getValue = function () {