2022-10-02 13:10:04 -07:00
|
|
|
import registerEvents from "retrospring/utilities/registerEvents";
|
2022-01-08 15:54:11 -08:00
|
|
|
import { commentDestroyHandler } from "./destroy";
|
2023-03-18 07:24:36 -07:00
|
|
|
import { commentComposeEnd, commentComposeStart, commentCreateClickHandler, commentCreateKeyboardHandler } from "./new";
|
2022-01-08 15:54:11 -08:00
|
|
|
import { commentReportHandler } from "./report";
|
|
|
|
import { commentToggleHandler } from "./toggle";
|
2023-03-05 08:29:38 -08:00
|
|
|
import { commentHotkeyHandler } from "retrospring/features/answerbox/comment/hotkey";
|
2022-01-08 15:54:11 -08:00
|
|
|
|
|
|
|
export default (): void => {
|
|
|
|
registerEvents([
|
|
|
|
{ type: 'click', target: '[name=ab-comments]', handler: commentToggleHandler, global: true },
|
2023-03-05 08:29:38 -08:00
|
|
|
{ type: 'click', target: '[name=ab-open-and-comment]', handler: commentHotkeyHandler, global: true },
|
2022-01-08 15:54:11 -08:00
|
|
|
{ type: 'click', target: '[data-action=ab-comment-report]', handler: commentReportHandler, global: true },
|
|
|
|
{ type: 'click', target: '[data-action=ab-comment-destroy]', handler: commentDestroyHandler, global: true },
|
2022-10-25 08:13:07 -07:00
|
|
|
{ type: 'compositionstart', target: '[name=ab-comment-new]', handler: commentComposeStart, global: true },
|
|
|
|
{ type: 'compositionend', target: '[name=ab-comment-new]', handler: commentComposeEnd, global: true },
|
2023-03-18 07:24:36 -07:00
|
|
|
{ type: 'keydown', target: '[name=ab-comment-new]', handler: commentCreateKeyboardHandler, global: true },
|
|
|
|
{ type: 'click', target: '[name=ab-comment-new-submit]', handler: commentCreateClickHandler, global: true }
|
2022-01-08 15:54:11 -08:00
|
|
|
]);
|
2022-10-02 13:10:04 -07:00
|
|
|
}
|