-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Do not use the function that returns function
- Loading branch information
Showing
5 changed files
with
54 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { RemoveRainbowBg } from "../../utils/AddClass"; | ||
import changeQueryInnerHTML from "../../utils/ChangeQueryInnerHTML"; | ||
import GundaiWebSite from "../GundaiWebsite"; | ||
import { MoodleAdditionalInfo } from "./type"; | ||
|
||
export const DisableRainbowFunc = function (this: GundaiWebSite<MoodleAdditionalInfo>) { | ||
changeQueryInnerHTML(["#instance-320-header"], "現在のログイン人数"); | ||
RemoveRainbowBg(".navbar", ".addinghtml"); | ||
RemoveRainbowBg(".page-header-headings h1"); | ||
RemoveRainbowBg("a"); | ||
|
||
const headerText = this.AdditionalInfo.headerText; | ||
document.querySelectorAll(".page-header-headings h1").forEach((e) => { | ||
if (e.innerHTML.includes(headerText)) e.innerHTML.replace(headerText, ""); | ||
}); | ||
}; | ||
|
||
export default DisableRainbowFunc; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { addRainbowBg, addRainbowText } from "../../utils/AddClass"; | ||
import changeQueryInnerHTML from "../../utils/ChangeQueryInnerHTML"; | ||
import GundaiWebSite from "../GundaiWebsite"; | ||
import { MoodleAdditionalInfo } from "./type"; | ||
|
||
export const EnableRainbowFunc = function (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; | ||
}); | ||
|
||
changeQueryInnerHTML(["#instance-320-header"], "現在のプレイ人数"); | ||
addRainbowBg(".navbar", ".addinghtml"); | ||
addRainbowText(".page-header-headings h1"); | ||
addRainbowText("a"); | ||
|
||
document.querySelectorAll(".logo").forEach((e) => { | ||
if (e.getAttribute("src")) e.setAttribute("src", chrome.runtime.getURL("assets/GULMS.png")); | ||
}); | ||
|
||
document.querySelectorAll("img.userpicture").forEach((e) => { | ||
if (e.getAttribute("src")) e.setAttribute("src", chrome.runtime.getURL("assets/partyparrot.gif")); | ||
}); | ||
|
||
const supportSection = document.querySelector(".footer-support-link"); | ||
if (supportSection) | ||
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; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// 情報の信頼性は社会の構築において重要な要素である | ||
// 個人の信頼性は家庭の構築において重要な要素である | ||
import GundaiWebSite from "../GundaiWebsite"; | ||
import DisableRainbowFunc from "./DisableRainbowFunc"; | ||
import EnableRainbowFunc from "./EnableRainbowFunc"; | ||
import DisableRainbow from "./DisableRainbow"; | ||
import EnableRainbow from "./EnableRainbow"; | ||
import { MoodleAdditionalInfo } from "./type"; | ||
|
||
export const Moodle = new GundaiWebSite<MoodleAdditionalInfo>(); | ||
Moodle.AdditionalInfo.headerText = " Gaming Edition🎮"; | ||
Moodle.EnableRainbow = EnableRainbowFunc(Moodle); | ||
Moodle.DisableRainbow = DisableRainbowFunc(Moodle); | ||
Moodle.EnableRainbow = EnableRainbow; | ||
Moodle.DisableRainbow = DisableRainbow; |