diff --git a/app/www/annotate.js b/app/www/annotate.js index 54163ce..ec02bad 100644 --- a/app/www/annotate.js +++ b/app/www/annotate.js @@ -423,12 +423,12 @@ class Annotator extends EventTarget { this.outPointTimeMs = out_ms; // this._seekByTimeMs(this.audioOffset < 0 ? this.audioOffset * 1000 : 0); // draw full stroke of annotation - console.log('setInOut'); + console.debug('setInOut'); this.drawStrokePosition(this.inPointPosition, this.outPointPosition); - console.log([`${this.inPointTimeMs}`, `${this.outPointTimeMs}`]) + console.debug([`${this.inPointTimeMs}`, `${this.outPointTimeMs}`]) this.slider.set([this.inPointTimeMs, this.outPointTimeMs]); - // console.log(this.selectedAnnotation); + // console.debug(this.selectedAnnotation); if (this.selectedAnnotation) { this.selectedAnnotation.t_in = in_ms; this.selectedAnnotation.t_out = out_ms; @@ -443,7 +443,7 @@ class Annotator extends EventTarget { this.outPointTimeMs = null; this._seekByTimeMs(this.audioOffset < 0 ? this.audioOffset * 1000 : 0); // draw full stroke of annotation - console.log('reset!'); + console.debug('reset!'); this.drawStrokePosition(this.inPointPosition, [Infinity, Infinity]); this.setUpAnnotator(); } @@ -471,7 +471,7 @@ class Annotator extends EventTarget { } return this.loadStrokes(data, metadata) }) - .catch(e => console.log(e)); + .catch(e => console.error(e)); } else { return this.loadStrokes(data, null); } @@ -480,7 +480,7 @@ class Annotator extends EventTarget { // play on click for player if(this.config.is_player) { this.svgEl.addEventListener('click', (ev) => { - console.log('clicked for play/pause'); + console.debug('clicked for play/pause'); this.playPause(); }); } @@ -492,7 +492,7 @@ class Annotator extends EventTarget { this.wrapperEl.classList.remove('loading'); } }) - .catch(e => console.log(e)); + .catch(e => console.debug(e)); } updateState() { @@ -519,7 +519,7 @@ class Annotator extends EventTarget { setSaved(state) { if (this.state != state) { - console.log('already outdated'); + console.debug('already outdated'); } else { this.wrapperEl.classList.add('saved'); @@ -545,7 +545,7 @@ class Annotator extends EventTarget { } }) .catch((error) => { - console.log(error); + console.error(error); }); } @@ -661,11 +661,11 @@ class Annotator extends EventTarget { ttInputEl.focus(); const submit = () => { - console.log(ttInputEl.value); + console.debug(ttInputEl.value); const tcMs = this.formatter.from(ttInputEl.value); let points = this.slider.get(); points[i] = tcMs; - console.log(points); + console.debug(points); this.slider.set(points); }; ttInputEl.addEventListener('keydown', (keyE) => { @@ -702,7 +702,6 @@ class Annotator extends EventTarget { } this.title = null; - console.log(metadata); if (metadata && metadata.hasOwnProperty('title')) { this.title = metadata.title; } @@ -755,17 +754,15 @@ class Annotator extends EventTarget { // Probably a wrong order if (ev.key == 'ArrowLeft' && ev.shiftKey) { const p = this._paused; - console.log(p); const diff = ev.ctrlKey ? 10000 : 1000; this.scrubTo(this._currentTimeMs - diff); - if (!p) { console.log('play!'); this.play(); } // scrubTo() causes a pause(); + if (!p) { this.play(); } // scrubTo() causes a pause(); } if (ev.key == 'ArrowRight' && ev.shiftKey) { const p = this._paused; - console.log(p); const diff = ev.ctrlKey ? 10000 : 1000; this.scrubTo(this._currentTimeMs + diff); - if (!p) { console.log('play!'); this.play(); } // scrubTo() causes a pause(); + if (!p) { this.play(); } // scrubTo() causes a pause(); } // additional keys only for annotation mode @@ -967,12 +964,12 @@ class Annotator extends EventTarget { } } else { if (this.audioEl.currentTime !== t_start / 1000) { - console.log(this.audioEl.currentTime, t_start / 1000); + console.debug(this.audioEl.currentTime, t_start / 1000); this.audioEl.currentTime = t_start / 1000; } this.audioEl.play(); // this.audioEl.play(); // play is done in "seeked" evenlistener - console.log(this.audioEl.currentTime, t_start, t_in, t_out); + console.debug(this.audioEl.currentTime, t_start, t_in, t_out); } this.audioIsPlaying = true; // also state as playing in preroll @@ -1115,7 +1112,7 @@ class Annotator extends EventTarget { // when an outpoint is set, stop playing there if (this.outPointPosition && (next_path > this.outPointPosition[0] || (next_path == this.outPointPosition[0] && next_point > this.outPointPosition[1]))) { - console.log('> out point', this.outPointPosition) + console.debug('> out point', this.outPointPosition) return [null, null]; }