diff --git a/dashboard-ui/nowplaying.html b/dashboard-ui/nowplaying.html
index 9c20226f6e..9a41101233 100644
--- a/dashboard-ui/nowplaying.html
+++ b/dashboard-ui/nowplaying.html
@@ -143,7 +143,7 @@
-
+ ${TabNowPlaying}${TabControls}
diff --git a/dashboard-ui/scripts/favorites.js b/dashboard-ui/scripts/favorites.js
index edbd158c79..cc0603cc0e 100644
--- a/dashboard-ui/scripts/favorites.js
+++ b/dashboard-ui/scripts/favorites.js
@@ -118,7 +118,7 @@
var page = this;
var tabContent = page.querySelector('.homeFavoritesTabContent');
- $(page.querySelector('neon-animated-pages')).on('iron-select', function () {
+ $(page.querySelector('neon-animated-pages')).on('tabchange', function () {
if (parseInt(this.selected) == 2) {
if (LibraryBrowser.needsRefresh(tabContent)) {
diff --git a/dashboard-ui/scripts/homenextup.js b/dashboard-ui/scripts/homenextup.js
index 088b51ae03..a92fb8b793 100644
--- a/dashboard-ui/scripts/homenextup.js
+++ b/dashboard-ui/scripts/homenextup.js
@@ -83,7 +83,7 @@
var page = this;
var tabContent = page.querySelector('.homeNextUpTabContent');
- $(page.querySelector('neon-animated-pages')).on('iron-select', function () {
+ $(page.querySelector('neon-animated-pages')).on('tabchange', function () {
if (parseInt(this.selected) == 1) {
if (LibraryBrowser.needsRefresh(tabContent)) {
diff --git a/dashboard-ui/scripts/homeupcoming.js b/dashboard-ui/scripts/homeupcoming.js
index 03715738e8..b9752f3c42 100644
--- a/dashboard-ui/scripts/homeupcoming.js
+++ b/dashboard-ui/scripts/homeupcoming.js
@@ -64,7 +64,7 @@
var page = this;
var tabContent = page.querySelector('.homeUpcomingTabContent');
- $(page.querySelector('neon-animated-pages')).on('iron-select', function () {
+ $(page.querySelector('neon-animated-pages')).on('tabchange', function () {
if (parseInt(this.selected) == 3) {
if (LibraryBrowser.needsRefresh(tabContent)) {
diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js
index 3d6e70f8a0..e1750be5f8 100644
--- a/dashboard-ui/scripts/indexpage.js
+++ b/dashboard-ui/scripts/indexpage.js
@@ -210,10 +210,6 @@
var page = this;
- Events.on(page.querySelector('.btnTakeTour'), 'click', function () {
- takeTour(page, Dashboard.getCurrentUserId());
- });
-
var tabs = page.querySelector('paper-tabs');
LibraryBrowser.configurePaperLibraryTabs(page, page.querySelectorAll('paper-tabs')[0], page.querySelectorAll('neon-animated-pages')[0]);
@@ -232,22 +228,25 @@
}
});
- $(page.querySelector('neon-animated-pages')).on('iron-select', function () {
+ $(page.querySelector('neon-animated-pages')).on('tabchange', function () {
loadTab(page, parseInt(this.selected));
});
- }).on('pagebeforeshowready', "#indexPage", function () {
+ $(page.querySelector('neon-animated-pages')).on('iron-select', function () {
- var page = this;
+ // When transition animations are used, add a content loading delay to allow the animations to finish
+ // Otherwise with both operations happening at the same time, it can cause the animation to not run at full speed.
+ var delay = LibraryBrowser.enableFullPaperTabs() ? 500 : 0;
+ var pages = this;
+ setTimeout(function () {
+ $(pages).trigger('tabchange');
+ }, delay);
+ });
- var tabs = page.querySelector('paper-tabs');
- var selected = tabs.selected;
+ Events.on(page.querySelector('.btnTakeTour'), 'click', function () {
+ takeTour(page, Dashboard.getCurrentUserId());
+ });
- if (selected == null) {
- selected = parseInt(getParameterByName('tab') || '0');
- tabs.selected = selected;
- page.querySelector('neon-animated-pages').selected = selected;
- }
});
function getDisplayPreferencesAppName() {
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index 715765a877..70b3508836 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -52,7 +52,7 @@
$('.btnSync', page).addClass('hide');
}
- if (user.Policy.EnablePublicSharing) {
+ if (LibraryBrowser.canShare(item, user)) {
$('.btnShare', page).removeClass('hide');
} else {
$('.btnShare', page).addClass('hide');
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index a29846022e..75c16c35b0 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -90,12 +90,16 @@
}
var now = new Date().getTime();
- var cacheDuration = 300000;
- if (!AppInfo.isNativeApp && ($.browser.ipad || $.browser.iphone || $.browser.android)) {
+ var cacheDuration;
+
+ if (AppInfo.isNativeApp) {
+ cacheDuration = 300000;
+ }
+ else if ($.browser.ipad || $.browser.iphone || $.browser.android) {
cacheDuration = 10000;
}
- else if (!$.browser.mobile) {
+ else {
cacheDuration = 60000;
}
@@ -167,13 +171,33 @@
tabs.hideScrollButtons = true;
+ if (AppInfo.enableBottomTabs) {
+ tabs.alignBottom = true;
+ tabs.classList.add('bottomTabs');
+ }
+
if (LibraryBrowser.enableFullPaperTabs()) {
$(tabs).show();
- LibraryBrowser.configureSwipeTabs(ownerpage, tabs, pages);
+ if ($.browser.safari) {
- $('.libraryViewNav', ownerpage).addClass('paperLibraryViewNav');
+ // Not very iOS-like I suppose
+ tabs.noSlide = true;
+ tabs.noink = true;
+ tabs.noBar = true;
+ }
+ else {
+ // Safari doesn't handle the horizontal swiping very well
+
+ // Not very iOS-like I suppose
+ pages.entryAnimation = 'slide-from-right-animation';
+ pages.exitAnimation = 'slide-left-animation';
+
+ LibraryBrowser.configureSwipeTabs(ownerpage, tabs, pages);
+ }
+
+ $('.libraryViewNav', ownerpage).addClass('paperLibraryViewNav').removeClass('libraryViewNavWithMinHeight');
} else {
@@ -190,7 +214,32 @@
var selected = this.selected;
$('a', legacyTabs).removeClass('ui-btn-active')[selected].classList.add('ui-btn-active');
});
+
+ $('.libraryViewNav', ownerpage).removeClass('libraryViewNavWithMinHeight');
}
+
+ $(ownerpage).on('pagebeforeshowready', LibraryBrowser.onTabbedPageBeforeShowReady);
+ },
+
+ onTabbedPageBeforeShowReady: function () {
+ var page = this;
+
+ var tabs = page.querySelector('paper-tabs');
+ var selected = tabs.selected;
+
+ if (selected == null) {
+ selected = parseInt(getParameterByName('tab') || '0');
+ tabs.selected = selected;
+ page.querySelector('neon-animated-pages').selected = selected;
+
+ } else if (!LibraryBrowser.enableFullPaperTabs()) {
+ Events.trigger(page.querySelector('neon-animated-pages'), 'tabchange');
+ }
+ },
+
+ canShare: function (item, user) {
+
+ return user.Policy.EnablePublicSharing;
},
getDateParamValue: function (date) {
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index ad9937c23a..a6b291c910 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -323,6 +323,14 @@
});
}
+ if (user.Policy.EnablePublicSharing) {
+ items.push({
+ name: Globalize.translate('ButtonShare'),
+ id: 'share',
+ ironIcon: 'share'
+ });
+ }
+
if (commands.indexOf('sync') != -1) {
items.push({
name: Globalize.translate('ButtonSync'),
@@ -445,6 +453,11 @@
case 'externalplayer':
LibraryBrowser.playInExternalPlayer(itemId);
break;
+ case 'share':
+ require(['sharingmanager'], function () {
+ SharingManager.showMenu(Dashboard.getCurrentUserId(), itemId);
+ });
+ break;
case 'removefromplaylist':
$(card).parents('.itemsContainer').trigger('removefromplaylist', [playlistItemId]);
break;
diff --git a/dashboard-ui/scripts/nowplayingpage.js b/dashboard-ui/scripts/nowplayingpage.js
index dbda6a62d3..23719bf16b 100644
--- a/dashboard-ui/scripts/nowplayingpage.js
+++ b/dashboard-ui/scripts/nowplayingpage.js
@@ -664,34 +664,6 @@
return false;
}
- function getBackdropUrl(item) {
-
- var screenWidth = screen.availWidth;
-
- if (item.BackdropImageTags && item.BackdropImageTags.length) {
-
- return ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- index: 0,
- maxWidth: screenWidth,
- tag: item.BackdropImageTags[0]
- });
-
- }
- else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
-
- return ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
- type: 'Backdrop',
- index: 0,
- maxWidth: screenWidth,
- tag: item.ParentBackdropImageTags[0]
- });
-
- }
-
- return null;
- };
-
function updateCastIcon() {
var info = MediaController.getPlayerInfo();
@@ -728,7 +700,10 @@
$('.requiresJqmCreate', this).trigger('create');
- LibraryBrowser.configureSwipeTabs(page, page.querySelectorAll('paper-tabs')[0], page.querySelectorAll('neon-animated-pages')[0]);
+ var tabs = page.querySelectorAll('paper-tabs')[0];
+ tabs.alignBottom = true;
+
+ LibraryBrowser.configureSwipeTabs(page, tabs, page.querySelectorAll('neon-animated-pages')[0]);
$(MediaController).on('playerchange', function () {
updateCastIcon(page);
diff --git a/dashboard-ui/scripts/sharingwidget.js b/dashboard-ui/scripts/sharingwidget.js
index c159aeb8b4..84c0532f61 100644
--- a/dashboard-ui/scripts/sharingwidget.js
+++ b/dashboard-ui/scripts/sharingwidget.js
@@ -14,7 +14,14 @@
html += '
' + Globalize.translate('HeaderShare') + '
';
html += '
';
- html += '
';
+ html += '
';
+
+ // We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it.
+ if (Dashboard.isConnectMode()) {
+ html += '';
+ }
+
+ html += '