mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update listviews
This commit is contained in:
parent
c87b1304da
commit
d9c694f564
13 changed files with 149 additions and 124 deletions
|
@ -15,12 +15,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.90",
|
"version": "1.4.91",
|
||||||
"_release": "1.4.90",
|
"_release": "1.4.91",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.90",
|
"tag": "1.4.91",
|
||||||
"commit": "36704279e05a90730af96c13b16c60ecc30cdce8"
|
"commit": "a4c5466d5a59e57b157aa941fcadb1e0df602f75"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.0",
|
"_target": "^1.2.0",
|
||||||
|
|
|
@ -112,8 +112,8 @@
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
dialogOptions.modal = false;
|
dialogOptions.modal = false;
|
||||||
dialogOptions.entryAnimationDuration = 160;
|
dialogOptions.entryAnimationDuration = 140;
|
||||||
dialogOptions.exitAnimationDuration = 200;
|
dialogOptions.exitAnimationDuration = 180;
|
||||||
dialogOptions.autoFocus = false;
|
dialogOptions.autoFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,18 @@
|
||||||
return apiClient.getItem(apiClient.getCurrentUserId(), id);
|
return apiClient.getItem(apiClient.getCurrentUserId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showContextMenu(button) {
|
function showContextMenu(button, itemsContainer) {
|
||||||
|
|
||||||
getItem(button).then(function (item) {
|
getItem(button).then(function (item) {
|
||||||
|
|
||||||
|
var playlistId = itemsContainer.getAttribute('data-playlistid');
|
||||||
|
var collectionId = itemsContainer.getAttribute('data-collectionid');
|
||||||
|
|
||||||
|
if (playlistId) {
|
||||||
|
var elem = parentWithAttribute(button, 'data-playlistitemid');
|
||||||
|
item.PlaylistItemId = elem ? elem.getAttribute('data-playlistitemid') : null;
|
||||||
|
}
|
||||||
|
|
||||||
require(['itemContextMenu'], function (itemContextMenu) {
|
require(['itemContextMenu'], function (itemContextMenu) {
|
||||||
itemContextMenu.show({
|
itemContextMenu.show({
|
||||||
positionTo: button,
|
positionTo: button,
|
||||||
|
@ -52,13 +60,23 @@
|
||||||
queue: true,
|
queue: true,
|
||||||
playAllFromHere: !item.IsFolder,
|
playAllFromHere: !item.IsFolder,
|
||||||
queueAllFromHere: !item.IsFolder,
|
queueAllFromHere: !item.IsFolder,
|
||||||
identify: false
|
identify: false,
|
||||||
|
playlistId: playlistId,
|
||||||
|
collectionId: collectionId
|
||||||
|
|
||||||
}).then(function(result) {
|
}).then(function (result) {
|
||||||
|
|
||||||
if (result.command == 'playallfromhere' || result.command == 'queueallfromhere') {
|
if (result.command == 'playallfromhere' || result.command == 'queueallfromhere') {
|
||||||
itemShortcuts.execute(button, result.command);
|
itemShortcuts.execute(button, result.command);
|
||||||
}
|
}
|
||||||
|
else if (result.command == 'removefromplaylist' || result.command == 'removefromcollection') {
|
||||||
|
|
||||||
|
itemsContainer.dispatchEvent(new CustomEvent('needsrefresh', {
|
||||||
|
detail: {},
|
||||||
|
cancelable: false,
|
||||||
|
bubbles: true
|
||||||
|
}));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -66,9 +84,11 @@
|
||||||
|
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
|
|
||||||
|
var itemsContainer = this;
|
||||||
|
|
||||||
var menuButton = parentWithClass(e.target, 'menuButton');
|
var menuButton = parentWithClass(e.target, 'menuButton');
|
||||||
if (menuButton) {
|
if (menuButton) {
|
||||||
showContextMenu(menuButton);
|
showContextMenu(menuButton, itemsContainer);
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
var serverId = item.ServerId;
|
var serverId = item.ServerId;
|
||||||
var apiClient = connectionManager.getApiClient(serverId);
|
var apiClient = connectionManager.getApiClient(serverId);
|
||||||
|
|
||||||
|
var canPlay = playbackManager.canPlay(item);
|
||||||
|
|
||||||
return apiClient.getCurrentUser().then(function (user) {
|
return apiClient.getCurrentUser().then(function (user) {
|
||||||
|
|
||||||
var commands = [];
|
var commands = [];
|
||||||
|
@ -42,7 +44,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
|
|
||||||
if (!isTheater) {
|
if (!isTheater) {
|
||||||
commands.push({
|
commands.push({
|
||||||
name: globalize.translate('sharedcomponents#Edit'),
|
name: globalize.translate('sharedcomponents#EditInfo'),
|
||||||
id: 'edit'
|
id: 'edit'
|
||||||
});
|
});
|
||||||
commands.push({
|
commands.push({
|
||||||
|
@ -85,7 +87,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.open !== false) {
|
if (options.open !== false) {
|
||||||
if (item.Type != 'Timer') {
|
if (item.Type != 'Timer' && item.Type != 'Audio') {
|
||||||
commands.push({
|
commands.push({
|
||||||
name: globalize.translate('sharedcomponents#Open'),
|
name: globalize.translate('sharedcomponents#Open'),
|
||||||
id: 'open'
|
id: 'open'
|
||||||
|
@ -93,6 +95,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canPlay) {
|
||||||
if (options.play !== false) {
|
if (options.play !== false) {
|
||||||
commands.push({
|
commands.push({
|
||||||
name: globalize.translate('sharedcomponents#Play'),
|
name: globalize.translate('sharedcomponents#Play'),
|
||||||
|
@ -122,6 +125,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
||||||
|
|
||||||
|
@ -141,6 +145,20 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.PlaylistItemId && options.playlistId) {
|
||||||
|
commands.push({
|
||||||
|
name: globalize.translate('sharedcomponents#RemoveFromPlaylist'),
|
||||||
|
id: 'removefromplaylist'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.collectionId) {
|
||||||
|
commands.push({
|
||||||
|
name: globalize.translate('sharedcomponents#RemoveFromCollection'),
|
||||||
|
id: 'removefromcollection'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (options.share !== false) {
|
if (options.share !== false) {
|
||||||
if (itemHelper.canShare(user, item)) {
|
if (itemHelper.canShare(user, item)) {
|
||||||
commands.push({
|
commands.push({
|
||||||
|
@ -197,7 +215,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeCommand(item, id) {
|
function executeCommand(item, id, options) {
|
||||||
|
|
||||||
var itemId = item.Id;
|
var itemId = item.Id;
|
||||||
var serverId = item.ServerId;
|
var serverId = item.ServerId;
|
||||||
|
@ -378,6 +396,37 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
getResolveFunction(resolve, id)();
|
getResolveFunction(resolve, id)();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'removefromplaylist':
|
||||||
|
|
||||||
|
apiClient.ajax({
|
||||||
|
|
||||||
|
url: apiClient.getUrl('Playlists/' + options.playlistId + '/Items', {
|
||||||
|
EntryIds: [item.PlaylistItemId].join(',')
|
||||||
|
}),
|
||||||
|
|
||||||
|
type: 'DELETE'
|
||||||
|
|
||||||
|
}).then(function () {
|
||||||
|
|
||||||
|
getResolveFunction(resolve, id, true)();
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'removefromcollection':
|
||||||
|
|
||||||
|
apiClient.ajax({
|
||||||
|
type: "DELETE",
|
||||||
|
url: apiClient.getUrl("Collections/" + options.collectionId + "/Items", {
|
||||||
|
|
||||||
|
Ids: [item.Id].join(',')
|
||||||
|
})
|
||||||
|
|
||||||
|
}).then(function () {
|
||||||
|
|
||||||
|
getResolveFunction(resolve, id, true)();
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
reject();
|
reject();
|
||||||
break;
|
break;
|
||||||
|
@ -464,7 +513,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
positionTo: options.positionTo
|
positionTo: options.positionTo
|
||||||
|
|
||||||
}).then(function (id) {
|
}).then(function (id) {
|
||||||
executeCommand(options.item, id).then(resolve);
|
executeCommand(options.item, id, options).then(resolve);
|
||||||
}, reject);
|
}, reject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -237,6 +237,10 @@ define(['datetime', 'globalize', 'embyRouter', 'material-icons', 'css!./mediainf
|
||||||
miscInfo.push(item.Width + "x" + item.Height);
|
miscInfo.push(item.Width + "x" + item.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.Type == 'Audio' && item.Container) {
|
||||||
|
miscInfo.push(item.Container);
|
||||||
|
}
|
||||||
|
|
||||||
html += miscInfo.map(function (m) {
|
html += miscInfo.map(function (m) {
|
||||||
return getMediaInfoItem(m);
|
return getMediaInfoItem(m);
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|
|
@ -105,10 +105,12 @@
|
||||||
"Shuffle": "Shuffle",
|
"Shuffle": "Shuffle",
|
||||||
"Identify": "Identify",
|
"Identify": "Identify",
|
||||||
"EditImages": "Edit Images",
|
"EditImages": "Edit Images",
|
||||||
|
"EditInfo": "Edit Info",
|
||||||
"Sync": "Sync",
|
"Sync": "Sync",
|
||||||
"InstantMix": "Instant Mix",
|
"InstantMix": "Instant Mix",
|
||||||
"ViewAlbum": "View Album",
|
"ViewAlbum": "View Album",
|
||||||
"ViewArtist": "View Artist",
|
"ViewArtist": "View Artist",
|
||||||
"QueueAllFromHere": "Queue All from Here",
|
"QueueAllFromHere": "Queue All from Here",
|
||||||
"PlayAllFromHere": "Play All from Here"
|
"PlayAllFromHere": "Play All from Here",
|
||||||
|
"RemoveFromPlaylist": "Remove from Playlist"
|
||||||
}
|
}
|
|
@ -881,11 +881,11 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.playedIndicator + .syncIndicator {
|
.playedIndicator + .syncIndicator, .countIndicator + .syncIndicator {
|
||||||
top: 32px;
|
top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card .playedIndicator {
|
.card .playedIndicator, .card .countIndicator {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
right: 5px;
|
right: 5px;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'scrollStyles'], function (layoutManager, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper) {
|
define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'scrollStyles', 'emby-itemscontainer'], function (layoutManager, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
|
||||||
|
@ -1133,7 +1133,7 @@
|
||||||
html += '<button class="btnAddToCollection autoSize" type="button" is="paper-icon-button-light" style="margin-left:1em;"><i class="md-icon" icon="add">add</i></button>';
|
html += '<button class="btnAddToCollection autoSize" type="button" is="paper-icon-button-light" style="margin-left:1em;"><i class="md-icon" icon="add">add</i></button>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="detailSectionContent itemsContainer">';
|
html += '<div is="emby-itemscontainer" class="detailSectionContent itemsContainer" data-collectionid="' + parentItem.Id + '">';
|
||||||
|
|
||||||
var shape = type.type == 'MusicAlbum' ? 'detailPageSquare' : 'detailPagePortrait';
|
var shape = type.type == 'MusicAlbum' ? 'detailPageSquare' : 'detailPagePortrait';
|
||||||
|
|
||||||
|
@ -1166,26 +1166,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFromCollection(page, parentItem, itemIds) {
|
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
|
||||||
|
|
||||||
var url = ApiClient.getUrl("Collections/" + parentItem.Id + "/Items", {
|
|
||||||
|
|
||||||
Ids: itemIds.join(',')
|
|
||||||
});
|
|
||||||
|
|
||||||
ApiClient.ajax({
|
|
||||||
type: "DELETE",
|
|
||||||
url: url
|
|
||||||
|
|
||||||
}).then(function () {
|
|
||||||
|
|
||||||
renderChildren(page, parentItem);
|
|
||||||
Dashboard.hideLoadingMsg();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderUserDataIcons(page, item) {
|
function renderUserDataIcons(page, item) {
|
||||||
|
|
||||||
var userDataIcons = page.querySelectorAll('.userDataIcons');
|
var userDataIcons = page.querySelectorAll('.userDataIcons');
|
||||||
|
@ -2195,10 +2175,9 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.querySelector('.collectionItems').addEventListener('removefromcollection', function (e) {
|
view.querySelector('.collectionItems').addEventListener('needsrefresh', function (e) {
|
||||||
|
|
||||||
var itemId = e.detail.itemId;
|
renderChildren(view, currentItem);
|
||||||
removeFromCollection(view, currentItem, [itemId]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
view.querySelector('.detailImageContainer').addEventListener('click', function (e) {
|
view.querySelector('.detailImageContainer').addEventListener('click', function (e) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['scrollHelper', 'viewManager', 'appSettings', 'appStorage', 'apphost', 'datetime', 'itemHelper', 'mediaInfo', 'scroller', 'scrollStyles'], function (scrollHelper, viewManager, appSettings, appStorage, appHost, datetime, itemHelper, mediaInfo, scroller) {
|
define(['scrollHelper', 'viewManager', 'appSettings', 'appStorage', 'apphost', 'datetime', 'itemHelper', 'mediaInfo', 'scroller', 'indicators', 'scrollStyles'], function (scrollHelper, viewManager, appSettings, appStorage, appHost, datetime, itemHelper, mediaInfo, scroller, indicators) {
|
||||||
|
|
||||||
function parentWithClass(elem, className) {
|
function parentWithClass(elem, className) {
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
function fadeInRight(elem) {
|
function fadeInRight(elem) {
|
||||||
|
|
||||||
var pct = browserInfo.mobile ? '2.5%' : '0.5%';
|
var pct = browserInfo.mobile ? '3%' : '0.5%';
|
||||||
|
|
||||||
var keyframes = [
|
var keyframes = [
|
||||||
{ opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 },
|
{ opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 },
|
||||||
|
@ -901,6 +901,16 @@
|
||||||
value: item.Id
|
value: item.Id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
atts.push({
|
||||||
|
name: 'serverid',
|
||||||
|
value: item.ServerId
|
||||||
|
});
|
||||||
|
|
||||||
|
atts.push({
|
||||||
|
name: 'id',
|
||||||
|
value: item.Id
|
||||||
|
});
|
||||||
|
|
||||||
if (options.context) {
|
if (options.context) {
|
||||||
atts.push({
|
atts.push({
|
||||||
name: 'context',
|
name: 'context',
|
||||||
|
@ -1553,7 +1563,7 @@
|
||||||
html += LibraryBrowser.getOfflineIndicatorHtml(item);
|
html += LibraryBrowser.getOfflineIndicatorHtml(item);
|
||||||
}
|
}
|
||||||
} else if (options.showUnplayedIndicator !== false) {
|
} else if (options.showUnplayedIndicator !== false) {
|
||||||
html += LibraryBrowser.getPlayedIndicatorHtml(item);
|
html += indicators.getPlayedIndicatorHtml(item);
|
||||||
} else if (options.showChildCountIndicator) {
|
} else if (options.showChildCountIndicator) {
|
||||||
html += LibraryBrowser.getGroupCountIndicator(item);
|
html += LibraryBrowser.getGroupCountIndicator(item);
|
||||||
}
|
}
|
||||||
|
@ -1597,7 +1607,7 @@
|
||||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayPlayButton autoSize" onclick="return false;"><i class="md-icon">play_arrow</i></button></div>';
|
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayPlayButton autoSize" onclick="return false;"><i class="md-icon">play_arrow</i></button></div>';
|
||||||
}
|
}
|
||||||
if (options.overlayMoreButton) {
|
if (options.overlayMoreButton) {
|
||||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayMoreButton autoSize" onclick="return false;"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button></div>';
|
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayMoreButton menuButton autoSize" onclick="return false;"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// cardScalable
|
// cardScalable
|
||||||
|
@ -1622,7 +1632,7 @@
|
||||||
|
|
||||||
if (options.cardLayout) {
|
if (options.cardLayout) {
|
||||||
html += '<div class="cardButtonContainer">';
|
html += '<div class="cardButtonContainer">';
|
||||||
html += '<button is="paper-icon-button-light" class="listviewMenuButton btnCardOptions autoSize"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button>';
|
html += '<button is="paper-icon-button-light" class="menuButton btnCardOptions autoSize"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button>';
|
||||||
html += "</div>";
|
html += "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1912,23 +1922,6 @@
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
|
||||||
getPlayedIndicatorHtml: function (item) {
|
|
||||||
|
|
||||||
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
|
|
||||||
if (item.UserData.UnplayedItemCount) {
|
|
||||||
return '<div class="playedIndicator">' + item.UserData.UnplayedItemCount + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type != 'TvChannel') {
|
|
||||||
if (item.UserData.PlayedPercentage && item.UserData.PlayedPercentage >= 100 || (item.UserData && item.UserData.Played)) {
|
|
||||||
return '<div class="playedIndicator"><i class="md-icon">check</i></div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
|
|
||||||
getGroupCountIndicator: function (item) {
|
getGroupCountIndicator: function (item) {
|
||||||
|
|
||||||
if (item.ChildCount) {
|
if (item.ChildCount) {
|
||||||
|
|
|
@ -336,22 +336,6 @@
|
||||||
return onListViewPlayButtonClick(e, playButton);
|
return onListViewPlayButtonClick(e, playButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
var listviewMenuButton = parentWithClass(e.target, 'listviewMenuButton') || parentWithClass(e.target, 'cardOverlayMoreButton');
|
|
||||||
|
|
||||||
if (listviewMenuButton) {
|
|
||||||
showContextMenu(listviewMenuButton, {});
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var button = parentWithClass(e.target, 'btnUserItemRating');
|
|
||||||
if (button) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var card = parentWithClass(e.target, 'card');
|
var card = parentWithClass(e.target, 'card');
|
||||||
|
|
||||||
if (card) {
|
if (card) {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
define(['appStorage'], function (appStorage) {
|
define(['appStorage'], function (appStorage) {
|
||||||
|
|
||||||
var currentDisplayInfo;
|
var currentDisplayInfo;
|
||||||
|
var datetime;
|
||||||
|
|
||||||
function mirrorItem(info) {
|
function mirrorItem(info) {
|
||||||
|
|
||||||
var item = info.item;
|
var item = info.item;
|
||||||
|
@ -614,6 +616,13 @@
|
||||||
|
|
||||||
self.canPlay = function (item) {
|
self.canPlay = function (item) {
|
||||||
|
|
||||||
|
if (item.Type == "Program") {
|
||||||
|
if (new Date().getTime() > datetime.parseISO8601Date(item.EndDate).getTime() || new Date().getTime() < datetime.parseISO8601Date(item.StartDate).getTime()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return self.canPlayByAttributes(item.Type, item.MediaType, item.PlayAccess, item.LocationType);
|
return self.canPlayByAttributes(item.Type, item.MediaType, item.PlayAccess, item.LocationType);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1052,6 +1061,10 @@
|
||||||
MediaController.init = function () {
|
MediaController.init = function () {
|
||||||
|
|
||||||
console.log('Beginning MediaController.init');
|
console.log('Beginning MediaController.init');
|
||||||
|
require(['datetime'], function (datetimeInstance) {
|
||||||
|
datetime = datetimeInstance;
|
||||||
|
});
|
||||||
|
|
||||||
if (window.ApiClient) {
|
if (window.ApiClient) {
|
||||||
initializeApiClient(window.ApiClient);
|
initializeApiClient(window.ApiClient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var elem = page.querySelector('#childrenContent .itemsContainer');
|
var elem = page.querySelector('#childrenContent .itemsContainer');
|
||||||
|
elem.setAttribute('data-playlistid', item.Id);
|
||||||
elem.innerHTML = html;
|
elem.innerHTML = html;
|
||||||
|
|
||||||
var listParent = elem;
|
var listParent = elem;
|
||||||
|
@ -135,23 +136,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFromPlaylist(page, item, ids) {
|
|
||||||
|
|
||||||
ApiClient.ajax({
|
|
||||||
|
|
||||||
url: ApiClient.getUrl('Playlists/' + item.Id + '/Items', {
|
|
||||||
EntryIds: ids.join(',')
|
|
||||||
}),
|
|
||||||
|
|
||||||
type: 'DELETE'
|
|
||||||
|
|
||||||
}).then(function () {
|
|
||||||
|
|
||||||
reloadItems(page, item);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function showDragAndDropHelp() {
|
function showDragAndDropHelp() {
|
||||||
|
|
||||||
if (AppInfo.isTouchPreferred) {
|
if (AppInfo.isTouchPreferred) {
|
||||||
|
@ -176,12 +160,6 @@
|
||||||
|
|
||||||
var elem = page.querySelector('#childrenContent .itemsContainer');
|
var elem = page.querySelector('#childrenContent .itemsContainer');
|
||||||
|
|
||||||
elem.addEventListener('removefromplaylist', function (e) {
|
|
||||||
|
|
||||||
var playlistItemId = e.detail.playlistItemId;
|
|
||||||
removeFromPlaylist(page, item, [playlistItemId]);
|
|
||||||
});
|
|
||||||
|
|
||||||
elem.addEventListener('needsrefresh', function () {
|
elem.addEventListener('needsrefresh', function () {
|
||||||
|
|
||||||
reloadItems(page, item);
|
reloadItems(page, item);
|
||||||
|
|
|
@ -2032,6 +2032,9 @@ var AppInfo = {};
|
||||||
},
|
},
|
||||||
canQueueMediaType: function(mediaType) {
|
canQueueMediaType: function(mediaType) {
|
||||||
return MediaController.canQueueMediaType(mediaType);
|
return MediaController.canQueueMediaType(mediaType);
|
||||||
|
},
|
||||||
|
canPlay: function (item) {
|
||||||
|
return MediaController.canPlay(item);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue