mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: allow turning off timeago
This commit is contained in:
3 files changed
+9
-2
No files matched your search
@@ -178,7 +178,6 @@ const ServerLangSettingNode = {
|
||||
|
||||
PreferenceSetting(
|
||||
Setting('setting_display', 'viewLang', null, langRange, 'UI Language'),
|
||||
Setting('setting_display', 'skipAnimate', false, 'boolean', 'Skip Animation'),
|
||||
Setting('setting_display', 'timeZone', 'Asia/Shanghai', timezones, 'Timezone'),
|
||||
LangSettingNode,
|
||||
Setting('setting_usage', 'codeTemplate', '', 'textarea', 'Default Code Template',
|
||||
|
||||
@@ -38,6 +38,7 @@ function cancelRelativeTime($container) {
|
||||
}
|
||||
|
||||
const relativeTimePage = new AutoloadPage('relativeTimePage', () => {
|
||||
if (!UserContext.showTimeAgo) return;
|
||||
runRelativeTime($('body'));
|
||||
$(document).on('vjContentNew', (e) => runRelativeTime($(e.target)));
|
||||
$(document).on('vjContentRemove', (e) => cancelRelativeTime($(e.target)));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable global-require */
|
||||
import {
|
||||
ContestModel, Context, Handler, ObjectId, param, PERM, PRIV, ProblemModel, Schema,
|
||||
SettingModel, SystemModel, SystemSettings, Types, UserModel,
|
||||
Setting, SettingModel, SystemModel, SystemSettings, Types, UserModel,
|
||||
} from 'hydrooj';
|
||||
import convert from 'schemastery-jsonschema';
|
||||
import markdown from './backendlib/markdown';
|
||||
@@ -165,4 +165,11 @@ export function apply(ctx: Context) {
|
||||
});
|
||||
ctx.plugin(require('./backendlib/template'));
|
||||
ctx.plugin(require('./backendlib/builder'));
|
||||
|
||||
ctx.inject(['setting'], (c) => {
|
||||
c.setting.PreferenceSetting(
|
||||
Setting('setting_display', 'skipAnimate', false, 'boolean', 'Skip Animation'),
|
||||
Setting('setting_display', 'showTimeAgo', true, 'boolean', 'Enable Time Ago'),
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user