Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 1 | import { |
| 2 | ScriptEnvironment, |
| 3 | ScriptPage, |
| 4 | ScriptRunPhase, |
| 5 | } from '../../../common/architecture/scripts/Script'; |
Adrià Vilanova Martínez | 8b591d9 | 2024-10-19 15:55:15 +0200 | [diff] [blame^] | 6 | import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript'; |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 7 | import CCInfiniteScroll from '../core/ccInfiniteScroll'; |
| 8 | import CCInfiniteScrollLoadMoreBarHandler from '../nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler'; |
| 9 | import CCInfiniteScrollLoadMoreBtnHandler from '../nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler'; |
| 10 | import CCInfiniteScrollSetUpHandler from '../nodeWatcherHandlers/ccInfiniteScrollSetUp.handler'; |
| 11 | |
| 12 | export interface InfiniteScrollNodeWatcherOptions { |
| 13 | ccInfiniteScroll: CCInfiniteScroll; |
| 14 | } |
| 15 | |
Adrià Vilanova Martínez | 8b591d9 | 2024-10-19 15:55:15 +0200 | [diff] [blame^] | 16 | export default class CCInfiniteScrollScript extends LegacyNodeWatcherScript<InfiniteScrollNodeWatcherOptions> { |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 17 | 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 | } |