Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1621:f8220eeeeddc
Popup now in core.js, universal to interface.
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Tue, 26 May 2015 11:40:17 +0100 |
parents | da84079192c6 |
children | c3a66f0b33cc |
comparison
equal
deleted
inserted
replaced
1620:da84079192c6 | 1621:f8220eeeeddc |
---|---|
31 audioContext = new AudioContext; | 31 audioContext = new AudioContext; |
32 | 32 |
33 // Create the audio engine object | 33 // Create the audio engine object |
34 audioEngineContext = new AudioEngine(); | 34 audioEngineContext = new AudioEngine(); |
35 }; | 35 }; |
36 | |
37 function createPopup() { | |
38 // Create popup window interface | |
39 var insertPoint = document.getElementById("topLevelBody"); | |
40 var blank = document.createElement('div'); | |
41 blank.className = 'testHalt'; | |
42 | |
43 var popupHolder = document.createElement('div'); | |
44 popupHolder.id = 'popupHolder'; | |
45 popupHolder.className = 'popupHolder'; | |
46 popupHolder.style.position = 'absolute'; | |
47 popupHolder.style.left = (window.innerWidth/2)-250 + 'px'; | |
48 popupHolder.style.top = (window.innerHeight/2)-125 + 'px'; | |
49 insertPoint.appendChild(popupHolder); | |
50 insertPoint.appendChild(blank); | |
51 } | |
52 | |
53 function showPopup() | |
54 { | |
55 var popupHolder = document.getElementById('popupHolder'); | |
56 if (popupHolder == null || popupHolder == undefined) { | |
57 createPopup(); | |
58 popupHolder = document.getElementById('popupHolder'); | |
59 } | |
60 popupHolder.style.zIndex = 3; | |
61 popupHolder.style.visibility = 'visible'; | |
62 var blank = document.getElementsByClassName('testHalt')[0]; | |
63 blank.style.zIndex = 2; | |
64 blank.style.visibility = 'visible'; | |
65 } | |
66 | |
67 function hidePopup() | |
68 { | |
69 var popupHolder = document.getElementById('popupHolder'); | |
70 popupHolder.style.zIndex = -1; | |
71 popupHolder.style.visibility = 'hidden'; | |
72 var blank = document.getElementsByClassName('testHalt')[0]; | |
73 blank.style.zIndex = -2; | |
74 blank.style.visibility = 'hidden'; | |
75 } | |
36 | 76 |
37 function loadProjectSpec(url) { | 77 function loadProjectSpec(url) { |
38 // Load the project document from the given URL, decode the XML and instruct audioEngine to get audio data | 78 // Load the project document from the given URL, decode the XML and instruct audioEngine to get audio data |
39 // If url is null, request client to upload project XML document | 79 // If url is null, request client to upload project XML document |
40 var r = new XMLHttpRequest(); | 80 var r = new XMLHttpRequest(); |