1$(document).ready(function () { 2 $(".votebutton").each(function () { 3 var id = $(this).attr('rel'); 4 var voted = getCookie('vote-succeed' + id); 5 if (voted) $(this).hide(); 6 }); 7 8 $('.votebutton').click(function (e) { 9 e.preventDefault(); 10 var id = $(this).attr('rel'); 11 var votetype = $(this).attr('data-type'); 12 var voted = getCookie('vote-succeed' + id); 13 var latestVoteTime = getCookie('latest-vote-time' + id); 14 var waitTime = timeSince(latestVoteTime)._seconds; 15 if (voted && waitTime < 60) { 16 alert("Xin vui lòng chá» trong " + (60 - waitTime) + " giây nữa Äá» ÄÆ°á»£c bình chá»n tiếp"); 17 return false; 18 } 19 if (votetype == 0) { 20 var order = $('input:radio[name=vote' + id + ']:checked').val(); 21 if (parseInt(order) == 'NaN' || order == undefined) { 22 alert('Bạn chưa chá»n mục nà o.'); 23 return false; 24 } 25 //alert ("ID=" + id + " --- ORDER:" + order); 26 //console.log("ID=" + id + " --- ORDER:" + order); 27 $.ajax({
28 type: "POST", 29 url: "/ajax/tool.ashx?type=vote&id=" + id + "&ord=" + order, 30 cache: false 31 }).done(function (msg) { 32 $('.votebutton').hide(); 33 setCookie("vote-succeed" + id, true, 30); 34 setCookie('latest-vote-time' + id, (new Date()).valueOf(), 30); 35 alert(msg); 36 }); 37 } else if (votetype == 1) { 38 //alert(votetype); 39 } 40 }); 41 $('.voteresult').click(function (e) { 42 e.preventDefault(); 43 var _id = $(this).attr('rel'); 44 //var rslUrl = "/ajax/vote.aspx?id=" + _id + "&rd=" + Math.random(1000000); 45 //alert(_id); 46 $.ajax({ 47 type: "POST", 48 url: "/ajax/vote.aspx?id=" + _id + "&rd=" + Math.random(1000000), 49 cache: false 50 }).done(function (msg) { 51 //alert(_id); 52 $('#vote-result-container' + _id).html(msg); 53 $('#vote-result-modal' + _id).modal('show'); 54 }); 55 //voteresult(id); 56 //window.setTimeout(function() { $('#loadingvote' + id).hide(); }, 5000); 57 }); 58 59}); 60 61function closeVoteResultForm(id) { 62 $('#vote-result-modal' + id).modal('hide'); 63 return true; 64 65} 66 67function timeSince(when) { // this ignores months 68 var obj = {}; 69 obj._milliseconds = (new Date()).valueOf() - when; 70 obj.milliseconds = obj._milliseconds % 1000; 71 obj._seconds = (obj._milliseconds - obj.milliseconds) / 1000; 72 obj.seconds = obj._seconds % 60; 73 return obj; 74} 75 76 77 78
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.