28 lines
774 B
TypeScript
28 lines
774 B
TypeScript
import { DomTools } from './domtools.classes.domtools';
|
|
import * as plugins from './domtools.plugins';
|
|
|
|
export class ThemeManager {
|
|
public domtoolsRef: DomTools;
|
|
|
|
constructor(domtoolsRefArg: DomTools) {
|
|
this.domtoolsRef = domtoolsRefArg;
|
|
}
|
|
|
|
public goBright() {
|
|
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
|
const goBright = (elementArg as any).goBright;
|
|
if (typeof goBright === 'boolean') {
|
|
(elementArg as any).goBright = true;
|
|
}
|
|
});
|
|
}
|
|
|
|
public goDark() {
|
|
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
|
const goBright = (elementArg as any).goBright;
|
|
if (typeof goBright === 'boolean') {
|
|
(elementArg as any).goBright = false;
|
|
}
|
|
});
|
|
}
|
|
} |