File tree Expand file tree Collapse file tree 6 files changed +30
-28
lines changed
Expand file tree Collapse file tree 6 files changed +30
-28
lines changed Original file line number Diff line number Diff line change 11import axios from 'axios' ;
22import * as settings from 'src/utils/settings/index.js' ;
33import { infoToast } from 'src/utils/2.toasts.js' ;
4- import { debugToast } from 'src/utils/debug.js ' ;
4+ import debugToast from 'src/utils/debugToast ' ;
55import onPage from 'src/utils/onPage.js' ;
66import decrypt from 'src/utils/decrypt.emails.js' ;
77import translate from 'src/utils/translate.js' ;
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import eventManager from 'src/utils/eventManager.js';
33import * as settings from 'src/utils/settings/index.js' ;
44import { global } from 'src/utils/global.js' ;
55import { toast as fnToast } from 'src/utils/2.toasts.js' ;
6- import { debug , debugToast } from 'src/utils/debug.js' ;
6+ import { debug } from 'src/utils/debug.js' ;
7+ import debugToast from 'src/utils/debugToast' ;
78import * as cardHelper from 'src/utils/cardHelper.js' ;
89import onPage from 'src/utils/onPage.js' ;
910import * as hover from 'src/utils/hover.js' ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import luxon from 'luxon';
33import * as settings from 'src/utils/settings/index.js' ;
44import style from 'src/utils/style.js' ;
55import wrap from 'src/utils/2.pokemon.js' ;
6- import { debugToast } from 'src/utils/debug.js ' ;
6+ import debugToast from 'src/utils/debugToast ' ;
77import { toast as BasicToast } from 'src/utils/2.toasts.js' ;
88import sleep from 'src/utils/sleep.js' ;
99import * as menu from 'src/utils/menu.js' ;
Original file line number Diff line number Diff line change 11import eventManager from 'src/utils/eventManager.js' ;
2- import { debug , debugToast } from 'src/utils/debug.js' ;
2+ import { debug } from 'src/utils/debug.js' ;
3+ import debugToast from 'src/utils/debugToast' ;
34
45eventManager . on ( 'GameStart' , function gameEvents ( ) {
56 let finished = false ;
Original file line number Diff line number Diff line change 1- import { toast } from './2.toasts.js' ;
2- import merge from './merge.js' ;
3-
41export function debug ( message , permission = 'debugging' , ...extras ) {
52 if ( ! value ( permission ) && ! value ( 'debugging.*' ) ) return ;
63 // message.stack = new Error().stack.split('\n').slice(2);
74 console . log ( `[${ permission } ]` , message , ...extras ) ;
85}
96
10- export function debugToast ( arg , permission = 'debugging' ) {
11- if ( ! value ( permission ) && ! value ( 'debugging.*' ) ) return false ;
12- if ( typeof arg === 'string' ) {
13- arg = {
14- text : arg ,
15- } ;
16- }
17- const defaults = {
18- background : '#c8354e' ,
19- textShadow : '#e74c3c 1px 2px 1px' ,
20- css : { 'font-family' : 'inherit' } ,
21- button : {
22- // Don't use buttons, mouseOver sucks
23- background : '#e25353' ,
24- textShadow : '#46231f 0px 0px 3px' ,
25- } ,
26- } ;
27- return toast ( merge ( defaults , arg ) ) ;
28- }
29-
30- function value ( key ) {
7+ export function value ( key ) {
318 const val = localStorage . getItem ( key ) ;
329 return val === '1' || val === 'true' ;
3310}
Original file line number Diff line number Diff line change 1+ import { toast } from './2.toasts.js' ;
2+ import merge from './merge.js' ;
3+ import { value } from './debug.js' ;
4+
5+ export default function debugToast ( arg , permission = 'debugging' ) {
6+ if ( ! value ( permission ) && ! value ( 'debugging.*' ) ) return false ;
7+ if ( typeof arg === 'string' ) {
8+ arg = {
9+ text : arg ,
10+ } ;
11+ }
12+ const defaults = {
13+ background : '#c8354e' ,
14+ textShadow : '#e74c3c 1px 2px 1px' ,
15+ css : { 'font-family' : 'inherit' } ,
16+ button : {
17+ // Don't use buttons, mouseOver sucks
18+ background : '#e25353' ,
19+ textShadow : '#46231f 0px 0px 3px' ,
20+ } ,
21+ } ;
22+ return toast ( merge ( defaults , arg ) ) ;
23+ }
You can’t perform that action at this time.
0 commit comments