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

removed dead code from librarybrowser.js

This commit is contained in:
Luke Pulverenti 2016-07-30 14:37:38 -04:00
parent 9a4988ecbb
commit 7570243d42
20 changed files with 224 additions and 302 deletions

View file

@ -98,6 +98,31 @@
}
}
var metroColors = ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"];
function getRandomMetroColor() {
var index = Math.floor(Math.random() * (metroColors.length - 1));
return metroColors[index];
}
function getMetroColor(str) {
if (str) {
var character = String(str.substr(0, 1).charCodeAt());
var sum = 0;
for (var i = 0; i < character.length; i++) {
sum += parseInt(character.charAt(i));
}
var index = String(sum).substr(-1);
return metroColors[index];
} else {
return getRandomMetroColor();
}
}
function loadUserList(context, apiClient, users) {
var html = "";
@ -125,7 +150,7 @@
}
else {
var background = libraryBrowser.getMetroColor(user.Id);
var background = getMetroColor(user.Id);
imgUrl = 'css/images/logindefault.png';
@ -173,7 +198,7 @@
var self = this;
view.querySelector('#divUsers').addEventListener('click', function(e) {
view.querySelector('#divUsers').addEventListener('click', function (e) {
var cardContent = parentWithClass(e.target, 'cardContent');
if (cardContent) {