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

@ -1,11 +1,22 @@
import * as userSettings from 'userSettings';
import * as webSettings from 'webSettings';
import skinManager from 'skinManager';
import events from 'events';
// Set the default theme when loading
// set the default theme when loading
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) {
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);
}
});