PageSourceSearch

https://newsmaker.md/wp-content/plugins/poll-maker/public/js/poll-maker-public-category.js?ver=5.7.4

js newsmaker.md collected 2026-10-02 03:03:34 UTC 6,349 bytes, 142 lines download raw bytes

1(function($) {
2	'use strict'
3
4    $(document).ready(function() {
5        var widthForNext = 1;
6        var widthForPrev = 0;
7        var containers = $(document).find('.ays_poll_category-container');
8
9        containers.each(function() {
10            var $j = $(this).attr('data-var');
11            var catContainer = $('#' + window['catContainer' + $j]);
12            catContainer.append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);
13
14            var previousNextBtnContainer = $("<div class='previous_next_buttons'></div>");
15            var btn = $("<button id='catBtn" + $j + "' class='ays-poll_previous_next_buttons ays-poll-next-btn ays_p_n_buttons" + $j + "' type='button' data-name='next'> " + window['aysPollBtnText' + $j] + " </button>");
16            var previousBtn = $("<button id='previousBtn" + $j + "' class='ays-poll_previous_next_buttons ays-poll-previous-btn ays_p_n_buttons" + $j + "' type='button' data-name='previous'> " + window['aysPollPreviousBtnText' + $j] + "</button>");
17            btn.css(dataCss);
18            previousBtn.css(dataCss);
19
20            if (catContainer.find('.apm-need-sign-in').length > 0 || !window['showNext' + $j]) {
21                btn.prop('disabled', true);
22            } else {
23            	btn.prop('disabled', !window['showNext' + $j]);
24            }
25
26            if (window['catIndex' + $j] != 0 ) {
27                previousBtn.prop('disabled', false);
28            } else {
29                previousBtn.prop('disabled', true);
30            }
31
32            if (window['pollsGlobalPool'+$j].length == 1) {
33                btn.prop('disabled', true);
34            }
35
36            var nextPrevButtonsWidths = JSON.parse(window['aysPollWidths'+$j]);
37            $(document).on('click', ".ays_p_n_buttons" + $j, function() {
38                if (window['showNext' + $j]) {
39                    if($(this).attr('data-name') == 'next') {
40                        if(nextPrevButtonsWidths[widthForNext] == "0px") {
41                            nextPrevButtonsWidths[widthForNext] = "100%";
42                        }
43
44                        $(this).parent().css("width", nextPrevButtonsWidths[widthForNext]);
45                        previousBtn.prop('disabled', false);
46
47                        var previousPollHtml = emptyCatCont($(this));
48                        window['pollsGlobalPool' + $j][window['catIndex' + $j]] = previousPollHtml;
49                        window['catIndex'+ $j]++;
50                        if(typeof(window['pollsGlobalPool' + $j][window['catIndex' + $j]]) != 'undefined'){
51                            catContainer.empty().append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);
52                        }
53
54                        catContainer.append(previousNextBtnContainer);
55                        var checkIfVoted = catContainer.find('.results-apm').length > 0 ? true : false;
56                        if (window['catIndex' + $j] != window['pollsGlobalPool' + $j].length - 1) {
57                            if (catContainer.find('.apm-need-sign-in').length > 0 || !window['showNext'+$j]) {
58                                btn.prop('disabled', true);
59                            } else {
60                                var checkVal = false;
61                                if (window['showNextVal'+$j] == false) {
62                                    checkVal = true;
63                                }
64                                btn.prop('disabled', checkVal);
65                            }
66
67                            if(checkIfVoted) {
68                                btn.prop('disabled', false);
69                            }
70                        } else {
71                            btn.prop('disabled', true);
72                        }
73
74                        widthForPrev++;
75                        widthForNext++;
76                    } else if($(this).attr('data-name') == 'previous') {
77                        widthForNext--;
78                        widthForPrev--;
79
80                        if (widthForPrev == 0) {
81                            widthForPrev == "100%";
82                        }
83
84                        if (nextPrevButtonsWidths[widthForPrev] == "0px") {
85                            nextPrevButtonsWidths[widthForPrev] = "100%";
86                        }
87
88                        $(this).parent().css("width", nextPrevButtonsWidths[widthForPrev]);
89                        var nextPollHtml = emptyCatCont($(this));
90
91                        window['pollsGlobalPool' + $j][window['catIndex' + $j]] = nextPollHtml;
92                        window['catIndex' + $j]--;
93
94                        btn.prop('disabled', false);
95                        previousBtn.prop('disabled', false);
96                        catContainer.empty().append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);
97                        catContainer.append(previousNextBtnContainer);
98                        if (window['catIndex' + $j] == 0) {
99                            previousBtn.prop('disabled', true);
100                        }
101                    }
102                } else {
103                    window['catIndex' + $j] = 0;
104                }
105            });
106
107            $(document).on('click', ".ays-poll_previous_next_buttons" ,function() {
108                $(document).find(".ays-poll_previous_next_buttons").css(dataCss);
109            });
110
111            $(document).on('mouseleave', ".ays_p_n_buttons" + $j, function() {
112                $(this).css(dataCss);
113            });
114
115            $(document).on('mouseenter', ".ays_p_n_buttons" + $j, function() {
116                $(this).css(hoverCss);
117            });
118
119            previousNextBtnContainer.append(previousBtn);
120            previousNextBtnContainer.append(btn);
121            catContainer.append(previousNextBtnContainer);
122
123            if (!window['showNext' + $j]) {
124                btn.prop('disabled', true);
125            }
126        });
127
128        function emptyCatCont(current) {
129            var content1 = current.parents('.ays_poll_category-container').clone();
130            var prevPollHtml = '';
131
132            if (content1.find('.ays-poll_previous_next_buttons').length > 0) {
133                content1.find('.previous_next_buttons').remove();
134                prevPollHtml = content1.html();
135                return prevPollHtml;
136            }
137
138            return false;
139        }
140    });
141
142})(jQuery);

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.