PageSourceSearch

https://media.baovanhoa.vn/web/js/vote.js?v=1.8.2

js baovanhoa.vn collected 2026-10-02 05:05:43 UTC 2,684 bytes, 78 lines download raw bytes

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.