Trying to improve frontpage fetching

This commit is contained in:
Kasper Rynning-Tønnesen
2017-09-17 11:33:01 +02:00
parent 5bbde84a7c
commit 850be93973
9 changed files with 28 additions and 59 deletions

View File

@@ -29,7 +29,7 @@ var Crypt = {
Hostcontroller.change_enabled(conf_arr.remote);
if(conf_arr.width != 100) Player.set_width(conf_arr.width);
if(conf_arr.name !== undefined && conf_arr.name !== "") Chat.namechange(conf_arr.name);
//if(conf_arr.name !== undefined && conf_arr.name !== "") Chat.namechange(conf_arr.name);
}
},

View File

@@ -137,6 +137,7 @@ var Frontpage = {
num++;
//if(num>19)break;
}
var options_list = lists.slice();
options_list = options_list.sort(Frontpage.sortFunction_active);
@@ -153,13 +154,13 @@ var Frontpage = {
var to_autocomplete = "input.desktop-search";
if(Helper.mobilecheck()) to_autocomplete = "input.mobile-search";
$(to_autocomplete).autocomplete({
/*$(to_autocomplete).autocomplete({
data: data,
limit: 5, // The max amount of results that can be shown at once. Default: Infinity.
onAutocomplete: function(val) {
Frontpage.to_channel(val, false);
},
});
});*/
//$(".autocomplete").off('keydown.autocomplete');
@@ -445,7 +446,7 @@ function initfp(){
tooltip: "Total Viewers"
});
socket.emit('frontpage_lists', {version: parseInt(localStorage.getItem("VERSION"))});
socket.emit('get_userlists', Crypt.getCookie('_uI'));
//socket.emit('get_userlists', Crypt.getCookie('_uI'));
$("#channel-load").css("display", "none");
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)

View File

@@ -154,11 +154,11 @@ $().ready(function(){
}
});
}
if(conf_arr != undefined && conf_arr.name !== undefined && conf_arr.name !== "") {
/*if(conf_arr != undefined && conf_arr.name !== undefined && conf_arr.name !== "") {
setTimeout(function(){
Chat.namechange(conf_arr.name);
}, 1000);
}
}*/
});
socket.on("self_ping", function() {
@@ -169,7 +169,7 @@ $().ready(function(){
setup_no_connection_listener();
try{
/*try{
$.ajax({
type: "GET",
url: "https://api.github.com/users/zoff-music/received_events",
@@ -189,7 +189,7 @@ $().ready(function(){
});
} catch(error){
Helper.log("Error with fetching GitHub commit info");
}
}*/
});
@@ -735,6 +735,7 @@ function setup_list_listener(){
function setup_playlist_listener(){
Helper.log("Setting up playlist_listener");
console.log("asd");
socket.on('playlists', Frontpage.frontpage_function);
}