Skip to content

Commit

Permalink
Merge pull request #57 from keombre/1.2.0
Browse files Browse the repository at this point in the history
Version 1.2.0
  • Loading branch information
mstieranka authored Oct 22, 2023
2 parents 94e18c5 + 5de64f3 commit 539f57f
Show file tree
Hide file tree
Showing 82 changed files with 5,890 additions and 11,127 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

18 changes: 0 additions & 18 deletions .csslintrc

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-env node */
module.exports = {
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
root: true,
env: {
browser: true,
webextensions: true,
},
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
},
};
27 changes: 9 additions & 18 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@ name: Lint
on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
env:
CI: true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun lint
env:
CI: true
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
./vscode/ipch/*
test_pages/
out
node_modules
build
keys.txt
utils/github_upload.js
.env
19 changes: 19 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"tabWidth": 4,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
},
{
"files": "*.json",
"options": {
"parser": "json",
"tabWidth": 2
}
}
]
}
8 changes: 8 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["stylelint-config-standard"],
"rules": {
"selector-class-pattern": ".*",
"color-hex-length": "long",
"alpha-value-notation": "number"
}
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"debug.json": "jsonc"
}
}
21 changes: 21 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Development

This is a database of all the information about developing the extension I can think of.

## Test Pages

When developing, you can place the HTML files gathered from issues into `test_pages/`.

The folder structure follows the search params of the URL, e.g. `?X=Course&Cou=123` maps to `test_pages/course/123.html`.

- `?X=[folder_name]`
- `?Cou=[file_name]`

The file can optionally include a comment in the first line describing what the page is.

```html
<!-- BI-PA2 Homework 4 -->
...the rest of the file
```

Then, when running `bun dev`, if you add the `ptmock.localhost 127.0.0.1` entry into your `/etc/hosts`, you can visit `http://ptmock.localhost:3000/`, which will contain a list of all the test pages with their comments. If you open one of them, the URL and the page should be the same as if you went to Progtest.
55 changes: 0 additions & 55 deletions Makefile

This file was deleted.

17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@

## Download

[Chrome Web Store](https://chrome.google.com/webstore/detail/progtest-themes/eoofjghfpdplnjhbfflfnfogdjnedgjf)
[Chrome Web Store](https://chrome.google.com/webstore/detail/progtest-themes/eoofjghfpdplnjhbfflfnfogdjnedgjf) (supports any Chromium browser, e.g. Opera, Brave, new Microsoft Edge, etc.)

[Firefox Addon](https://github.com/keombre/progtest-theme/releases/latest)

[Microsoft Edge Addons](https://microsoftedge.microsoft.com/addons/detail/knkajihkihfoadhcgjibkhlhdfdmliem)

## Building from source

In order to build from source, you are going to need `npm` and `make`.
In order to build from source, you are going to need `bun`.

The current version of **ProgTest Themes** has been successfully compiled using `nodejs 12.12.0`, `npm 6.12.0` and `GNU Make 4.2.1`.
The current version of **ProgTest Themes** has been successfully compiled using `bun 1.0.6`.

1. Install all dev dependencies using `npm install`
2. Run `make dev` to create unpacked version of the extension in `build/`
3. Load the extension to your browser. `chrome://extensions` in Chrome or `about:addons` in Firefox. (Note: the dev version uses `manifests/debug.json`, adjust it to suite your needs)
1. Install all dev dependencies using `bun install`
2. Run `bun dev` to get a hot-reloading version of the extension in `build/`. Alternatively, run `bun build:chrome` or `bun build:firefox` to build it just once (and with the proper manifests; the dev version uses `manifests/debug.json`).
3. Load the extension to your browser
- `chrome://extensions` in Chrome
- `about:addons` (if building) / `about:debugging#/runtime/this-firefox` (if developing) in Firefox

## Privacy policy

In short, we don't collect any data, but you can read it in full [here](https://github.com/keombre/progtest-theme/blob/stable/privacy_policy.md).

## Creating new theme
Expand Down
Binary file added bun.lockb
Binary file not shown.
91 changes: 40 additions & 51 deletions manifests/chrome.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,43 @@
{
"name": "ProgTest Themes",
"version": "1.1.6",
"description": "Theme manager for ProgTest",
"manifest_version": 2,
"content_scripts": [
{
"run_at": "document_start",
"js": [
"content/start.js",
"content/highlightjs/highlight.pack.js"
],
"matches": [
"*://progtest.fit.cvut.cz/*"
],
"all_frames": true
},
{
"run_at": "document_end",
"js": [
"content/end.js"
],
"matches": [
"*://progtest.fit.cvut.cz/*"
],
"all_frames": true
}
],
"background": {
"scripts": [
"background.js"
],
"persistent": true
"name": "ProgTest Themes",
"version": "1.2.0",
"description": "Theme manager for ProgTest",
"manifest_version": 3,
"content_scripts": [
{
"run_at": "document_start",
"js": ["content/start.js", "content/highlightjs/highlight.min.js"],
"css": ["themes/loading/on.css"],
"matches": ["https://progtest.fit.cvut.cz/*"],
"all_frames": true
},
"permissions": [
"webRequest",
"webRequestBlocking",
"*://progtest.fit.cvut.cz/*",
"*://courses.fit.cvut.cz/*",
"storage",
"tabs"
],
"browser_action": {
"default_title": "",
"default_icon": "icon.png",
"default_popup": "options/options.html"
{
"run_at": "document_end",
"js": ["content/end.js"],
"matches": ["https://progtest.fit.cvut.cz/*"],
"all_frames": true
}
],
"web_accessible_resources": [
{
"resources": ["content/loader.js"],
"matches": ["https://progtest.fit.cvut.cz/*"]
},
"icons": {
"128": "icon.png"
},
"web_accessible_resources": [
"themes/*"
]
}
{
"resources": ["themes/*"],
"matches": ["https://progtest.fit.cvut.cz/*"]
}
],
"background": { "service_worker": "background.js" },
"permissions": ["storage", "tabs"],
"host_permissions": [
"https://progtest.fit.cvut.cz/*",
"https://courses.fit.cvut.cz/data/courses-all.json"
],
"action": {
"default_title": "",
"default_icon": "icon.png",
"default_popup": "settings/index.html"
},
"icons": { "128": "icon.png" }
}
Loading

0 comments on commit 539f57f

Please sign in to comment.