This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from dora1998/develop
v2のリリース🎉
- Loading branch information
Showing
26 changed files
with
7,716 additions
and
613 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,22 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
"prettier/@typescript-eslint" | ||
], | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"env": { "node": true, "es6": true }, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-use-before-define": "warn", | ||
"@typescript-eslint/camelcase": "warn" | ||
} | ||
} |
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 +1,9 @@ | ||
ref | ||
dist/ | ||
build/ | ||
web-ext-artifacts/ | ||
|
||
node_modules/ | ||
|
||
.idea | ||
|
||
.DS_Store |
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
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,37 @@ | ||
{ | ||
"name": "kuplus", | ||
"version": "2.0.0", | ||
"description": "Browser extension for students at Kyoto University", | ||
"repository": "https://github.com/dora1998/KUPlus.git", | ||
"author": "dora <[email protected]>", | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"build": "webpack", | ||
"build:prod": "webpack --mode=production && web-ext build --overwrite-dest --source-dir ./build/", | ||
"watch": "webpack --watch", | ||
"lint": "eslint src/*.ts", | ||
"lint:fix": "eslint --fix src/*.ts", | ||
"start:firefox": "web-ext run --source-dir ./dist/" | ||
}, | ||
"devDependencies": { | ||
"@types/chrome": "^0.0.89", | ||
"@types/jquery": "^3.3.31", | ||
"@typescript-eslint/eslint-plugin": "^2.3.2", | ||
"@typescript-eslint/parser": "^2.3.2", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"copy-webpack-plugin": "^5.0.4", | ||
"eslint": "^6.5.1", | ||
"eslint-config-prettier": "^6.4.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"prettier": "^1.18.2", | ||
"ts-loader": "^6.2.0", | ||
"typescript": "^3.6.3", | ||
"web-ext": "^3.2.0", | ||
"webpack": "^4.40.2", | ||
"webpack-cli": "^3.3.9" | ||
}, | ||
"dependencies": { | ||
"jquery": "^3.4.1" | ||
} | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
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,44 @@ | ||
{ | ||
"name": "KUPlus (くーぷら)", | ||
"description": "KULASISなどの京大学務システムの機能を拡張する非公式拡張機能です。本拡張機能を使用したことによる損害に対して一切責任を負いません。自己責任で使用してください。", | ||
"version": "2.0.0", | ||
"manifest_version": 2, | ||
"icons": { | ||
"16": "icons/icon_16.png", | ||
"48": "icons/icon_48.png", | ||
"128": "icons/icon_128.png" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"run_at": "document_end", | ||
"matches": [ | ||
"https://www.k.kyoto-u.ac.jp/student/*" | ||
], | ||
"js": [ | ||
"scripts/vendor.bundle.js", | ||
"scripts/main.bundle.js" | ||
], | ||
"css": [ | ||
"styles/styles.css" | ||
] | ||
} | ||
], | ||
"background": { | ||
"scripts": [ | ||
"scripts/background.bundle.js" | ||
], | ||
"persistent": false | ||
}, | ||
"browser_action": { | ||
"default_icon": { | ||
"16": "icons/icon_16.png", | ||
"48": "icons/icon_48.png", | ||
"128": "icons/icon_128.png" | ||
}, | ||
"default_title": "KUPlus", | ||
"default_popup": "pages/popup.html" | ||
}, | ||
"permissions": [ | ||
"tabs" | ||
] | ||
} |
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,22 +1,20 @@ | ||
|
||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="css/styles_popup.css"> | ||
|
||
<title>KUPlus Popup</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<button href="https://www.k.kyoto-u.ac.jp/student/la/top">KULASIS</button> | ||
<button href="https://panda.ecs.kyoto-u.ac.jp/portal/login">PandA</button> | ||
<button href="https://m.kulib.kyoto-u.ac.jp/webopac/ufisnd.do">MyKULINE</button> | ||
<button href="https://outlook.com/st.kyoto-u.ac.jp">KUMOI</button> | ||
<button href="https://www.g.k.kyoto-u.ac.jp/shibboleth/index.php">GORILLA</button> | ||
</div> | ||
|
||
<script type="text/javascript" src="lib/jquery-3.3.1.min.js"></script> | ||
<script type="text/javascript" src="js/popup.js"></script> | ||
</body> | ||
</html> | ||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="../styles/styles_popup.css"> | ||
|
||
<title>KUPlus Popup</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<button href="https://www.k.kyoto-u.ac.jp/student/la/top">KULASIS</button> | ||
<button href="https://panda.ecs.kyoto-u.ac.jp/portal/login">PandA</button> | ||
<button href="https://m.kulib.kyoto-u.ac.jp/webopac/ufisnd.do">MyKULINE</button> | ||
<button href="https://outlook.com/st.kyoto-u.ac.jp">KUMOI</button> | ||
<button href="https://www.g.k.kyoto-u.ac.jp/shibboleth/index.php">GORILLA</button> | ||
</div> | ||
|
||
<script src="../scripts/popup.bundle.js"></script> | ||
</body> | ||
</html> |
File renamed without changes.
78 changes: 39 additions & 39 deletions
78
src/css/styles_popup.css → public/styles/styles_popup.css
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,40 +1,40 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
width: 200px; | ||
padding: 16px; | ||
margin: 0; | ||
background-color: #222; | ||
} | ||
.container button { | ||
width: 100%; | ||
background-color: transparent; | ||
font-size: 1.5em; | ||
color: #fff; | ||
border: none; | ||
border-radius: 8px; | ||
cursor: pointer; | ||
outline: none; | ||
padding: 16px; | ||
position: relative; | ||
} | ||
.container button:hover { | ||
background-color: rgba(255, 255, 255, 0.5); | ||
} | ||
.container button:hover::before{ | ||
content: ''; | ||
width: 8px; | ||
height: 8px; | ||
border: 0px; | ||
border-top: solid 2px #000; | ||
border-right: solid 2px #000; | ||
-ms-transform: rotate(45deg); | ||
-webkit-transform: rotate(45deg); | ||
transform: rotate(45deg); | ||
position: absolute; | ||
top: 50%; | ||
left: 8px; | ||
margin-top: -4px; | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
width: 200px; | ||
padding: 16px; | ||
margin: 0; | ||
background-color: #222; | ||
} | ||
.container button { | ||
width: 100%; | ||
background-color: transparent; | ||
font-size: 1.5em; | ||
color: #fff; | ||
border: none; | ||
border-radius: 8px; | ||
cursor: pointer; | ||
outline: none; | ||
padding: 16px; | ||
position: relative; | ||
} | ||
.container button:hover { | ||
background-color: rgba(255, 255, 255, 0.5); | ||
} | ||
.container button:hover::before{ | ||
content: ''; | ||
width: 8px; | ||
height: 8px; | ||
border: 0px; | ||
border-top: solid 2px #000; | ||
border-right: solid 2px #000; | ||
-ms-transform: rotate(45deg); | ||
-webkit-transform: rotate(45deg); | ||
transform: rotate(45deg); | ||
position: absolute; | ||
top: 50%; | ||
left: 8px; | ||
margin-top: -4px; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,43 @@ | ||
import MessageSender = chrome.runtime.MessageSender; | ||
|
||
const LOCALSTORAGE_TIMETABLE = "timetable"; | ||
|
||
function onRequest( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
request: any, | ||
sender: MessageSender, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
callback: (response?: any) => void | ||
): void { | ||
if (request.action == "getTimeTable") { | ||
console.log("getTimeTable"); | ||
callback(getTimeTable()); | ||
} else if (request.action == "setTimeTable") { | ||
let data = getTimeTable(); | ||
if (data == undefined) { | ||
data = new Array(5); | ||
for (let j = 0; j < 5; j++) { | ||
data[j] = new Array(5); | ||
} | ||
} | ||
data[request.day][request.c] = { name: request.name, place: request.place }; | ||
localStorage[LOCALSTORAGE_TIMETABLE] = JSON.stringify(data); | ||
console.log( | ||
"Saved Day:" + | ||
request.day + | ||
" Class:" + | ||
request.c + | ||
" Name:" + | ||
request.name + | ||
" Place:" + | ||
request.place | ||
); | ||
} | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function getTimeTable(): any { | ||
let data = localStorage[LOCALSTORAGE_TIMETABLE]; | ||
if (data != undefined) data = JSON.parse(data); | ||
return data; | ||
} | ||
chrome.runtime.onMessage.addListener(onRequest); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.