comparison ape.js @ 709:d7f85b8bb851

Quick removal of innerText with innerHTML for Firefox/Mozilla support
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Thu, 09 Apr 2015 11:06:08 +0100
parents 8fd1f946f84e
children fef9e8337cfd
comparison
equal deleted inserted replaced
708:8fd1f946f84e 709:d7f85b8bb851
33 title.align = "center"; 33 title.align = "center";
34 var titleSpan = document.createElement('span'); 34 var titleSpan = document.createElement('span');
35 35
36 // Set title to that defined in XML, else set to default 36 // Set title to that defined in XML, else set to default
37 if (titleAttr != undefined) { 37 if (titleAttr != undefined) {
38 titleSpan.innerText = titleAttr.value; 38 titleSpan.innerHTML = titleAttr.value;
39 } else { 39 } else {
40 titleSpan.innerText = 'APE Tool'; 40 titleSpan.innerHTML = 'APE Tool';
41 } 41 }
42 // Insert the titleSpan element into the title div element. 42 // Insert the titleSpan element into the title div element.
43 title.appendChild(titleSpan); 43 title.appendChild(titleSpan);
44 44
45 // Store the return URL path in global projectReturn 45 // Store the return URL path in global projectReturn
54 var downloadPoint = document.createElement('div'); 54 var downloadPoint = document.createElement('div');
55 downloadPoint.id = 'download-point'; 55 downloadPoint.id = 'download-point';
56 56
57 // Create playback start/stop points 57 // Create playback start/stop points
58 var playback = document.createElement("button"); 58 var playback = document.createElement("button");
59 playback.innerText = 'Start'; 59 playback.innerHTML = 'Start';
60 // onclick function. Check if it is playing or not, call the correct function in the 60 // onclick function. Check if it is playing or not, call the correct function in the
61 // audioEngine, change the button text to reflect the next state. 61 // audioEngine, change the button text to reflect the next state.
62 playback.onclick = function() { 62 playback.onclick = function() {
63 if (audioEngineContext.status == 0) { 63 if (audioEngineContext.status == 0) {
64 audioEngineContext.play(); 64 audioEngineContext.play();
65 this.innerText = 'Stop'; 65 this.innerHTML = 'Stop';
66 } else { 66 } else {
67 audioEngineContext.stop(); 67 audioEngineContext.stop();
68 this.innerText = 'Start'; 68 this.innerHTML = 'Start';
69 } 69 }
70 }; 70 };
71 // Create Submit (save) button 71 // Create Submit (save) button
72 var submit = document.createElement("button"); 72 var submit = document.createElement("button");
73 submit.innerText = 'Submit'; 73 submit.innerHTML = 'Submit';
74 submit.onclick = function() { 74 submit.onclick = function() {
75 // TODO: Update this for postTest tags 75 // TODO: Update this for postTest tags
76 createProjectSave(projectReturn) 76 createProjectSave(projectReturn)
77 }; 77 };
78 // Append the interface buttons into the interfaceButtons object. 78 // Append the interface buttons into the interfaceButtons object.
136 audioEngineContext.newTrack(trackURL); 136 audioEngineContext.newTrack(trackURL);
137 // Create document objects to hold the comment boxes 137 // Create document objects to hold the comment boxes
138 var trackComment = document.createElement('div'); 138 var trackComment = document.createElement('div');
139 // Create a string next to each comment asking for a comment 139 // Create a string next to each comment asking for a comment
140 var trackString = document.createElement('span'); 140 var trackString = document.createElement('span');
141 trackString.innerText = 'Comment on track '+index; 141 trackString.innerHTML = 'Comment on track '+index;
142 // Create the HTML5 comment box 'textarea' 142 // Create the HTML5 comment box 'textarea'
143 var trackCommentBox = document.createElement('textarea'); 143 var trackCommentBox = document.createElement('textarea');
144 trackCommentBox.rows = '4'; 144 trackCommentBox.rows = '4';
145 trackCommentBox.cols = '100'; 145 trackCommentBox.cols = '100';
146 trackCommentBox.name = 'trackComment'+index; 146 trackCommentBox.name = 'trackComment'+index;
320 trackObj.id = i; 320 trackObj.id = i;
321 trackObj.url = audioEngineContext.audioObjects[i].url; 321 trackObj.url = audioEngineContext.audioObjects[i].url;
322 var slider = document.createElement("Rating"); 322 var slider = document.createElement("Rating");
323 var rate = Number(trackSliderObjects[i].style.left.substr(0,trackSliderObjects[i].style.left.length-2)); 323 var rate = Number(trackSliderObjects[i].style.left.substr(0,trackSliderObjects[i].style.left.length-2));
324 rate = (rate-rateMin)/rateMax; 324 rate = (rate-rateMin)/rateMax;
325 slider.innerText = Math.floor(rate*100); 325 slider.innerHTML = Math.floor(rate*100);
326 var comment = document.createElement("Comment"); 326 var comment = document.createElement("Comment");
327 comment.innerText = commentObjects[i].value; 327 comment.innerHTML = commentObjects[i].value;
328 trackObj.appendChild(slider); 328 trackObj.appendChild(slider);
329 trackObj.appendChild(comment); 329 trackObj.appendChild(comment);
330 xmlDoc.appendChild(trackObj); 330 xmlDoc.appendChild(trackObj);
331 } 331 }
332 332