1/** 2 * WeeklyView Javascript 3 * @version 1.0 4 */ 5jQuery(document).ready(function($){ 6 7 // Hover on event dots tooltips 8 $('body').on('mouseover','em.dayTag',function(){ 9 OBJ = $(this); 10 11 PAR = OBJ.closest('.eventon_weeklyview'); 12 13 p = OBJ.offset(); 14 t = PAR.offset(); 15 w = PAR.width(); 16 xleft = p.left - t.left; 17 xtop = p.top - t.top; 18 19 TITLE = OBJ.data('title'); 20 21 // adjust side of the tooltip 22 if((w/2) > xleft){ 23 HTML = "<em class='evowv_tooltip' style='top:"+(xtop-13)+"px;left:"+(xleft+23)+"px;'>"+TITLE+"</em>"; 24 }else{ 25 26 xright = w - xleft; 27 HTML = "<em class='evowv_tooltip left' style='top:"+(xtop-13)+"px;right:"+(xright+13)+"px;'>"+TITLE+"</em>"; 28 } 29 30 PAR.append(HTML); 31 }); 32 33 $('body').on('mouseout','em.dayTag',function(){ 34 OBJ = $(this); 35 OBJ.closest('.eventon_weeklyview').find('.evowv_tooltip').remove(); 36 }); 37 38 // Click on each week day 39 $('.calendar_header').on('click','.evo_wv_day', function(){ 40 OBJ = $(this); 41 42 // set focus class 43 OBJ.siblings().removeClass('focus'); 44 OBJ.addClass('focus'); 45 46 events = OBJ.attr('data-events'); 47 evCal = OBJ.closest('.ajde_evcal_calendar'); 48 evList = evCal.find('.eventon_events_list'); 49 evList.find('.eventon_list_event').hide(); 50 51 // If set to hide events on initial load 52 evCal.find('.eventon_events_list').removeClass('evowv_hide'); 53 evCal.find('.evowv_click_notice').remove(); 54 55 if( events != 'no'){ 56 events = $.parseJSON(events); 57 $.each(events, function(index, value){ 58 evList.find('.eventon_list_event[data-time='+ value +']').slideDown(); 59 }); 60 }else{ 61 noev = evList.find('div.noevent').length; 62 if(!noev){ 63 tx_noevents = evCal.find('.EVOWV_content').attr('data-txnoevent'); 64 evList.append('<div class="eventon_list_event noevent"><p class="no_events">'+tx_noevents+'</p></div>'); 65 } 66 evList.find('.noevent').slideDown(); 67 } 68 }); 69 70 // Week range selection 71 $('.evoWV').on('mouseover', '.EVOWV_change', function(){ 72 $(this).parent().find('.EVOWV_ranger').show(); 73 }); 74 $('.evoWV').on('mouseleave','.EVOWV_ranger', function(){ 75 $(this).hide(); 76 }); 77 $('.evoWV').on('click','.EVOWV_range_mover',function(){ 78 var OBJ = $(this), 79 RANGES = OBJ.siblings('.EVOWV_ranger_handle').find('ul'); 80 81 CHANGE = 150; 82 TOP = parseInt(RANGES.css('top')); 83 if( OBJ.hasClass('up')){ 84 NEW = TOP+CHANGE; 85 if(NEW>0) return; 86 RANGES.animate({'top':NEW}); 87 }else{ 88 NEW = TOP-CHANGE; 89 if(NEW<-600) return; 90 RANGES.animate({'top':NEW}); 91 } 92 }); 93 // click on a new range 94 $('.evoWV').on('click','.EVOWV_date_ranges li',function(){ 95 var evCal = $(this).closest('.ajde_evcal_calendar'); 96 if(!evCal.hasClass('evoWV')) return; 97 98 new_week(evCal.attr('id'), $(this) ); 99 } ); 100 101 // click on side arrows 102 $('.evoWV').on('click', '.evowv_arrow', function(event){ 103 var evCal = $(this).closest('.ajde_evcal_calendar'); 104 if(!evCal.hasClass('evoWV')) return; 105 106 new_week(evCal.attr('id'), $(this) ); 107 }); 108 109 // When main cal AJAX update events 110 $('body').on('evo_main_ajax_success',function(event, evCal, evodata, ajaxtype, eventList){ 111 112 //console.log(eventList); 113 114 if(evCal.hasClass('evoWV')){ 115 116 EVOWV_content = evCal.find('.EVOWV_content'); 117 // AJAX data array 118 var data_arg = { 119 action: 'weekupate', 120 cal_id: evCal.attr('id'), 121 week_incre: EVOWV_content.attr('data-week_incre'), 122 focus_start_date_range: EVOWV_content.attr('data-start'), 123 focus_end_date_range: EVOWV_content.attr('data-end'), 124 eventsLIST: eventList, 125 shortcode: evCal.evo_shortcodes(), 126 }; 127 $.ajax({
128 beforeSend: function(){ 129 //evCal.find('#eventon_loadbar').show().css({width:'0%'}).animate({width:'100%'}); 130 }, 131 type: 'POST', 132 url:the_ajax_script.ajaxurl, 133 data: data_arg, 134 dataType:'json', 135 success:function(data){ 136 if(data.status=='ok'){ 137 evCal.find('.EVOWV_content').replaceWith(data.header); 138 evCal.find('.eventon_events_list').html(data.events); 139 } 140 141 },complete:function(){ 142 // evCal.evo_loader_animation({direction:'end'}); 143 } 144 }); 145 } 146 }); 147 148 // AJAX: New Week events and data update 149 function new_week(cal_id, OBJ){ 150 var evCal = $('#'+cal_id); 151 152 // run this script only on calendars with Fullcal 153 if(evCal.hasClass('evoWV')){ 154 155 var cal_header = evCal.find('.calendar_header'); 156 var evodata = evCal.find('.evo-data'); 157 var EVOWV_content = evCal.find('.EVOWV_content'); 158 159 // AJAX data array 160 var data_arg = { 161 action: 'new_week', 162 cal_id: cal_id, 163 week_incre: OBJ.attr('data-week'), 164 filters: evCal.evoGetFilters(), 165 shortcode: evCal.evo_shortcodes(), 166 evodata: evCal.evo_getevodata() 167 }; 168 169 $.ajax({
170 beforeSend: function(){ 171 evCal.evo_loader_animation({direction:'start'}); 172 }, 173 type: 'POST', 174 url:the_ajax_script.ajaxurl, 175 data: data_arg, 176 dataType:'json', 177 success:function(data){ 178 179 if(data.status=='ok'){ 180 evCal.find('.EVOWV_content').replaceWith(data.header); 181 evCal.find('.eventon_events_list').html(data.events); 182 evCal.find('.eventon_events_list').removeClass('evowv_hide'); 183 184 // update evo-data 185 evodata.attr({ 186 'data-range_start':data.unix_start, 187 'data-range_end': data.unix_end 188 }); 189 } 190 191 },complete:function(){ 192 evCal.evo_loader_animation({direction:'end'}); 193 } 194 }); 195 } 196 } 197 198 // if mobile check 199 function is_mobile(){ 200 return ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )? true: false; 201 } 202});
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.