mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added more specified feedback on voting
This commit is contained in:
11
js/list.js
11
js/list.js
@@ -42,7 +42,7 @@ function updateList()
|
|||||||
var video_thumb = "http://i.ytimg.com/vi/"+video_id+"/mqdefault.jpg";
|
var video_thumb = "http://i.ytimg.com/vi/"+video_id+"/mqdefault.jpg";
|
||||||
var odd = ""; if(j%2===0)odd=" oddlist";
|
var odd = ""; if(j%2===0)odd=" oddlist";
|
||||||
var delsong = ""; if(pass_corr=="correct")delsong="<input id='del' title='Remove' type='button' class='button' value='X' onclick=\"vote('"+video_id+"','del')\">";
|
var delsong = ""; if(pass_corr=="correct")delsong="<input id='del' title='Remove' type='button' class='button' value='X' onclick=\"vote('"+video_id+"','del')\">";
|
||||||
var finalhtml="<div id='result' class='result lresult"+odd+"'>"+
|
var finalhtml="<div id='result' class='"+video_id+" result lresult"+odd+"'>"+
|
||||||
"<img class='thumb lthumb' src='"+video_thumb+"'>"+
|
"<img class='thumb lthumb' src='"+video_thumb+"'>"+
|
||||||
"<div class='ltitle'>"+video_title+"</div>"+
|
"<div class='ltitle'>"+video_title+"</div>"+
|
||||||
"<div class='votes'>"+listeID.votes+
|
"<div class='votes'>"+listeID.votes+
|
||||||
@@ -98,7 +98,6 @@ function updateList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vote(id, vote){
|
function vote(id, vote){
|
||||||
console.log(adminpass);
|
|
||||||
serverAns = ($.ajax({
|
serverAns = ($.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "php/change.php",
|
url: "php/change.php",
|
||||||
@@ -116,14 +115,14 @@ function vote(id, vote){
|
|||||||
{
|
{
|
||||||
alert("Wrong adminpassword!");
|
alert("Wrong adminpassword!");
|
||||||
}else{
|
}else{
|
||||||
if(vote=="pos"){ $("#playlist").addClass("success");}
|
if(vote=="pos" && serverAns != "many"){ $("."+id).addClass("success");}
|
||||||
else{ $("#playlist").addClass("fadeerror");}
|
else{ $("."+id).addClass("fadeerror");}
|
||||||
updateList();
|
updateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$("#playlist").removeClass("success");
|
$("."+id).removeClass("success");
|
||||||
$("#playlist").removeClass("fadeerror");
|
$("."+id).removeClass("fadeerror");
|
||||||
},1500);
|
},1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,10 +181,13 @@ else if(isset($_GET['vote'])){ //if th
|
|||||||
array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]);
|
array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]);
|
||||||
file_put_contents($list, json_encode($data));
|
file_put_contents($list, json_encode($data));
|
||||||
echo "Vote registrated. I hope";
|
echo "Vote registrated. I hope";
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
print("many");
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
echo array_key_exists($id, $data["songs"]); //not in use..i think..
|
print("many"); //not in use..i think..
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
print("wrong");
|
print("wrong");
|
||||||
|
|||||||
Reference in New Issue
Block a user