Added vote to site

This commit is contained in:
Unick Soft
2017-07-28 00:17:42 +03:00
parent a64fff2dd9
commit ab0d155367
23 changed files with 199 additions and 9 deletions

View File

@@ -398,7 +398,40 @@ function postLoadPage()
}
}
if (document.getElementById('VoteButton') !== null)
document.getElementById('VoteButton').onclick = function ()
{
var dialogButtons = {};
for (var i = 0; i < 6 && document.getElementById('vote' + i) !== null; i++)
{
document.getElementById('vote' + i)["voteIndex"] = i;
document.getElementById('vote' + i).onclick = function ()
{
console.log("Vote" + this["voteIndex"]);
$.ajax({
type: "GET",
url: "/cgi-bin/vote.php?index=" + this["voteIndex"],
dataType: "text"
});
$("#voteDialog").dialog('close');
$("#VoteButton").hide();
}
}
dialogButtons[g_close] = function() {
$( this ).dialog( "close" );
};
$( "#voteDialog" ).dialog({
resizable: false,
title: g_vote,
width: 400,
modal: true,
dialogClass: 'EdgeDialog',
buttons: dialogButtons,
});
}
// Get algorithms list and load it.
$.get( "/cgi-bin/getPluginsList.php",

View File

@@ -66,6 +66,7 @@ var g_editWeight = "Edit weight";
var g_noWeight = "No weight";
var g_groupRename = "Group rename";
var g_vote = "Vote";
function loadTexts()
{
@@ -133,4 +134,5 @@ function loadTexts()
g_noWeight = document.getElementById("noWeight").innerHTML;
g_groupRename = document.getElementById("groupeRenameText").innerHTML;
g_vote = document.getElementById("voteText").innerHTML;
}