comparison interfaces/ape.js @ 603:640ffb822da1

Bug #1652 and Feature #1650 fixes. You can specify the track labels through page attribute 'label' ('default', 'none', 'number', 'letter', 'capital'). Updated examples to match schema
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Thu, 10 Mar 2016 16:16:16 +0000
parents 7567dda76333
children a2d823a093e2
comparison
equal deleted inserted replaced
602:6531e3903ea1 603:640ffb822da1
237 console.log('Stopped at ' + time); // DEBUG/SAFETY 237 console.log('Stopped at ' + time); // DEBUG/SAFETY
238 } 238 }
239 }; 239 };
240 // Create Submit (save) button 240 // Create Submit (save) button
241 var submit = document.createElement("button"); 241 var submit = document.createElement("button");
242 submit.innerHTML = 'Submit'; 242 submit.innerHTML = 'Next';
243 submit.onclick = buttonSubmitClick; 243 submit.onclick = buttonSubmitClick;
244 submit.id = 'submit-button'; 244 submit.id = 'submit-button';
245 // Append the interface buttons into the interfaceButtons object. 245 // Append the interface buttons into the interfaceButtons object.
246 interfaceButtons.appendChild(playback); 246 interfaceButtons.appendChild(playback);
247 interfaceButtons.appendChild(submit); 247 interfaceButtons.appendChild(submit);
533 w = Math.floor(w+(offset+8)); 533 w = Math.floor(w+(offset+8));
534 trackObj.style.left = w+'px'; 534 trackObj.style.left = w+'px';
535 this.canvas.appendChild(trackObj); 535 this.canvas.appendChild(trackObj);
536 this.sliders.push(trackObj); 536 this.sliders.push(trackObj);
537 this.metrics.push(new metricTracker(this)); 537 this.metrics.push(new metricTracker(this));
538 trackObj.innerHTML = '<span>'+(this.metrics.length-1)+'</span>'; 538 var label = document.createElement("label");
539 switch(audioObject.specification.parent.label) {
540 case "letter":
541 label.textContent = String.fromCharCode(97 + this.metrics.length-1);
542 break;
543 case "capital":
544 label.textContent = String.fromCharCode(65 + this.metrics.length-1);
545 break;
546 case "none":
547 label.textContent = "";
548 break;
549 default:
550 label.textContent = ""+this.metrics.length;
551 break;
552 }
553 trackObj.appendChild(label);
539 this.metrics[this.metrics.length-1].initialise(convSliderPosToRate(trackObj)); 554 this.metrics[this.metrics.length-1].initialise(convSliderPosToRate(trackObj));
540 return trackObj; 555 return trackObj;
541 }; 556 };
542 557
543 this.resize = function(event) 558 this.resize = function(event)