blob: 199ff1880a83e2e57806f197ff598173a28de4d9 [file] [log] [blame]
Adrià Vilanova Martínez66836fd2024-05-04 22:43:06 +02001import DependenciesProviderSingleton, {
2 ExtraInfoDependency,
3} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
4import {
5 ScriptEnvironment,
6 ScriptPage,
7 ScriptRunPhase,
8} from '../../../common/architecture/scripts/Script';
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +02009import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript';
Adrià Vilanova Martínez66836fd2024-05-04 22:43:06 +020010import ExtraInfo from '../core';
11import CCExtraInfoProfileAbuseChipsHandler from '../nodeWatcherHandlers/profile/ccExtraInfoProfileAbuseChips.handler';
12import CCExtraInfoProfilePerForumStatsHandler from '../nodeWatcherHandlers/profile/ccExtraInfoProfilePerForumStats.handler';
13import CCExtraInfoThreadCommentHandler from '../nodeWatcherHandlers/thread/ccExtraInfoThreadComment.handler';
14import CCExtraInfoThreadListHandler from '../nodeWatcherHandlers/threadList/ccExtraInfoThreadList.handler';
15import CCExtraInfoThreadListToolbeltHandler from '../nodeWatcherHandlers/threadList/ccExtraInfoThreadListToolbelt.handler';
16import CCExtraInfoThreadQuestionHandler from '../nodeWatcherHandlers/thread/ccExtraInfoThreadQuestion.handler';
17import CCExtraInfoThreadReplyHandler from '../nodeWatcherHandlers/thread/ccExtraInfoThreadReply.handler';
18
19export interface CCExtraInfoMainOptions {
20 extraInfo: ExtraInfo;
21}
22
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +020023export default class CCExtraInfoMainScript extends LegacyNodeWatcherScript<CCExtraInfoMainOptions> {
Adrià Vilanova Martínez66836fd2024-05-04 22:43:06 +020024 page = ScriptPage.CommunityConsole;
25 environment = ScriptEnvironment.ContentScript;
26 runPhase = ScriptRunPhase.Main;
27 handlers = new Map([
28 ['ccExtraInfoProfile', CCExtraInfoProfileAbuseChipsHandler],
29 ['ccExtraInfoProfilePerForumStats', CCExtraInfoProfilePerForumStatsHandler],
30 ['ccExtraInfoThreadComment', CCExtraInfoThreadCommentHandler],
31 ['ccExtraInfoThreadList', CCExtraInfoThreadListHandler],
32 ['ccExtraInfoThreadListToolbelt', CCExtraInfoThreadListToolbeltHandler],
33 ['ccExtraInfoThreadQuestion', CCExtraInfoThreadQuestionHandler],
34 ['ccExtraInfoThreadReply', CCExtraInfoThreadReplyHandler],
35 ]);
36
37 protected optionsFactory(): CCExtraInfoMainOptions {
38 const dependenciesProvider = DependenciesProviderSingleton.getInstance();
39 return {
40 extraInfo: dependenciesProvider.getDependency(ExtraInfoDependency),
41 };
42 }
43}