From ec469a7b05cc9bb430393c3e73c8af0d09fe90f1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 7 Jun 2015 17:21:30 -0400 Subject: [PATCH] add mono CreateWebRequest workaround --- dashboard-ui/css/card.css | 13 ++- dashboard-ui/css/librarybrowser.css | 40 ++++++-- dashboard-ui/scripts/appsettings.js | 2 +- dashboard-ui/scripts/backdrops.js | 4 +- dashboard-ui/scripts/channelitems.js | 4 +- dashboard-ui/scripts/indexpage.js | 33 ++++--- dashboard-ui/scripts/itembynamedetailpage.js | 6 +- dashboard-ui/scripts/itemlistpage.js | 2 +- dashboard-ui/scripts/librarybrowser.js | 18 ++-- dashboard-ui/scripts/librarymenu.js | 32 +++++- dashboard-ui/scripts/mediaplayer-video.js | 9 +- dashboard-ui/scripts/moviegenres.js | 2 +- dashboard-ui/scripts/musicgenres.js | 2 +- dashboard-ui/scripts/playlistedit.js | 3 +- dashboard-ui/scripts/site.js | 13 ++- dashboard-ui/scripts/tvgenres.js | 2 +- dashboard-ui/thirdparty/cordova/chromecast.js | 99 +++++++++---------- .../cordova/registrationservices.js | 6 ++ 18 files changed, 184 insertions(+), 106 deletions(-) diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index e166310677..aa1aaaa5a5 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -69,7 +69,7 @@ } .bottomPaddedCard .cardBox { - margin-bottom: 5px; + margin-bottom: 12px; } .visualCardBox { @@ -85,7 +85,7 @@ } .ui-page-theme-b .visualCardBox { - background: rgba(45,45,45,.85); + background: rgba(40,40,40,.85); border-radius: 3px; } @@ -174,7 +174,7 @@ } .visualCardBox .outerCardFooter { - padding: 5px; + padding: 3px; position: relative; } @@ -195,6 +195,12 @@ line-height: 1.4; } +.cardButtonContainer { + text-align: right; + float: right; + padding: 5px 0 2px; +} + .cardContent .cardFooter .cardText { font-size: 14px; } @@ -220,7 +226,6 @@ } .cardBox:not(.visualCardBox) .outerCardFooter .cardText:last-child { - margin-bottom: 2em; } @media all and (max-width: 600px) { diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 837d56f91b..fecc66559e 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1367,13 +1367,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { margin: 0 auto !important; } - .itemsListview .ui-li-aside { - right: 70px; - font-size: 13px; - top: 35%; - font-weight: 300 !important; - } - .itemsListview .ui-li-count { right: 1em; top: 70%; @@ -1409,11 +1402,20 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { background-position: center center; } -.listViewMoreButton { +.listViewAside { position: absolute; right: 0; top: 10%; - padding: 15px 20px; +} + + .listViewAside button { + padding: 15px 10px; + margin: 0 !important; + vertical-align: middle; + } + +.listViewMoreButton { + padding-left: 20px !important; font-size: 20px; } @@ -1475,9 +1477,27 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { color: #2ad; } +.listViewUserDataButtons { + visibility: hidden; +} + +@media all and (min-width: 1200px) { + + li:hover .listViewUserDataButtons { + visibility: visible !important; + } +} + +@media all and (max-width: 1200px) { + + .listViewUserDataButtons { + display: none; + } +} + @media all and (max-width: 600px) { - .itemsListview .ui-li-aside { + .listViewAsideText { display: none; } } diff --git a/dashboard-ui/scripts/appsettings.js b/dashboard-ui/scripts/appsettings.js index 945bbc16d1..d71aff97ea 100644 --- a/dashboard-ui/scripts/appsettings.js +++ b/dashboard-ui/scripts/appsettings.js @@ -38,7 +38,7 @@ update('enableItemPreviews', val.toString()); } - return store.getItem('enableItemPreviews') != 'false'; + return store.getItem('enableItemPreviews') == 'true'; }, enableFullScreen: function (val) { diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js index 770e14e01e..5f2e81588c 100644 --- a/dashboard-ui/scripts/backdrops.js +++ b/dashboard-ui/scripts/backdrops.js @@ -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); diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js index ee2d980906..9a37b1e93a 100644 --- a/dashboard-ui/scripts/channelitems.js +++ b/dashboard-ui/scripts/channelitems.js @@ -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(); diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 7977912fdf..bc775f4025 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -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 += '
'; html += '

' + Globalize.translate('HeaderLatestMedia') + '

'; - if (user.Policy.EnableUserPreferenceAccess) { + if (user.Policy.EnableUserPreferenceAccess && !AppInfo.isNativeApp) { html += '' + Globalize.translate('ButtonEdit') + ''; } @@ -235,7 +235,7 @@ html += '
'; html += '

' + Globalize.translate('HeaderMyMedia') + '

'; - if (user.Policy.EnableUserPreferenceAccess) { + if (user.Policy.EnableUserPreferenceAccess && !AppInfo.isNativeApp) { html += '' + Globalize.translate('ButtonEdit') + ''; } @@ -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); + } }); }); diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index 1d89079cf0..5b0d4920be 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -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 }); } diff --git a/dashboard-ui/scripts/itemlistpage.js b/dashboard-ui/scripts/itemlistpage.js index 48e88b7e72..a0dcc0dbe6 100644 --- a/dashboard-ui/scripts/itemlistpage.js +++ b/dashboard-ui/scripts/itemlistpage.js @@ -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(); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 3249f19ba3..da74e1a384 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -848,10 +848,6 @@ html += '

'; } - html += '
'; - html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false); - html += '
'; - html += LibraryBrowser.getSyncIndicator(item); if (item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.MediaType == 'Video') { @@ -863,9 +859,17 @@ } html += ''; + html += '
'; + html += ''; + html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false); + html += ''; html += ''; + html += ''; + html += LibraryBrowser.getUserDataIconsHtml(item); + html += ''; + html += '
'; html += ''; @@ -1553,7 +1557,7 @@ html += '
'; if (options.cardLayout) { - html += '
'; + html += '
'; html += ''; html += "
"; } @@ -2269,7 +2273,7 @@ btnCssClass += " imageButton"; - return ''; + return ''; }, @@ -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 { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 0efa08e8a6..ef0fe7166e 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -38,7 +38,7 @@ // html += ''; //} - if (!$.browser.mobile && !AppInfo.isTouchPreferred) { + if (!$.browser.mobile && !AppInfo.isNativeApp) { html += ''; } @@ -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 += '
'; - html += '' + Globalize.translate('ButtonManageServer') + ''; + html += '' + Globalize.translate('ButtonManageServer') + ''; html += '' + Globalize.translate('ButtonMetadataManager') + ''; 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); diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 15a7a80bc5..894234dbaa 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -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 += '