Skip to content

Commit

Permalink
Add: Gaming MyLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Oct 16, 2023
1 parent 9a57e35 commit 9f897e0
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 12 deletions.
4 changes: 4 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
{
"matches": ["*://www.media.gunma-u.ac.jp/*"],
"js": ["common.js", "media.js"]
},
{
"matches": ["*://opac.lib.gunma-u.ac.jp/*"],
"js": ["common.js", "mylib.js"]
}
]
}
6 changes: 3 additions & 3 deletions src/class/Kyomu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ const EnableRainbow = () => {
AddRainbowBg(".top_title_header", ".top_now_title");

// トップページのウェルカムメッセージ
ChangeQueryInnerHTML(["#loginHeader_lblWelcome_1_lbl"], "よおこそ、群馬大学ゲーミング教務システムへ");
ChangeQueryInnerHTML("#loginHeader_lblWelcome_1_lbl", "よおこそ、群馬大学ゲーミング教務システムへ");
ChangeQueryInnerHTML(
["#loginHeader_lblWelcome_2_lbl"],
"#loginHeader_lblWelcome_2_lbl",
"このサイトでは、プレーヤーの群馬大学での𝑮𝒂𝒎𝒊𝒏𝒈 𝑳𝒊𝒇𝒆 𝑺𝒕𝒚𝒍𝒆をいい感じにします",
);

// トップページのお知らせ
ChangeQueryInnerHTML(["#AllAnnualList_LblTitle"], "ゲーミング ライフ スタイル");
ChangeQueryInnerHTML("#AllAnnualList_LblTitle", "ゲーミング ライフ スタイル");

// 受信メッセージ一覧
AddRainbowBg("#ctl00_phContents_ctlMesReceive_gridMes tr");
Expand Down
2 changes: 1 addition & 1 deletion src/class/Moodle/DisableRainbow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import GundaiWebSite from "../GundaiWebsite";
import { MoodleAdditionalInfo } from "./type";

export default function DisableRainbowFunc(this: GundaiWebSite<MoodleAdditionalInfo>) {
changeQueryInnerHTML(["#instance-320-header"], "現在のログイン人数");
changeQueryInnerHTML("#instance-320-header", "現在のログイン人数");
RemoveRainbowBg(".navbar", ".addinghtml");
RemoveRainbowBg(".page-header-headings h1");
RemoveRainbowBg("a");
Expand Down
2 changes: 1 addition & 1 deletion src/class/Moodle/EnableRainbow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function EnableRainbowFunc(this: GundaiWebSite<MoodleAdditionalIn
if (!e.innerHTML.includes(headerText)) e.innerHTML = e.innerHTML + headerText;
});

changeQueryInnerHTML(["#instance-320-header"], "現在のプレイ人数");
changeQueryInnerHTML("#instance-320-header", "現在のプレイ人数");
AddRainbowBg(".navbar", ".addinghtml");
AddRainbowText(".page-header-headings h1");
AddRainbowText("a");
Expand Down
22 changes: 22 additions & 0 deletions src/class/MyLibrary/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AddRainbowBg, AddRainbowText } from "../../utils/AddClass";
import ChangeQueryInnerHTML from "../../utils/ChangeQueryInnerHTML";
import GundaiWebSite from "../GundaiWebsite";

export const MyLibrary = new GundaiWebSite(() => {
if (location.pathname == "/portal/portal/selectLogin/") {
//document.getElementById("explanation")
ChangeQueryInnerHTML(
"#explanation",
"My Libraryへよおこそ。全学ゲーミングアカウントをお持ちの方は、全学ゲーミングアカウントでログイン。お持ちでない方は図書館ゲストIDでログインを選択してください。",
);
ChangeQueryInnerHTML("#ssoLoginTitle", "全学ゲーミングアカウントでログイン");

// フッターをレインボー
AddRainbowBg("#footer");
document.getElementById("footer")!.id = "";
}

// ヘッダーとタイトルをレインボー
AddRainbowBg("#header", "h2");
AddRainbowText("#lblTitle", "#mainTitle");
});
2 changes: 1 addition & 1 deletion src/class/SSO/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import GundaiWebSite from "../GundaiWebsite";

const EnableRainbow = () => {
AddClass([".header_column", ".input_form", ".input_column"], ["rainbow-bg"]);
changeQueryInnerHTML([".product"], "群馬大学ゲーミングサインオンシステム");
changeQueryInnerHTML(".product", "群馬大学ゲーミングサインオンシステム");
};

export const SSO = new GundaiWebSite(EnableRainbow);
1 change: 1 addition & 0 deletions src/class/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export { default as GundaiWebSite } from "./GundaiWebsite";
export { Kyomu } from "./Kyomu";
export { Media } from "./Media";
export { Moodle } from "./Moodle";
export { MyLibrary } from "./MyLibrary";
export { SSO } from "./SSO";
6 changes: 6 additions & 0 deletions src/scripts/content_mylib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import "../styles/mylibrary.scss";

import { MyLibrary } from "../class";
import LoadGamingWebsite from "../utils/LoadGamingWebsite";

LoadGamingWebsite(MyLibrary);
3 changes: 3 additions & 0 deletions src/styles/mylibrary.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#footer{
background: none;
}
10 changes: 4 additions & 6 deletions src/utils/ChangeQueryInnerHTML.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export default function ChangeQueryInnerHTML(queries: string[], innerHTML: string) {
queries.forEach((query) => {
const elements = document.querySelectorAll(query);
elements.forEach((element) => {
element.innerHTML = innerHTML;
});
export default function ChangeQueryInnerHTML(query: string, innerHTML: string) {
const elements = document.querySelectorAll(query);
elements.forEach((element) => {
element.innerHTML = innerHTML;
});
}

0 comments on commit 9f897e0

Please sign in to comment.