diff --git a/inception/inception-brat-editor/src/main/ts/src/dispatcher/Dispatcher.ts b/inception/inception-brat-editor/src/main/ts/src/dispatcher/Dispatcher.ts index f527f420b59..5247d80e981 100644 --- a/inception/inception-brat-editor/src/main/ts/src/dispatcher/Dispatcher.ts +++ b/inception/inception-brat-editor/src/main/ts/src/dispatcher/Dispatcher.ts @@ -44,7 +44,7 @@ export type Message = 'dispatchAsynchError' | 'collectionLoaded' | 'requestRende | 'svgWidth' | 'configurationUpdated' | 'newSourceData' | 'init' | 'click' | 'contextmenu' | 'isReloadOkay' | 'spanAndAttributeTypesLoaded' | 'keydown' | 'dragstart' | 'mousedown' | 'mouseup' | 'mousemove' - | 'displaySpanComment' | 'displayArcComment' | 'displaySentComment' | 'hideComment' + | 'displaySpanComment' | 'displayArcComment' | 'displaySentComment' | 'resize' | 'displaySpanButtons' | 'configurationChanged' | 'mouseover' | 'mouseout' | 'dblclick' | 'keypress' | 'touchstart' | 'touchend' | 'collectionChanged' | 'renderData' | 'renderDataPatch' | 'triggerRender' diff --git a/inception/inception-brat-editor/src/main/ts/src/visualizer/Visualizer.ts b/inception/inception-brat-editor/src/main/ts/src/visualizer/Visualizer.ts index 2d1d419ff66..b955af01a58 100644 --- a/inception/inception-brat-editor/src/main/ts/src/visualizer/Visualizer.ts +++ b/inception/inception-brat-editor/src/main/ts/src/visualizer/Visualizer.ts @@ -3788,7 +3788,6 @@ export class Visualizer { const target = evt.target target.classList.remove('badTarget') - this.dispatcher.post('hideComment') if (this.highlight) { this.highlight.map(h => h.remove()) diff --git a/inception/inception-brat-editor/src/main/ts/src/visualizer_ui/VisualizerUI.ts b/inception/inception-brat-editor/src/main/ts/src/visualizer_ui/VisualizerUI.ts index c7f9b42e593..380ce9e2470 100644 --- a/inception/inception-brat-editor/src/main/ts/src/visualizer_ui/VisualizerUI.ts +++ b/inception/inception-brat-editor/src/main/ts/src/visualizer_ui/VisualizerUI.ts @@ -41,9 +41,8 @@ import type { Dispatcher } from '../dispatcher/Dispatcher' import { INSTANCE as Configuration } from '../configuration/Configuration' -import { INSTANCE as Util } from '../util/Util' import { DocumentData } from '../visualizer/DocumentData' -import { RelationTypeDto, EntityTypeDto, VID, CommentType } from '../protocol/Protocol' +import { RelationTypeDto, EntityTypeDto, VID } from '../protocol/Protocol' import { DiamAjax, Offsets } from '@inception-project/inception-js-api' import { Entity } from '../visualizer/Entity' import { AttributeType } from '../visualizer/AttributeType' @@ -55,25 +54,16 @@ export class VisualizerUI { private dispatcher: Dispatcher - private commentPopup: JQuery - private commentDisplayed = false - private displayCommentTimer: number | undefined = undefined - private ajax: DiamAjax constructor (dispatcher: Dispatcher, ajax: DiamAjax) { console.debug('Setting up brat visualizer-ui module...') this.ajax = ajax - this.commentPopup = $('#commentpopup') this.dispatcher = dispatcher this.dispatcher .on('init', this, this.init) .on('dataReady', this, this.rememberData) -// .on('displaySpanComment', this, this.displaySpanComment) -// .on('displayArcComment', this, this.displayArcComment) -// .on('displaySentComment', this, this.displaySentComment) - .on('hideComment', this, this.hideComment) .on('resize', this, this.onResize) .on('spanAndAttributeTypesLoaded', this, this.spanAndAttributeTypesLoaded) .on('doneRendering', this, this.onDoneRendering) @@ -84,231 +74,6 @@ export class VisualizerUI { .on('contextmenu', this, this.contextMenu) } - /* START comment popup - related */ - - /** - * @deprecated To be replaced with the new Popover component - */ - adjustToCursor (evt: MouseEvent, element, offset, top, right) { - // get the real width, without wrapping - element.css({ left: 0, top: 0 }) - const screenWidth = $(window).width() - // FIXME why the hell is this 22 necessary?!? - const elementHeight = element.height() + 22 - const elementWidth = element.width() + 22 - let x, y - offset = offset || 0 - if (top) { - y = evt.clientY - elementHeight - offset - if (y < 0) { top = false } - } - if (!top) { - y = evt.clientY + offset - } - if (right) { - x = evt.clientX + offset - if (x >= screenWidth - elementWidth) { right = false } - } - if (!right) { - x = evt.clientX - elementWidth - offset - } - if (y < 0) { y = 0 } - if (x < 0) { x = 0 } - element.css({ top: y, left: x }) - } - - /** - * @deprecated To be replaced with the new Popover component - */ - displaySentComment (evt: MouseEvent, commentText: string, commentType: CommentType) { - this.displayComment(evt, '', commentText, commentType) - } - - /** - * @deprecated To be replaced with the new Popover component - */ - displayComment (evt: MouseEvent, comment: string, commentText: string, commentType: CommentType, immediately?: boolean) { - let idtype = '' - if (commentType) { - // label comment by type, with special case for default note type - let commentLabel: string - if (commentType === 'AnnotatorNotes') { - commentLabel = 'Note: ' - } else { - commentLabel = '' + Util.escapeHTML(commentType) + ': ' - } - comment += '