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": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.167", "version": "1.4.168",
"_release": "1.4.167", "_release": "1.4.168",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.167", "tag": "1.4.168",
"commit": "03c12f1c7360d863dc0ec55491a292a3f64fb400" "commit": "feb02354eb53d74eba763c538b70435da37cb9aa"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View File

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

View File

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

View File

@ -30,7 +30,12 @@
text-transform: uppercase; 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); 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; position: relative;
overflow: hidden; overflow: hidden;
font-weight: 500; font-weight: 500;
text-transform: uppercase;
border-radius: 50%; border-radius: 50%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
justify-content: center; justify-content: center;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -246,5 +246,7 @@
"HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.",
"PleaseEnterNameOrId": "Please enter a name or an external Id.", "PleaseEnterNameOrId": "Please enter a name or an external Id.",
"MessageItemSaved": "Item saved.", "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}", "ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share", "Share": "Share",
"Add": "Add", "Add": "Add",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,6 @@
{ {
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}", "ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share", "Share": "Share",
"Add": "Aggiungi", "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}", "ValueSpecialEpisodeName": "\u0410\u0440\u043d\u0430\u0439\u044b - {0}",
"Share": "\u041e\u0440\u0442\u0430\u049b\u0442\u0430\u0441\u0443", "Share": "\u041e\u0440\u0442\u0430\u049b\u0442\u0430\u0441\u0443",
"Add": "\u04ae\u0441\u0442\u0435\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}", "ValueSpecialEpisodeName": "Special - {0}",
"Share": "Share", "Share": "Share",
"Add": "\ucd94\uac00", "Add": "\ucd94\uac00",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,6 @@
{ {
"SyncToOtherDevice": "Sync to other device",
"MakeAvailableOffline": "Make available offline",
"ValueSpecialEpisodeName": "Special - {0}", "ValueSpecialEpisodeName": "Special - {0}",
"Share": "\u5206\u4eab", "Share": "\u5206\u4eab",
"Add": "\u6dfb\u52a0", "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; display: inline-block;
} }
.activeSession {
width: 50%;
}
.activeSession .cardBox { @media all and (min-width: 420px) {
-moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
-ms-box-shadow: 0 2px 4px rgba(0,0,0,0.1); .activeSession {
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1); width: 50% !important;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
border: 0 !important;
} }
}
.sessionNowPlayingContent { .sessionNowPlayingContent {
background-size: cover; background-size: cover;
@ -878,10 +873,6 @@ a[data-role='button'], .type-interior button:not([data-role='none']):not(.clearB
.sessionAppName { .sessionAppName {
max-width: 150px; max-width: 150px;
} }
.activeSession {
width: 100%;
}
} }
.disabledUser { .disabledUser {

View File

@ -998,3 +998,11 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
width: 16.666666666666666666666666666667% !important; 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 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 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="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 class="detailUserDataIcons userDataIcons"></div>
</div> </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 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 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="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 class="detailUserDataIcons userDataIcons"></div>
</div> </div>
</div> </div>

View File

@ -309,7 +309,7 @@
var nowPlayingItem = session.NowPlayingItem; 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) { if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) {
className += ' transcodingSession'; className += ' transcodingSession';

View File

@ -99,7 +99,10 @@
html += '<div class="homePageSection">'; html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + group.name + '</h1>'; html += '<h1 class="listHeader">' + group.name + '</h1>';
var allowBottomPadding = true;
if (enableScrollX()) { if (enableScrollX()) {
allowBottomPadding = false;
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">'; html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else { } else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">'; html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
@ -116,7 +119,8 @@
centerText: true, centerText: true,
context: 'home-upcoming', context: 'home-upcoming',
overlayMoreButton: true, overlayMoreButton: true,
showParentTitle: true showParentTitle: true,
allowBottomPadding: allowBottomPadding
}); });
html += '</div>'; 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; var currentItem;
@ -63,16 +63,41 @@
function getContextMenuOptions(item, button) { function getContextMenuOptions(item, button) {
return { var options = {
item: item, item: item,
open: false, open: false,
play: false, play: false,
queue: false, queue: false,
playAllFromHere: false, playAllFromHere: false,
queueAllFromHere: false, queueAllFromHere: false,
sync: false,
positionTo: button 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) { function reloadFromItem(page, params, item) {
@ -143,9 +168,17 @@
} }
if (itemHelper.canSync(user, item)) { if (itemHelper.canSync(user, item)) {
hideAll(page, 'btnSync', true); if (appHost.supports('sync')) {
hideAll(page, 'btnSyncLocal', true);
hideAll(page, 'btnSync');
} else {
hideAll(page, 'btnSyncLocal');
hideAll(page, 'btnSync', true);
}
updateSyncStatus(page, item);
} else { } else {
hideAll(page, 'btnSync'); hideAll(page, 'btnSync');
hideAll(page, 'btnSyncLocal');
} }
if (item.Type == 'Program' && item.TimerId) { if (item.Type == 'Program' && item.TimerId) {
@ -2083,6 +2116,11 @@
elems[i].addEventListener('click', onSyncClick); 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'); elems = view.querySelectorAll('.btnRecord,.btnFloatingRecord');
for (i = 0, length = elems.length; i < length; i++) { for (i = 0, length = elems.length; i < length; i++) {
elems[i].addEventListener('click', onRecordClick); elems[i].addEventListener('click', onRecordClick);

View File

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

View File

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

View File

@ -213,60 +213,6 @@
MediaController.enableDisplayMirroring(this.checked); 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() { function mediaController() {
var self = this; var self = this;
@ -274,12 +220,6 @@
var currentTargetInfo; var currentTargetInfo;
var players = []; 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) { self.registerPlayer = function (player) {
players.push(player); players.push(player);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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