Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2778:80c95ab21220
#138 Create the image controller in core.js
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Fri, 21 Apr 2017 14:56:28 +0100 |
parents | 87d71c41c174 |
children | d8c36948f2b7 |
comparison
equal
deleted
inserted
replaced
2777:72604c3a3ed9 | 2778:80c95ab21220 |
---|---|
1111 advanceState(); | 1111 advanceState(); |
1112 return; | 1112 return; |
1113 } | 1113 } |
1114 var node = this.popupOptions[this.currentIndex], | 1114 var node = this.popupOptions[this.currentIndex], |
1115 pass = true, | 1115 pass = true, |
1116 timeDelta = (new Date() - lastNodeStart)/1000.0; | 1116 timeDelta = (new Date() - lastNodeStart) / 1000.0; |
1117 if (timeDelta < node.specification.minWait) { | 1117 if (timeDelta < node.specification.minWait) { |
1118 interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait "+(node.specification.minWait-timeDelta).toFixed(0)+" seconds"); | 1118 interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait " + (node.specification.minWait - timeDelta).toFixed(0) + " seconds"); |
1119 return; | 1119 return; |
1120 } | 1120 } |
1121 node.elapsedTime = timeDelta; | 1121 node.elapsedTime = timeDelta; |
1122 if (node.specification.type == 'question') { | 1122 if (node.specification.type == 'question') { |
1123 // Must extract the question data | 1123 // Must extract the question data |
3005 } else { | 3005 } else { |
3006 this.object.className = 'master-volume-holder-float'; | 3006 this.object.className = 'master-volume-holder-float'; |
3007 } | 3007 } |
3008 }; | 3008 }; |
3009 return volume; | 3009 return volume; |
3010 })(); | |
3011 | |
3012 this.imageHolder = (function () { | |
3013 var imageController = {}; | |
3014 imageController.root = document.createElement("div"); | |
3015 imageController.root.id = "imageController"; | |
3016 imageController.img = document.createElement("img"); | |
3017 imageController.root.appendChild(imageController.img); | |
3018 imageController.setImage = function (src) { | |
3019 imageController.img.src = ""; | |
3020 if (typeof src !== "string" || src.length == undefined) { | |
3021 return; | |
3022 } | |
3023 imageController.img.src = src; | |
3024 } | |
3025 return imageController; | |
3010 })(); | 3026 })(); |
3011 | 3027 |
3012 this.calibrationModuleObject = null; | 3028 this.calibrationModuleObject = null; |
3013 this.calibrationModule = function () { | 3029 this.calibrationModule = function () { |
3014 // This creates an on-page calibration module | 3030 // This creates an on-page calibration module |