Fixed error with undefined in ids

This commit is contained in:
Kasper Rynning-Tønnesen
2015-08-03 12:07:35 +02:00
parent 2a18fba467
commit 0bf93e9764
2 changed files with 4 additions and 5 deletions

View File

@@ -79,7 +79,6 @@ io.on('connection', function(socket){
var short_id = uniqueID(socket.id,4);
unique_ids.push(short_id);
socket.on('namechange', function(data)
{
if(name.length < 9 && name.indexOf(" ") == -1)
@@ -740,7 +739,7 @@ function contains(a, obj) {
}
function rndName(seed, len) {
var vowels = ['a', 'e', 'i', 'o', 'u'];
var vowels = ['a', 'e', 'i', 'o', 'u', 'aa', 'ae', 'oe'];
consts = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'tt', 'ch', 'sh'];
//len = 8;
len = Math.floor(len);
@@ -758,7 +757,7 @@ function rndName(seed, len) {
function uniqueID(seed, minlen){
var len = minlen;
var id = rndName(seed, len);
var id = rndName(seed, minlen);
while( contains(unique_ids, id) && len<=8){
id = rndName(String(len)+id, len);

View File

@@ -113,7 +113,7 @@ var Youtube = {
|| newState.data == 101 || newState.data == 150)
socket.emit("skip", newState.data);
else if(video_id !== undefined)
ytplayer.loadVideoById(video_id);
ytplayer.loadVideoById(video_id);
},
onPlayerReady: function(event) {
@@ -147,7 +147,7 @@ var Youtube = {
var colorThief = new ColorThief();
var color = colorThief.getColor(img);
document.getElementsByTagName("body")[0].style.backgroundColor = Helper.rgbToHsl(color);
console.log(colorThief.getColor(img));
$("meta[name=theme-color]").attr("content", Helper.rgbToHex(color[0], color[1], color[2]));