1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update remove from playlist, collection id

This commit is contained in:
Luke Pulverenti 2016-07-20 16:45:50 -04:00
parent 79240b1a24
commit 17cb2f5da1
9 changed files with 59 additions and 22 deletions

View file

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.108",
"_release": "1.4.108",
"version": "1.4.110",
"_release": "1.4.110",
"_resolution": {
"type": "version",
"tag": "1.4.108",
"commit": "42932aca23d729123c468fa71c73d84483025aca"
"tag": "1.4.110",
"commit": "fec7da49cf36f8177347d4ad14e443db644dc7f5"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0",

View file

@ -168,6 +168,10 @@ define(['browser'], function (browser) {
return 10000000;
}
if (browser.ps4) {
return 8000000;
}
var userAgent = navigator.userAgent.toLowerCase();
if (browser.tizen) {

View file

@ -107,7 +107,6 @@
function onDrop(evt, itemsContainer) {
var playlistId = itemsContainer.getAttribute('data-playlistid');
loading.show();
@ -115,6 +114,7 @@
var newIndex = evt.newIndex;
var itemId = el.getAttribute('data-playlistitemid');
var playlistId = el.getAttribute('data-playlistid');
var serverId = el.getAttribute('data-serverid');
var apiClient = connectionManager.getApiClient(serverId);

View file

@ -170,8 +170,10 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var playlistItemId = item.PlaylistItemId ? (' data-playlistitemid="' + item.PlaylistItemId + '"') : '';
var positionTicksData = item.UserData && item.UserData.PlaybackPositionTicks ? (' data-positionticks="' + item.UserData.PlaybackPositionTicks + '"') : '';
var collectionIdData = options.collectionId ? (' data-collectionid="' + options.collectionId + '"') : '';
var playlistIdData = options.playlistId ? (' data-playlistid="' + options.playlistId + '"') : '';
html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + index + '"' + playlistItemId + ' data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-mediatype="' + item.MediaType + '" data-type="' + item.Type + '"' + positionTicksData + '>';
html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + index + '"' + playlistItemId + ' data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-mediatype="' + item.MediaType + '" data-type="' + item.Type + '"' + positionTicksData + collectionIdData + playlistIdData + '>';
if (!clickEntireItem && options.dragHandle) {
html += '<button is="paper-icon-button-light" class="listViewDragHandle autoSize"><i class="md-icon">&#xE25D;</i></button>';

View file

@ -109,10 +109,8 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
getItem(card).then(function (item) {
var itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
var playlistId = itemsContainer ? itemsContainer.getAttribute('data-playlistid') : null;
var collectionId = itemsContainer ? itemsContainer.getAttribute('data-collectionid') : null;
var playlistId = card.getAttribute('data-playlistid');
var collectionId = card.getAttribute('data-collectionid');
if (playlistId) {
var elem = dom.parentWithAttribute(card, 'data-playlistitemid');
@ -138,6 +136,8 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}
else if (result.command == 'removefromplaylist' || result.command == 'removefromcollection') {
var itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
if (itemsContainer) {
itemsContainer.dispatchEvent(new CustomEvent('needsrefresh', {
detail: {},
@ -148,6 +148,8 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}
else if (result.command == 'canceltimer') {
var itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
if (itemsContainer) {
itemsContainer.dispatchEvent(new CustomEvent('timercancelled', {
detail: {},

View file

@ -6,6 +6,23 @@
var currentRecognition = null;
function normalizeInput(text, options) {
if (options.requireNamedIdentifier) {
var srch = 'jarvis';
var index = text.toLowerCase().indexOf(srch);
if (index != -1) {
text = text.substring(index + srch.length);
} else {
return null;
}
}
return text;
}
/// <summary> Starts listening for voice commands </summary>
/// <returns> . </returns>
function listen(options) {
@ -31,6 +48,9 @@
var resultInput = event.results[resultCount][0].transcript || '';
resultCount++;
resultInput = normalizeInput(resultInput, options);
if (resultInput) {
if (options.continuous) {
events.trigger(receiver, 'input', [
{
@ -41,6 +61,7 @@
resolve(resultInput);
}
}
}
};
recognition.onerror = function () {

View file

@ -1125,7 +1125,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 += '</div>';
html += '<div is="emby-itemscontainer" class="detailSectionContent itemsContainer" data-collectionid="' + parentItem.Id + '">';
html += '<div is="emby-itemscontainer" class="detailSectionContent itemsContainer">';
var shape = type.type == 'MusicAlbum' ? 'detailPageSquare' : 'detailPagePortrait';
@ -1138,7 +1138,8 @@
showDetailsMenu: true,
overlayMoreButton: true,
showAddToCollection: false,
showRemoveFromCollection: true
showRemoveFromCollection: true,
collectionId: parentItem.Id
});
html += '</div>';

View file

@ -810,6 +810,13 @@
});
}
if (options.collectionId) {
atts.push({
name: 'collectionid',
value: options.collectionId
});
}
return atts;
},

View file

@ -68,12 +68,12 @@
playFromHere: true,
action: 'playallfromhere',
smallIcon: true,
dragHandle: true
dragHandle: true,
playlistId: item.Id
});
}
var elem = page.querySelector('#childrenContent .itemsContainer');
elem.setAttribute('data-playlistid', item.Id);
elem.innerHTML = html;
ImageLoader.lazyChildren(elem);