Skip to content

Commit

Permalink
Clean: Simple function export
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Oct 16, 2023
1 parent f1e8895 commit 9a57e35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/class/Moodle/DisableRainbow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import changeQueryInnerHTML from "../../utils/ChangeQueryInnerHTML";
import GundaiWebSite from "../GundaiWebsite";
import { MoodleAdditionalInfo } from "./type";

export const DisableRainbowFunc = function (this: GundaiWebSite<MoodleAdditionalInfo>) {
export default function DisableRainbowFunc(this: GundaiWebSite<MoodleAdditionalInfo>) {
changeQueryInnerHTML(["#instance-320-header"], "現在のログイン人数");
RemoveRainbowBg(".navbar", ".addinghtml");
RemoveRainbowBg(".page-header-headings h1");
Expand All @@ -13,6 +13,4 @@ export const DisableRainbowFunc = function (this: GundaiWebSite<MoodleAdditional
document.querySelectorAll(".page-header-headings h1").forEach((e) => {
if (e.innerHTML.includes(headerText)) e.innerHTML.replace(headerText, "");
});
};

export default DisableRainbowFunc;
}
6 changes: 2 additions & 4 deletions src/class/Moodle/EnableRainbow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import changeQueryInnerHTML from "../../utils/ChangeQueryInnerHTML";
import GundaiWebSite from "../GundaiWebsite";
import { MoodleAdditionalInfo } from "./type";

export const EnableRainbowFunc = function (this: GundaiWebSite<MoodleAdditionalInfo>) {
export default function EnableRainbowFunc(this: GundaiWebSite<MoodleAdditionalInfo>) {
const headerText = this.AdditionalInfo.headerText;
document.querySelectorAll(".page-header-headings h1").forEach((e) => {
if (!e.innerHTML.includes(headerText)) e.innerHTML = e.innerHTML + headerText;
Expand All @@ -27,6 +27,4 @@ export const EnableRainbowFunc = function (this: GundaiWebSite<MoodleAdditionalI
supportSection.innerHTML =
supportSection.innerHTML +
`<a href="https://twitter.com/Hayao0819" target="blank" class="rainbow-text">Gaming Edition開発者に連絡する<i class="icon fa fa-external-link fa-fw ml-1" aria-hidden="true"></i></a>`;
};

export default EnableRainbowFunc;
}

0 comments on commit 9a57e35

Please sign in to comment.