Mercurial > hg > webaudioevaluationtool
comparison interfaces/ape.js @ 2782:be845c47bdaf
#138. Added fixed image to APE
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Fri, 21 Apr 2017 16:15:40 +0100 |
parents | c74c698795a9 |
children | cae61c5bbed1 |
comparison
equal
deleted
inserted
replaced
2781:c59bcb698684 | 2782:be845c47bdaf |
---|---|
454 this.name = interfaceObject.name; | 454 this.name = interfaceObject.name; |
455 this.interfaceObject = interfaceObject; | 455 this.interfaceObject = interfaceObject; |
456 this.sliderDOM = document.createElement('div'); | 456 this.sliderDOM = document.createElement('div'); |
457 this.sliderDOM.className = 'sliderCanvasDiv'; | 457 this.sliderDOM.className = 'sliderCanvasDiv'; |
458 this.sliderDOM.id = 'sliderCanvasHolder-' + this.id; | 458 this.sliderDOM.id = 'sliderCanvasHolder-' + this.id; |
459 this.imageHolder = (function () { | |
460 var imageController = {}; | |
461 imageController.root = document.createElement("div"); | |
462 imageController.root.className = "imageController"; | |
463 imageController.img = document.createElement("img"); | |
464 imageController.root.appendChild(imageController.img); | |
465 imageController.setImage = function (src) { | |
466 imageController.img.src = ""; | |
467 if (typeof src !== "string" || src.length == undefined) { | |
468 return; | |
469 } | |
470 imageController.img.src = src; | |
471 } | |
472 return imageController; | |
473 })(); | |
459 | 474 |
460 var pagetitle = document.createElement('div'); | 475 var pagetitle = document.createElement('div'); |
461 pagetitle.className = "pageTitle"; | 476 pagetitle.className = "pageTitle"; |
462 pagetitle.align = "center"; | 477 pagetitle.align = "center"; |
463 var titleSpan = document.createElement('span'); | 478 var titleSpan = document.createElement('span'); |
468 titleSpan.textContent = "Axis " + String(this.id + 1); | 483 titleSpan.textContent = "Axis " + String(this.id + 1); |
469 } | 484 } |
470 pagetitle.appendChild(titleSpan); | 485 pagetitle.appendChild(titleSpan); |
471 this.sliderDOM.appendChild(pagetitle); | 486 this.sliderDOM.appendChild(pagetitle); |
472 | 487 |
488 if (interfaceObject.image !== undefined) { | |
489 this.sliderDOM.appendChild(this.imageHolder.root); | |
490 this.imageHolder.setImage(interfaceObject.image); | |
491 } | |
473 // Create the slider box to hold the slider elements | 492 // Create the slider box to hold the slider elements |
474 this.canvas = document.createElement('div'); | 493 this.canvas = document.createElement('div'); |
475 if (this.name !== undefined) | 494 if (this.name !== undefined) |
476 this.canvas.id = 'slider-' + this.name; | 495 this.canvas.id = 'slider-' + this.name; |
477 else | 496 else |