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

update live tv menu

This commit is contained in:
Luke Pulverenti 2015-08-28 11:02:22 -04:00
parent 06b74be1fd
commit 3bae11071d
57 changed files with 368 additions and 115 deletions

View file

@ -8,7 +8,38 @@
var items = result.Items;
deferred.resolveWith(null, [items]);
var list = [];
for (var i = 0, length = items.length; i < length; i++) {
var view = items[i];
list.push(view);
if (view.CollectionType == 'livetv') {
view.ImageTags = {};
view.icon = 'live-tv';
var guideView = $.extend({}, view);
guideView.Name = Globalize.translate('ButtonGuide');
guideView.ImageTags = {};
guideView.icon = 'dvr';
guideView.url = 'livetv.html?tab=1';
guideView.onclick = "LibraryBrowser.showTab('livetv.html', 1);return false;";
list.push(guideView);
var recordedTvView = $.extend({}, view);
recordedTvView.Name = Globalize.translate('ButtonRecordedTv');
recordedTvView.ImageTags = {};
recordedTvView.icon = 'video-library';
recordedTvView.url = 'livetv.html?tab=3';
recordedTvView.onclick = "LibraryBrowser.showTab('livetv.html', 3);return false;";
list.push(recordedTvView);
}
}
deferred.resolveWith(null, [list]);
});
return deferred.promise();
@ -36,53 +67,53 @@
switch (item.CollectionType) {
case "movies":
icon = "fa-film";
icon = "local-movies";
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "music":
icon = "fa-music";
icon = "library-music";
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "photos":
icon = "fa-photo";
icon = "photo";
backgroundColor = 'rgba(127, 0, 0, 0.9)';
break;
case "livetv":
icon = "fa-video-camera";
icon = "live-tv";
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "tvshows":
icon = "fa-video-camera";
icon = "live-tv";
backgroundColor = 'rgba(77, 88, 164, 0.9)';
break;
case "games":
icon = "fa-gamepad";
icon = "folder";
backgroundColor = 'rgba(183, 202, 72, 0.9)';
break;
case "trailers":
icon = "fa-film";
icon = "local-movies";
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "homevideos":
icon = "fa-video-camera";
icon = "video-library";
backgroundColor = 'rgba(110, 52, 32, 0.9)';
break;
case "musicvideos":
icon = "fa-video-camera";
icon = "video-library";
backgroundColor = 'rgba(143, 54, 168, 0.9)';
break;
case "books":
icon = "fa-book";
icon = "folder";
break;
case "channels":
icon = "fa-globe";
icon = "folder";
backgroundColor = 'rgba(51, 136, 204, 0.9)';
break;
case "playlists":
icon = "fa-list";
icon = "folder";
break;
default:
icon = "fa-folder-o";
icon = "folder";
break;
}
@ -93,12 +124,15 @@
}
var href = item.url || LibraryBrowser.getHref(item);
var onclick = item.onclick ? ' onclick="' + item.onclick + '"' : '';
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
icon = item.icon || icon;
html += '<a' + onclick + ' data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
html += '<div class="cardBox" style="background-color:' + backgroundColor + ';margin:4px;border-radius:4px;">';
html += "<div class='cardText' style='padding:8px 10px;color:#fff;font-size:14px;'>";
html += '<i class="fa ' + icon + '"></i>';
html += '<iron-icon icon="' + icon + '"></iron-icon>';
html += '<span style="margin-left:.7em;">' + item.Name + '</span>';
html += "</div>";