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

fixes #912 - Add special views for Dlna

This commit is contained in:
Luke Pulverenti 2014-09-01 16:10:54 -04:00
parent 2d48323943
commit 0110056c56
4 changed files with 22 additions and 10 deletions

View file

@ -24,14 +24,14 @@
<div id="recentlyPlayed" style="display: none;"> <div id="recentlyPlayed" style="display: none;">
<h1 class="listHeader">${HeaderRecentlyPlayed}</h1> <h1 class="listHeader">${HeaderRecentlyPlayed}</h1>
<div id="recentlyPlayedSongs"> <div id="recentlyPlayedSongs" class="itemsContainer fullWidthItemsContainer" style="text-align:left;">
</div> </div>
</div> </div>
<div id="topPlayed" style="display: none;"> <div id="topPlayed" style="display: none;">
<h1 class="listHeader">${HeaderFrequentlyPlayed}</h1> <h1 class="listHeader">${HeaderFrequentlyPlayed}</h1>
<div id="topPlayedSongs"> <div id="topPlayedSongs" class="itemsContainer fullWidthItemsContainer" style="text-align:left;">
</div> </div>
</div> </div>
</div> </div>

View file

@ -557,7 +557,7 @@
}, },
getUserDataCssClass: function (key) { getUserDataCssClass: function (key) {
return 'libraryItemUserData' + key; return 'libraryItemUserData' + key.replace(new RegExp(' ', 'g'), '');
}, },
getListViewHtml: function (options) { getListViewHtml: function (options) {
@ -605,8 +605,8 @@
var href = LibraryBrowser.getHref(item, options.context); var href = LibraryBrowser.getHref(item, options.context);
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-index="' + index + '" data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '">'; html += '<li class="' + cssClass + '"' + dataAttributes + ' data-index="' + index + '" data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '">';
var onclick = options.defaultAction ? (' data-action="' + options.defaultAction + '" class="itemWithAction"') : ''; var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '" class="itemWithAction"') : '';
html += '<a' + onclick + ' href="' + href + '">'; html += '<a' + defaultActionAttribute + ' href="' + href + '">';
var imgUrl; var imgUrl;
@ -1089,7 +1089,13 @@
var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options); var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options);
html += '<a' + dataAttributes + ' class="' + cssClass + '" href="' + href + '">'; var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '"') : '';
if (options.defaultAction) {
cssClass += ' itemWithAction';
}
html += '<a' + dataAttributes + ' class="' + cssClass + '" href="' + href + '"' + defaultActionAttribute + '>';
var style = ""; var style = "";

View file

@ -727,14 +727,16 @@
var elem = this; var elem = this;
var action = elem.getAttribute('data-action'); var action = elem.getAttribute('data-action');
var itemId = elem.parentNode.getAttribute('data-itemid'); var elemWithAttributes = elem.getAttribute('data-itemid') ? elem : elem.parentNode;
var itemId = elemWithAttributes.getAttribute('data-itemid');
if (action == 'play') { if (action == 'play') {
MediaController.play(itemId); MediaController.play(itemId);
} }
else if (action == 'playallfromhere') { else if (action == 'playallfromhere') {
var index = elem.parentNode.getAttribute('data-index'); var index = elemWithAttributes.getAttribute('data-index');
var itemsContainer = $(elem).parents('.itemsContainer'); var itemsContainer = $(elem).parents('.itemsContainer');
closeContextMenu(); closeContextMenu();

View file

@ -54,7 +54,9 @@
showUnplayedIndicator: false, showUnplayedIndicator: false,
shape: "homePageSquare", shape: "homePageSquare",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true,
defaultAction: 'play'
})).createCardMenus(); })).createCardMenus();
}); });
@ -84,7 +86,9 @@
showUnplayedIndicator: false, showUnplayedIndicator: false,
shape: "homePageSquare", shape: "homePageSquare",
showTitle: true, showTitle: true,
showParentTitle: true showParentTitle: true,
defaultAction: 'play'
})).createCardMenus(); })).createCardMenus();
}); });