mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 02:30:51 +00:00
Added vote to site
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user