@@ -3,7 +3,7 @@ import * as settings from '../../utils/settings/index.js';
33import { isApril , IMAGES } from '../../utils/isApril.js' ;
44
55const year = `${ new Date ( ) . getFullYear ( ) } ` ;
6- const aprilFools = settings . register ( {
6+ export const aprilFools = settings . register ( {
77 name : 'Disable April Fools Jokes' ,
88 key : 'underscript.disable.fishday' ,
99 note : 'Disables *almost* everything.' ,
@@ -13,7 +13,8 @@ const aprilFools = settings.register({
1313 toggleFish ( $ ( 'body' ) ) ;
1414 } ,
1515} ) ;
16- function isSoftDisabled ( ) {
16+
17+ export function isSoftDisabled ( ) {
1718 return localStorage . getItem ( aprilFools . key ) === year ;
1819}
1920
@@ -26,10 +27,10 @@ function toggleFish($el) {
2627
2728 $el . find ( `img[src*="undercards.net/${ search } /"],img[src^="/${ search } /"],img[src^="${ search } /"]` ) . each ( ( _ , img ) => {
2829 img . src = img . src . replace ( search , replace ) ;
29- } ) . on ( 'error' , ( ) => aprilFools . set ( year ) ) ;
30+ } ) . one ( 'error' , ( ) => aprilFools . set ( year ) ) ;
3031 $el . find ( `[style*="url(\\"${ search } /"]` ) . each ( ( i , img ) => {
3132 img . style . background = img . style . background . replace ( search , replace ) ;
32- } ) . on ( 'error' , ( ) => aprilFools . set ( year ) ) ;
33+ } ) . one ( 'error' , ( ) => aprilFools . set ( year ) ) ;
3334}
3435
3536eventManager . on ( 'undercards:season' , ( ) => {
0 commit comments