MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / toggleButton

Function toggleButton

static/real-dark.ts:33–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31const localKey = 'aprilfools2024';
32
33function toggleButton() {
34 const theme = Settings.getStoredSettings().theme;
35 const date = new Date();
36 // month is 0-index and date is 1-indexed, because obviously that makes sense
37 const is_april_1 = date.getMonth() === 3 && date.getDate() === 1;
38 $('#true-dark .content').toggle(
39 is_april_1 && theme !== 'real-dark' && local.localStorage.get(localKey, '') !== 'hidden',
40 );
41}
42
43export function takeUsersOutOfRealDark() {
44 // take user out of real-dark in case they got stuck previously

Callers 1

setupRealDarkFunction · 0.85

Calls 2

getStoredSettingsMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected