-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
388 additions
and
373 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"[typescript]": { | ||
"editor.defaultFormatter": "vscode.typescript-language-features", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnType": true | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { Dict } from './utils/type' | ||
import { Dict } from './utils/type'; | ||
|
||
const config: Dict<any> = { | ||
match: { | ||
codeforces: [ | ||
'codeforces.com', | ||
'codeforc.es', | ||
], | ||
hdu: [ | ||
'acm.hdu.edu.cn', | ||
], | ||
qoj: [ | ||
'qoj.ac', | ||
'pjudge.ac', | ||
], | ||
vjudge: [ | ||
'vjudge.net', | ||
'vjudge.net.cn', | ||
'cn.vjudge.net', | ||
'vjudge.z180.cn', | ||
], | ||
}, | ||
} | ||
match: { | ||
codeforces: [ | ||
'codeforces.com', // | ||
'codeforc.es', | ||
], | ||
hdu: [ | ||
'acm.hdu.edu.cn', // | ||
], | ||
qoj: [ | ||
'qoj.ac', // | ||
'pjudge.ac', | ||
], | ||
vjudge: [ | ||
'vjudge.net', // | ||
'vjudge.net.cn', | ||
'cn.vjudge.net', | ||
'vjudge.z180.cn', | ||
], | ||
}, | ||
}; | ||
|
||
config.matches = [] | ||
config.matches = []; | ||
for (const module in config.match) { | ||
for (const domain of config.match[module]) { | ||
config.matches.push(`http://${domain}`) | ||
config.matches.push(`https://${domain}`) | ||
config.matches.push(`http://${domain}/*`) | ||
config.matches.push(`https://${domain}/*`) | ||
} | ||
for (const domain of config.match[module]) { | ||
config.matches.push(`http://${domain}`); | ||
config.matches.push(`https://${domain}`); | ||
config.matches.push(`http://${domain}/*`); | ||
config.matches.push(`https://${domain}/*`); | ||
} | ||
} | ||
|
||
export default config | ||
export default config; |
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,3 +1,3 @@ | ||
import { app } from './app'; | ||
|
||
app.apply(); | ||
app.apply(); |
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,12 +1,11 @@ | ||
import config from '../../config' | ||
import App from '../../app' | ||
import Module from "../../types/module" | ||
import config from '../../config'; | ||
import App from '../../app'; | ||
import Module from '../../types/module'; | ||
|
||
export default class ModuleCodeforces extends Module { | ||
run() { | ||
} | ||
run() {} | ||
|
||
constructor(app: App) { | ||
super(app, 'codeforces', config.match.codeforces) | ||
} | ||
} | ||
constructor(app: App) { | ||
super(app, 'codeforces', config.match.codeforces); | ||
} | ||
} |
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,12 +1,11 @@ | ||
import config from '../../config' | ||
import App from '../../app' | ||
import Module from "../../types/module" | ||
import config from '../../config'; | ||
import App from '../../app'; | ||
import Module from '../../types/module'; | ||
|
||
export default class ModuleHDU extends Module { | ||
run() { | ||
} | ||
run() {} | ||
|
||
constructor(app: App) { | ||
super(app, 'hdu', config.match.hdu) | ||
} | ||
} | ||
constructor(app: App) { | ||
super(app, 'hdu', config.match.hdu); | ||
} | ||
} |
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,12 +1,11 @@ | ||
import config from '../../config' | ||
import App from '../../app' | ||
import Module from "../../types/module" | ||
import config from '../../config'; | ||
import App from '../../app'; | ||
import Module from '../../types/module'; | ||
|
||
export default class ModuleQOJ extends Module { | ||
run() { | ||
} | ||
run() {} | ||
|
||
constructor(app: App) { | ||
super(app, 'qoj', config.match.qoj) | ||
} | ||
} | ||
constructor(app: App) { | ||
super(app, 'qoj', config.match.qoj); | ||
} | ||
} |
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,23 +1,23 @@ | ||
import Feature from "../../../types/feature"; | ||
import Feature from '../../../types/feature'; | ||
|
||
export default class AcceptedCounter extends Feature { | ||
run() { | ||
this.on('/user/*', () => { | ||
(document.getElementsByClassName('toggle-detail')[0] as HTMLElement).onclick = () => { | ||
for (const $tr of document.querySelectorAll('#probRecords tbody tr:not(#templ)')) { | ||
let ojName = ($tr.children[0] as HTMLElement).innerText.trim(); | ||
let acceptedNum = $tr.children[1].children.length || 0; | ||
let attemptedNum = $tr.children[2].children.length || 0; | ||
$tr.children[0].innerHTML = ` | ||
run() { | ||
this.on('/user/*', () => { | ||
(document.getElementsByClassName('toggle-detail')[0] as HTMLElement).onclick = () => { | ||
for (const $tr of document.querySelectorAll('#probRecords tbody tr:not(#templ)')) { | ||
let ojName = ($tr.children[0] as HTMLElement).innerText.trim(); | ||
let acceptedNum = $tr.children[1].children.length || 0; | ||
let attemptedNum = $tr.children[2].children.length || 0; | ||
$tr.children[0].innerHTML = ` | ||
${ojName} | ||
<br> | ||
<span style="color: #999"> | ||
${acceptedNum} / ${acceptedNum + attemptedNum} | ||
</span> | ||
`; | ||
console.log(ojName, acceptedNum, attemptedNum); | ||
} | ||
} | ||
}); | ||
} | ||
console.log(ojName, acceptedNum, attemptedNum); | ||
} | ||
}; | ||
}); | ||
} | ||
} |
Oops, something went wrong.