mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update build scripts
This commit is contained in:
parent
257a7d2879
commit
a8ef5994d8
20 changed files with 482 additions and 452 deletions
|
@ -280,6 +280,7 @@
|
|||
tabs.addEventListener('iron-select', function () {
|
||||
|
||||
var animateTab = !$.browser.safari;
|
||||
animateTab = false;
|
||||
var selected = pages.selected;
|
||||
if (selected != null && animateTab) {
|
||||
var newValue = this.selected;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
html += '<paper-icon-button icon="mic" class="headerButton headerButtonRight headerVoiceButton hide" onclick="VoiceInputManager.startListening();"></paper-icon-button>';
|
||||
|
||||
//html += '<paper-button class="headerButton headerButtonRight btnNotifications subdued" type="button" title="Notifications"><div class="btnNotificationsInner">0</div></paper-button>';
|
||||
html += '<paper-button class="headerButton headerButtonRight btnNotifications subdued" type="button" title="Notifications"><div class="btnNotificationsInner">0</div></paper-button>';
|
||||
|
||||
if (!showUserAtTop()) {
|
||||
html += '<paper-icon-button icon="person" class="headerButton headerButtonRight headerUserButton" onclick="return Dashboard.showUserFlyout(this);"></paper-icon-button>';
|
||||
|
@ -143,20 +143,20 @@
|
|||
|
||||
function updateViewMenuBarHeadroom(page, viewMenuBar) {
|
||||
|
||||
if (page.classList.contains('libraryPage')) {
|
||||
// Don't like this timeout at all but if headroom is activated during the page events it will jump and flicker on us
|
||||
setTimeout(reEnableHeadroom, 700);
|
||||
} else {
|
||||
viewMenuBar.classList.add('headroomDisabled');
|
||||
}
|
||||
//if (page.classList.contains('libraryPage')) {
|
||||
// // Don't like this timeout at all but if headroom is activated during the page events it will jump and flicker on us
|
||||
// setTimeout(reEnableHeadroom, 700);
|
||||
//} else {
|
||||
// viewMenuBar.classList.add('headroomDisabled');
|
||||
//}
|
||||
}
|
||||
|
||||
function reEnableHeadroom() {
|
||||
|
||||
var headroomDisabled = document.querySelectorAll('.headroomDisabled');
|
||||
for (var i = 0, length = headroomDisabled.length; i < length; i++) {
|
||||
headroomDisabled[i].classList.remove('headroomDisabled');
|
||||
}
|
||||
//var headroomDisabled = document.querySelectorAll('.headroomDisabled');
|
||||
//for (var i = 0, length = headroomDisabled.length; i < length; i++) {
|
||||
// headroomDisabled[i].classList.remove('headroomDisabled');
|
||||
//}
|
||||
}
|
||||
|
||||
function getItemHref(item, context) {
|
||||
|
@ -815,14 +815,14 @@
|
|||
|
||||
});
|
||||
|
||||
pageClassOn('pagebeforehide', 'page', function () {
|
||||
//pageClassOn('pagebeforehide', 'page', function () {
|
||||
|
||||
var headroomEnabled = document.querySelectorAll('.headroomEnabled');
|
||||
for (var i = 0, length = headroomEnabled.length; i < length; i++) {
|
||||
headroomEnabled[i].classList.add('headroomDisabled');
|
||||
}
|
||||
// var headroomEnabled = document.querySelectorAll('.headroomEnabled');
|
||||
// for (var i = 0, length = headroomEnabled.length; i < length; i++) {
|
||||
// headroomEnabled[i].classList.add('headroomDisabled');
|
||||
// }
|
||||
|
||||
});
|
||||
//});
|
||||
|
||||
function onPageBeforeShowDocumentReady(page) {
|
||||
|
||||
|
|
|
@ -20,6 +20,13 @@
|
|||
require(['multiserversync'], function () {
|
||||
|
||||
lastStart = new Date().getTime();
|
||||
|
||||
options = options || {};
|
||||
|
||||
if ($.browser.safari) {
|
||||
options.enableBackgroundTransfer = true;
|
||||
}
|
||||
|
||||
syncPromise = new MediaBrowser.MultiServerSync(ConnectionManager).sync(options).done(function () {
|
||||
|
||||
syncPromise = null;
|
||||
|
|
|
@ -121,54 +121,41 @@
|
|||
|
||||
function getNotificationHtml(notification) {
|
||||
|
||||
var html = '';
|
||||
var itemHtml = '';
|
||||
|
||||
var cssClass = notification.IsRead ? "flyoutNotification" : "flyoutNotification unreadFlyoutNotification";
|
||||
|
||||
html += '<div data-notificationid="' + notification.Id + '" class="' + cssClass + '">';
|
||||
|
||||
html += '<div class="notificationImage">';
|
||||
html += getImageHtml(notification);
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="notificationContent">';
|
||||
|
||||
html += '<p style="font-size:16px;margin: .5em 0 .5em;" class="notificationName">';
|
||||
if (notification.Url) {
|
||||
html += '<a href="' + notification.Url + '" target="_blank" style="text-decoration:none;">' + notification.Name + '</a>';
|
||||
} else {
|
||||
html += notification.Name;
|
||||
itemHtml += '<a class="clearLink" href="' + notification.Url + '" target="_blank">';
|
||||
}
|
||||
html += '</p>';
|
||||
|
||||
html += '<p class="notificationTime" style="margin: .5em 0;">' + humane_date(notification.Date) + '</p>';
|
||||
itemHtml += '<paper-icon-item>';
|
||||
|
||||
itemHtml += '<paper-fab class="listAvatar blue" icon="dvr" item-icon></paper-fab>';
|
||||
|
||||
itemHtml += '<paper-item-body three-line>';
|
||||
|
||||
itemHtml += '<div>';
|
||||
itemHtml += notification.Name;
|
||||
itemHtml += '</div>';
|
||||
|
||||
itemHtml += '<div secondary>';
|
||||
itemHtml += humane_date(notification.Date);
|
||||
itemHtml += '</div>';
|
||||
|
||||
if (notification.Description) {
|
||||
html += '<p style="margin: .5em 0;max-height:150px;overflow:hidden;text-overflow:ellipsis;">' + notification.Description + '</p>';
|
||||
itemHtml += '<div secondary>';
|
||||
itemHtml += notification.Description;
|
||||
itemHtml += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
itemHtml += '</paper-item-body>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function getImageHtml(notification) {
|
||||
|
||||
if (notification.Level == "Error") {
|
||||
|
||||
return '<div class="imgNotification imgNotificationError"><div class="imgNotificationInner imgNotificationIcon"></div></div>';
|
||||
|
||||
}
|
||||
if (notification.Level == "Warning") {
|
||||
|
||||
return '<div class="imgNotification imgNotificationWarning"><div class="imgNotificationInner imgNotificationIcon"></div></div>';
|
||||
itemHtml += '</paper-icon-item>';
|
||||
|
||||
if (notification.Url) {
|
||||
itemHtml += '</a>';
|
||||
}
|
||||
|
||||
return '<div class="imgNotification imgNotificationNormal"><div class="imgNotificationInner imgNotificationIcon"></div></div>';
|
||||
|
||||
return itemHtml;
|
||||
}
|
||||
|
||||
window.Notifications = new notifications();
|
||||
|
@ -187,6 +174,12 @@
|
|||
$(apiClient).off("websocketmessage", onWebSocketMessage).on("websocketmessage", onWebSocketMessage);
|
||||
}
|
||||
|
||||
$(document).on('headercreated', function (e, apiClient) {
|
||||
$('.btnNotifications').on('click', function () {
|
||||
Dashboard.navigate('notificationlist.html');
|
||||
});
|
||||
});
|
||||
|
||||
Dashboard.ready(function () {
|
||||
|
||||
if (window.ApiClient) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue