ui: allow font customization

This commit is contained in:
undefined committed 2022-02-22 00:24:50 +08:00
1 parent cf1195a6ee
commit 9b2c36efbf
13 files changed
+93 -31

No files matched your search

@@ -2,7 +2,7 @@ import { NamedPage } from 'vj/misc/Page';
import i18n from 'vj/utils/i18n';
import tpl from 'vj/utils/tpl';
const page = new NamedPage('home_preference', () => {
function initCodeLangHelper() {
function setOptions($el, options) {
$el.empty();
$.each(options, (key, value) => {
@@ -66,6 +66,14 @@ const page = new NamedPage('home_preference', () => {
$('#codelang-sub-select').on('change', function () {
$('[name="codeLang"]').val(this.value);
});
}
const page = new NamedPage('home_preference', () => {
initCodeLangHelper();
$('[name="fontFamily"] option, [name="codeFontFamily"] option').each(function () {
this.style.fontFamily = this.getAttribute('value');
this.textContent = i18n(this.textContent.trim());
});
});
export default page;