update sync menus

This commit is contained in:
Luke Pulverenti 2016-08-12 11:54:37 -04:00
parent 43a0e6ccea
commit b2fa34662d
62 changed files with 275 additions and 144 deletions

View File

@ -14,12 +14,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.167",
"_release": "1.4.167",
"version": "1.4.168",
"_release": "1.4.168",
"_resolution": {
"type": "version",
"tag": "1.4.167",
"commit": "03c12f1c7360d863dc0ec55491a292a3f64fb400"
"tag": "1.4.168",
"commit": "feb02354eb53d74eba763c538b70435da37cb9aa"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1",

View File

@ -132,10 +132,16 @@
justify-content: center;
position: relative;
background-clip: content-box !important;
border-radius: 2px;
color: #fff;
}
@media all and (min-width: 600px) {
.cardImageContainer {
border-radius: 2px;
}
}
.visualCardBox .cardImageContainer {
border-radius: 0;
}

View File

@ -1079,7 +1079,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
outerCardFooter = getCardFooterText(item, options, showTitle, imgUrl, footerCssClass, progressHtml, true);
}
if (outerCardFooter && !options.cardLayout) {
if (outerCardFooter && !options.cardLayout && options.allowBottomPadding !== false) {
cardBoxClass += ' cardBox-bottompadded';
}

View File

@ -30,7 +30,12 @@
text-transform: uppercase;
}
.emby-button.raised, .emby-button.fab {
.emby-button.raised {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-transform: none;
}
.emby-button.fab {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
}
@ -141,7 +146,6 @@
position: relative;
overflow: hidden;
font-weight: 500;
text-transform: uppercase;
border-radius: 50%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
justify-content: center;

View File

@ -206,12 +206,21 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (isMobileApp && options.sync !== false) {
if (itemHelper.canSync(user, item)) {
commands.push({
name: globalize.translate('sharedcomponents#Sync'),
name: globalize.translate('sharedcomponents#SyncToOtherDevice'),
id: 'sync'
});
}
}
if (appHost.supports('sync') && options.syncLocal !== false) {
if (itemHelper.canSync(user, item)) {
commands.push({
name: globalize.translate('sharedcomponents#MakeAvailableOffline'),
id: 'synclocal'
});
}
}
if (options.openAlbum !== false && item.AlbumId) {
commands.push({
name: Globalize.translate('sharedcomponents#ViewAlbum'),
@ -425,6 +434,19 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
getResolveFunction(resolve, id)();
break;
}
case 'synclocal':
{
require(['syncDialog'], function (syncDialog) {
syncDialog.showMenu({
items: [
{
Id: itemId
}]
});
});
getResolveFunction(resolve, id)();
break;
}
case 'removefromplaylist':
apiClient.ajax({

View File

@ -271,7 +271,9 @@
editImages: true,
editSubtitles: true,
sync: false,
share: false
share: false,
play: false,
queue: false
}).then(function (result) {

View File

@ -241,6 +241,13 @@
ironIcon: 'call-merge'
});
if (user.Policy.EnableSync && appHost.supports('sync')) {
menuItems.push({
name: globalize.translate('sharedcomponents#MakeAvailableOffline'),
id: 'synclocal'
});
}
menuItems.push({
name: globalize.translate('sharedcomponents#MarkPlayed'),
id: 'markplayed'
@ -257,12 +264,14 @@
ironIcon: 'refresh'
});
if (user.Policy.EnableSync) {
menuItems.push({
name: globalize.translate('sharedcomponents#Sync'),
name: globalize.translate('sharedcomponents#SyncToOtherDevice'),
id: 'sync',
ironIcon: 'sync'
});
dispatchNeedsRefresh();
}
require(['actionsheet'], function (actionsheet) {
actionsheet.show({
@ -284,6 +293,7 @@
});
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'playlist':
require(['playlistEditor'], function (playlistEditor) {
@ -293,12 +303,14 @@
});
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'delete':
deleteItems(items).then(function () {
embyRouter.goHome();
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'groupvideos':
combineVersions(apiClient, items);
@ -308,12 +320,14 @@
apiClient.markPlayed(apiClient.getCurrentUserId(), itemId);
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'markunplayed':
items.forEach(function (itemId) {
apiClient.markUnplayed(apiClient.getCurrentUserId(), itemId);
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'refresh':
require(['refreshDialog'], function (refreshDialog) {
@ -323,6 +337,7 @@
}).show();
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'sync':
require(['syncDialog'], function (syncDialog) {
@ -335,6 +350,20 @@
});
});
hideSelections();
dispatchNeedsRefresh();
break;
case 'synclocal':
require(['syncDialog'], function (syncDialog) {
syncDialog.showMenu({
items: items.map(function (i) {
return {
Id: i
};
})
});
});
hideSelections();
dispatchNeedsRefresh();
break;
default:
break;

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\u0414\u043e\u0431\u0430\u0432\u0438",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Afegeix",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "P\u0159idat",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Del",
"Add": "Tilf\u00f8j",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Mit einem anderen Ger\u00e4t synchronisieren",
"MakeAvailableOffline": "Offline verf\u00fcgbar machen",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Teilen",
"Add": "Hinzuf\u00fcgen",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\u03a0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c3\u03b5",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -246,5 +246,7 @@
"HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.",
"PleaseEnterNameOrId": "Please enter a name or an external Id.",
"MessageItemSaved": "Item saved.",
"SearchResults": "Search Results"
"SearchResults": "Search Results",
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline"
}

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Especial - {0}",
"Share": "Compartir",
"Add": "Agregar",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Compartir",
"Add": "A\u00f1adir",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Sp\u00e9cial - {0}",
"Share": "Partager",
"Add": "Ajouter",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\u05d4\u05d5\u05e1\u05e3",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Dodaj",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Hozz\u00e1ad",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Aggiungi",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "\u0410\u0440\u043d\u0430\u0439\u044b - {0}",
"Share": "\u041e\u0440\u0442\u0430\u049b\u0442\u0430\u0441\u0443",
"Add": "\u04ae\u0441\u0442\u0435\u0443",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\ucd94\uac00",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Spesial - {0}",
"Share": "Del",
"Add": "Legg til",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Speciaal - {0}",
"Share": "Delen",
"Add": "Toevoegen",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Dodaj",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Especial - {0}",
"Share": "Compartilhar",
"Add": "Adicionar",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Especial - {0}",
"Share": "Partilhar",
"Add": "Adicionar",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "\u0421\u043f\u0435\u0446\u044d\u043f\u0438\u0437\u043e\u0434 - {0}",
"Share": "\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f",
"Add": "\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Specialavsnitt - {0}",
"Share": "Dela",
"Add": "L\u00e4gg till",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Ekle",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Add",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "Th\u00eam",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\u6dfb\u52a0",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share",
"Add": "\u65b0\u589e",

View File

@ -1,4 +1,6 @@
{
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}",
"Share": "\u5206\u4eab",
"Add": "\u6dfb\u52a0",

View File

@ -685,18 +685,13 @@ a[data-role='button'], .type-interior button:not([data-role='none']):not(.clearB
display: inline-block;
}
.activeSession {
width: 50%;
}
.activeSession .cardBox {
-moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
-ms-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
border: 0 !important;
@media all and (min-width: 420px) {
.activeSession {
width: 50% !important;
}
}
.sessionNowPlayingContent {
background-size: cover;
@ -878,10 +873,6 @@ a[data-role='button'], .type-interior button:not([data-role='none']):not(.clearB
.sessionAppName {
max-width: 150px;
}
.activeSession {
width: 100%;
}
}
.disabledUser {

View File

@ -998,3 +998,11 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
width: 16.666666666666666666666666666667% !important;
}
}
.btnSyncComplete {
background: #673AB7 !important;
}
.btnSyncComplete i {
border-radius: 1000px;
}

View File

@ -33,6 +33,7 @@
<button is="emby-button" type="button" class="raised subdued hide btnCancelRecording"><i class="md-icon">delete</i><span>${ButtonCancelRecording}</span></button>
<button is="emby-button" type="button" class="raised subdued btnSync hide"><i class="md-icon">sync</i><span>${ButtonSync}</span></button>
<button is="emby-button" type="button" class="raised subdued btnMoreCommands hide notext"><i class="md-icon">more_vert</i></button>
<button is="emby-button" type="button" class="fab mini subdued btnSyncLocal hide"><i class="md-icon">file_download</i></button>
<div class="detailUserDataIcons userDataIcons"></div>
</div>
</div>
@ -51,6 +52,7 @@
<button is="emby-button" type="button" class="raised subdued hide btnCancelRecording"><i class="md-icon">delete</i><span>${ButtonCancelRecording}</span></button>
<button is="emby-button" type="button" class="raised subdued btnSync hide"><i class="md-icon">sync</i><span>${ButtonSync}</span></button>
<button is="emby-button" type="button" class="raised subdued btnMoreCommands hide notext"><i class="md-icon">more_vert</i></button>
<button is="emby-button" type="button" class="fab mini subdued btnSyncLocal hide"><i class="md-icon">file_download</i></button>
<div class="detailUserDataIcons userDataIcons"></div>
</div>
</div>

View File

@ -309,7 +309,7 @@
var nowPlayingItem = session.NowPlayingItem;
var className = nowPlayingItem ? 'scalableCard card activeSession' : 'scalableCard card activeSession';
var className = nowPlayingItem ? 'scalableCard card activeSession backdropCard' : 'scalableCard card activeSession backdropCard';
if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) {
className += ' transcodingSession';

View File

@ -99,7 +99,10 @@
html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + group.name + '</h1>';
var allowBottomPadding = true;
if (enableScrollX()) {
allowBottomPadding = false;
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
@ -116,7 +119,8 @@
centerText: true,
context: 'home-upcoming',
overlayMoreButton: true,
showParentTitle: true
showParentTitle: true,
allowBottomPadding: allowBottomPadding
});
html += '</div>';

View File

@ -1,4 +1,4 @@
define(['layoutManager', 'cardBuilder', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'userdataButtons', 'dom', 'indicators', 'scrollStyles', 'emby-itemscontainer'], function (layoutManager, cardBuilder, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper, userdataButtons, dom, indicators) {
define(['layoutManager', 'cardBuilder', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'userdataButtons', 'dom', 'indicators', 'apphost', 'scrollStyles', 'emby-itemscontainer'], function (layoutManager, cardBuilder, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper, userdataButtons, dom, indicators, appHost) {
var currentItem;
@ -63,16 +63,41 @@
function getContextMenuOptions(item, button) {
return {
var options = {
item: item,
open: false,
play: false,
queue: false,
playAllFromHere: false,
queueAllFromHere: false,
sync: false,
positionTo: button
};
if (appHost.supports('sync')) {
// Will be displayed via button
options.syncLocal = false;
} else {
// Will be displayed via button
options.sync = false;
}
return options;
}
function updateSyncStatus(page, item) {
var i, length;
var elems = page.querySelectorAll('.btnSyncLocal');
for (i = 0, length = elems.length; i < length; i++) {
if (item.SyncPercent == 100) {
elems[i].querySelector('i').innerHTML = 'offline_pin';
elems[i].classList.add('btnSyncComplete');
} else {
elems[i].querySelector('i').innerHTML = 'file_download';
elems[i].classList.remove('btnSyncComplete');
}
}
}
function reloadFromItem(page, params, item) {
@ -143,9 +168,17 @@
}
if (itemHelper.canSync(user, item)) {
if (appHost.supports('sync')) {
hideAll(page, 'btnSyncLocal', true);
hideAll(page, 'btnSync');
} else {
hideAll(page, 'btnSyncLocal');
hideAll(page, 'btnSync', true);
}
updateSyncStatus(page, item);
} else {
hideAll(page, 'btnSync');
hideAll(page, 'btnSyncLocal');
}
if (item.Type == 'Program' && item.TimerId) {
@ -2083,6 +2116,11 @@
elems[i].addEventListener('click', onSyncClick);
}
elems = view.querySelectorAll('.btnSyncLocal');
for (i = 0, length = elems.length; i < length; i++) {
elems[i].addEventListener('click', onSyncClick);
}
elems = view.querySelectorAll('.btnRecord,.btnFloatingRecord');
for (i = 0, length = elems.length; i < length; i++) {
elems[i].addEventListener('click', onRecordClick);

View File

@ -83,7 +83,8 @@
showParentTitle: true,
coverImage: true,
lazy: true,
cardLayout: true
cardLayout: true,
allowBottomPadding: !enableScrollX()
});
ImageLoader.lazyChildren(recordingItems);

View File

@ -108,7 +108,8 @@
overlayText: false,
lazy: true,
overlayMoreButton: overlayButton != 'play',
overlayPlayButton: overlayButton == 'play'
overlayPlayButton: overlayButton == 'play',
allowBottomPadding: !enableScrollX()
});
var elem = page.querySelector('.' + sectionClass);
@ -199,12 +200,6 @@
var mdlTabs = view.querySelector('.libraryViewNav');
var baseUrl = 'tv.html';
var topParentId = params.topParentId;
if (topParentId) {
baseUrl += '?topParentId=' + topParentId;
}
libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4]);
mdlTabs.addEventListener('tabchange', function (e) {

View File

@ -213,60 +213,6 @@
MediaController.enableDisplayMirroring(this.checked);
}
function bindKeys(controller) {
var self = this;
var keyResult = {};
self.keyBinding = function (e) {
if (bypass()) return;
console.log("keyCode", e.keyCode);
if (keyResult[e.keyCode]) {
e.preventDefault();
keyResult[e.keyCode](e);
}
};
self.keyPrevent = function (e) {
if (bypass()) return;
var codes = [32, 38, 40, 37, 39, 81, 77, 65, 84, 83, 70];
if (codes.indexOf(e.keyCode) != -1) {
e.preventDefault();
}
};
keyResult[32] = function () { // spacebar
var player = controller.getCurrentPlayer();
player.getPlayerState().then(function (result) {
var state = result;
if (state.NowPlayingItem && state.PlayState) {
if (state.PlayState.IsPaused) {
player.unpause();
} else {
player.pause();
}
}
});
};
var bypass = function () {
// Get active elem to see what type it is
var active = document.activeElement;
var type = active.type || active.tagName.toLowerCase();
return (type === "text" || type === "select" || type === "textarea" || type == "password");
};
}
function mediaController() {
var self = this;
@ -274,12 +220,6 @@
var currentTargetInfo;
var players = [];
var keys = new bindKeys(self);
window.addEventListener('keydown', keys.keyBinding);
window.addEventListener('keypress', keys.keyPrevent);
window.addEventListener('keyup', keys.keyPrevent);
self.registerPlayer = function (player) {
players.push(player);

View File

@ -27,12 +27,15 @@
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
var allowBottomPadding = !enableScrollX();
var container = page.querySelector('#recentlyAddedItems');
cardBuilder.buildCards(items, {
itemsContainer: container,
shape: getPortraitShape(),
scalable: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: allowBottomPadding
});
});
}
@ -65,13 +68,16 @@
page.querySelector('#resumableSection').classList.add('hide');
}
var allowBottomPadding = !enableScrollX();
var container = page.querySelector('#resumableItems');
cardBuilder.buildCards(result.Items, {
itemsContainer: container,
preferThumb: true,
shape: getThumbShape(),
scalable: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: allowBottomPadding
});
});
@ -104,7 +110,10 @@
html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + title + '</h1>';
var allowBottomPadding = true;
if (enableScrollX()) {
allowBottomPadding = false;
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
@ -113,7 +122,8 @@
html += cardBuilder.getCardsHtml(recommendation.Items, {
shape: getPortraitShape(),
scalable: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: allowBottomPadding
});
html += '</div>';

View File

@ -43,7 +43,8 @@
showParentTitle: true,
lazy: true,
centerText: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: !enableScrollX()
});
ImageLoader.lazyChildren(elem);
@ -89,7 +90,8 @@
action: 'instantmix',
lazy: true,
centerText: true,
overlayMoreButton: true
overlayMoreButton: true,
allowBottomPadding: !enableScrollX()
});
ImageLoader.lazyChildren(itemsContainer);
@ -135,7 +137,8 @@
action: 'instantmix',
lazy: true,
centerText: true,
overlayMoreButton: true
overlayMoreButton: true,
allowBottomPadding: !enableScrollX()
});
ImageLoader.lazyChildren(itemsContainer);
@ -177,7 +180,8 @@
coverImage: true,
showItemCounts: true,
centerText: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: !enableScrollX()
});
ImageLoader.lazyChildren(itemsContainer);
@ -243,10 +247,6 @@
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
self.initTab = function () {
var tabContent = view.querySelector('.pageTabContent[data-index=\'' + 0 + '\']');
@ -351,12 +351,6 @@
var mdlTabs = view.querySelector('.libraryViewNav');
var baseUrl = 'music.html';
var topParentId = params.topParentId;
if (topParentId) {
baseUrl += '?topParentId=' + topParentId;
}
libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 4, 5, 6]);
mdlTabs.addEventListener('beforetabchange', function (e) {

View File

@ -88,6 +88,8 @@
view.querySelector('#resumableSection').classList.add('hide');
}
var allowBottomPadding = !enableScrollX();
var container = view.querySelector('#resumableItems');
cardBuilder.buildCards(result.Items, {
itemsContainer: container,
@ -98,7 +100,8 @@
showParentTitle: true,
overlayText: false,
centerText: true,
overlayPlayButton: true
overlayPlayButton: true,
allowBottomPadding: allowBottomPadding
});
});
}

View File

@ -101,7 +101,10 @@
html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + group.name + '</h1>';
var allowBottomPadding = true;
if (enableScrollX()) {
allowBottomPadding = false;
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
@ -117,7 +120,8 @@
showDetailsMenu: true,
centerText: true,
overlayMoreButton: true,
showParentTitle: true
showParentTitle: true,
allowBottomPadding: allowBottomPadding
});
html += '</div>';

View File

@ -50,23 +50,25 @@ function isCacheable(request) {
return true;
}
//self.addEventListener('fetch', function (event) {
if (self.location.toString().indexOf('localhost') == -1) {
self.addEventListener('fetch', function (event) {
// if (!isCacheable(event.request)) {
// return;
// }
if (!isCacheable(event.request)) {
return;
}
// event.respondWith(
// caches.open(staticFileCacheName).then(function (cache) {
// return cache.match(event.request).then(function (response) {
// return response || fetch(event.request).then(function (response) {
// cache.put(event.request, response.clone());
// return response;
// });
// });
// })
// );
//});
event.respondWith(
caches.open(staticFileCacheName).then(function (cache) {
return cache.match(event.request).then(function (response) {
return response || fetch(event.request).then(function (response) {
cache.put(event.request, response.clone());
return response;
});
});
})
);
});
}
self.addEventListener('activate', function (event) {

View File

@ -83,16 +83,12 @@ button.emby-button.raised.cancelDark {
color: #fff;
}
.ui-body-b button.emby-button.subdued:not([disabled]) {
color: #404040;
}
.ui-body-b button.emby-button.raised.subdued:not([disabled]) {
background: #404040;
color: #fff;
}
.ui-body-b button.emby-button.raised[disabled].subduedd {
.ui-body-b button.emby-button.raised[disabled].subdued {
background: #111;
}