PageSourceSearch

https://pub-ini.ru/wp-content/plugins/booster-extension/assets/js/frontend.js?ver=1.0.0

js pub-ini.ru collected 2026-10-02 10:35:25 UTC 12,659 bytes, 284 lines download raw bytes

1
2function booster_extension_read_later_posts( cruurenclass = '' ){
3    
4    jQuery(document).ready( function($) {
5
6        "use scrict";
7        if( cruurenclass ){
8            var ClickClass = '.'+cruurenclass+' .booster-favourite-post';
9        }else{
10            var ClickClass = '.booster-favourite-post';
11        }
12
13        $(ClickClass).click(function () {
14
15            var cid = $(this).attr('post-id');
16            var ppcount = $('.booster-favourite-posts-count').attr('twp-pp-count');
17            var current = '.booster-favourite-'+cid;
18            var AddRemove;
19            if( $(current).hasClass('booster-favourite-selected') ){
20                ppcount = ppcount - 1;
21                $(current).removeClass('booster-favourite-selected');
22                AddRemove = 'remove';
23
24            }else{
25                ppcount++;
26                $(current).addClass('booster-favourite-selected');
27                AddRemove = 'add';
28            }
29
30            $('.booster-favourite-posts-count').empty();
31            $('.booster-favourite-posts-count').attr('twp-pp-count',ppcount);
32            $('.booster-favourite-posts-count').html(ppcount);
33
34            var pid = $(current).attr('post-id');
35            var ajaxurl = booster_extension_frontend_script.ajax_url;
36            var data = {
37                'action': 'booster_extension_read_later_post_ajax',
38                'pid': pid,
39                'AddRemove': AddRemove,
40                '_wpnonce': booster_extension_frontend_script.ajax_nonce,
41            };
42            $.post(ajaxurl, data, function (response) {
43
44                $('.twp-read-later-notification').empty();
45                $('.twp-read-later-notification').html(response);
46                $('.twp-read-later-notification').fadeIn();
47                setTimeout(function () { 
48                    $('.twp-read-later-notification').fadeOut();
49                }, 3000);
50
51                $('#twp-close-popup').click(function(){
52                    $('.twp-read-later-notification').fadeOut();
53                });
54
55            });
56            
57        });
58
59    });
60}
61
62booster_extension_read_later_posts();
63
64function twp_be_pinterest() {
65    var e = document.createElement('script');
66    e.setAttribute('type', 'text/javascript');
67    e.setAttribute('charset', 'UTF-8');
68    e.setAttribute('src', 'https://assets.pinterest.com/js/pinmarklet.js?r=' + Math.random() * 99999999);
69    document.body.appendChild(e);
70}
71
72function booster_extension_popup_new_window(event, url) {
73    event.preventDefault();
74    var strWindowFeatures = "location=yes,height=570,width=520,scrollbars=yes,status=yes";
75    var LINK = url;
76    window.open(LINK, "_blank", strWindowFeatures);
77}
78
79likedislike();
80
81function likedislike(after_load = '') {
82
83    jQuery(document).ready(function ($) {
84
85        "use scrict";
86        if (after_load) {
87            var click_val = '.' + after_load + ' .twp-like-dislike-button .twp-post-like-dislike';
88        } else {
89            var click_val = '.twp-like-dislike-button .twp-post-like-dislike';
90        }
91
92        $(click_val).click(function () {
93
94            var ajaxurl = booster_extension_frontend_script.ajax_url;
95            var postID = $(this).attr('data-id');
96            var LikeDislike = $(this).attr('id');
97
98            if (LikeDislike == 'twp-post-like') {
99
100                if ($(this).hasClass('cant-like')) {
101                    var count_like = $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html();
102                    $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html(count_like - 1);
103                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").removeClass('cant-like');
104                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").addClass('can-like');
105                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").removeClass('cant-dislike');
106                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").addClass('can-dislike');
107                }else{
108
109                    if ($(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").hasClass('cant-dislike')) {
110                        var count_dlike = $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html();
111                        $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html(count_dlike - 1);
112                    }
113                    var count_like = $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html();
114                    count_like++;
115                    $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html(count_like);
116                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").removeClass('can-like');
117                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").addClass('cant-like');
118                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").removeClass('cant-dislike');
119                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").addClass('can-dislike');
120                }
121
122            }else{
123
124                if ($(this).hasClass('cant-dislike')) {
125                    var count_dislike = $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html();
126                    $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html(count_dislike - 1);
127                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").removeClass('cant-dislike');
128                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").removeClass('cant-like');
129                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").addClass('can-like');
130                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").addClass('can-dislike');
131                }else{
132
133                    if ($(this).closest('.twp-like-dislike-button').find("#twp-post-like").hasClass('cant-like')) {
134                        var count_like = $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html();
135                        $(this).closest('.twp-like-dislike-button').find(".twp-like-count").html(count_like - 1);
136                    }
137
138                    var count_dlike = $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html();
139                    count_dlike++;
140                    $(this).closest('.twp-like-dislike-button').find(".twp-dislike-count").html(count_dlike);
141                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").removeClass('can-dislike');
142                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").removeClass('cant-like');
143                    $(this).closest('.twp-like-dislike-button').find("#twp-post-like").addClass('can-like');
144                    $(this).closest('.twp-like-dislike-button').find("#twp-post-dislike").addClass('cant-dislike');
145
146                }
147
148            }
149
150            var data = {
151                'action': 'booster_extension_like_dislike',
152                'postID': postID,
153                'LikeDislike': LikeDislike,
154                '_wpnonce': booster_extension_frontend_script.ajax_nonce,
155            };
156
157            $.post(ajaxurl, data, function (response) {
158            });
159
160        });
161
162    });
163
164}
165
166booster_extension_post_reaction();
167
168function booster_extension_post_reaction(after_load_reaction = '') {
169    
170    jQuery(document).ready(function ($) {
171
172        "use scrict";
173        if (after_load_reaction) {
174            var click_val = '.' + after_load_reaction + ' .twp-reactions-icons .be-face-icons';
175        } else {
176            var click_val = '.twp-reactions-icons .be-face-icons';
177        }
178        $(click_val).click(function () {
179            if ($(this).hasClass('reacted')) {
180
181                var count_react = $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text();
182                $(this).closest('.twp-reacts-wrap').find('.twp-react-count').empty();
183                $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text(count_react - 1);
184                $(this).addClass('un-reacted');
185                $(this).removeClass('reacted');
186
187                var percent = 0;
188                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
189                    percent += Number($(this).closest('.twp-reacts-wrap').find('.twp-react-count').text());
190                });
191
192                var percent_4 = 0;
193                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
194                    percent_4 += Number($(this).closest('.twp-reacts-wrap').find('.twp-react-count').text());
195                });
196
197                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
198
199                    var percent_5 = $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text();
200                    var percent_6 = (percent_5 * 100) / parseInt(percent_4);
201                    percent_6 = percent_6.toFixed(2);
202                    $(this).closest('.twp-reacts-wrap').find('.twp-react-percent span').empty();
203                    if (!percent_6) {
204                        percent_6 = 0;
205                    }
206                    $(this).closest('.twp-reacts-wrap').find('.twp-react-percent span').text(percent_6);
207
208                });
209
210            } else {
211
212                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
213
214                    if ($(this).find('.be-face-icons').hasClass('reacted')) {
215                        var count_react_1 = $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text();
216                        $(this).closest('.twp-reacts-wrap').find('.twp-react-count').empty();
217                        $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text(count_react_1 - 1);
218                    }
219
220                });
221
222                var count_react = $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text();
223                $(this).closest('.twp-reacts-wrap').find('.twp-react-count').empty();
224                count_react++;
225                $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text(count_react);
226                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap .be-face-icons').not(this).removeClass('reacted');
227                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap .be-face-icons').not(this).addClass('un-reacted');
228                $(this).addClass('reacted');
229                $(this).removeClass('un-reacted');
230
231                var percent_1 = 0;
232                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
233
234                    percent_1 += Number($(this).closest('.twp-reacts-wrap').find('.twp-react-count').text());
235
236                });
237
238                $(this).closest('.twp-reactions-icons').find('.twp-reacts-wrap').each(function () {
239
240                    var percent_2 = $(this).closest('.twp-reacts-wrap').find('.twp-react-count').text();
241                    var percent_3 = (percent_2 * 100) / parseInt(percent_1);
242                    percent_3 = percent_3.toFixed(0);
243                    $(this).closest('.twp-reacts-wrap').find('.twp-react-percent span').empty();
244                    if (!percent_3) {
245                        percent_3 = 0;
246                    }
247                    
248                    $(this).closest('.twp-reacts-wrap').find('.twp-react-percent span').text(percent_3);
249
250                });
251
252            }
253
254            var ajaxurl = booster_extension_frontend_script.ajax_url;
255            var reactdata = $(this).attr('react-data');
256            var postID = $(this).attr('post-id');
257            var data = {
258                'action': 'booster_extension_post_react',
259                'postID': postID,
260                'reactdata': reactdata,
261                '_wpnonce': booster_extension_frontend_script.ajax_nonce,
262            };
263            $.post(ajaxurl, data, function (response) {
264            });
265
266        });
267    });
268}
269
270jQuery(document).ready(function ($) {
271
272        "use scrict";
273
274        $(".twp-review-link").click(function() {
275
276            $('html, body').animate( { scrollTop: $("#comment").offset().top }, 400 );
277            
278        });
279
280        $('.booster-bg-image').each(function () {
281            var src = $(this).children('img').attr('src');
282            $(this).css('background-image', 'url(' + src + ')').children('img').hide();
283        });
284});

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.