# HG changeset patch # User Nicholas Jillings # Date 1492782988 -3600 # Node ID 80c95ab21220176cd22303155a0c0d51f95cd711 # Parent 72604c3a3ed9ff026646e821086a628db5ec3f16 #138 Create the image controller in core.js diff -r 72604c3a3ed9 -r 80c95ab21220 js/core.js --- a/js/core.js Fri Apr 21 14:46:16 2017 +0100 +++ b/js/core.js Fri Apr 21 14:56:28 2017 +0100 @@ -1113,9 +1113,9 @@ } var node = this.popupOptions[this.currentIndex], pass = true, - timeDelta = (new Date() - lastNodeStart)/1000.0; + timeDelta = (new Date() - lastNodeStart) / 1000.0; if (timeDelta < node.specification.minWait) { - interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait "+(node.specification.minWait-timeDelta).toFixed(0)+" seconds"); + interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait " + (node.specification.minWait - timeDelta).toFixed(0) + " seconds"); return; } node.elapsedTime = timeDelta; @@ -3009,6 +3009,22 @@ return volume; })(); + this.imageHolder = (function () { + var imageController = {}; + imageController.root = document.createElement("div"); + imageController.root.id = "imageController"; + imageController.img = document.createElement("img"); + imageController.root.appendChild(imageController.img); + imageController.setImage = function (src) { + imageController.img.src = ""; + if (typeof src !== "string" || src.length == undefined) { + return; + } + imageController.img.src = src; + } + return imageController; + })(); + this.calibrationModuleObject = null; this.calibrationModule = function () { // This creates an on-page calibration module