ui: fix bugs (#437)

pull/439/head
panda 2 years ago committed by GitHub
parent ebad34a426
commit e87149fd45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,7 @@ const katexPage = new AutoloadPage('katexPage', () => {
})); }));
} }
runKatex($('.typo')); runKatex($('.typo'));
$(document).on('vjContentNew', (e) => runKatex($(e.target).find('.typo'))); $(document).on('vjContentNew', (e) => runKatex($(e.target).find('.typo').addBack('.typo')));
}); });
}); });

@ -12,7 +12,7 @@ export default new AutoloadPage('media', async () => {
resolvers.push((html) => html && $(ele).replaceWith($(html))); resolvers.push((html) => html && $(ele).replaceWith($(html)));
}; };
users.get().forEach((ele) => resolve(ele, { type: 'user', id: +$(ele).text() })); users.get().forEach((ele) => resolve(ele, { type: 'user', id: +$(ele).text() }));
$dom.find('.typo').get().forEach((el) => { $dom.find('.typo').addBack('.typo').get().forEach((el) => {
if (el.className.includes('no-media')) return; if (el.className.includes('no-media')) return;
$(el).find('a[href]').get().forEach((ele) => { $(el).find('a[href]').get().forEach((ele) => {
if ($(ele).parent().hasClass('user-profile-link')) return; if ($(ele).parent().hasClass('user-profile-link')) return;

@ -41,12 +41,6 @@ function ExtraFilesConfig() {
const dispatch = useDispatch(); const dispatch = useDispatch();
const userRef = React.useRef<any>(); const userRef = React.useRef<any>();
const judgeRef = React.useRef<any>(); const judgeRef = React.useRef<any>();
React.useEffect(() => {
userRef.current.setSelectedKeys(userExtraFiles);
}, [JSON.stringify(userExtraFiles)]);
React.useEffect(() => {
judgeRef.current.setSelectedKeys(judgeExtraFiles);
}, [JSON.stringify(judgeExtraFiles)]);
return ( return (
<FormItem columns={12} label="ExtraFilesTabs" disableLabel> <FormItem columns={12} label="ExtraFilesTabs" disableLabel>
<Tabs id="ExtraFilesTabs"> <Tabs id="ExtraFilesTabs">
@ -89,9 +83,6 @@ function LangConfig() {
const dispatch = useDispatch(); const dispatch = useDispatch();
const ref = React.useRef<any>(); const ref = React.useRef<any>();
const selectedKeys = langs.filter((i) => !prefixes.has(i)); const selectedKeys = langs.filter((i) => !prefixes.has(i));
React.useEffect(() => {
ref.current.setSelectedKeys(selectedKeys);
}, [JSON.stringify(selectedKeys)]);
return ( return (
<FormItem columns={12} label="langs"> <FormItem columns={12} label="langs">
<CustomSelectAutoComplete <CustomSelectAutoComplete

@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.41.9", "version": "4.41.10",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "index.ts", "main": "index.ts",

Loading…
Cancel
Save