Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from dora1998/develop
Browse files Browse the repository at this point in the history
v2のリリース🎉
  • Loading branch information
dora1998 authored Oct 7, 2019
2 parents 69a5bbc + a0cd0f1 commit d5794d2
Show file tree
Hide file tree
Showing 26 changed files with 7,716 additions and 613 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
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"
}
}
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
ref
dist/
build/
web-ext-artifacts/

node_modules/

.idea

.DS_Store
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ https://chrome.google.com/webstore/detail/obeghdnflgepdemhcnkmbnojlcbdlenl/
本リポジトリをクローンして、ご自身のChromeに導入することも可能です。ただし、アップデートが自動で行われないため、将来的に不具合が発生する可能性があります。

# 使用上の注意
作者は、本拡張機能を使用したことによるいかなる損害に対しても**一切**責任を負いません。自己責任で使用してください。
特に履修登録などの重大な手続きにおいて、本拡張機能が原因の損害が発生した場合でも、いかなる補償もいたしかねます。予めご了承ください。
作者は、本拡張機能を使用したことによるいかなる損害に対しても**一切**責任を負いません。自己責任で使用してください。
特に履修登録などの重大な手続きにおいて、本拡張機能が原因の損害が発生した場合でも、いかなる補償もいたしかねます。予めご了承ください。
万全を期す場合は、本拡張機能を一時的に無効にして操作を行っていただければと思います。

ソースコードを見ていただければわかるとは思いますが、拡張機能実装にあたり、KULASISでの手続きや検索処理を加工するような実装はしておりません。

# ChangeLog
## v2.0.0
* シラバス小窓の廃止
* `chrome://newtab/` でポップアップクリック時に新規タブを開かないように変更
* My部局ボタンを削除
* (開発環境を一新)

## v1.1.0
* 授業資料の一覧でのDL機能追加

Expand All @@ -38,5 +44,5 @@ https://chrome.google.com/webstore/detail/obeghdnflgepdemhcnkmbnojlcbdlenl/

# お問い合わせ
本拡張機能に関するお問い合わせは、
[@\_dorayaki\_](https://twitter.com/_dorayaki_)
[@d0ra1998](https://twitter.com/d0ra1998)
までリプライ又はDMなどでお願いします。
37 changes: 37 additions & 0 deletions package.json
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
44 changes: 44 additions & 0 deletions public/manifest.json
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"
]
}
42 changes: 20 additions & 22 deletions src/popup.html → public/pages/popup.html
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 src/css/styles_popup.css → public/styles/styles_popup.css
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 removed release/kuplus-1.0.0.crx
Binary file not shown.
Binary file removed release/kuplus-1.0.0.zip
Binary file not shown.
Binary file removed release/kuplus-1.1.0.zip
Binary file not shown.
43 changes: 43 additions & 0 deletions src/background.ts
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.
23 changes: 0 additions & 23 deletions src/js/background.js

This file was deleted.

Loading

0 comments on commit d5794d2

Please sign in to comment.