PageSourceSearch

https://automonth.ru/wp-content/plugins/cs-ajax-post-nav/assets/js/csapn.js

js automonth.ru collected 2026-10-05 05:04:53 UTC 1,902 bytes, 68 lines download raw bytes

1function csapn_get_previous_post(post_id) {
2    
3    var hr_line = jQuery('#post-divider-'+post_id);
4    
5    jQuery.ajax({
6        url: window.csapn_ajax.ajax_url,
7        type: 'post',
8        dataType: 'json',
9        data: 
10        {
11            action: 'csapn_get_previous_post',
12            post_id: post_id
13        },
14        beforeSend: function() {
15            //container.addClass('loading');
16        },
17        complete: function() {
18            //container.removeClass('loading');
19        },
20        success: function (json) {
21            if ( jQuery('.ajax-post-container').is('div') ) {
22                jQuery('.ajax-post-container').append(json['html']);
23            }
24            else {
25                hr_line.parent('').append('<div class="ajax-post-container">' + json['html'] + '</div>');
26            }
27        }
28    });
29    
30    return false;
31}
32
33
34function check_current_hr() {
35    
36    var scrollTop = jQuery(window).scrollTop();
37    var window_height = jQuery(window).height();
38    
39    jQuery('hr.post-divider').each(function(e){
40        var this_el = jQuery(this);
41        var this_el_top_pos = this_el.offset().top;
42        
43        if ( !this_el.hasClass('csapn-ajax-opened') ) {
44            if (scrollTop + window_height >= this_el_top_pos) {
45                this_el.addClass('csapn-ajax-opened');
46                csapn_get_previous_post(this_el.data('id'));
47            }
48        }
49        else { 
50            if ( !this_el.hasClass('csapn-ajax-url-setted') ) {
51                if (scrollTop > this_el_top_pos) {
52                    this_el.addClass('csapn-ajax-url-setted');
53                    window.history.replaceState('', this_el.data('title'), this_el.data('url'));
54                }
55            }
56        }
57    });
58    
59    return true;
60}
61
62jQuery(window).scroll(function(){
63    check_current_hr();
64});
65
66jQuery(document).ready(function(){ 
67    check_current_hr();
68});

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.