diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 0b951f2b8..d464a30c2 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.25.1", + "version": "2.25.2", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", diff --git a/packages/hydrooj/setting.yaml b/packages/hydrooj/setting.yaml index dcfabbcf1..88bbfac6a 100644 --- a/packages/hydrooj/setting.yaml +++ b/packages/hydrooj/setting.yaml @@ -3,14 +3,17 @@ langs: desc: Code language settings default: __hint__: - - All keys started with _ will be ignored - - Entries named like [foo], [foo].[bar] [foo].[baz] will be merged into one category. - - A entry named [foo].[bar] will inhert all options defined in entry [foo] if not overwritten - - code_file option defaults to foo.[name] - - highlight option defaults to [name] - - if highlight option was set, monaco option defaults to [highlight], otherwise defaults to [name] - - Compile step will be ignored if compile option was not set - - Key marked with a ? means the option is optional + - ~ All keys starting with _ will be ignored + - ~ Entries named like [foo], [foo].[bar] [foo].[baz] + - will be merged into one category. + - ~ A entry named [foo].[bar] will inhert all options + - defined in entry [foo] if not overwritten + - ~ code_file option defaults to foo.[name] + - ~ highlight option defaults to [name] + - ~ if highlight option was set, monaco option defaults + - to [highlight], otherwise defaults to [name] + - ~ Compiling be be ignored if compile option wasn't set + - ~ Key marked with a ? means the option is optional - (name): compile?: Compile Command code_file?: Where to write code file when compiling diff --git a/packages/ui-default/components/editor/cmeditor.page.js b/packages/ui-default/components/editor/cmeditor.page.js index 8d4459c1a..c59e7aed3 100644 --- a/packages/ui-default/components/editor/cmeditor.page.js +++ b/packages/ui-default/components/editor/cmeditor.page.js @@ -3,10 +3,12 @@ import delay from 'vj/utils/delay'; import CmEditor from '.'; function runSubstitute($container) { - const selector = ['textarea[data-markdown]']; - $container.find(selector.join(', ')).get().forEach((element) => { + $container.find('textarea[data-markdown]').get().forEach((element) => { CmEditor.getOrConstruct($(element)); }); + $container.find('textarea[data-yaml]').get().forEach((element) => { + CmEditor.getOrConstruct($(element), { language: 'yaml' }); + }); } const cmEditorPage = new AutoloadPage('cmEditorPage', () => { diff --git a/packages/ui-default/components/editor/index.js b/packages/ui-default/components/editor/index.js index 66c84a2a9..85a4d0316 100644 --- a/packages/ui-default/components/editor/index.js +++ b/packages/ui-default/components/editor/index.js @@ -58,10 +58,16 @@ export default class Editor extends DOMAttachedObject { lightbulb: { enabled: true }, model: this.model, automaticLayout: true, + wordWarp: 'bounded', + minimap: { enabled: false }, + hideCursorInOverviewRuler: true, + overviewRulerLanes: 0, + overviewRulerBorder: false, }; if (autoResize) { cfg.scrollbar = { vertical: 'hidden', + horizontal: 'hidden', handleMouseWheel: false, }; cfg.scrollBeyondLastLine = false; diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index acd650137..4004fcb69 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.8.2", + "version": "4.8.3", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/templates/components/form.html b/packages/ui-default/templates/components/form.html index 731183ac6..d90194778 100644 --- a/packages/ui-default/templates/components/form.html +++ b/packages/ui-default/templates/components/form.html @@ -183,7 +183,7 @@ {% endmacro %} {% macro form_textarea(args) %} -{{ form_begin({columns:8}|assign(args)) }} +{{ form_begin({columns:10}|assign(args)) }} {{ textarea(args) }} {{ form_end(args) }} {% endmacro %} diff --git a/packages/ui-default/templates/partials/setting.html b/packages/ui-default/templates/partials/setting.html index 7744009b2..3abd8dab6 100644 --- a/packages/ui-default/templates/partials/setting.html +++ b/packages/ui-default/templates/partials/setting.html @@ -52,7 +52,8 @@ name:setting.key, value:'' if secret else (current[setting.key]|default(setting.value)), disabled:setting.disabled, - placeholder:_('(Not changed)') if secret else '' + placeholder:_('(Not changed)') if secret else '', + extra_attr: 'data-yaml' if setting.subType == 'yaml' else '' }) }} {% elif setting.type == 'markdown' %} {{ form.form_textarea({