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

add mono CreateWebRequest workaround

This commit is contained in:
Luke Pulverenti 2015-06-07 17:21:30 -04:00
parent 386e63ee64
commit ec469a7b05
18 changed files with 184 additions and 106 deletions

View file

@ -38,7 +38,7 @@
update('enableItemPreviews', val.toString());
}
return store.getItem('enableItemPreviews') != 'false';
return store.getItem('enableItemPreviews') == 'true';
},
enableFullScreen: function (val) {

View file

@ -85,7 +85,7 @@
type: "Backdrop",
tag: item.tag,
maxWidth: screenWidth,
quality: 80
quality: 50
});
setBackdropImage(getElement(), imgUrl);
@ -174,7 +174,7 @@
type: "Backdrop",
tag: item.tag,
maxWidth: screenWidth,
quality: 80
quality: 50
});
setBackdropImage(getElement(), imgUrl);

View file

@ -147,9 +147,9 @@
context: 'channels',
showTitle: true,
coverImage: true,
cardLayout: true,
showYear: true,
lazy: true
lazy: true,
centerText: true
});
var elem = $('#items', page).html(html).lazyChildren();

View file

@ -32,51 +32,51 @@
var item = items[i];
var icon;
var backgroundColor = 'rgba(82, 181, 75, 0.7)';
var backgroundColor = 'rgba(82, 181, 75, 0.9)';
switch (item.CollectionType) {
case "movies":
icon = "fa-film";
backgroundColor = 'rgba(176, 94, 81, 0.7)';
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "music":
icon = "fa-music";
backgroundColor = 'rgba(217, 145, 67, 0.7)';
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "photos":
icon = "fa-photo";
backgroundColor = 'rgba(127, 0, 0, 0.7)';
backgroundColor = 'rgba(127, 0, 0, 0.9)';
break;
case "livetv":
icon = "fa-video-camera";
backgroundColor = 'rgba(255, 233, 127, 0.7)';
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "tvshows":
icon = "fa-video-camera";
backgroundColor = 'rgba(77, 88, 164, 0.7)';
backgroundColor = 'rgba(77, 88, 164, 0.9)';
break;
case "games":
icon = "fa-gamepad";
backgroundColor = 'rgba(183, 202, 72, 0.7)';
backgroundColor = 'rgba(183, 202, 72, 0.9)';
break;
case "trailers":
icon = "fa-film";
backgroundColor = 'rgba(176, 94, 81, 0.7)';
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "homevideos":
icon = "fa-video-camera";
backgroundColor = 'rgba(110, 52, 32, 0.7)';
backgroundColor = 'rgba(110, 52, 32, 0.9)';
break;
case "musicvideos":
icon = "fa-video-camera";
backgroundColor = 'rgba(143, 54, 168, 0.7)';
backgroundColor = 'rgba(143, 54, 168, 0.9)';
break;
case "books":
icon = "fa-book";
break;
case "channels":
icon = "fa-globe";
backgroundColor = 'rgba(51, 136, 204, 0.7)';
backgroundColor = 'rgba(51, 136, 204, 0.9)';
break;
case "playlists":
icon = "fa-list";
@ -153,7 +153,7 @@
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>';
if (user.Policy.EnableUserPreferenceAccess) {
if (user.Policy.EnableUserPreferenceAccess && !AppInfo.isNativeApp) {
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
}
@ -235,7 +235,7 @@
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderMyMedia') + '</h1>';
if (user.Policy.EnableUserPreferenceAccess) {
if (user.Policy.EnableUserPreferenceAccess && !AppInfo.isNativeApp) {
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
}
@ -461,7 +461,7 @@
(function ($, document) {
var defaultFirstSection = 'smalllibrarytiles-automobile';
var defaultFirstSection = 'smalllibrarytiles';
function getDefaultSection(index) {
@ -643,7 +643,10 @@
Dashboard.getCurrentUser().done(function (user) {
loadSections(page, user, result).done(function () {
showWelcomeIfNeeded(page, result);
if (!AppInfo.isNativeApp) {
showWelcomeIfNeeded(page, result);
}
});
});

View file

@ -453,7 +453,8 @@
html = LibraryBrowser.getListViewHtml({
items: result.Items,
playFromHere: true,
defaultAction: 'playallfromhere'
defaultAction: 'playallfromhere',
smallIcon: true
});
}
else if (query.IncludeItemTypes == "Movie" || query.IncludeItemTypes == "Trailer") {
@ -503,7 +504,8 @@
else {
html = LibraryBrowser.getListViewHtml({
items: result.Items
items: result.Items,
smallIcon: true
});
}

View file

@ -125,7 +125,7 @@
Dashboard.getCurrentUser().done(function (user) {
if (user.Policy.IsAdministrator && query.ParentId) {
if (user.Policy.IsAdministrator && query.ParentId && !AppInfo.isNativeApp) {
$('#editButtonContainer', page).show();
} else {
$('#editButtonContainer', page).hide();

View file

@ -848,10 +848,6 @@
html += '</p>';
}
html += '<div class="ui-li-aside">';
html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false);
html += '</div>';
html += LibraryBrowser.getSyncIndicator(item);
if (item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.MediaType == 'Video') {
@ -863,9 +859,17 @@
}
html += '</a>';
html += '<div class="listViewAside">';
html += '<span class="listViewAsideText">';
html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false);
html += '</span>';
html += '<button type="button" data-role="none" class="listviewMenuButton imageButton listViewMoreButton" data-icon="none">';
html += '<i class="material-icons">more_vert</i>';
html += '</button>';
html += '<span class="listViewUserDataButtons">';
html += LibraryBrowser.getUserDataIconsHtml(item);
html += '</span>';
html += '</div>';
html += '</li>';
@ -1553,7 +1557,7 @@
html += '<div class="' + footerClass + '">';
if (options.cardLayout) {
html += '<div class="cardText" style="text-align:right; float:right;">';
html += '<div class="cardButtonContainer">';
html += '<button class="listviewMenuButton imageButton btnCardOptions" type="button" data-role="none" style="margin: 4px 0 0;"><i class="material-icons">more_vert</i></button>';
html += "</div>";
}
@ -2269,7 +2273,7 @@
btnCssClass += " imageButton";
return '<button data-itemid="' + itemId + '" class="' + btnCssClass + '" type="button" onclick="LibraryBrowser.' + method + '(this);return false;" title="' + tooltip + '"><i class="fa ' + icon + '"></i></button>';
return '<button data-itemid="' + itemId + '" class="' + btnCssClass + '" type="button" onclick="LibraryBrowser.' + method + '(this);return false;" title="' + tooltip + '" data-role="none"><i class="fa ' + icon + '"></i></button>';
},
@ -2284,7 +2288,7 @@
var tooltipPlayed = Globalize.translate('TooltipPlayed');
if ((item.MediaType || item.IsFolder) && type != "TvChannel" && type != "MusicArtist") {
if ((item.MediaType || item.IsFolder) && type != "TvChannel" && type != "MusicArtist" && item.MediaType != "Audio") {
if (userData.Played) {
html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRating', 'fa-check', tooltipPlayed);
} else {

View file

@ -38,7 +38,7 @@
// html += '<button class="headerButtonViewMenu headerButton headerButtonRight" type="button" data-role="none"><i class="material-icons">more_vert</i></button>';
//}
if (!$.browser.mobile && !AppInfo.isTouchPreferred) {
if (!$.browser.mobile && !AppInfo.isNativeApp) {
html += '<a href="dashboard.html" class="headerButton headerButtonRight dashboardEntryHeaderButton" style="display:none;"><i class="material-icons">settings</i></a>';
}
@ -101,6 +101,21 @@
$(initViewMenuBarHeadroom);
//$('.headerButtonViewMenu').off('click', onViewButtonClick).on('click', onViewButtonClick);
if (AppInfo.isNativeApp) {
$(document).off('swiperight.drawer').on('swiperight.drawer', '.libraryPage', onSwipeRight);
}
}
function onSwipeRight(event) {
if (event.swipestop && event.swipestop.coords) {
var x = event.swipestop.coords[0];
if (x < 50) {
showLibraryMenu();
}
}
}
//function onViewButtonClick() {
@ -155,7 +170,7 @@
html += Globalize.translate('HeaderAdmin');
html += '</div>';
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="dashboard" href="dashboard.html"><span class="fa fa-server sidebarLinkIcon"></span>' + Globalize.translate('ButtonManageServer') + '</a>';
html += '<a class="sidebarLink lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="#"><span class="fa fa-server sidebarLinkIcon"></span>' + Globalize.translate('ButtonManageServer') + '</a>';
html += '<a class="sidebarLink lnkMediaFolder editorViewMenu" data-itemid="editor" href="edititemmetadata.html"><span class="fa fa-edit sidebarLinkIcon"></span>' + Globalize.translate('ButtonMetadataManager') + '</a>';
if (!$.browser.mobile && !AppInfo.isTouchPreferred) {
@ -412,6 +427,8 @@
panel = $('#libraryPanel').panel({}).lazyChildren().trigger('create');
$('.lnkManageServer', panel).on('click', onManageServerClicked);
updateLibraryMenu();
}
else if (requiresLibraryMenuRefresh) {
@ -422,6 +439,17 @@
return panel;
}
function onManageServerClicked() {
requirejs(["scripts/registrationservices"], function () {
RegistrationServices.validateFeature('manageserver').done(function () {
Dashboard.navigate('dashboard.html');
});
});
}
function getDashboardMenu(page) {
var panel = $('#dashboardPanel', page);

View file

@ -1109,7 +1109,10 @@
var requiresNativeControls = !self.enableCustomVideoControls();
// Can't autoplay in these browsers so we need to use the full controls
if (requiresNativeControls) {
if (requiresNativeControls && AppInfo.isNativeApp && $.browser.android) {
html += '<video data-viblast-key="N8FjNTQ3NDdhZqZhNGI5NWU5ZTI=" class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="anonymous" ' + posterCode + ' webkit-playsinline>';
}
else if (requiresNativeControls) {
html += '<video data-viblast-key="N8FjNTQ3NDdhZqZhNGI5NWU5ZTI=" class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="anonymous" controls="controls"' + posterCode + ' webkit-playsinline>';
}
else {
@ -1219,6 +1222,10 @@
}, 3000);
}
if (requiresNativeControls) {
$(this).attr('controls', 'controls');
}
}).on("volumechange.mediaplayerevent", function (e) {
var vol = this.volume;

View file

@ -1,6 +1,6 @@
(function ($, document) {
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'ThumbCard');
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'Thumb');
// The base query options
var query = {

View file

@ -1,6 +1,6 @@
(function ($, document) {
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'ThumbCard');
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'Thumb');
// The base query options
var query = {

View file

@ -99,7 +99,8 @@
title: item.Name,
showRemoveFromPlaylist: true,
playFromHere: true,
defaultAction: 'playallfromhere'
defaultAction: 'playallfromhere',
smallIcon: true
});
}

View file

@ -36,7 +36,7 @@ var Dashboard = {
$.mobile.popup.prototype.options.transition = "pop";
if ($.browser.mobile) {
$.mobile.defaultPageTransition = "slide";
$.mobile.defaultPageTransition = "none";
} else {
$.mobile.defaultPageTransition = "none";
}
@ -45,6 +45,9 @@ var Dashboard = {
// Make panels a little larger than the defaults
$.mobile.panel.prototype.options.classes.modalOpen = "largePanelModalOpen ui-panel-dismiss-open";
$.mobile.panel.prototype.options.classes.panel = "largePanel ui-panel";
$.event.special.swipe.verticalDistanceThreshold = 40;
$.mobile.loader.prototype.options.disabled = true;
},
isConnectMode: function () {
@ -92,7 +95,7 @@ var Dashboard = {
}
Dashboard.hideLoadingMsg();
if (!Dashboard.suppressAjaxErrors && data.type != 'GET') {
if (!Dashboard.suppressAjaxErrors && data.type != 'GET' && !AppInfo.isNativeApp) {
setTimeout(function () {
@ -731,7 +734,7 @@ var Dashboard = {
if (item.selected) {
menuHtml += '<a class="sidebarLink selectedSidebarLink" href="' + item.href + '">';
} else {
menuHtml += '<a data-transition="none" class="sidebarLink" href="' + item.href + '">';
menuHtml += '<a class="sidebarLink" href="' + item.href + '">';
}
var icon = item.icon;
@ -765,7 +768,7 @@ var Dashboard = {
html += '<div data-role="panel" id="dashboardPanel" class="dashboardPanel" data-position="left" data-display="overlay" data-position-fixed="true" data-theme="a">';
html += '<p class="libraryPanelHeader" style="margin: 15px 0 15px 20px;"><a href="index.html" data-transition="none" class="imageLink"><img src="css/images/mblogoicon.png" /><span style="color:#333;">EMBY</span></a></p>';
html += '<p class="libraryPanelHeader" style="margin: 15px 0 15px 20px;"><a href="index.html" class="imageLink"><img src="css/images/mblogoicon.png" /><span style="color:#333;">EMBY</span></a></p>';
html += '<div class="sidebarLinks">';
html += menuHtml;
@ -1982,7 +1985,7 @@ $(document).on('pagecreate', ".page", function () {
Dashboard.firePageEvent(page, 'pageinitdepends');
}
$('.localnav a, .libraryViewNav a').attr('data-transition', 'none');
//$('.localnav a, .libraryViewNav a').attr('data-transition', 'none');
}).on('pagebeforeshow', ".page", function () {

View file

@ -1,6 +1,6 @@
(function ($, document) {
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'ThumbCard');
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'Thumb');
// The base query options
var query = {