Mercurial > hg > webaudioevaluationtool
comparison interfaces/ordinal.js @ 2980:68e5a789702f
JSHinting project
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 12 Jan 2018 15:49:54 +0000 |
parents | 5e1e9e606373 |
children | cb227441a102 95e946ee225b |
comparison
equal
deleted
inserted
replaced
2979:d5432dd0924e | 2980:68e5a789702f |
---|---|
1 /** | 1 /** |
2 * WAET Blank Template | 2 * WAET Blank Template |
3 * Use this to start building your custom interface | 3 * Use this to start building your custom interface |
4 */ | 4 */ |
5 /*globals interfaceContext, window, document, specification, audioEngineContext, console, testState, $, storage */ | 5 /*globals interfaceContext, window, document, specification, audioEngineContext, console, testState, $, storage, sessionStorage */ |
6 // Once this is loaded and parsed, begin execution | 6 // Once this is loaded and parsed, begin execution |
7 loadInterface(); | 7 loadInterface(); |
8 | 8 |
9 function loadInterface() { | 9 function loadInterface() { |
10 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects, | 10 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects, |
269 e.preventDefault(); // Necessary. Allows us to drop. | 269 e.preventDefault(); // Necessary. Allows us to drop. |
270 } | 270 } |
271 | 271 |
272 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object. | 272 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object. |
273 var srcid = e.dataTransfer.getData('text/plain'); | 273 var srcid = e.dataTransfer.getData('text/plain'); |
274 if (srcid == "") { | 274 if (srcid === "") { |
275 srcid = sessionStorage.getItem("drag-object"); | 275 srcid = sessionStorage.getItem("drag-object"); |
276 } | 276 } |
277 console.log(srcid); | 277 console.log(srcid); |
278 var srcid = Number(srcid); | 278 srcid = Number(srcid); |
279 var elements = container.childNodes; | 279 var elements = container.childNodes; |
280 var srcObject = audioEngineContext.audioObjects.find(function (ao) { | 280 var srcObject = audioEngineContext.audioObjects.find(function (ao) { |
281 return ao.id === srcid; | 281 return ao.id === srcid; |
282 }); | 282 }); |
283 var src = srcObject.interfaceDOM.root; | 283 var src = srcObject.interfaceDOM.root; |