mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
CShow clock in TV layout
This commit is contained in:
parent
1c9b6005ef
commit
ffb5d2129b
2 changed files with 21 additions and 0 deletions
|
@ -19,6 +19,7 @@ import ServerConnections from '../components/ServerConnections';
|
||||||
import { PluginType } from '../types/plugin.ts';
|
import { PluginType } from '../types/plugin.ts';
|
||||||
import Events from '../utils/events.ts';
|
import Events from '../utils/events.ts';
|
||||||
import { getParameterByName } from '../utils/url.ts';
|
import { getParameterByName } from '../utils/url.ts';
|
||||||
|
import datetime from '../scripts/datetime';
|
||||||
|
|
||||||
import '../elements/emby-button/paper-icon-button-light';
|
import '../elements/emby-button/paper-icon-button-light';
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ import '../styles/flexstyles.scss';
|
||||||
html += '<button is="paper-icon-button-light" class="headerCastButton castButton headerButton headerButtonRight hide"><span class="material-icons cast" aria-hidden="true"></span></button>';
|
html += '<button is="paper-icon-button-light" class="headerCastButton castButton headerButton headerButtonRight hide"><span class="material-icons cast" aria-hidden="true"></span></button>';
|
||||||
html += '<button type="button" is="paper-icon-button-light" class="headerButton headerButtonRight headerSearchButton hide"><span class="material-icons search" aria-hidden="true"></span></button>';
|
html += '<button type="button" is="paper-icon-button-light" class="headerButton headerButtonRight headerSearchButton hide"><span class="material-icons search" aria-hidden="true"></span></button>';
|
||||||
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerUserButton hide"><span class="material-icons person" aria-hidden="true"></span></button>';
|
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerUserButton hide"><span class="material-icons person" aria-hidden="true"></span></button>';
|
||||||
|
html += '<div class="currentTimeText hide"></div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<div class="headerTabs sectionTabs hide">';
|
html += '<div class="headerTabs sectionTabs hide">';
|
||||||
|
@ -61,11 +63,13 @@ import '../styles/flexstyles.scss';
|
||||||
headerAudioPlayerButton = skinHeader.querySelector('.headerAudioPlayerButton');
|
headerAudioPlayerButton = skinHeader.querySelector('.headerAudioPlayerButton');
|
||||||
headerSearchButton = skinHeader.querySelector('.headerSearchButton');
|
headerSearchButton = skinHeader.querySelector('.headerSearchButton');
|
||||||
headerSyncButton = skinHeader.querySelector('.headerSyncButton');
|
headerSyncButton = skinHeader.querySelector('.headerSyncButton');
|
||||||
|
currentTimeText = skinHeader.querySelector('.currentTimeText');
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
lazyLoadViewMenuBarImages();
|
lazyLoadViewMenuBarImages();
|
||||||
bindMenuEvents();
|
bindMenuEvents();
|
||||||
updateCastIcon();
|
updateCastIcon();
|
||||||
|
updateClock();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentApiClient() {
|
function getCurrentApiClient() {
|
||||||
|
@ -189,6 +193,17 @@ import '../styles/flexstyles.scss';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateClock() {
|
||||||
|
if (layoutManager.tv) {
|
||||||
|
currentTimeText.classList.remove('hide');
|
||||||
|
setInterval(function() {
|
||||||
|
currentTimeText.innerHTML = datetime.getDisplayTime(new Date());
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
currentTimeText.classList.add('hide');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function showSearch() {
|
function showSearch() {
|
||||||
inputManager.handleCommand('search');
|
inputManager.handleCommand('search');
|
||||||
}
|
}
|
||||||
|
@ -940,6 +955,7 @@ import '../styles/flexstyles.scss';
|
||||||
let headerSearchButton;
|
let headerSearchButton;
|
||||||
let headerAudioPlayerButton;
|
let headerAudioPlayerButton;
|
||||||
let headerSyncButton;
|
let headerSyncButton;
|
||||||
|
let currentTimeText;
|
||||||
const enableLibraryNavDrawer = layoutManager.desktop;
|
const enableLibraryNavDrawer = layoutManager.desktop;
|
||||||
const enableLibraryNavDrawerHome = !layoutManager.tv;
|
const enableLibraryNavDrawerHome = !layoutManager.tv;
|
||||||
const skinHeader = document.querySelector('.skinHeader');
|
const skinHeader = document.querySelector('.skinHeader');
|
||||||
|
|
|
@ -1515,3 +1515,8 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards {
|
||||||
line-clamp: 6;
|
line-clamp: 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.currentTimeText {
|
||||||
|
padding-left: 0.8em;
|
||||||
|
padding-right: 0.8em;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue