mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-15 18:08:17 -07:00
changed getRandomMetroColor to getMetroColor
This commit is contained in:
parent
d27b583884
commit
f5550ea802
@ -151,7 +151,7 @@
|
||||
|
||||
if (url) {
|
||||
|
||||
var style = useBackgroundColor ? "background-color:" + Dashboard.getRandomMetroColor() + ";" : "";
|
||||
var style = useBackgroundColor ? "background-color:" + Dashboard.getMetroColor(item.Id) + ";" : "";
|
||||
|
||||
html += "<img class='itemDetailImage' src='" + url + "' style='" + style + "' />";
|
||||
}
|
||||
@ -700,7 +700,9 @@
|
||||
|
||||
html += '<img src="' + imgUrl + '" />';
|
||||
} else {
|
||||
html += '<img src="css/images/items/list/person.png" style="width:185px;"/>';
|
||||
var style = "background-color:" + Dashboard.getMetroColor(cast.Name) + ";";
|
||||
|
||||
html += '<img src="css/images/items/list/person.png" style="max-width:185px; '+style+'"/>';
|
||||
}
|
||||
|
||||
html += '<div class="posterViewItemText posterViewItemPrimaryText">' + cast.Name + '</div>';
|
||||
|
@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
if (url) {
|
||||
var style = useBackgroundColor ? "background-color:" + Dashboard.getRandomMetroColor() + ";" : "";
|
||||
var style = useBackgroundColor ? "background-color:" + Dashboard.getMetroColor(item.Id) + ";" : "";
|
||||
|
||||
html += "<img class='itemDetailImage' src='" + url + "' style='" + style + "' />";
|
||||
}
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
var linkId = "lnkUser" + i;
|
||||
|
||||
var background = Dashboard.getRandomMetroColor();
|
||||
var background = Dashboard.getMetroColor(user.Id);
|
||||
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var color = plugin.tileColor || Dashboard.getRandomMetroColor();
|
||||
var color = plugin.tileColor || Dashboard.getMetroColor(plugin.name);
|
||||
|
||||
html += "<div class='posterViewItemText' style='background:" + color + "'>";
|
||||
|
||||
|
@ -472,11 +472,11 @@ var Dashboard = {
|
||||
}
|
||||
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
|
||||
|
||||
html += "<img style='background:" + Dashboard.getRandomMetroColor() + ";' src='css/images/items/list/audio.png' />";
|
||||
html += "<img style='background:" + Dashboard.getMetroColor(item.Id) + ";' src='css/images/items/list/audio.png' />";
|
||||
}
|
||||
else {
|
||||
|
||||
html += "<img style='background:" + Dashboard.getRandomMetroColor() + ";' src='css/images/items/list/collection.png' />";
|
||||
html += "<img style='background:" + Dashboard.getMetroColor(item.Id) + ";' src='css/images/items/list/collection.png' />";
|
||||
}
|
||||
|
||||
if (showText) {
|
||||
@ -1146,6 +1146,19 @@ var Dashboard = {
|
||||
var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1));
|
||||
|
||||
return Dashboard.metroColors[index];
|
||||
},
|
||||
|
||||
getMetroColor: function (str) {
|
||||
|
||||
if (str) {
|
||||
var char = str.substr(0,1).charCodeAt();
|
||||
var index = String(char).substr(char.length,1);
|
||||
|
||||
return Dashboard.metroColors[index];
|
||||
}else {
|
||||
return Dashboard.getRandomMetroColor();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user