1/** 2 * Main javascript for fullCal addon for eventon 3 * @version 2.2.4 4 * @license EventON JavaScript Assets 5 * Copyright (C) 2014-2026 Ashan Jay, AshanJay Designs LLC. 6 * 7 * PROPRIETARY LICENSE - All Rights Reserved 8 * 9 * Permission granted solely for personal use with valid EventON license. 10 * YOU MAY NOT: redistribute, resell, sublicense, or publish these Assets. 11 * 12 * Trademark: "EventON" is a trademark of AshanJay Designs LLC. 13 * Contact: [email protected] 14 * 15 * PROVIDED "AS IS" WITHOUT WARRANTY. VIOLATION MAY RESULT IN LEGAL ACTION. 16 */ 17jQuery(document).ready(function($){ 18 //init(); 19 20 21 const EVO_FullCal = { 22 E:{ body: $('body')}, 23 init() { 24 this.bindEvents(); 25 }, 26 bindEvents() { 27 const self = this; 28 this.E.body 29 .on('evo_init_ajax_success_each_cal', (event, data, calid) => { 30 const $CAL = $('#' + calid); 31 if (!$CAL.hasClass('evoFC')) return; 32 33 const SC = $CAL.evo_shortcode_data(); 34 $CAL.evo_fullcal(); 35 36 if (SC.evc_open === 'no' && SC.load_fullmonth
36=== 'no') { 37 $CAL.find('#evcal_list').addClass('evo_hide'); 38 } 39 40 draw_fullcal($CAL, 'init'); 41 }) 42 43 .on('evo_init_ajax_success', () => { 44 $('.ajde_evcal_calendar.noiajx.evoFC').each((i, el) => { 45 const $cal = $(el); 46 draw_fullcal($cal, 'init'); 47 populate_grid_boxes_with_events($cal, 'init_ajax'); 48 }); 49 }) 50 51 // Main AJAX complete 52 .on('evo_main_ajax_complete', (event, CAL, ajaxtype, data, data_arg) => { 53 const SC = data_arg.shortcode; 54 if (SC.calendar_type === 'fullcal') { 55 populate_grid_boxes_with_events(CAL, 'main_ajax_complete'); 56 } 57 }) 58 } 59 } 60 61 // ====================== PLUGIN ====================== 62 $.fn.evo_fullcal = function() { 63 return this.each(function() { 64 $(this).evo_cal_functions({ return: 'load_shortcodes' }); 65 }); 66 }; 67 68 // Auto initialize the module 69 EVO_FullCal.init(); 70 71 72 73 // DRAW FullCal grid 74 function draw_fullcal( CAL, type ){ 75 76 //return; 77 78 BUS = $('#evo_global_data').data('d'); 79 var eJSON = CAL.find('.evo_cal_events').data('events'); 80 SC = CAL.evo_shortcode_data(); 81 const cal_tz = CAL.evo_get_global({S1:'cal_def',S2:'cal_tz'}); 82 var template_data = {'days':{}}; 83 var days_in_month = CAL.evo_day_in_month({M: SC.fixed_month, Y: SC.fixed_year}); 84 85 86 // day names 87 day_names = {}; 88 _z = start_of_week = BUS.cal_def.start_of_week; 89 for(z=0; z<=6; z++){ 90 day_names[z]= BUS.dms.d3[_z]; 91 _z++; 92 _z = (_z>6)? 0: _z; 93 } 94 95 first_day_index = CAL.evo_get_day_name_index({D:1,M: SC.fixed_month, Y: SC.fixed_year}); 96 boxes = ( first_day_index < start_of_week)? 97 ((7 - start_of_week) +first_day_index): (first_day_index- start_of_week); 98 99 // NOW - current user time 100 M = moment(); 101 var SU = parseInt( SC.focus_start_date_range); 102 var MM = moment.unix( SU ).tz( cal_tz ); 103 template_data['blanks'] = boxes; 104 template_data['day_names'] = day_names; 105 template_data['month'] = SC.fixed_month; 106 107 // month strip class name additions 108 _class_adds_mo = ''; 109 if(SC.style == 'names') _class_adds_mo += ' names'; 110 if(SC.style == 'nobox') _class_adds_mo += ' nobox'; 111 if(SC.heat == 'yes') _class_adds_mo += ' heatmap'; 112 template_data['months_strip_classes'] = _class_adds_mo; 113 114 var boxcount = boxes; 115 var row = 1; 116 var calrows = Math.ceil( (boxes+days_in_month)/7); 117 var boxsin_lastrow = (boxes+days_in_month)%7; 118 var first_row_days = boxes < 7 ? 7 - boxes : 0; // Days in first row 119 var last_row_days = boxsin_lastrow == 0 ? 7 : boxsin_lastrow; 120 121 // each day in month 122 for(var x=1; x<= days_in_month; x++){ 123 124 boxcount++; 125 126 _class_adds = ''; 127 _class_adds += ' '+boxcount +' b'+boxcount; 128 129 if(x == M.get('date') && M.get('month') == (MM.get('month')) && SC.fixed_year == MM.year() ) _class_adds += ' today'; 130 if(x == SC.fixed_day ) _class_adds += ' on_focus'; 131 if(x > (days_in_month-7)) _class_adds += ' bb'; 132 133 // before last row 134 if(boxsin_lastrow != 0 && row == calrows-1 && x <= (days_in_month-7)) _class_adds += ' blsr'; 135 136 137 // last row cell 138 if( boxcount> 21 && calrows == 4 && boxsin_lastrow != 0) _class_adds += ' nobrt'; 139 if( boxcount> 28 && calrows == 5 && boxsin_lastrow != 0) _class_adds += ' nobrt'; 140 if( boxcount> 35 && calrows == 6 && boxsin_lastrow != 0) _class_adds += ' nobrt'; 141 142 143 // last day of the week 144 if( boxcount %7 == 0){ 145 _class_adds += ' lstdw'; 146 row++; 147 } 148 149 // first box 150 if( x == 1)_class_adds += ' frs'; 151 // top left day cell 152 if( 8 - boxes == x && x < 8) _class_adds += ' tl'; 153 154 // start of row 155 if (boxcount % 7 == 1 ) _class_adds += ' str'; 156 157 // right bottom box 158 if( boxcount %7 == 0 && row == calrows && boxsin_lastrow != 0) _
158class_adds += ' rb'; 159 160 // bottom left box 161 if( boxcount == 29 && row == calrows) _class_adds += ' lb'; 162 if( boxcount == 36 && row == calrows) _class_adds += ' lb'; 163 164 if(first_row_days == 1 && x == 1) _class_adds += ' top2'; 165 if(last_row_days == 1 && x == days_in_month) _class_adds += ' bot2'; 166 167 168 template_data['days'][x] = {}; 169 template_data['days'][x]['cls'] = _class_adds; 170 template_data['days'][x]['su'] = MM.unix(); 171 template_data['days'][x]['e'] = {}; 172 173 MM.add(1,'d'); 174 175 template_data['days'][x]['eu'] = MM.unix() - 1; 176 } 177 178 _html_grid = get_evo_temp_processed_html( template_data , 'evofc_grid'); 179 180 // replace or insert HTML 181 if(type == 'replace'){ 182 return _html_grid; 183 }else if( type == 'insert'){ 184 185 _html_base = get_evo_temp_processed_html( template_data , 'evofc_base'); 186 ELM = CAL.find('#eventon_loadbar_section'); 187 ELM.after( _html_base ); 188 CAL.find('.evofc_grid').html( _html_grid ); 189 CAL.find('.evofc_month').addClass('focus'); 190 }else{ 191 //_html_base = get_evo_temp_processed_html( template_data , 'evofc_base'); 192 //ELM = CAL.find('#eventon_loadbar_section'); 193 //ELM.after( _html_base ); 194 CAL.find('.evofc_grid').html( _html_grid ); 195 CAL.find('.evofc_month').addClass('focus'); 196 } 197 198 // update other calendar content 199 CAL.find('.evofc_months_strip').addClass( _class_adds_mo ); 200 stop_grid_loading( CAL); 201 CAL.find('.evofc_month_grid').fadeIn(); 202 203 if( type != 'replace') populate_grid_boxes_with_events( CAL , type); 204 } 205 function get_evo_temp_processed_html( template_data, part){ 206 BUS = $('#evo_global_data').data('d'); 207 template = Handlebars.compile( BUS.temp[ part ] ); 208 return template( template_data ); 209 } 210 function activate_grid_loading(CAL){ 211 CAL.find('.evofc_month_grid').addClass( 'evofc_loading_grid' ); 212 CAL.find('.evofc_day').html(` 213 <span class='evo_day_in evo_ajax_load_events evofc_pre_loader'> 214 <span class='evo_day_in_num evoboxbb' style=' max-width: 33%;'></span> 215 <span class='evo_day_in_num evoboxbb'></span> 216 <span class='evo_day_in_num evoboxbb'></span> 217 </span>`); 218 } 219 function stop_grid_loading( CAL){ 220 CAL.find('.evofc_pre_loader').remove(); 221 CAL.find('.evofc_month_grid').removeClass( 'evofc_loading_grid' ); 222 } 223 // populate the grid boxes with events JSON 224 function populate_grid_boxes_with_events(CAL, type){ 225 226 var eJSON = CAL.find('.evo_cal_events').data('events'); 227 grid = CAL.find('.evofc_month_grid'); 228 SC = CAL.evo_shortcode_data(); 229 var cal_events = CAL.find('.eventon_list_event'); 230 cal_events.hide(); 231 232 var _txt_more = CAL.evo_get_txt({V:'more'}); 233 234 let _show_ehover_class = ('ehover' in SC && SC.ehover == 'event') ? 'eH': ''; 235 236 // EACH DAY 237 max_events = 0; days = {}; 238 grid.find('.evofc_day').each(function(index){ 239 O = $(this); 240 241 EC = 0; 242 O_span = O.find('span.day_evs'); 243 O_span.html(''); 244 O.removeClass('has_events'); 245 246 // each day unix 247 SU = parseInt(O.data('su')); 248 EU = parseInt(O.data('eu')); 249 250 // record events for this date 251 var this_events = []; 252 253 // run thru each event in calendar month 254 cal_events.each(function(index, elm){ 255 var ED = $(elm).evo_cal_get_basic_eventdata(); 256 if(!ED) return; 257 258 ESU = ED.unix_start; EEU = ED.unix_end; 259 260 var inrange = CAL.evo_is_in_range({ 261 'S': SU, 'E': EU, 'start': ESU,'end':EEU 262 }); 263 264 // if event is not in range --> skip 265 if(!inrange) return; 266 267 // record this event for the date 268 this_events.push( $(elm).attr('id') ); 269 270 _color = parseInt( ED.hex_color, 16) > 0xffffff/2 ? '#000':'#fff'; 271 272 EC++; 273 O.addClass('has_events'); 274 O.removeClass('noE'); 275 276 // Names in the grid 277 if( SC.style == 'names'){ 278 if(EC <3){ 279 280 var _day_class = ''; 281 282 if(ESU < SU && SU < EEU && EEU <=EU) _day_class = 'muld_e'; 283 if(ESU < SU && EU < EEU ) _day_class = 'muld_m'; 284 if(SU <= ESU && EU < EEU ) _day_class = 'muld_s'; 285 if(ESU < SU && O.hasClass('d_1')) _day_class += ' strpr'; 286 287 var _event_title = ED.event_title; 288 var classes = [ED.uID, _day_class, _show_ehover_class].filter(
288Boolean); // Filter out empty strings 289 var classString = classes.join(' '); 290 291 var _content = "<i class='"+ classString + "' style='background-color:"+ ED.hex_color +"; color:"+_color+"' title='"+ _event_title +"' data-eid='"+ED.uID+"'>"+ _event_title +"</i>"; 292 293 // if previous date has same event 294 if(O.prev().find('i.'+ ED.uID ).length>0){ 295 prev_ind = O.prev().find('i.'+ ED.uID).index(); 296 if( prev_ind == 0){ 297 O_span.prepend( _content); 298 }else{ 299 // prev ind = 1 300 if( O_span.find('i').length==0){ 301 var prev_i = O.prev().find('i.'+ ED.uID); 302 O.prev().find('span.day_evs').prepend( prev_i); 303 } 304 O_span.append( _content); 305 } 306 }else{ 307 O_span.append( _content); 308 } 309 }else{ 310 if(O.find('b').length == 0) O.find('span.day_evs').append( "<b>+ "+_txt_more+"</b>"); 311 } 312 }else{ 313 if(EC >=5 ){ 314 const _EC = EC > 9 ? '': EC; 315 O_span.html( "<b class='evofc_oversz'>+ "+_EC+"</b>"); 316 }else{ 317 318 //console.log(ED); 319 _event_title = ED.event_title; 320 var classes = [ED.uID, _show_ehover_class].filter(Boolean); 321 var classString = classes.join(' '); 322 323 //console.log(ED); 324 O_span.append( "<i class='"+ classString + "' style='background-color:"+ ED.hex_color +"; color:"+_color+"' title='"+ _event_title +"' data-eid='"+ED.uID+"'></i>"); 325 } 326 } 327 if( EC> max_events) max_events = EC; 328 329 }); 330 331 O.data('e', this_events); 332 333 if( EC == 0) O.addClass('noE'); 334 days[index] = EC; 335 }); 336 337 // heat map coloring 338 if( SC.heat =='yes'){ 339 var grid_data = grid.data('d'); 340 var color = 'heat_c' in grid_data && grid_data.heat_c ? grid_data.heat_c : '4ccdea'; 341 342 grid.find('.evofc_day').each(function(index){ 343 var events = days[index]; 344 var opacity = ( events/ max_events).toFixed(2) ; 345 346 if(events>0){ 347 if( $(this).find('em.hm').length> 0){ 348 $(this).find('em.hm').css({ 349 'background-color': '#'+ color, 350 'opacity': opacity 351 }); 352 }else{ 353 $(this).append('<em class="hm" style="'+ 'background-color:#'+ color +'; opacity:'+ opacity +'"></em>'); 354 } 355 }else{ 356 $(this).find('em.hm').remove(); 357 } 358 }); 359 } 360 361 362 setTimeout(function(){
363 if(SC.load_fullmonth == 'no') load_correct_events( CAL, type); 364 if( SC.load_fullmonth == 'yes') { 365 CAL.find('.eventon_list_event').show(); 366 } 367 },300); 368 369 // trigger 370 $('body').trigger('evofc_calendar_populated',[ CAL , type]); 371 } 372 373 374 375 // GENERAL Interactions 376 // fix ratios for resizing the calendar size 377 $( window ).resize(function() { $('body').trigger('evofc_resize_cal_grid'); }); 378 // CLICK on a day 379 $('body').on( 'click','.evofc_day',function(){ clickon_day($(this)); }); 380 381 function clickon_day(obj){ 382 if( obj.hasClass('evo_fc_empty')) return; 383 384 CAL = obj.closest('.ajde_evcal_calendar'); 385 SC = CAL.evo_shortcode_data(); 386 CAL.evo_update_cal_sc({ F:'fixed_day', V:obj.data('d') }); 387 388 load_correct_events( CAL ,'click'); 389 } 390 391 // load correct events in event list based on fixed day 392 function load_correct_events(CAL, type){ 393 SC = CAL.evo_shortcode_data(); 394 const OD = CAL.evo_get_OD(); 395 396 397 if(type == 'init' && SC.grid_ux == 2) return; 398 399 fixed_day = parseInt(SC.fixed_day); 400 401 var box_obj = CAL.find('.evofc_day.d_'+fixed_day); 402 box_obj.siblings('.evofc_day').removeClass('on_focus'); 403 box_obj.addClass('on_focus'); 404 405 // clicked day unix 406 SU = parseInt(box_obj.data('su')); 407 EU = parseInt(box_obj.data('eu')); 408 409 // get in range events from calendar 410 R = CAL.evo_cal_events_in_range({ 411 S: SU, 412 E: EU, 413 closeEC: (SC.evc_open=='yes'? false:true), 414 }); 415 416 // grid interaction 417 if( SC.grid_ux == 1){ 418 $([document.documentElement, document.body]).animate({ 419 scrollTop: CAL.find('#evcal_list').offset().top - 50 420 }, 200); 421 } 422 423 // if no events 424 var inside_content = ''; 425 if( R.count == 0){ 426 txt = CAL.evo_get_global({S1:'txt',S2:'no_events'}); 427 inside_content = "<div class='eventon_list_event no_events'><p class='no_events' >"+ txt +"</p></div>"; 428 } 429 430 // load events in lightbox 431 if(SC.grid_ux == 2 && type != 'init' ) { 432 433 // hide event list 434 CAL.find('.eventon_events_list').hide(); 435 436 // if load all events
437 if( SC.load_fullmonth == 'yes' || type =='click'){ 438 439 let content = ('count' in R && R.count > 0) ? R.html : inside_content; 440 441 442 443 // Create temp DOM, modify, and extract HTML in one go 444 const modifiedContent = $('<div>') 445 .html(content) 446 .find('.eventon_list_event') 447 .addClass(function() { 448 return CAL.attr('class').split(' ').find(cls => cls.startsWith('etttc_')) || ''; 449 }) 450 .show() 451 .end() // go back to the root <div> 452 .html(); // get final HTML 453 454 // Then use it 455 $('.evofc_lightbox').evo_append_lb({ C: modifiedContent, CAL: CAL }); 456 457 CAL.evo_lightbox_open({ 458 lbdata: { 459 content: modifiedContent, 460 class: 'evofc_lb', 461 additional_class: 'eventon_events_list evcal_eventcard', 462 padding:'evopad0' 463 } 464 }); 465 466 } 467 468 // show events as list below calendar 469 }else{ 470 eList = CAL.find('#evcal_list'); 471 472 if(R.count == 0){ 473 if(eList.has('.no_events.eventon_list_event').length){ 474 eList.find('.no_events.eventon_list_event').show(); 475 }else{ 476 eList.append( inside_content ); 477 } 478 }else{ 479 $.each(R.json,function(i,evid){ 480 eList.find('#event_'+i).show(); 481 }); 482 CAL.find('.eventon_list_event.no_events').remove(); 483 } 484 CAL.find('#evcal_list').removeClass('evo_hide').show(); 485 } 486 487 // trigger 488 $('body').trigger('evofc_calendar_events_loaded',[ CAL , type]); 489 } 490 491 // BODY GEN 492 $('body') 493 // calendar view switching 494 .on('evo_vSW_clicked_before_ajax',function(event, O, CAL, DD, reload_cal_data){ 495 if(!(O.hasClass('evofc'))) return; 496 var SC = CAL.evo_shortcode_data(); 497 498 CAL.evo_update_cal_sc({F:'calendar_type', V: 'fullcal'}); 499 500 }) 501 .on('evo_vSW_clicked',function(event, OBJ, CAL){ 502 if(!(OBJ.hasClass('evofc'))) return; 503 504 CAL.evo_update_cal_sc({F:'calendar_type', V: 'fullcal'}); 505 506 const grid_content = draw_fullcal( CAL ,'insert' ); 507 508 509 510 }) 511 // resize fullcal grid 512 .on('evofc_resize_cal_grid', function(){ 513 console.log('e'); 514 $('.eventon_fullcal').each(function(){ 515 var cal_width = $(this).width(); 516 var strip = $(this).find('.evofc_months_strip'); 517 var multiplier = strip.attr('data-multiplier'); 518 519 if(multiplier<0){ 520 strip.width(cal_width*3).css({'margin-left':(multiplier*cal_width)+'px'}); 521 } 522 //console.log(cal_width); 523 $(this).find('.evofc_month').width(cal_width); 524 $(this).find('.evofc_grid.evoposr').width(cal_width); 525 }); 526 }) 527 // event hover infox box 528 .on('mouseover', 'i.eH', function (){ 529 const $el = $(this); 530 const eid = $el.data('eid'); 531 const CAL = $el.closest('.ajde_evcal_calendar'); 532 const _fc_grid_O = CAL.find('.evofc_month_grid'); 533 const eventObj = CAL.find('#event_' + eid); 534 const infoWindow = CAL.find('.evofc_einfobox'); 535 const infoWindowContent = CAL.find('.evofc_einfobox_in'); 536 const dateBox = $el.closest('.evofc_day'); 537 538 let eventdata = eventObj.evo_cal_get_basic_eventdata(); 539 if( !eventdata) return; 540 541 542 const infoboxHtml = ` 543 `+ ('image_url' in eventdata && eventdata.image_url !== '' && eventdata.image_url !== undefined ? `<div class='evofc_iw_img evomarb5' style='background:url(${eventdata.image_url}'></div>`:'') + 544 `<p class='evoff_1'>${eventdata.event_title}</p>` 545 + ( 'time_text' in eventdata && eventdata.time_text !== ''? `<p class='evoff_2 evofz12'>${eventdata.time_text}</p>`:'') 546 547 + ( 'location' in eventdata && eventdata.location !== ''? `<p class='evoff_2 evofz12'><i class='fa fa-map-marker evomarr5'></i> ${eventdata.location}</p>`:'' ) 548 ; 549 550 // Set infobox content and show it 551 infoWindowContent.html(infoboxHtml); 552 infoWindow.removeClass('evodni'); 553 554 // Calculate positioning 555 let leftOff, topOff; 556 557 const elOffset = $el.offset(); 558 const elPosition = $el.position(); 559 const elWidth = $el.outerWidth(); 560 const elHeight = $el.outerHeight(); 561 const gridOffset = _fc_grid_O.offset(); 562 const boxHeight= dateBox.outerHeight(); 563 const boxOffset = dateBox.offset(); 564 const boxPosition = dateBox.position(); 565 const infoWindowWidth = infoWindow.outerWidth(); 566 const infoWindowHeight = infoWindow.outerHeight(); 567 568 leftOff = elWidth > 9 ? elOffset.left - 80: elOffset.left - 140; 569 leftOff = boxPosition.left; 570 topOff = boxPosition.top - infoWindowHeight + 40; 571 572 573 // Apply positioning 574 infoWindow.css({ 575 left: leftOff, 576 top: topOff 577 }); 578 }) 579 .on('mouseout', 'i.eH', function (e){ 580 event.stopPropagation(); 581 582 CAL.find('.evofc_einfobox').addClass('evodni'); 583 }) 584 585 // tool tips on calendar dates 586 .on('mouseover' , '.evofc_day.has_events', function(){ 587 var O = $(this); 588 var CAL = O.closest('.ajde_evcal_calendar'); 589 var SC = CAL.evo_shortcode_data(); 590 var _fc_grid_O = CAL.find('.evofc_month_grid'); 591 const box_index = O.index(), 592 box_height = O.height(); 593 594 // event names 595 if(SC.hover =='numname'){ 596 597 R = CAL.evo_cal_events_in_range({ 598 S: parseInt(O.data('su')), E: parseInt(O.data('eu')), 599 hide:false}); 600 _events_html = ''; 601 602 titletip = CAL.find('.evofc_title_tip'); 603 604 // events count 605 CAL.find('.evofc_ttle_cnt').html( R.count); 606 607 // event names 608 _C = 0; 609 $.each( R.json, function(key, ED){ 610 if(_C>2) return; 611 _events_html += "<li style='border-left-color:#"+ ED.hex_color +"'>"+ ED.event_title +"</li>"; 612 _C++; 613 });
614 615 // show more events text only for events more than 3 616 if( R.count > 3){ 617 _events_html += "<li>+ "+ CAL.evo_get_global({S1:'txt',S2:'more'}) +"</li>"; 618 } 619 CAL.find('.evofc_ttle_events').html( _events_html ); 620 621 // Positioning 622 TITLETIP_HEIGHT = titletip.height(); 623 624 var offs = O.position(); 625 width = $('.eventon_fullcal').width(); 626 var dayh = CAL.find('.eventon_fc_daynames').height(); 627 628 var _TOP = (offs.top + dayh - TITLETIP_HEIGHT); 629 630 631 if( O.offset().left < ( _fc_grid_O.offset().left + _fc_grid_O.width() - (O.width()*4) ) ){ 632 titletip.removeClass('lefter'); 633 leftOff = offs.left + O.outerWidth(); 634 rightOFF = 'initial'; 635 }else{ 636 titletip.addClass('lefter'); 637 leftOff = 'initial'; 638 rightOFF = width- offs.left ; 639 } 640 641 // top row boxes 642 if( box_index <8){ 643 titletip.addClass('topper'); 644 _TOP = offs.top + dayh + O.outerHeight(); 645 }else{ 646 titletip.removeClass('topper'); 647 } 648 649 titletip.css({ 650 top: _TOP, 651 left:leftOff, 652 right:rightOFF 653 }) 654 .stop(true, false) 655 .fadeIn('fast'); 656 657 }else{ // just event count number 658 const popup = CAL.find('.evoFC_tip'); 659 const offs = O.position(); 660 const elWidth = O.outerWidth(); 661 var leftOff =''; 662 663 var dayh = _fc_grid_O.find('.eventon_fc_daynames') 664 .height(); 665 666 if(O.offset().left < ( _fc_grid_O.offset().left + _fc_grid_O.width() - (O.width()*3) ) ){ 667 popup.removeClass('leftyy'); 668 leftOff = offs.left + elWidth - 2 ; 669 }else{ 670 popup.addClass('leftyy'); 671 leftOff = offs.left - 17; 672 } 673 popup.css({top: (offs.top + dayh), left:leftOff}); 674 popup.html( O.data('e').length ).stop(true, false).fadeIn('fast'); 675 } 676 677 }) 678 .on('mouseout' , '.evofc_day.has_events', function(e){ 679 event.stopPropagation(); 680 //return; 681 682 var relatedTarget = $(event.relatedTarget); 683 var target = $(this); 684 685 //if (relatedTarget.closest('.evofc_day').length == 0) { return; } 686 687 O = $(this); 688 CAL = O.closest('.ajde_evcal_calendar'); 689 SC = CAL.evo_shortcode_data(); 690 691 692 if(SC.hover=='numname'){ 693 CAL.find('.evofc_title_tip').removeClass('lefter'); 694 CAL.find('.evofc_title_tip').stop(true, false).hide(); 695 }else{ 696 var popup = CAL.find('.evoFC_tip'); 697 popup.removeClass('leftyy'); 698 popup.stop(true, false).hide(); 699 } 700 }); 701 702 // AJAX Operations 703 // SUCCESS 704 $('body') 705 .on('evo_main_ajax_before_fnc', function(e, CAL, ajaxtype, data_arg){ 706 if( data_arg.shortcode.calendar_type == 'fullcal'){ 707 activate_grid_loading( CAL ); 708 } 709 }) 710 .on('evo_main_ajax_success',function(event, CAL, ajaxtype, data, data_arg){ 711 //return; 712 if( data.SC.calendar_type == 'fullcal'){ 713 714 715 SC = data.SC; 716 717 _month_grid_adds = draw_fullcal( CAL, 'replace' ); 718 719 var this_section = CAL.find('.eventon_fc_days'); 720 var strip = CAL.find('.evofc_months_strip'); 721 var grid = CAL.find('.evofc_grid'); 722 var cur_margin = parseInt(strip.css('marginLeft')); 723 var month_width = parseInt(strip.parent().outerWidth()); 724 var month_height = strip.find('.evofc_month').height(); 725 const gridWidth = grid.width(); 726 var months = strip.find('.evofc_month').length; 727 var super_margin; 728 var pre_elems = strip.find('.focus').prevAll().length; 729 var next_elems = strip.find('.focus').nextAll().length; 730 731 // Set strip to match single month dimensions 732 grid.css({ 733 width: gridWidth, height: month_height, overflow: 'hidden' 734 }); 735 736 // build out month grid animation 737 if( data_arg.direction =='next' || ajaxtype=='jumper' || ajaxtype == 'today'){ 738 739 // Append new month with translateX(month_width) 740 grid.append(_month_grid_adds); 741 strip.find('.evofc_month').width(gridWidth).css({ transform: 'translateX(0px)' });; 742 743 // Animate both months 744 grid.find('.evofc_month').addClass('evofc_transition') 745 .css({ transform: 'translateX(-' + gridWidth + 'px)' }); 746 747 setTimeout(() => { 748 //return; 749 // Remove old month, reset transform 750 grid.find('.evofc_month').removeClass('evofc_transition'); 751 grid.find('.evofc_month:first-child').remove(); 752 grid.find('.evofc_month').css({ transform: 'translateX(0)' }); 753 grid.find('.evofc_month').removeClass('focus').addClass('focus');
754 strip.attr({ 'data-multiplier': '0' }); 755 grid.css({height:'auto'}); 756 757 // Load events 758 // populate_grid_boxes_with_events(CAL, 'main_ajax'); 759 }, 200); // Match transition duration 760 761 762 }else if( data_arg.direction =='prev'){ 763 // Prepend new month with translateX(-month_width) 764 grid.prepend(_month_grid_adds); 765 grid.find('.evofc_month').width(gridWidth).css({ transform: 'translateX(-' + gridWidth + 'px)' }); 766 767 // Animate both months to translateX(0) 768 setTimeout(() => { 769 grid.find('.evofc_month').addClass('evofc_transition').css({ transform: 'translateX(0)' }); 770 }, 10); // Small delay to ensure transition applies 771 772 setTimeout(() => { 773 //return; 774 // Remove old month, reset transform 775 grid.find('.evofc_month:last-child').remove(); 776 grid.find('.evofc_month').css({ transform: 'translateX(0)' }); 777 grid.find('.evofc_month').removeClass('evofc_transition'); 778 grid.find('.evofc_month').removeClass('focus').addClass('focus'); 779 strip.attr({ 'data-multiplier': '0' }); 780 grid.css({height:'auto'}); 781 782 // Load events 783 // populate_grid_boxes_with_events(CAL, 'main_ajax'); 784 }, 200); // Match transition duration 785 786 }else{// no month change - filter, search 787 //console.log(_month_grid_adds); 788 grid.find('.evofc_month').replaceWith( _month_grid_adds ); 789 grid.find('.evofc_month[month='+ SC.fixed_month +']').addClass('focus'); 790 grid.css({height:'auto'}); 791 } 792 793 strip.find('.evofc_month').width(gridWidth); 794 795 796 stop_grid_loading( CAL ); 797 } 798 }); 799 800 801 // if mobile check 802 function is_mobile(){ 803 return ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )? true: false; 804 } 805 function is_android(){ 806 var ua = navigator.userAgent.toLowerCase(); 807 return ( ua.indexOf("android") > -1)? true: false; 808 } 809 810});
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.