diff --git a/src/class/ClassApplicator.ts b/src/class/ClassApplicator.ts index 7280452..851088b 100644 --- a/src/class/ClassApplicator.ts +++ b/src/class/ClassApplicator.ts @@ -10,22 +10,22 @@ const rainbowTextShadow = "rainbow-text-shadow"; // selectorで適用されるセレクタを取得できます // baseは初期化に必ず指定する必要があり書き換えるべきではありませんが、classesは追加で個別の設定を行うために指定できます export class classApplicator { - base: string[]; + #base: string[]; classes: string[]; constructor(base: string[]) { - this.base = base; + this.#base = base; this.classes = []; } apply(...elements: Elements[]) { - addClass(elements, [...this.base, ...this.classes]); + addClass(elements, [...this.#base, ...this.classes]); } remove(...elements: Elements[]) { - removeClass(elements, [...this.base, ...this.classes]); + removeClass(elements, [...this.#base, ...this.classes]); } selector() { - if (this.classes.length === 0) return `.${this.base}`; - else return `.${this.base}.${this.classes.join(".")}`; + if (this.classes.length === 0) return `.${this.#base}`; + else return `.${this.#base}.${this.classes.join(".")}`; } } diff --git a/src/class/Moodle/EnableRainbow.ts b/src/class/Moodle/EnableRainbow.ts index be6138e..25c0f52 100644 --- a/src/class/Moodle/EnableRainbow.ts +++ b/src/class/Moodle/EnableRainbow.ts @@ -1,4 +1,3 @@ -import { removeClass } from "../../utils/addClass"; import changeQueryInnerHTML from "../../utils/changeQueryInnerHTML"; import { RainbowApplicator } from "../ClassApplicator"; import { GundaiWebSite } from "../UnivWebsite"; @@ -14,7 +13,8 @@ export const EnableRainbowTextAndBg = (rainbow: RainbowApplicator) => { // rainbowBgの中のrainbowTextを無効化 const rainbowBgSelector = rainbow.bg.selector(); const targetElementsSelector = `${rainbowBgSelector} ${rainbow.text.selector()}`; - removeClass([targetElementsSelector], rainbow.text.base); + //removeClass([targetElementsSelector], rainbow.text.base); + rainbow.text.remove(targetElementsSelector); }; export const InjectLink = () => { diff --git a/tsconfig.json b/tsconfig.json index ac05d4d..0b76c0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "ES2015", "module": "commonjs", "outDir": "dist", "strict": true,