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

Rework device icons + add Kodi

This commit is contained in:
mcarlton00 2019-12-20 17:44:38 -05:00
parent 4f71cc1814
commit d9757956a3
4 changed files with 91 additions and 4 deletions

View file

@ -623,7 +623,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
}
},
getClientImage: function (connection) {
var iconUrl = imageHelper.getDeviceIcon(connection.DeviceName);
var iconUrl = imageHelper.getDeviceIcon(connection);
return "<img src='" + iconUrl + "' />";
},
getNowPlayingImageUrl: function (item) {

View file

@ -74,7 +74,7 @@ define(["loading", "dom", "libraryMenu", "globalize", "scripts/imagehelper", "hu
deviceHtml += '<div class="cardScalable">';
deviceHtml += '<div class="cardPadder cardPadder-backdrop"></div>';
deviceHtml += '<a is="emby-linkbutton" href="' + (canEdit ? "device.html?id=" + device.Id : "#") + '" class="cardContent cardImageContainer">';
var iconUrl = imageHelper.getDeviceIcon(device.Name);
var iconUrl = imageHelper.getDeviceIcon(device);
if (iconUrl) {
deviceHtml += '<div class="cardImage" style="background-image:url(\'' + iconUrl + "');background-size: auto 64%;background-position:center center;\">";

83
src/img/devices/kodi.svg Normal file
View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 6.3500002 6.35"
version="1.1"
id="svg209"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="kodi.svg">
<defs
id="defs203" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="14.481547"
inkscape:cx="46.769888"
inkscape:cy="2.9628438"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="958"
inkscape:window-height="1046"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
showborder="false" />
<metadata
id="metadata206">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-36.172785,-93.796202)">
<g
id="g288"
transform="matrix(0.08,0,0,0.08,40.526601,88.485226)">
<path
style="fill:#fcfdfd;stroke-width:0.26458332"
d="M 53.294636,119.35119 V 79.663689 h 39.6875 39.687504 v 39.687501 39.6875 h -39.687504 -39.6875 z"
id="path292"
inkscape:connector-curvature="0" />
</g>
<g
id="g458"
transform="matrix(1.3761467,0,0,1.3824885,-26.630201,-38.456318)"
style="fill:#ffffff">
<path
inkscape:connector-curvature="0"
id="path290"
d="m 86.821863,141.89184 c -4.738031,-4.75964 -5.21681,-5.32353 -5.21681,-6.14421 0,-0.82158 0.475054,-1.37867 5.232871,-6.13649 4.755163,-4.75516 5.315254,-5.23287 6.135311,-5.23287 0.816171,0 1.367555,0.46161 5.767798,4.82865 4.869157,4.83242 5.618187,5.74523 5.618187,6.84664 0,0.41218 -1.56974,2.16406 -5.227397,5.83397 -4.820566,4.83672 -5.299999,5.24491 -6.160273,5.24491 -0.860462,0 -1.337844,-0.40681 -6.149687,-5.2406 z m 22.167567,-12.45471 c -0.43656,-0.27248 -2.90711,-2.63708 -5.49011,-5.25468 -4.195656,-4.25186 -4.696351,-4.85335 -4.696351,-5.64184 0,-0.7938 0.52954,-1.41399 5.264351,-6.16552 4.65819,-4.67464 5.36203,-5.28293 6.11273,-5.28293 0.75071,0 1.45455,0.60829 6.11274,5.28293 4.77294,4.7898 5.26435,5.36684 5.26435,6.18178 0,0.81542 -0.48628,1.38513 -5.23941,6.13825 -5.61044,5.61045 -5.77073,5.71416 -7.3283,4.74201 z m -40.159671,-5.27314 c -3.563575,-3.58155 -4.95179,-5.1483 -4.95179,-5.58859 0,-0.75745 9.338353,-10.60129 10.056905,-10.60129 0.258398,0 0.542083,0.18833 0.630413,0.41851 0.08833,0.23018 0.160599,4.76238 0.160599,10.07156 0,9.10984 -0.109482,10.67659 -0.746061,10.67659 -0.109052,0 -2.426582,-2.23955 -5.150066,-4.97678 z m 13.200476,-1.52715 c -0.08833,-0.23018 -0.160599,-5.35578 -0.160599,-11.39022 0,-8.97344 0.06852,-11.10183 0.376214,-11.686174 0.206914,-0.392956 2.447049,-2.768293 4.978074,-5.278528 4.322575,-4.287066 4.662361,-4.564062 5.598663,-4.564062 0.945832,0 1.259131,0.267172 6.127684,5.22552 4.658009,4.743923 5.131509,5.310164 5.137619,6.143874 0.006,0.85888 -0.67407,1.59995 -10.505989,11.44323 -5.782003,5.78868 -10.710359,10.52488 -10.9519,10.52488 -0.241541,0 -0.511437,-0.18833 -0.599766,-0.41852 z"
style="fill:#ffffff;stroke-width:0.26458332"
transform="matrix(0.08,0,0,0.08,40.526602,88.485226)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -3,7 +3,7 @@ define(["browser"], function (browser) {
function getDeviceIcon(device) {
var baseUrl = "img/devices/";
switch (device) {
switch (device.Name) {
case "Opera":
case "Opera TV":
return baseUrl + "opera.svg";
@ -24,6 +24,10 @@ define(["browser"], function (browser) {
case "Web Browser":
return baseUrl + "html5.svg";
default:
switch(device.AppName) {
case "Kodi":
return baseUrl + "kodi.svg";
}
return baseUrl + "other.svg";
}
}