blob: e12a7c40dfe86022865c4cad44f1af9af6752499 [file] [log] [blame]
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02001import {
2 ScriptEnvironment,
3 ScriptPage,
4 ScriptRunPhase,
5} from '../../../common/architecture/scripts/Script';
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +02006import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript';
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02007import CCInfiniteScroll from '../core/ccInfiniteScroll';
8import CCInfiniteScrollLoadMoreBarHandler from '../nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler';
9import CCInfiniteScrollLoadMoreBtnHandler from '../nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler';
10import CCInfiniteScrollSetUpHandler from '../nodeWatcherHandlers/ccInfiniteScrollSetUp.handler';
11
12export interface InfiniteScrollNodeWatcherOptions {
13 ccInfiniteScroll: CCInfiniteScroll;
14}
15
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +020016export default class CCInfiniteScrollScript extends LegacyNodeWatcherScript<InfiniteScrollNodeWatcherOptions> {
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +020017 page = ScriptPage.CommunityConsole;
18 environment = ScriptEnvironment.ContentScript;
19 runPhase = ScriptRunPhase.Main;
20 handlers = new Map([
21 ['ccInfiniteScrollSetUp', CCInfiniteScrollSetUpHandler],
22 ['ccInfiniteScrollLoadMoreBar', CCInfiniteScrollLoadMoreBarHandler],
23 ['ccInfiniteScrollLoadMoreBtn', CCInfiniteScrollLoadMoreBtnHandler],
24 ]);
25
26 protected optionsFactory(): InfiniteScrollNodeWatcherOptions {
27 return {
28 ccInfiniteScroll: new CCInfiniteScroll(),
29 };
30 }
31}