From c9d08e51d0a43a196e4934249c7e36b6f0b758c4 Mon Sep 17 00:00:00 2001 From: "Nicolas A. Tonne" Date: Thu, 7 May 2015 16:52:28 +0200 Subject: [PATCH 01/17] Fix stuff --- static/js/search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/search.js b/static/js/search.js index e4789492..fec649f1 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -98,6 +98,7 @@ $(document).keyup(function(e) { $("#search-btn i").toggleClass("mdi-navigation-close"); $("#search-btn i").toggleClass("mdi-action-search"); + $("#results").toggleClass("hide"); } else if ($("div.result").length > 2){ @@ -135,7 +136,7 @@ function showSearch(){ $(".search_input").focus(); } $("#song-title").toggleClass("hide"); - $("#results").removeClass("hide"); + $("#results").toggleClass("hide"); $("#results").empty(); $("#search-btn i").toggleClass("mdi-navigation-close"); $("#search-btn i").toggleClass("mdi-action-search"); From 61ada15af3e722d1824349a5e4a3e109f3724713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 8 May 2015 12:31:53 +0200 Subject: [PATCH 02/17] Fixed error on new channel --- server/server.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/server.js b/server/server.js index 47dfcea9..fbc4bcd0 100755 --- a/server/server.js +++ b/server/server.js @@ -636,8 +636,6 @@ function sort_list(coll, socket, send, list_send) function send_play(coll, socket) { db.collection(coll).find({now_playing:true}, function(err, np){ - if(np.length != 0) - { db.collection(coll).find({views:{$exists:true}}, function(err, conf){ if(conf.length != 0) { @@ -648,7 +646,6 @@ function send_play(coll, socket) socket.emit(coll+",np", toSend); } }); - } }); } From 9bc0f8d02f8e9ba245d2968c0def3867bc2ea3e2 Mon Sep 17 00:00:00 2001 From: "Nicolas A. Tonne" Date: Fri, 8 May 2015 12:45:21 +0200 Subject: [PATCH 03/17] Disable search inside list --- static/js/searchlist.js | 1 + 1 file changed, 1 insertion(+) diff --git a/static/js/searchlist.js b/static/js/searchlist.js index 02882e4b..4b29fc4b 100755 --- a/static/js/searchlist.js +++ b/static/js/searchlist.js @@ -11,6 +11,7 @@ $(document).ready(function() }); find = false; $("html").keydown(function(event) { + return; if ((event.keyCode == 27 && find) || (event.ctrlKey && event.keyCode === 70)) { find = !find; From 3ea894ea683a3bdaa1589acccf9001abab8a32ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 8 May 2015 21:40:02 +0200 Subject: [PATCH 04/17] testing --- index.php | 45 ++++++++++++++++++++++++++++++++++++++++++++ static/css/style.css | 9 +++++++++ static/js/search.js | 10 +++++++++- 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 25603f5f..59a7d3c2 100755 --- a/index.php +++ b/index.php @@ -34,6 +34,51 @@
-
- +
+
+
+ + +
+ +
+ + + +
+
diff --git a/static/js/search.js b/static/js/search.js index 1b9b40d3..3c7f737a 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -1,7 +1,7 @@ var old_input=""; var timer = 0; var api_key = "***REMOVED***"; -var result_html = $("#temp-results").html(); +var result_html = $("#temp-results-container").html(); $( "#results" ).empty(); var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/ From bd2243f01a3e929b344c65f0c85d33537fb08ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 8 May 2015 22:00:46 +0200 Subject: [PATCH 16/17] testing --- static/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/search.js b/static/js/search.js index 3c7f737a..a23a560f 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -197,7 +197,7 @@ function search(search_input){ //$("#results").append(result_html); - var song = $(result_html).find("#result"); + var song = $(result_html).html(); song.find(".search-title").text(title); song.find(".result_info").text(duration); song.find(".thumb").attr("src", thumb); From a12b0f7e2b698aff01ed2983620828baba30fa82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 8 May 2015 22:31:42 +0200 Subject: [PATCH 17/17] fixed how search is appended, and added transition to it. Also added search progress shitfuck --- static/js/search.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/static/js/search.js b/static/js/search.js index a23a560f..7f04b92f 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -181,6 +181,7 @@ function search(search_input){ success: function(response){ var output = ""; + var pre_result = $(result_html); //$("#results").append(result_html); @@ -196,8 +197,7 @@ function search(search_input){ thumb=song.snippet.thumbnails.medium.url; //$("#results").append(result_html); - - var song = $(result_html).html(); + var song = pre_result; song.find(".search-title").text(title); song.find(".result_info").text(duration); song.find(".thumb").attr("src", thumb); @@ -205,15 +205,14 @@ function search(search_input){ song.attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");"); song.attr("id",id); - console.log(song.html()); - output += song.html(); + } }); - $(output).appendTo("#results"); + console.log(response.items.length); - console.log(output); + $("").appendTo($("#results")).show("blind", (response.items.length-1) * 83.33); if(!contains($("#search_loader").attr("class").split(" "), "hide")) $("#search_loader").addClass("hide");