diff --git a/package.json b/package.json index 1a78e21b..feadcd3f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "ora": "^5.4.0", "semver": "^7.3.5", "ts-jest": "^26.5.4", - "typescript": "4.2.3", + "typescript": "4.2.4", "yargs": "^16.2.0" } } diff --git a/packages/fps-importer/package.json b/packages/fps-importer/package.json index ea6e5ab8..6623cee9 100644 --- a/packages/fps-importer/package.json +++ b/packages/fps-importer/package.json @@ -14,9 +14,9 @@ }, "devDependencies": { "@types/xml2js": "^0.4.8", - "bson": "^4.2.3" + "bson": "^4.3.0" }, "peerDependencies": { "hydrooj": "^2.20.0" } -} \ No newline at end of file +} diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 56cd01ef..998ae907 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -12,7 +12,7 @@ "@hydrooj/utils": "^1.0.0", "adm-zip": "^0.5.5", "axios": "^0.21.1", - "bson": "^4.2.3", + "bson": "^4.3.0", "fs-extra": "^9.1.0", "js-yaml": "^4.0.0", "lodash": "^4.17.21", diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index dcd8e37f..95d3427f 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -13,7 +13,7 @@ "dependencies": { "@hydrooj/utils": "^1.0.1", "adm-zip": "^0.5.5", - "ansi_up": "^5.0.0", + "ansi_up": "^5.0.1", "cookies": "^0.8.0", "detect-browser": "^5.1.1", "fs-extra": "^9.1.0", @@ -22,13 +22,13 @@ "koa": "^2.13.1", "koa-body": "^4.2.0", "koa-compress": "^5.0.1", - "koa-proxies": "^0.11.0", + "koa-proxies": "^0.12.1", "koa-router": "^10.0.0", "koa-static-cache": "^5.1.3", "lodash": "^4.17.21", - "minio": "7.0.17", + "minio": "7.0.18", "moment-timezone": "^0.5.32", - "mongodb": "^3.6.5", + "mongodb": "^3.6.6", "nodemailer": "^6.5.0", "p-queue": "^6.6.2", "reflect-metadata": "^0.1.13", diff --git a/packages/migrate-vijos/package.json b/packages/migrate-vijos/package.json index cd687da6..f2955292 100644 --- a/packages/migrate-vijos/package.json +++ b/packages/migrate-vijos/package.json @@ -9,6 +9,6 @@ "@types/mongodb": "^3.6.12" }, "dependencies": { - "mongodb": "^3.6.5" + "mongodb": "^3.6.6" } } diff --git a/packages/ui-default/handler.js b/packages/ui-default/handler.js index a296f3e1..32e0d7b7 100644 --- a/packages/ui-default/handler.js +++ b/packages/ui-default/handler.js @@ -111,20 +111,24 @@ class MarkdownHandler extends Handler { } } -const getUrl = (files) => files.map((i) => { +const getHash = (i) => { const shasum = crypto.createHash('sha1'); const file = readFileSync(join(tmpdir(), 'hydro', 'public', i)); shasum.update(file); - const hash = shasum.digest('hex').substr(0, 10); - return `/${i}?${hash}`; -}); + return shasum.digest('hex').substr(0, 10); +}; + +const getUrl = (files) => files.map((i) => `/${i}?${getHash(i)}`); bus.on('app/started', () => { const files = readdirSync(join(tmpdir(), 'hydro', 'public')); const pages = files.filter((file) => file.endsWith('.page.js')); const themes = files.filter((file) => file.endsWith('.theme.js')); UiContextBase.extraPages = getUrl(pages); - UiContextBase.themes = getUrl(themes); + UiContextBase.themes = {}; + for (const theme of themes) { + UiContextBase.themes[theme] = `/${theme}?${getHash(theme)}`; + } }); global.Hydro.handler.ui = async () => { diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 1a31d26a..8d8c1bbb 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.5.12", + "version": "4.5.13", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", @@ -26,7 +26,7 @@ "acorn": "^8.0.5", "acorn-stage3": "^4.0.0", "acorn-walk": "^8.0.2", - "astring": "^1.7.3", + "astring": "^1.7.4", "autoprefixer": "^9.8.6", "babel-loader": "^8.2.2", "babel-plugin-lodash": "^3.3.4", @@ -104,7 +104,7 @@ "dependencies": { "98.css": "^0.1.16", "js-yaml": "^4.0.0", - "katex": "^0.13.1", + "katex": "^0.13.2", "lodash": "^4.17.21", "markdown-it": "^12.0.4", "markdown-it-anchor": "^7.1.0", diff --git a/packages/ui-default/pages/problem_detail.page.jsx b/packages/ui-default/pages/problem_detail.page.jsx index 0f4ef811..b44204af 100644 --- a/packages/ui-default/pages/problem_detail.page.jsx +++ b/packages/ui-default/pages/problem_detail.page.jsx @@ -216,7 +216,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor async function loadSubjective() { try { const props = yaml.load(base64.decode(document.getElementsByClassName('section__body typo')[0].innerText)); - $('.loader-container').show(); + $('.outer-loader-container').show(); const { default: Subjective } = await import('vj/components/subjective-question/index'); const React = await import('react'); const ReactDOM = await import('react-dom'); @@ -227,11 +227,9 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor , $('.problem-content').get(0), ); - $('.loader-container').hide(); + $('.outer-loader-container').hide(); // eslint-disable-next-line no-empty - } catch (e) { - console.error(e); - } + } catch (e) { } } $(document).on('click', '[name="problem-sidebar__open-scratchpad"]', (ev) => { diff --git a/packages/ui-default/templates/layout/html5.html b/packages/ui-default/templates/layout/html5.html index 6fb687bf..a35beb86 100644 --- a/packages/ui-default/templates/layout/html5.html +++ b/packages/ui-default/templates/layout/html5.html @@ -26,7 +26,10 @@ {% endblock %} - + {% if not isIE(handler.request.headers['user-agent']) %} + + {% endif %} + {{ handler.renderTitle(page_name) }} {% if not isIE(handler.request.headers['user-agent']) %} diff --git a/packages/ui-default/templates/partials/footer.html b/packages/ui-default/templates/partials/footer.html index 0a85aed4..35a7885f 100644 --- a/packages/ui-default/templates/partials/footer.html +++ b/packages/ui-default/templates/partials/footer.html @@ -61,7 +61,7 @@ Theme diff --git a/packages/ui-default/templates/problem_detail.html b/packages/ui-default/templates/problem_detail.html index ba3d9cdf..e2218d71 100644 --- a/packages/ui-default/templates/problem_detail.html +++ b/packages/ui-default/templates/problem_detail.html @@ -47,8 +47,9 @@ {% include "partials/problem_sidebar.html" %} - + {% endblock %} diff --git a/packages/ui-default/theme/default.js b/packages/ui-default/theme/default.js index a9e41fd8..1a27f008 100644 --- a/packages/ui-default/theme/default.js +++ b/packages/ui-default/theme/default.js @@ -26,4 +26,4 @@ import 'vj/components/katex/katex.styl'; const pageStyleReq = require.context('../', true, /\.page\.styl$/i); pageStyleReq.keys().map((key) => pageStyleReq(key)); const pageStyleReqDefault = require.context('../', true, /\.page\.default\.styl$/i); -pageStyleReqDefault.keys().map((key) => pageStyleReq(key)); +pageStyleReqDefault.keys().map((key) => pageStyleReqDefault(key)); diff --git a/packages/utils/package.json b/packages/utils/package.json index a2f94edd..38c12437 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -7,7 +7,7 @@ "author": "undefined ", "license": "AGPL-3.0-only", "dependencies": { - "bson": "^4.2.3", + "bson": "^4.3.0", "moment": "^2.29.1", "systeminformation": "^5.6.10" },