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

update list views

This commit is contained in:
Luke Pulverenti 2016-07-16 17:28:15 -04:00
parent cbf80fb548
commit aaf5037d13
14 changed files with 164 additions and 70 deletions

View file

@ -15,12 +15,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.84", "version": "1.4.85",
"_release": "1.4.84", "_release": "1.4.85",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.84", "tag": "1.4.85",
"commit": "15bfe5a5a9ca97a96f3f30c76dd463266f66e290" "commit": "02ae5393a31e8266eb52f0e1a6471b9da8f964c7"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0", "_target": "^1.2.0",

View file

@ -1,12 +1,74 @@
define(['itemShortcuts', 'registerElement'], function (itemShortcuts) { define(['itemShortcuts', 'connectionManager', 'registerElement'], function (itemShortcuts, connectionManager) {
var ItemsContainerProtoType = Object.create(HTMLDivElement.prototype); var ItemsContainerProtoType = Object.create(HTMLDivElement.prototype);
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
function parentWithAttribute(elem, name) {
while (!elem.getAttribute(name)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
function getItem(button) {
button = parentWithAttribute(button, 'data-id');
var serverId = button.getAttribute('data-serverid');
var id = button.getAttribute('data-id');
var apiClient = connectionManager.getApiClient(serverId);
return apiClient.getItem(apiClient.getCurrentUserId(), id);
}
function showContextMenu(button) {
getItem(button).then(function (item) {
require(['itemContextMenu'], function (itemContextMenu) {
itemContextMenu.show({
positionTo: button,
item: item
});
});
});
}
function onClick(e) {
var menuButton = parentWithClass(e.target, 'menuButton');
if (menuButton) {
showContextMenu(menuButton);
e.stopPropagation();
return false;
}
}
ItemsContainerProtoType.attachedCallback = function () { ItemsContainerProtoType.attachedCallback = function () {
this.addEventListener('click', onClick);
itemShortcuts.on(this); itemShortcuts.on(this);
}; };
ItemsContainerProtoType.detachedCallback = function () { ItemsContainerProtoType.detachedCallback = function () {
this.removeEventListener('click', onClick);
itemShortcuts.off(this); itemShortcuts.off(this);
}; };

View file

@ -14,3 +14,52 @@
.timerIndicator { .timerIndicator {
color: #CB272A; color: #CB272A;
} }
.indicator + .indicator {
margin-left: .25em;
}
.countIndicator {
background: rgba(82,181,75,1);
border-radius: 500px;
display: -ms-flex;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
color: #fff;
}
.playedIndicator {
background: rgba(82,181,75,1);
border-radius: 500px;
display: -ms-flex;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.countIndicator, .playedIndicator {
width: 28px;
height: 28px;
}
.playedIndicator i {
width: 22px;
height: 22px;
font-size: 22px;
}
.layout-tv .countIndicator, .layout-tv .playedIndicator {
width: 3.8vh;
height: 3.8vh;
}
.layout-tv .playedIndicator i {
width: 2.6vh;
height: 2.6vh;
font-size: 2.6vh;
}

View file

@ -200,7 +200,10 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (ap
require(['actionsheet'], function (actionSheet) { require(['actionsheet'], function (actionSheet) {
actionSheet.show({ actionSheet.show({
items: commands
items: commands,
positionTo: options.positionTo
}).then(function (id) { }).then(function (id) {
executeCommand(options.item, id).then(resolve); executeCommand(options.item, id).then(resolve);
}, reject); }, reject);

View file

@ -169,6 +169,14 @@ div.listItem {
margin-top: 0; margin-top: 0;
} }
.listItem .indicators {
right: .5vh;
top: .5vh;
position: absolute;
display: flex;
align-items: center;
}
@supports (display: flex) { @supports (display: flex) {
.listItem, .listItemBody, .listItemMediaInfo { .listItem, .listItemBody, .listItemMediaInfo {

View file

@ -201,8 +201,6 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
if (options.showParentTitle) { if (options.showParentTitle) {
if (item.Type == 'Episode') { if (item.Type == 'Episode') {
textlines.push(item.SeriesName || ' '); textlines.push(item.SeriesName || ' ');
} else if (item.Type == 'MusicAlbum') {
textlines.push(item.AlbumArtist || ' ');
} }
} }
@ -213,13 +211,28 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
} }
textlines.push(displayName); textlines.push(displayName);
if (item.Type == 'Audio') { if (item.ArtistItems && item.Type != 'MusicAlbum') {
textlines.push(item.ArtistItems.map(function (a) { textlines.push(item.ArtistItems.map(function (a) {
return a.Name; return a.Name;
}).join(', ') || ' '); }).join(', ') || ' ');
} }
if (item.AlbumArtist && item.Type == 'MusicAlbum') {
textlines.push(item.AlbumArtist || ' ');
}
if (item.Type == 'Game') {
textlines.push(item.GameSystem || ' ');
}
if (item.Type == 'TvChannel') {
if (item.CurrentProgram) {
textlines.push(itemHelper.getDisplayName(item.CurrentProgram));
}
}
var lineCount = textlines.length; var lineCount = textlines.length;
if (!options.enableSideMediaInfo) { if (!options.enableSideMediaInfo) {
lineCount++; lineCount++;
@ -241,7 +254,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += '<h2>'; html += '<h2>';
} }
else if (i == 0) { else if (i == 0) {
html += '<h3>'; html += '<div>';
} else { } else {
html += '<div class="secondary">'; html += '<div class="secondary">';
} }
@ -249,7 +262,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
if (i == 0 && isLargeStyle) { if (i == 0 && isLargeStyle) {
html += '</h2>'; html += '</h2>';
} else if (i == 0) { } else if (i == 0) {
html += '</h3>'; html += '</div>';
} else { } else {
html += '</div>'; html += '</div>';
} }
@ -268,7 +281,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += '</div>'; html += '</div>';
if (!clickEntireItem) { if (!clickEntireItem) {
html += '<button is="paper-icon-button-light" class="listviewMenuButton autoSize"><i class="md-icon">&#xE5D4;</i></button>'; html += '<button is="paper-icon-button-light" class="menuButton autoSize"><i class="md-icon">&#xE5D4;</i></button>';
html += '<span class="listViewUserDataButtons">'; html += '<span class="listViewUserDataButtons">';
html += userdataButtons.getIconsHtml(item, false); html += userdataButtons.getIconsHtml(item, false);
html += '</span>'; html += '</span>';

View file

@ -3,9 +3,9 @@
} }
i.mediaInfoItem { i.mediaInfoItem {
width: 3vh; width: auto;
height: 3vh; height: auto;
font-size: 3vh; font-size: 1.6em;
margin-right: .6em; margin-right: .6em;
} }
@ -63,9 +63,3 @@ i.mediaInfoItem {
font-size: 90%; font-size: 90%;
padding: .1em .5em; padding: .1em .5em;
} }
.layout-tv i.mediaInfoItem {
width: 4vh;
height: 4vh;
font-size: 4vh;
}

View file

@ -125,7 +125,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
} }
else if (action == 'setplaylistindex') { else if (action == 'setplaylistindex') {
playbackManager.currentPlaylistIndex(parseInt(card.getAttribute('data-index')));
} }
else if (action == 'record') { else if (action == 'record') {

View file

@ -26,14 +26,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"main": "iron-meta.html", "main": "iron-meta.html",
"homepage": "https://github.com/PolymerElements/iron-meta", "homepage": "https://github.com/polymerelements/iron-meta",
"_release": "1.1.1", "_release": "1.1.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.1", "tag": "v1.1.1",
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f" "commit": "e171ee234b482219c9514e6f9551df48ef48bd9f"
}, },
"_source": "git://github.com/PolymerElements/iron-meta.git", "_source": "git://github.com/polymerelements/iron-meta.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-meta" "_originalSource": "polymerelements/iron-meta"
} }

View file

@ -39,6 +39,6 @@
"commit": "8715c83bf04a228de00ec662ed43eb6141e61b91" "commit": "8715c83bf04a228de00ec662ed43eb6141e61b91"
}, },
"_source": "git://github.com/Polymer/polymer.git", "_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.1.0", "_target": "^1.0.0",
"_originalSource": "Polymer/polymer" "_originalSource": "Polymer/polymer"
} }

View file

@ -414,7 +414,7 @@
html += listView.getListViewHtml({ html += listView.getListViewHtml({
items: MediaController.playlist(), items: MediaController.playlist(),
smallIcon: true, smallIcon: true,
action: 'none' action: 'setplaylistindex'
}); });
playlistNeedsRefresh = false; playlistNeedsRefresh = false;
@ -556,24 +556,6 @@
return elem; return elem;
} }
function onContextClick(e) {
var mediaItem = parentWithClass(e.target, 'itemAction');
if (mediaItem != null) {
mediaItem = parentWithClass(e.target, 'listItem');
var indexValue = mediaItem.getAttribute('data-index');
if (indexValue) {
MediaController.currentPlaylistIndex(parseInt(indexValue));
}
e.preventDefault();
e.stopPropagation();
return false;
}
}
function onBtnCommandClick() { function onBtnCommandClick() {
if (currentPlayer) { if (currentPlayer) {
@ -693,8 +675,6 @@
return datetime.getDisplayRunningTime(ticks); return datetime.getDisplayRunningTime(ticks);
}; };
context.addEventListener('click', onContextClick);
} }
function onPlayerChange() { function onPlayerChange() {

View file

@ -885,30 +885,10 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
top: 32px; top: 32px;
} }
.playedIndicator { .syncIndicator i {
display: flex; font-size: 180%;
justify-content: center;
align-items: center;
position: absolute;
top: 5px;
right: 5px;
text-align: center;
vertical-align: middle;
width: 26px;
height: 26px;
border-radius: 50%;
color: #fff;
background: rgb(82, 181, 75);
background: rgba(82, 181, 75, .95);
line-height: 21px;
line-height: initial;
font-weight: 500;
} }
.playedIndicator i, .syncIndicator i {
font-size: 180%;
}
.mediaSourceIndicator { .mediaSourceIndicator {
display: block; display: block;
position: absolute; position: absolute;

View file

@ -78,7 +78,8 @@
html = listView.getListViewHtml({ html = listView.getListViewHtml({
items: result.Items, items: result.Items,
sortBy: query.SortBy sortBy: query.SortBy,
showParentTitle: true
}); });
} }
else if (viewStyle == "PosterCard") { else if (viewStyle == "PosterCard") {

View file

@ -1819,6 +1819,7 @@ var AppInfo = {};
define("recordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/recordingeditor"], returnFirstDependency); define("recordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/recordingeditor"], returnFirstDependency);
define("subtitleEditor", [embyWebComponentsBowerPath + "/subtitleeditor/subtitleeditor"], returnFirstDependency); define("subtitleEditor", [embyWebComponentsBowerPath + "/subtitleeditor/subtitleeditor"], returnFirstDependency);
define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency); define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency);
define("itemContextMenu", [embyWebComponentsBowerPath + "/itemcontextmenu"], returnFirstDependency);
define("refreshDialog", [embyWebComponentsBowerPath + "/refreshdialog/refreshdialog"], returnFirstDependency); define("refreshDialog", [embyWebComponentsBowerPath + "/refreshdialog/refreshdialog"], returnFirstDependency);
define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency); define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency);
define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency); define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency);
@ -2025,6 +2026,9 @@ var AppInfo = {};
}, },
play: function (options) { play: function (options) {
MediaController.play(options); MediaController.play(options);
},
currentPlaylistIndex: function (options) {
return MediaController.currentPlaylistIndex(options);
} }
}; };
}); });