PageSourceSearch

https://www.lamianews.gr/wp-content/plugins/blog-post-calendar-widget/js/wp_calendar.js?ver=6.2.14

js lamianews.gr collected 2026-10-08 08:56:07 UTC 7,701 bytes, 167 lines download raw bytes

1var wp_cal_dates = new Array();
2var wp_cal_posts = new Array();
3var wp_cal_link = '';
4function WP_Cal_open_link(lnk) {
5    document.location.href = lnk;
6}
7
8function WP_Cal_convertMonth(month) {
9    var m = new Array(7);
10    m["1"] = 1;
11    m["2"] = 2;
12    m["3"] = 3;
13    m["4"] = 4;
14    m["5"] = 5;
15    m["6"] = 6;
16    m["7"] = 7;
17    m["8"] = 8;
18    m["9"] = 9;
19    m["10"] = 10;
20    m["11"] = 11;
21    m["12"] = 12;
22    return m[month];
23}
24
25jQuery(document).ready(function(){
26    jQuery('#wp-calendar').datepicker();
27    jQuery('#wp-calendar a.ui-state-active').addClass('wp-calendar-current-date').parent('td').addClass('wp-calendar-today-active');
28    
29    function WP_Cal_get_posts_by_month( month, year){
30        var check_date = month+'-'+year;
31        var found_at = jQuery.inArray( check_date , wp_cal_dates);
32        if( found_at == -1 ){
33            
34            jQuery(".wp_calendar .calendar_wrap_loading").removeClass('calendar_wrap_loading_hide').addClass('calendar_wrap_loading_show');
35            jQuery(".wp_calendar .calendar_wrap_loading").css( "top", "-" + (jQuery('#calendar_wrap table.wp-cal-datepicker-calendar').height() - 1) + "px" );
36            jQuery('#wp-calendar .ui-datepicker-prev').toggle();
37            jQuery('#wp-calendar .ui-datepicker-next').toggle();
38
39            jQuery('#calendar_wrap .calendar-pagi a').each(function(){
40                jQuery(this).removeClass('pagi_state_show').toggle();
41            });
42            
43            wp_cal_dates.push(check_date);
44            jQuery.ajax({
45                type    :   'POST',
46                url     :   wpCalendarObj.ajaxurl,
47                data    :   {
48                    action          :   'wp_calendar_get_posts',
49                    ajax            :   'true',
50                    post            :   wpCalendarObj.wpCalPostname,
51                    future          :   wpCalendarObj.future,
52                    author          :   wpCalendarObj.author,
53                    comment_count   :   wpCalendarObj.comment_count,
54                    taxonomy        :   wpCalendarObj.taxonomy,
55                    term            :   wpCalendarObj.term,
56                    month           :   month,
57                    year            :   year
58                },
59                success :   function( data ){
60                    data = jQuery.parseJSON( data );
61                    var posts = data.posts;
62                    var this_dates = data.classes;
63                    var curr_date = new Array();
64                    var d = '';
65                    jQuery.each( this_dates, function (key , value){
66                        curr_date = key.split('-');
67                        d = curr_date[2];
68                        var element = jQuery('#wp-calendar a.ui-state-default:contains("'+d+'")');
69                        if( element.length > 1 ){
70                            jQuery(element).each( function(){
71                                if( jQuery( this ).text() == d ){
72                                    jQuery( this ).parent('td').addClass('WP-Cal-popup');
73                                }
74                            });
75                            
76                        }
77                        else{
78                            jQuery( element ).parent('td').addClass('WP-Cal-popup');
79                        }
80                    });
81                    jQuery('#wp-calendar .WP-Cal-popup').each( function (){
82                        var year = jQuery(this).attr('data-year');
83                        var month = jQuery(this).attr('data-month');
84                        month = parseInt( month ) + 1;
85                        var day = jQuery(this).find('a.ui-state-default').text(); //alert(month);
86                        var this_date = year + '-' + month + '-' + day;
87                        var innerContent = posts[this_date];
88                        jQuery(this).append( '<div class="wp-cal-tooltip">'+innerContent+'</div>' );
89                    });
90                    var new_data_element = {
91                        month : check_date, 
92                        classes : this_dates, 
93                        posts : posts
94                    };
95                    wp_cal_posts.push( new_data_element );
96                },
97                complete: function() {
98                    jQuery('.ui-datepicker-next, .ui-datepicker-prev, .wp-cal-prev, .wp-cal-next').bind('click');
99                    
100                    jQuery(".wp_calendar .calendar_wrap_loading").removeClass('calendar_wrap_loading_show').addClass('calendar_wrap_loading_hide');
101                    jQuery('#wp-calendar .ui-datepicker-prev').toggle();
102                    jQuery('#wp-calendar .ui-datepicker-next').toggle();
103                    jQuery('#calendar_wrap .calendar-pagi a').each(function(){
104                        jQuery(this).removeClass("pagi_state_hide").toggle();
105                    });
106                }
107            });
108        }
109        else{
110            var this_dates = {};
111            var this_posts = {};
112            
113            jQuery( wp_cal_posts ).each( function (){
114                if( this.month == check_date ){
115                    this_dates = this.classes;
116                    this_posts = this.posts;
117                    var curr_date = new Array();
118                    var d = '';
119                    jQuery.each( this_dates, function (key , value){
120                        curr_date = key.split('-');
121                        d = curr_date[2];
122                        var element = jQuery('#wp-calendar a.ui-state-default:contains("'+d+'")');
123                        if( element.length > 1 ){
124                            jQuery(element).each( function(){
125                                if( jQuery( this ).text() == d ){
126                                    jQuery( this ).parent('td').addClass('WP-Cal-popup');
127                                }
128                            });
129
130                        }
131                        else{
132                            jQuery( element ).parent('td').addClass('WP-Cal-popup');
133                        }
134                    });
135                    jQuery('#wp-calendar .WP-Cal-popup').each( function (){
136                        var year = jQuery(this).attr('data-year');
137                        var month = jQuery(this).attr('data-month');
138                        month = parseInt( month ) + 1;
139                        var day = jQuery(this).find('a.ui-state-default').text();
140                        var this_date = year + '-' + month + '-' + day;
141                        var innerContent = this_posts[this_date];
142                        jQuery(this).append( '<div class="wp-cal-tooltip">'+innerContent+'</div>' );
143                    });
144                }
145            });
146        }
147    }
148
149    jQuery('.ui-datepicker-next, .ui-datepicker-prev, .wp-cal-prev, .wp-cal-next').live('click', function (){
150        var Month = jQuery('#wp-calendar .ui-datepicker-month #monthnum').val();
151        var Year = jQuery('#wp-calendar .ui-datepicker-year').text(); //alert(Month);
152        Month = WP_Cal_convertMonth(Month); //alert(Month);
153        WP_Cal_get_posts_by_month( Month, Year );
154    });
155    var c_date = new Date(), c_month = (parseInt(c_date.getMonth()) + 1), c_year = c_date.getFullYear();
156   
157    WP_Cal_get_posts_by_month(c_month, c_year);
158
159    jQuery('.WP-Cal-popup').live({
160        mouseenter: function() {
161            jQuery(this).find('div').show();
162        },
163        mouseleave: function() {
164            jQuery(this).find('div').hide();
165        }
166    });
167});

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.