-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 710a760
Showing
680 changed files
with
70,108 additions
and
0 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,6 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
pnpm-lock.yaml |
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 @@ | ||
enable-pre-post-scripts = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
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,17 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} |
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,27 @@ | ||
{ | ||
"search.exclude": { | ||
"out": true | ||
}, | ||
"typescript.tsc.autoDetect": "off", | ||
"cSpell.words": [ | ||
"autorefresh", | ||
"chtml", | ||
"clike", | ||
"codicon", | ||
"codicons", | ||
"CYEZOI", | ||
"foldcode", | ||
"foldgutter", | ||
"mathjax", | ||
"newoj", | ||
"pdoc", | ||
"pdocs", | ||
"ppcount", | ||
"problemset", | ||
"psdict", | ||
"psdoc", | ||
"rdoc", | ||
"realname" | ||
], | ||
"explorer.excludeGitIgnore": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Change Log | ||
|
||
All notable changes to the "cyezoi" extension will be documented in this file. | ||
|
||
## [Unreleased] | ||
|
||
- Initial release |
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,38 @@ | ||
# CYEZOI README | ||
|
||
CYEZOI is an extension that can help user get and submit problems without opening the browser. | ||
|
||
## Features | ||
|
||
TODO | ||
|
||
## Requirements | ||
|
||
Users using this extension should have [an CYEZOI account](https://newoj.cyezoi.com). | ||
|
||
## Extension Settings | ||
|
||
This extension contributes the following settings: | ||
|
||
* `myExtension.enable`: Enable/disable this extension. | ||
* `myExtension.thing`: Set to `blah` to do something. | ||
|
||
## Known Issues | ||
|
||
None | ||
|
||
## Release Notes | ||
|
||
Users appreciate release notes as you update your extension. | ||
|
||
### 1.0.0 | ||
|
||
Initial release of ... | ||
|
||
### 1.0.1 | ||
|
||
Fixed issue #. | ||
|
||
### 1.1.0 | ||
|
||
Added features X, Y, and Z. |
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,28 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
|
||
export default [{ | ||
files: ["**/*.ts"], | ||
}, { | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: { | ||
"@typescript-eslint/naming-convention": ["warn", { | ||
selector: "import", | ||
format: ["camelCase", "PascalCase"], | ||
}], | ||
|
||
curly: "warn", | ||
eqeqeq: "warn", | ||
"no-throw-literal": "warn", | ||
semi: "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 |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"name": "cyezoi", | ||
"displayName": "CYEZOI Helper", | ||
"description": "", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^1.94.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [], | ||
"main": "./out/extension.js", | ||
"contributes": { | ||
"views": { | ||
"explorer": [ | ||
{ | ||
"id": "cyezoi", | ||
"name": "CYEZOI" | ||
} | ||
] | ||
}, | ||
"treeView": [ | ||
{ | ||
"id": "cyezoi", | ||
"name": "CYEZOI" | ||
} | ||
], | ||
"commands": [ | ||
{ | ||
"command": "cyezoi.login", | ||
"title": "CYEZOI: Login" | ||
}, | ||
{ | ||
"command": "cyezoi.openOutput", | ||
"title": "CYEZOI: Open Output" | ||
}, | ||
{ | ||
"command": "cyezoi.logout", | ||
"title": "CYEZOI: Logout" | ||
}, | ||
{ | ||
"command": "cyezoi.refreshProblemTree", | ||
"title": "CYEZOI: Refresh Problem Tree", | ||
"icon": { | ||
"light": "res/icons/refresh-light.svg", | ||
"dark": "res/icons/refresh-dark.svg" | ||
} | ||
}, | ||
{ | ||
"command": "cyezoi.openProblem", | ||
"title": "CYEZOI: Open Problem" | ||
}, | ||
{ | ||
"command": "cyezoi.submitProblem", | ||
"title": "CYEZOI: Submit Problem", | ||
"icon": { | ||
"light": "res/icons/send-light.svg", | ||
"dark": "res/icons/send-dark.svg" | ||
} | ||
}, | ||
{ | ||
"command": "cyezoi.openSubmission", | ||
"title": "CYEZOI: Open Submission" | ||
} | ||
], | ||
"menus": { | ||
"view/title": [ | ||
{ | ||
"command": "cyezoi.refreshProblemTree", | ||
"when": "view == cyezoi", | ||
"group": "navigation" | ||
} | ||
], | ||
"view/item/context": [ | ||
{ | ||
"command": "cyezoi.submitProblem", | ||
"when": "viewItem == problem", | ||
"group": "inline" | ||
} | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "pnpm run compile", | ||
"compile": "tsc -p ./", | ||
"watch": "tsc -watch -p ./", | ||
"pretest": "pnpm run compile && pnpm run lint", | ||
"lint": "eslint src", | ||
"test": "vscode-test" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.8", | ||
"@types/node": "20.x", | ||
"@types/vscode": "^1.94.0", | ||
"@types/ws": "^8.5.12", | ||
"@typescript-eslint/eslint-plugin": "^8.7.0", | ||
"@typescript-eslint/parser": "^8.7.0", | ||
"@vscode/test-cli": "^0.0.10", | ||
"@vscode/test-electron": "^2.4.1", | ||
"eslint": "^9.11.1", | ||
"typescript": "^5.6.2" | ||
}, | ||
"dependencies": { | ||
"@vscode/codicons": "^0.0.36", | ||
"hydrooj": "^4.16.1", | ||
"marked": "^14.1.3", | ||
"ws": "^8.18.0" | ||
} | ||
} |
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,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<style> | ||
@font-face { | ||
font-family: 'hydro-icons'; | ||
src: url('{{hydroIconsFile}}') format('woff2'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
</style> | ||
{{staticFiles}} | ||
</head> | ||
|
||
<body> | ||
<h1 id="title">Loading...</h1> | ||
<vscode-button disabled icon="check" id="submitProblem">Submit</vscode-button> | ||
<div id="problem"></div> | ||
</body> | ||
|
||
</html> |
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,62 @@ | ||
const vscode = window.acquireVsCodeApi(); | ||
window.MathJax = { | ||
tex: { | ||
inlineMath: [['$', '$']], | ||
displayMath: [['$$', '$$']], | ||
}, | ||
}; | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
const title = document.getElementById('title'); | ||
const submitProblem = document.getElementById('submitProblem'); | ||
const problem = document.getElementById('problem'); | ||
window.addEventListener('message', event => { | ||
const message = event.data; | ||
switch (message.command) { | ||
case 'notFound': | ||
problem.innerHTML = 'Problem not found'; | ||
break; | ||
case 'problem': | ||
title.innerText = '#' + message.data.problemId + '. ' + message.data.title; | ||
submitProblem.addEventListener('click', () => { | ||
vscode.postMessage({ command: 'submitProblem', problemId: message.data.problemId }); | ||
}); | ||
submitProblem.disabled = false; | ||
problem.innerHTML = message.data.markdownContent.zh; | ||
window.MathJax.typeset(); | ||
const pre = problem.getElementsByTagName('pre'); | ||
const editors = []; | ||
for (let i = 0; i < pre.length; i++) { | ||
const code = pre[i].innerText.trim(); | ||
const codeElement = document.createElement('div'); | ||
const copyButton = document.createElement('vscode-button'); | ||
copyButton.innerText = 'Copy'; | ||
copyButton.onclick = () => { | ||
navigator.clipboard.writeText(code); | ||
copyButton.innerText = 'Copied'; | ||
copyButton.disabled = true; | ||
setTimeout(() => { | ||
copyButton.innerText = 'Copy'; | ||
copyButton.disabled = false; | ||
}, 1000); | ||
}; | ||
codeElement.appendChild(copyButton); | ||
const editorElement = document.createElement('div'); | ||
codeElement.appendChild(editorElement); | ||
editors.push(window.CodeMirror(editorElement, { | ||
autoRefresh: true, | ||
value: code, | ||
readOnly: true, | ||
theme: 'material', | ||
})); | ||
pre[i].parentNode.replaceChild(codeElement, pre[i]); | ||
} | ||
for (let i = 0; i < editors.length; i++) { | ||
editors[i].setSize('100%', 'auto'); | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
}); |
Oops, something went wrong.