add editor.

This commit is contained in:
2023-01-06 20:09:26 +08:00
parent 2c7da88b06
commit c3746ad105
14 changed files with 298 additions and 169 deletions

View File

@@ -136,9 +136,31 @@ export function getTagColor(tag: string) {
}[tag]
}
export function buildProblemCodeKey(problemID: number, contestID = null) {
export function buildProblemCodeKey(problemID: string, contestID = "") {
if (contestID) {
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
}
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
}
export const languageLabel = {
C: "C",
"C++": "C++",
Java: "Java",
Python2: "Python2",
Python3: "Python",
JavaScript: "JS",
Golang: "Go",
}
export type LANGUAGE = keyof typeof languageLabel
export const languageValue = {
C: "c",
"C++": "cpp",
Java: "java",
Python2: "python",
Python3: "python",
JavaScript: "javascript",
Golang: "go",
}