comparison js/core.js @ 2725:9c01d5dd22a2

#163. Made comment box highlighting a core function
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Sat, 15 Apr 2017 11:59:21 +0100
parents 2e1cafe93c78
children a13adc8f8d3d
comparison
equal deleted inserted replaced
2724:a684dc7a5327 2725:9c01d5dd22a2
2452 } 2452 }
2453 this.trackComment.style.width = boxwidth + "px"; 2453 this.trackComment.style.width = boxwidth + "px";
2454 this.trackCommentBox.style.width = boxwidth - 6 + "px"; 2454 this.trackCommentBox.style.width = boxwidth - 6 + "px";
2455 }; 2455 };
2456 this.resize(); 2456 this.resize();
2457 this.highlight = function (state) {
2458 if (state === true) {
2459 $(this.trackComment).addClass("comment-box-playing");
2460 } else {
2461 $(this.trackComment).removeClass("comment-box-playing");
2462 }
2463 };
2457 }; 2464 };
2458 commentBoxes.createCommentBox = function (audioObject) { 2465 commentBoxes.createCommentBox = function (audioObject) {
2459 var node = new this.elementCommentBox(audioObject); 2466 var node = new this.elementCommentBox(audioObject);
2460 this.boxes.push(node); 2467 this.boxes.push(node);
2461 audioObject.commentDOM = node; 2468 audioObject.commentDOM = node;
2483 this.injectPoint.removeChild(box.trackComment); 2490 this.injectPoint.removeChild(box.trackComment);
2484 }, this); 2491 }, this);
2485 this.injectPoint = null; 2492 this.injectPoint = null;
2486 } 2493 }
2487 this.boxes = []; 2494 this.boxes = [];
2495 };
2496 commentBoxes.highlightById = function (id) {
2497 if (id === undefined || typeof id !== "number" || id >= this.boxes.length) {
2498 console.log("Error - Invalid id");
2499 id = -1;
2500 }
2501 this.boxes.forEach(function (a) {
2502 if (a.id === id) {
2503 a.highlight(true);
2504 } else {
2505 a.highlight(false);
2506 }
2507 });
2488 }; 2508 };
2489 return commentBoxes; 2509 return commentBoxes;
2490 })(); 2510 })();
2491 2511
2492 this.commentQuestions = []; 2512 this.commentQuestions = [];
3667 } 3687 }
3668 pFilenamePrefix = value; 3688 pFilenamePrefix = value;
3669 return value; 3689 return value;
3670 } 3690 }
3671 } 3691 }
3672 }) 3692 });
3673 } 3693 }
3674 3694
3675 var window_depedancy_callback; 3695 var window_depedancy_callback;
3676 window_depedancy_callback = window.setInterval(function () { 3696 window_depedancy_callback = window.setInterval(function () {
3677 if (check_dependancies()) { 3697 if (check_dependancies()) {