mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
get icons, swipebox through bower
This commit is contained in:
parent
cc0fd844c3
commit
601e6202e3
77815 changed files with 210644 additions and 107 deletions
|
@ -184,7 +184,9 @@
|
|||
page.querySelector('#resumableItems').classList.remove('hiddenScrollX');
|
||||
}
|
||||
|
||||
reload(page);
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
reload(page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
(function ($, document) {
|
||||
|
||||
$(document).on('pagebeforeshowready', "#homeUpcomingPage", function () {
|
||||
|
||||
function loadUpcoming(page) {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
24 :
|
||||
40;
|
||||
|
@ -59,6 +56,15 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshowready', "#homeUpcomingPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
loadUpcoming(page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -174,30 +174,30 @@
|
|||
|
||||
}).on('pagebeforeshowready', "#indexPage", function () {
|
||||
|
||||
var args = arguments;
|
||||
var page = this;
|
||||
|
||||
if (window.ApiClient) {
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
if (window.ApiClient) {
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
getDisplayPreferences('home', userId).done(function (result) {
|
||||
getDisplayPreferences('home', userId).done(function (result) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
loadSections(page, user, result).done(function () {
|
||||
loadSections(page, user, result).done(function () {
|
||||
|
||||
if (!AppInfo.isNativeApp) {
|
||||
showWelcomeIfNeeded(page, result);
|
||||
}
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
if (!AppInfo.isNativeApp) {
|
||||
showWelcomeIfNeeded(page, result);
|
||||
}
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function getDisplayPreferencesAppName() {
|
||||
|
|
|
@ -822,14 +822,16 @@
|
|||
|
||||
function onPageShowDocumentReady(page) {
|
||||
|
||||
var elems = page.querySelectorAll('.libraryViewNav .ui-btn-active');
|
||||
elems = $(elems).filter(':visible');
|
||||
if (!NavHelper.isBack()) {
|
||||
var elems = page.querySelectorAll('.libraryViewNav .ui-btn-active');
|
||||
elems = $(elems).filter(':visible');
|
||||
|
||||
if (elems.length) {
|
||||
elems[0].scrollIntoView();
|
||||
if (elems.length) {
|
||||
elems[0].scrollIntoView();
|
||||
|
||||
// Scroll back up so in case vertical scroll was messed with
|
||||
window.scrollTo(0, 0);
|
||||
// Scroll back up so in case vertical scroll was messed with
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -948,4 +950,48 @@ $.fn.createHoverTouch = function () {
|
|||
}
|
||||
});
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
(function () {
|
||||
|
||||
var backUrl;
|
||||
|
||||
$(document).on('pagebeforeshow', ".page", function () {
|
||||
|
||||
if (getWindowUrl() != backUrl) {
|
||||
backUrl = null;
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on("popstate", function () {
|
||||
backUrl = getWindowUrl();
|
||||
});
|
||||
|
||||
function isBack() {
|
||||
|
||||
return backUrl == getWindowUrl();
|
||||
}
|
||||
|
||||
function needsRefresh(elem) {
|
||||
|
||||
var last = elem.getAttribute('data-lastrefresh') || '0';
|
||||
|
||||
if (isBack()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var now = new Date().getTime();
|
||||
if ((now - parseInt(last)) < 60000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
elem.setAttribute('data-lastrefresh', now);
|
||||
return true;
|
||||
}
|
||||
|
||||
window.NavHelper = {
|
||||
needsRefresh: needsRefresh,
|
||||
isBack: isBack
|
||||
};
|
||||
|
||||
})();
|
|
@ -249,11 +249,13 @@
|
|||
$(containers).removeClass('hiddenScrollX');
|
||||
}
|
||||
|
||||
loadResume(page, userId, parentId);
|
||||
loadLatest(page, userId, parentId);
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
loadResume(page, userId, parentId);
|
||||
loadLatest(page, userId, parentId);
|
||||
|
||||
if (AppInfo.enableMovieHomeSuggestions) {
|
||||
loadSuggestions(page, userId, parentId);
|
||||
if (AppInfo.enableMovieHomeSuggestions) {
|
||||
loadSuggestions(page, userId, parentId);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -185,17 +185,19 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
loadLatest(page, parentId);
|
||||
loadPlaylists(page, parentId);
|
||||
loadRecentlyPlayed(page, parentId);
|
||||
loadFrequentlyPlayed(page, parentId);
|
||||
|
||||
var containers = page.querySelectorAll('.itemsContainer');
|
||||
if (enableScrollX()) {
|
||||
$(containers).addClass('hiddenScrollX');
|
||||
} else {
|
||||
$(containers).removeClass('hiddenScrollX');
|
||||
}
|
||||
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
loadLatest(page, parentId);
|
||||
loadPlaylists(page, parentId);
|
||||
loadRecentlyPlayed(page, parentId);
|
||||
loadFrequentlyPlayed(page, parentId);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -867,15 +867,6 @@ var Dashboard = {
|
|||
|
||||
if (icon) {
|
||||
menuHtml += '<iron-icon icon="' + icon + '" class="sidebarLinkIcon"' + style + '></iron-icon>';
|
||||
//if (icon.indexOf('fa') == 0) {
|
||||
// menuHtml += '<span class="fa ' + icon + ' sidebarLinkIcon"' + style + '></span>';
|
||||
//}
|
||||
//else if (icon.indexOf('fa') == 0) {
|
||||
// menuHtml += '<span class="fa ' + icon + ' sidebarLinkIcon"' + style + '></span>';
|
||||
//}
|
||||
//else {
|
||||
// menuHtml += '<i class="material-icons sidebarLinkIcon"' + style + '>' + icon + '</i>';
|
||||
//}
|
||||
}
|
||||
|
||||
menuHtml += '<span class="sidebarLinkText">';
|
||||
|
@ -1568,10 +1559,10 @@ var Dashboard = {
|
|||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
|
||||
Dashboard.importCss('thirdparty/swipebox-master/css/swipebox.min.css');
|
||||
Dashboard.importCss('bower_components/swipebox/src/css/swipebox.min.css');
|
||||
|
||||
require([
|
||||
'thirdparty/swipebox-master/js/jquery.swipebox.min'
|
||||
'bower_components/swipebox/src/js/jquery.swipebox.min'
|
||||
], function () {
|
||||
|
||||
deferred.resolve();
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
return 'Thumb';
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshowready', "#tvNextUpPage", function () {
|
||||
function loadLatest(page) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var page = this;
|
||||
|
||||
var limit = 30;
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
|
@ -71,6 +69,14 @@
|
|||
elem.innerHTML = html;
|
||||
ImageLoader.lazyChildren(elem);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshowready', "#tvNextUpPage", function () {
|
||||
|
||||
var page = this;
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
loadLatest(page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -180,7 +180,9 @@
|
|||
page.querySelector('#resumableItems').classList.remove('hiddenScrollX');
|
||||
}
|
||||
|
||||
reload(page);
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
reload(page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
var data = {};
|
||||
|
||||
function getQuery() {
|
||||
var key = getWindowUrl();
|
||||
|
||||
var key = getSavedQueryKey();
|
||||
var pageData = data[key];
|
||||
|
||||
if (!pageData) {
|
||||
|
@ -15,16 +16,20 @@
|
|||
IncludeItemTypes: "Series",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
StartIndex: 0
|
||||
StartIndex: 0,
|
||||
Limit: LibraryBrowser.getDefaultPageSize()
|
||||
}
|
||||
};
|
||||
|
||||
pageData.query.ParentId = LibraryMenu.getTopParentId();
|
||||
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
|
||||
}
|
||||
return pageData.query;
|
||||
}
|
||||
|
||||
function getSavedQueryKey() {
|
||||
|
||||
return 'tvstudios' + (getQuery().ParentId || '');
|
||||
return getWindowUrl();
|
||||
}
|
||||
|
||||
function reloadItems(page) {
|
||||
|
@ -131,20 +136,6 @@
|
|||
|
||||
}).on('pagebeforeshowready', "#tvStudiosPage", function () {
|
||||
|
||||
var query = getQuery();
|
||||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var limit = LibraryBrowser.getDefaultPageSize();
|
||||
|
||||
// If the default page size has changed, the start index will have to be reset
|
||||
if (limit != query.Limit) {
|
||||
query.Limit = limit;
|
||||
query.StartIndex = 0;
|
||||
}
|
||||
|
||||
LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query);
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
updateFilterControls(this);
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
(function ($, document) {
|
||||
|
||||
$(document).on('pagebeforeshowready', "#tvUpcomingPage", function () {
|
||||
function loadUpcoming(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
24 :
|
||||
40;
|
||||
24 :
|
||||
40;
|
||||
|
||||
var query = {
|
||||
|
||||
|
@ -59,6 +57,14 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
|
||||
});
|
||||
}
|
||||
$(document).on('pagebeforeshowready', "#tvUpcomingPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if (NavHelper.needsRefresh(page)) {
|
||||
loadUpcoming(page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue