2022-01-08 15:54:11 -08:00
|
|
|
import registerEvents from 'utilities/registerEvents';
|
|
|
|
import registerAnswerboxCommentEvents from './comment';
|
|
|
|
import { answerboxDestroyHandler } from './destroy';
|
|
|
|
import { answerboxReportHandler } from './report';
|
2021-12-26 14:01:16 -08:00
|
|
|
import { shareEventHandler } from './share';
|
2022-01-08 15:54:11 -08:00
|
|
|
import { answerboxSmileHandler } from './smile';
|
|
|
|
import { answerboxSubscribeHandler } from './subscribe';
|
2021-08-10 04:16:40 -07:00
|
|
|
|
|
|
|
export default (): void => {
|
2021-08-10 06:50:17 -07:00
|
|
|
if ('share' in navigator) {
|
|
|
|
document.body.classList.add('cap-web-share');
|
|
|
|
}
|
2022-01-08 15:54:11 -08:00
|
|
|
|
|
|
|
registerEvents([
|
|
|
|
{ type: 'click', target: '[name=ab-share]', handler: shareEventHandler, global: true },
|
|
|
|
{ type: 'click', target: '[data-action=ab-submarine]', handler: answerboxSubscribeHandler, global: true },
|
|
|
|
{ type: 'click', target: '[data-action=ab-report]', handler: answerboxReportHandler, global: true },
|
|
|
|
{ type: 'click', target: '[data-action=ab-destroy]', handler: answerboxDestroyHandler, global: true },
|
|
|
|
{ type: 'click', target: '[name=ab-smile]', handler: answerboxSmileHandler, global: true }
|
|
|
|
]);
|
|
|
|
|
|
|
|
registerAnswerboxCommentEvents();
|
2021-08-10 06:50:17 -07:00
|
|
|
}
|