1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

pull fonts from official repository

This commit is contained in:
dkanada 2020-10-25 20:20:06 +09:00
parent b912299718
commit 3bbebdb49b
6 changed files with 29 additions and 11 deletions

View file

@ -69,7 +69,6 @@
"howler": "^2.2.0", "howler": "^2.2.0",
"intersection-observer": "^0.11.0", "intersection-observer": "^0.11.0",
"jellyfin-apiclient": "^1.4.2", "jellyfin-apiclient": "^1.4.2",
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"jstree": "^3.3.10", "jstree": "^3.3.10",
"libarchive.js": "^1.3.0", "libarchive.js": "^1.3.0",

View file

@ -90,12 +90,6 @@ _define('material-icons', function() {
return materialIcons; return materialIcons;
}); });
// noto font
const noto = require('jellyfin-noto');
_define('jellyfin-noto', function () {
return noto;
});
const epubjs = require('epubjs'); const epubjs = require('epubjs');
_define('epubjs', function () { _define('epubjs', function () {
return epubjs; return epubjs;

View file

@ -22,6 +22,12 @@
"id": "wmc" "id": "wmc"
} }
], ],
"fonts": [
"https://repo.jellyfin.org/releases/other/fonts/noto-sans.css",
"https://repo.jellyfin.org/releases/other/fonts/noto-sans-kr.css",
"https://repo.jellyfin.org/releases/other/fonts/noto-sans-jp.css",
"https://repo.jellyfin.org/releases/other/fonts/noto-sans-sc.css"
],
"plugins": [ "plugins": [
"plugins/playAccessValidation/plugin", "plugins/playAccessValidation/plugin",
"plugins/experimentalWarnings/plugin", "plugins/experimentalWarnings/plugin",

View file

@ -1,11 +1,22 @@
import * as userSettings from 'userSettings'; import * as userSettings from 'userSettings';
import * as webSettings from 'webSettings';
import skinManager from 'skinManager'; import skinManager from 'skinManager';
import events from 'events'; import events from 'events';
// Set the default theme when loading // set the default theme when loading
skinManager.setTheme(userSettings.theme()); skinManager.setTheme(userSettings.theme());
// Set the user's prefered theme when signing in // set the saved theme once a user authenticates
events.on(window.connectionManager, 'localusersignedin', function (e, user) { events.on(window.connectionManager, 'localusersignedin', function (e, user) {
skinManager.setTheme(userSettings.theme()); skinManager.setTheme(userSettings.theme());
}); });
webSettings.getFonts().then(fonts => {
for (const font of fonts) {
let link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.href = font;
document.getElementsByTagName('head')[0].appendChild(link);
}
});

View file

@ -102,3 +102,12 @@ export function getPlugins() {
return []; return [];
}); });
} }
export function getFonts() {
return getConfig().then(config => {
return config.fonts;
}).catch(error => {
console.log('cannot get web config:', error);
return [];
});
}

View file

@ -505,7 +505,6 @@ function initClient() {
'sortable', 'sortable',
'webcomponents', 'webcomponents',
'material-icons', 'material-icons',
'jellyfin-noto',
'date-fns', 'date-fns',
'page', 'page',
'polyfill', 'polyfill',
@ -528,7 +527,7 @@ function initClient() {
}); });
promise = require(['fetch']) promise = require(['fetch'])
.then(() => require(['jQuery', 'polyfill', 'fast-text-encoding', 'intersection-observer', 'classlist-polyfill', 'css!assets/css/site', 'jellyfin-noto'], (jQuery) => { .then(() => require(['jQuery', 'polyfill', 'fast-text-encoding', 'intersection-observer', 'classlist-polyfill', 'css!assets/css/site'], (jQuery) => {
// Expose jQuery globally // Expose jQuery globally
window.$ = jQuery; window.$ = jQuery;
window.jQuery = jQuery; window.jQuery = jQuery;