WordPress.org

Plugin Directory

Changeset 1698281 for event-post


Ignore:
Timestamp:
07/18/17 16:14:26 (2 months ago)
Author:
bastho
Message:

Improved search UI

Location:
event-post/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • event-post/trunk/css/eventpost.css

    r1450059 r1698281  
    272272 
    273273} 
     274 
     275/* Search widget */ 
     276body:not(.wp-admin) .eventpost-date-wrapper label, body:not(.wp-admin) .eventpost-datepicker-simple-inputgroup{ 
     277    display: inline; 
     278} 
     279.eventpost-search-item-count{ 
     280    display: inline-block; 
     281    padding: 0.4em 1em; 
     282    border-radius: 3px; 
     283    background:rgba(200, 200, 0, 0.3); 
     284    margin: 1em 0; 
     285} 
  • event-post/trunk/css/eventpost.min.css

    r1450059 r1698281  
    11 
    2 .event_item{display:block;clear:both;font-size:.95em;margin:1em 0}.event_item:after{display:block;clear:both;padding:1px;content:' '}.event_item .event_thumbnail{float:left;margin:0 1em 0 0}.event_map{background:#CCC;border:#999 1px solid}.event_past{font-size:.8em;opacity:.7}.event_item a{text-decoration:none}.event_item h5{font-size:1em;clear:none}.event_item address{line-height:inherit;margin-bottom:0}.event_data{display:block;font-size:.8em;opacity:.9;line-height:1.1em}.event_single{padding:.5em .5em .5em 1.5em;margin:.5em 0;background:#FFF;background:rgba(255,255,255,0.9);border:0;border-left:#FFF 10px solid}.event_data .date{font-size:1.2em}.event_data .time{font-size:1.1em;opacity:.8}.event_data a{font-size:.7em;background:transparent;display:block;padding:.2em .5em;border-radius:.2em;float:right;margin:.1em .2em;text-decoration:none!important;font-weight:900}.event_data a.gps{font-size:1.1em}.event_data.event_category{clear:both}.event_geolist_icon_loader{line-height:5em;background:#CCC;background-color:rgba(0,0,0,0.1);border:#000 1px dotted;text-align:center}.event_geolist_icon_loader .dashicons{line-height:3em}.event_geolist_parsed .event_geolist_icon_loader{display:none}.event_geolist .event_item{display:none}.event_map_popup{background:#f5f5f5;border-radius:0 15px 15px;border:#FFF 1px solid;padding:.5em;color:#000;position:absolute;top:5px;left:5px;width:200px;box-shadow:rgba(0,0,0,0.5) 2px 2px 5px}.event_map_popup a,.event_map_popup a:hover{text-decoration:none;color:#222}.event_map_popup img{float:left;margin-right:4px;max-width:50%;height:auto}.olMap img{max-width:none}.olControlZoom{display:none}.olControlAttribution{right:5px;bottom:5px;font-size:.6em}.eventpost_calendar{width:100%;min-height:100px;border:#CCC 1Px solid;padding:.3em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;position:relative;text-align:center}.eventpost_cal_loader{margin-top:20px}.eventpost_cal_list{position:absolute;width:100%;height:100%;left:0;background:#FFF;padding:.5em;border:#CCC 1px solid;top:0;overflow:auto;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.eventpost_calendar table{width:100%}.eventpost_calendar td,.eventpost_calendar th{text-align:center}.eventpost_calendar table caption{text-align:center}.eventpost_calendar th{font-weight:900}.eventpost_calendar tbody td.event_post_day_now{border:#8C4 2px solid}.eventpost_calendar button{cursor:pointer;display:inline-block;padding:.1em;background:transparent;font-weight:900;box-shadow:none;border:0;border-radius:0}.eventpost_calendar tbody button{padding:.3em 0;background:rgba(0,0,0,0.4);border:transparent 1px solid;width:100%}.eventpost_calendar tbody button:hover,.eventpost_calendar tbody button:focus{border:#FFF 1px solid;border-radius:0}.eventpost_calendar button.eventpost_cal_close{position:absolute;right:2px;top:2px;display:bock;padding:.3em .6em;background:#555;color:#FFF;text-decoration:none}.eventpost_calendar button.eventpost_cal_close:hover,.eventpost_calendar button.eventpost_cal_close:focus{background:#000;color:#FFF}.widget .eventpost_widget *,.widget .eventpost_widget img,.widget .eventpost_widget div,.widget .eventpost_widget a,.widget .eventpost_widget span{max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important}.eventpost-weather-very-hot{background:#f56048}.eventpost-weather-hot{background:#fbaa1b}.eventpost-weather-average{background:#e8d024}.eventpost-weather-cold{background:#60bdfa}.eventpost-weather-very-cold{background:#1c71f2}.eventpost-weather-none{background:grey} 
     2.event_item{display:block;clear:both;font-size:.95em;margin:1em 0}.event_item:after{display:block;clear:both;padding:1px;content:' '}.event_item .event_thumbnail{float:left;margin:0 1em 0 0}.event_map{background:#CCC;border:#999 1px solid}.event_past{font-size:.8em;opacity:.7}.event_item a{text-decoration:none}.event_item h5{font-size:1em;clear:none}.event_item address{line-height:inherit;margin-bottom:0}.event_data{display:block;font-size:.8em;opacity:.9;line-height:1.1em}.event_single{padding:.5em .5em .5em 1.5em;margin:.5em 0;background:#FFF;background:rgba(255,255,255,0.9);border:0;border-left:#FFF 10px solid}.event_data .date{font-size:1.2em}.event_data .time{font-size:1.1em;opacity:.8}.event_data a{font-size:.7em;background:transparent;display:block;padding:.2em .5em;border-radius:.2em;float:right;margin:.1em .2em;text-decoration:none!important;font-weight:900}.event_data a.gps{font-size:1.1em}.event_data.event_category{clear:both}.event_geolist_icon_loader{line-height:5em;background:#CCC;background-color:rgba(0,0,0,0.1);border:#000 1px dotted;text-align:center}.event_geolist_icon_loader .dashicons{line-height:3em}.event_geolist_parsed .event_geolist_icon_loader{display:none}.event_geolist .event_item{display:none}.event_map_popup{background:#f5f5f5;border-radius:0 15px 15px;border:#FFF 1px solid;padding:.5em;color:#000;position:absolute;top:5px;left:5px;width:200px;box-shadow:rgba(0,0,0,0.5) 2px 2px 5px}.event_map_popup a,.event_map_popup a:hover{text-decoration:none;color:#222}.event_map_popup img{float:left;margin-right:4px;max-width:50%;height:auto}.olMap img{max-width:none}.olControlZoom{display:none}.olControlAttribution{right:5px;bottom:5px;font-size:.6em}.eventpost_calendar{width:100%;min-height:100px;border:#CCC 1Px solid;padding:.3em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;position:relative;text-align:center}.eventpost_cal_loader{margin-top:20px}.eventpost_cal_list{position:absolute;width:100%;height:100%;left:0;background:#FFF;padding:.5em;border:#CCC 1px solid;top:0;overflow:auto;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.eventpost_calendar table{width:100%}.eventpost_calendar td,.eventpost_calendar th{text-align:center}.eventpost_calendar table caption{text-align:center}.eventpost_calendar th{font-weight:900}.eventpost_calendar tbody td.event_post_day_now{border:#8C4 2px solid}.eventpost_calendar button{cursor:pointer;display:inline-block;padding:.1em;background:transparent;font-weight:900;box-shadow:none;border:0;border-radius:0}.eventpost_calendar tbody button{padding:.3em 0;background:rgba(0,0,0,0.4);border:transparent 1px solid;width:100%}.eventpost_calendar tbody button:hover,.eventpost_calendar tbody button:focus{border:#FFF 1px solid;border-radius:0}.eventpost_calendar button.eventpost_cal_close{position:absolute;right:2px;top:2px;display:bock;padding:.3em .6em;background:#555;color:#FFF;text-decoration:none}.eventpost_calendar button.eventpost_cal_close:hover,.eventpost_calendar button.eventpost_cal_close:focus{background:#000;color:#FFF}.widget .eventpost_widget *,.widget .eventpost_widget img,.widget .eventpost_widget div,.widget .eventpost_widget a,.widget .eventpost_widget span{max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important}.eventpost-weather-very-hot{background:#f56048}.eventpost-weather-hot{background:#fbaa1b}.eventpost-weather-average{background:#e8d024}.eventpost-weather-cold{background:#60bdfa}.eventpost-weather-very-cold{background:#1c71f2}.eventpost-weather-none{background:grey}body:not(.wp-admin) .eventpost-date-wrapper label,body:not(.wp-admin) .eventpost-datepicker-simple-inputgroup{display:inline}.eventpost-search-item-count{display:inline-block;padding:.4em 1em;border-radius:3px;background:rgba(200,200,0,0.3);margin:1em 0} 
  • event-post/trunk/eventpost.php

    r1698242 r1698281  
    520520            $deps = array('jquery'); 
    521521        } 
    522         if($this->settings['datepicker']=='simple' || (isset($_GET['page']) && $_GET['page']=='event-settings')){ 
     522        if($this->settings['datepicker']=='simple' || !is_admin() || (isset($_GET['page']) && $_GET['page']=='event-settings')){ 
    523523            wp_enqueue_script('jquery-ui-datepicker'); 
    524524            $deps[] = 'jquery-ui-datepicker'; 
     
    530530        } 
    531531        wp_localize_script('event-post-admin', 'eventpost', array( 
     532            'ajaxurl' => admin_url('admin-ajax.php'), 
    532533            'imgpath' => plugins_url('/img/', __FILE__), 
    533534            'date_choose' => '<span class="screen-reader-text">'.__('Choose', 'event-post').'</span><i class="dashicons dashicons-calendar-alt"></i>', 
     
    19231924        $tax = (false !== $tax = filter_input(INPUT_GET, 'tax')) ? $tax : ''; 
    19241925 
     1926        if(empty(str_replace(array('0', ' ', ':', '-'), '', $from))){ 
     1927            $from=false; 
     1928        } 
     1929        if(empty(str_replace(array('0', ' ', ':', '-'), '', $to))){ 
     1930            $to=false; 
     1931        } 
     1932 
    19251933        // Search form 
    19261934        $this->admin_scripts(null, true); 
  • event-post/trunk/js/eventpost-admin.js

    r1505946 r1698281  
    264264    jQuery('#eventaddress_result').html(addr + '<br/><img src="' + eventpost.imgpath + 'loader.gif" alt="..."/>'); 
    265265 
    266     jQuery.post(ajaxurl, data, function (data) { 
     266    jQuery.post(eventpost.ajaxurl, data, function (data) { 
    267267        eventpost_search_form(); 
    268268        var html_ret = ''; 
     
    437437            dateFormat: "yy-mm-dd", 
    438438            autoSize: true 
    439         });/*.change(function () { 
    440             var date_id = jQuery(this).attr('id').replace('_date', ''); 
    441             var hd = jQuery('#' + date_id + '_date_human'); 
    442             if (jQuery(this).val() !== '') { 
    443                 eventpost_concat_time(); 
    444                 eventpost_chkdate(); 
    445                 jQuery.post(ajaxurl, {action: 'EventPostHumanDate', date: eventpost_getdate_sql(date_id)}, function (data) { 
    446                     hd.html(data); 
    447                 }); 
    448             } 
    449         })*/ 
     439        }); 
    450440    } 
    451441    /** 
     
    505495        var hd = jQuery('#' + date_id + '_date_human'); 
    506496        if (jQuery(this).val() !== '') { 
    507             jQuery.post(ajaxurl, {action: 'EventPostHumanDate', date: eventpost_getdate_sql(date_id)}, function (data) { 
     497            jQuery.post(eventpost.ajaxurl, {action: 'EventPostHumanDate', date: eventpost_getdate_sql(date_id)}, function (data) { 
    508498                hd.html(data); 
    509499            }); 
  • event-post/trunk/js/eventpost-admin.min.js

    r1505946 r1698281  
    11 
    2 var ep_map,ep_can_drag_map,ep_view,ep_vectorSource,ep_feature,ep_proj_source,ep_proj_destination,marker,ep_marker,lat,lon,map_id,ep_geoloasked=false,ep_geolocalized=false,ep_currentloc=[0,0];function eventpost_numdate(b){var a=new RegExp("[-: T/]","g");if(b.replace){b=b.replace(a,"")}return parseInt(b)}function eventpost_getdate(a){d=jQuery("#"+a+"_date").val();return d?eventpost_numdate(d.substring(0,16)+":00"):""}function eventpost_getdate_sql(a){return jQuery("#"+a+"_date").val()}function eventpost_concat_time(){jQuery(".eventpost-datepicker-simple-wrap").each(function(){d=jQuery(this).find(".eventpost-datepicker-simple-date").val()+" "+jQuery(this).find(".eventpost-datepicker-simple-hour").val()+":"+jQuery(this).find(".eventpost-datepicker-simple-time").val()+":00";jQuery(this).find(".eventpost-datepicker-simple").val(d)});jQuery(".eventpost-datepicker-native-wrap").each(function(){year=parseInt(jQuery(this).find(".eventpost-datepicker-native-year").val());month=parseInt(jQuery(this).find(".eventpost-datepicker-native-month").val());if(month<10){month="0"+month}day=parseInt(jQuery(this).find(".eventpost-datepicker-native-day").val());if(day<10){day="0"+day}hour=parseInt(jQuery(this).find(".eventpost-datepicker-native-hour").val());if(hour<10){hour="0"+hour}minute=parseInt(jQuery(this).find(".eventpost-datepicker-native-minute").val());if(minute<10){minute="0"+minute}d=year+"-"+month+"-"+day+" "+(isNaN(hour)?"00":hour)+":"+(isNaN(minute)?"00":minute)+":00";jQuery(this).find(".eventpost-datepicker-native").val(d)})}function eventpost_set_allday(){set=jQuery("#event-post-date-all-day").is(":checked");if(set===true){jQuery(".eventpost-datepicker-native-hour, .eventpost-datepicker-native-minute, .eventpost-datepicker-simple-hour, .eventpost-datepicker-simple-time").val("00").trigger("change").parent().hide(300)}else{jQuery(".eventpost-datepicker-native-hour, .eventpost-datepicker-native-minute, .eventpost-datepicker-simple-hour, .eventpost-datepicker-simple-time").parent().show(300)}}function eventpost_chkdate(){var b=eventpost_getdate(eventpost.META_START);var a=eventpost_getdate(eventpost.META_END);if(a===""||b>a){jQuery("#"+eventpost.META_END+"_date").val(jQuery("#"+eventpost.META_START+"_date").val());jQuery("#"+eventpost.META_END+"_date").parents("label").find(".human_date").html(jQuery("#"+eventpost.META_START+"_date").parents("label").find(".human_date").html());jQuery("#"+eventpost.META_END+"_date").parents("label").effect("shake");fields=["simple-date","simple-hour","simple-time","native-year","native-month","native-day","native-hour","native-minute",];for(f in fields){fname=fields[f];jQuery(".eventpost-datepicker-"+fname,jQuery("#"+eventpost.META_END+"_date").parents("label")).val(jQuery(".eventpost-datepicker-"+fname,jQuery("#"+eventpost.META_START+"_date").parents("label")).val())}jQuery(".eventpost-datepicker-control",jQuery("#"+eventpost.META_END+"_date").parents("label")).last().trigger("change");a=b}if(b===0){jQuery(".event-post-event_begin_date-remove").hide()}else{jQuery(".event-post-event_begin_date-remove").show()}if(a===0){jQuery(".event-post-event_end_date-remove").hide()}else{jQuery(".event-post-event_end_date-remove").show()}}function eventpost_getlocation(a){ep_currentloc=[a.coords.latitude,a.coords.longitude]}function eventpost_location(){if("geolocation" in navigator){if(ep_geoloasked===false){ep_geoloasked=true;navigator.geolocation.getCurrentPosition(eventpost_getlocation);var a=navigator.geolocation.watchPosition(function(b){if(ep_geolocalized===false){ep_geolocalized=true;eventpost_getlocation(b);eventpost_apply("",ep_currentloc[0],ep_currentloc[1])}})}else{if(ep_geolocalized===true){eventpost_apply("",ep_currentloc[0],ep_currentloc[1])}}}if(ep_currentloc!=="no"){return ep_currentloc}else{return[lat,lon]}}function eventpost_apply(c,a,b){if(jQuery("#geo_address").val()===""&&c!==""){jQuery("#geo_address").val(c)}jQuery("#geo_latitude").val(a);jQuery("#geo_longitude").val(b).trigger("change");eventpost_search_form()}function eventpost_edit(){sctype=jQuery("#ep_sce_type").val();if(sctype==="list"){jQuery("#ep_sce_maponly").hide();jQuery("#ep_sce_listonly").show()}if(sctype==="map"){jQuery("#ep_sce_maponly").show();jQuery("#ep_sce_listonly").hide()}var a="[events_"+sctype;jQuery("#event_post_sc_edit input,#event_post_sc_edit select").each(function(){if(!jQuery(this).hasClass("event_post_sc_no_use")){var c=jQuery(this).parent().parent().parent().attr("class");var b=jQuery(this).data("att");var e=jQuery(this).val();if(b!==null&&e!==""&&(c==="all"||c===sctype)){a+=" "+b+'="'+e+'"'}}});a+="]";jQuery("#ep_sce_shortcode").html(a)}function eventpost_insertcontent(c){if(IEbof){switchEditors.go("content","html");document.post.content.value+=c;switchEditors.go("content","tinymce")}else{document.post.content.value+=c;if(document.all){value=c;document.getElementById("content_ifr").name="content_ifr";var b=document.getElementById("content_ifr").document.selection;if(tinyMCE.activeEditor.selection){tinyMCE.activeEditor.selection.setContent(c)}else{if(tinyMCE.activeEditor){tinyMCE.activeEditor.execCommand("mceInsertRawHTML",false,c)}else{if(b){var a=b.createRange();a.pasteHTML(value)}else{}}}}else{document.getElementById("content_ifr").name="content_ifr";if(document.content_ifr){document.content_ifr.document.execCommand("insertHTML",false,c)}else{if(document.getElementById("content_ifr").contentDocument){document.getElementById("content_ifr").contentDocument.execCommand("insertHTML",false,c)}else{if(tinyMCE.activeEditor.selection){tinyMCE.activeEditor.selection.setContent(c)}else{tinyMCE.activeEditor.execCommand("mceInsertRawHTML",false,c)}}}}}}function eventpost_search_location(){var b=jQuery("#event_address_search_txt").attr("value");if(b===""){eventpost_search_form();jQuery("#eventaddress_result").append('<span class="alert">'+eventpost.empty_address+"</span>");return}var a={action:"EventPostGetLatLong",q:b};jQuery("#eventaddress_result").html(b+'<br/><img src="'+eventpost.imgpath+'loader.gif" alt="..."/>');jQuery.post(ajaxurl,a,function(e){eventpost_search_form();var g="";for(var c in e){c=e[c];if(c.lat!==undefined&&c.lon!==undefined&&c.display_name!==undefined){g+="<p><a onclick='eventpost_apply(\""+c.display_name.replace("'","&apos;").replace('"',"&quot;")+'","'+c.lat+'","'+c.lon+"\")'>";if(c.icon!==undefined){g+='<img src="'+c.icon+'" alt="'+c.type+'"/>'}g+=c.display_name+"</a></p>"}}jQuery("#eventaddress_result").append(g)},"json")}function eventpost_search_form(){jQuery("#eventaddress_result").html('<input type="search" id="event_address_search_txt" placeholder="'+eventpost.search+'"/><button id="event_address_search_bt" class="button"><span class="dashicons dashicons-search"></span><span class="screen-reader-text">ok</span></button>');jQuery("#event_address_search_txt").on("keydown",function(b){var a=b.keyCode||b.which;if(a===13){b.preventDefault();eventpost_search_location();return false}});jQuery("#event_address_search_bt").click(function(){eventpost_search_location()})}function ep_set_coord(){lat=parseFloat(jQuery("#geo_latitude").val());lon=parseFloat(jQuery("#geo_longitude").val());if(isNaN(lat)){lat=0}if(isNaN(lon)){lon=0}var a=new ol.proj.transform([lon,lat],ep_proj_source,ep_proj_destination);ep_map.getView().setCenter(a);if(lat===0&&lon===0){ep_map.getView().setZoom(1)}else{ep_map.getView().setZoom(12)}}function ep_set_can_drag(a){if(a===true){ep_can_drag_map=true;jQuery(".ep-block-draging").hide();jQuery(".ep-stop-draging").show()}else{ep_can_drag_map=false;jQuery(".ep-block-draging").show();jQuery(".ep-stop-draging").hide()}}jQuery(window).load(function(){jQuery("#event_address_coords").hide();jQuery("#event_address_search").click(function(){if(jQuery("#event_address_coords").css("display")==="block"){jQuery("#event_address_coords").hide(100)}else{jQuery("#event_address_coords").show(100);eventpost_search_form()}});jQuery("#event_address_unsearch").click(function(){jQuery("#event_address_coords").hide()});jQuery("#event_post_sc_edit input,#event_post_sc_edit select").change(function(){eventpost_edit()});jQuery("#ep_sce_submit").click(function(){eventpost_insertcontent(jQuery("#ep_sce_shortcode").html())});jQuery("#ep_sce_nball").click(function(){jQuery("#ep_sce_nb").val("-1");eventpost_edit()});jQuery("#ep_sce_shortcode").click(function(){jQuery(this).select()});eventpost_edit();jQuery("#eventpost-color-dropdown").hide().before(' <a href="#" id="event-color-section-more-btn">'+eventpost.datepickeri18n.edit+"</a>");jQuery("#eventpost-color-preview, #event-color-section-more-btn").click(function(a){a.preventDefault();jQuery("#eventpost-color-dropdown").toggle(300)});jQuery("#eventpost-color-dropdown input").on("change click",function(){jQuery("#eventpost-color-preview").attr("src",jQuery("#eventpost-color-preview").data("url")+jQuery(this).val()+".png");jQuery("#eventpost-color-dropdown").hide(300)});eventpost_chkdate();jQuery(".eventpost-datepicker-simple").each(function(){current_date=jQuery(this).val();current_id=jQuery(this).attr("id");jQuery(this).wrap('<div class="eventpost-datepicker-simple-wrap eventpost-date-wrapper" id="eventpost-datepicker-simple-wrap-'+current_id+'" data-id="'+current_id+'">');jQuery(this).after('<input  class="eventpost-datepicker-control eventpost-datepicker-simple-date" value="'+current_date.substr(0,10)+'" size="10" data-value="'+current_date.substr(0,10)+'"><label><span class="screen-reader-text">'+eventpost.datepickeri18n.hour+'</span><select class="eventpost-datepicker-control eventpost-datepicker-simple-hour" data-value="'+current_date.substr(11,2)+'"></select></label><label><span class="screen-reader-text">'+eventpost.datepickeri18n.minute+'</span><select class="eventpost-datepicker-control eventpost-datepicker-simple-time" data-value="'+current_date.substr(14,2)+'"></select></label>');jQuery(this).hide();for(h=0;h<24;h++){h0=h>9?h:"0"+h;h0h=h0;if(eventpost.lang==="en"){if(h<=12){h0h=h+" AM"}else{h0h=(h-12)+" PM"}}jQuery("#eventpost-datepicker-simple-wrap-"+current_id+" .eventpost-datepicker-simple-hour").append('<option value="'+h0+'"'+(h===parseInt(current_date.substr(11,2))?" selected":"")+">"+h0h+"</option>")}m_sel=false;for(m=0;m<60;m+=5){m0=m>9?m:"0"+m;selected="";if(!m_sel&&Math.abs(m-parseInt(current_date.substr(14,2)))<=3){selected=" selected";m_sel=true}jQuery("#eventpost-datepicker-simple-wrap-"+current_id+" .eventpost-datepicker-simple-time").append('<option value="'+m0+'"'+selected+">"+m0+"</option>")}});if(jQuery.datepicker){jQuery(".eventpost-datepicker-simple-date").wrap('<div class="eventpost-datepicker-simple-inputgroup">').datepicker({firstDay:1,changeYear:true,changeMonth:true,showMonthAfterYear:true,yearRange:"c-5:+5",buttonText:eventpost.date_choose,showOn:"both",dateFormat:"yy-mm-dd",autoSize:true})}jQuery(".eventpost-datepicker-native").each(function(){current_date=jQuery(this).val();current_id=jQuery(this).attr("id");jQuery(this).wrap('<div class="timestamp-wrap eventpost-timestamp-wrap eventpost-date-wrapper eventpost-datepicker-native-wrap" id="eventpost-datepicker-native-wrap-'+current_id+'" data-id="'+current_id+'">');dp_month='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.month+'</span><select class="eventpost-datepicker-control eventpost-datepicker-native-month" id="eventpost-datepicker-native-'+current_id+'-month" data-value="'+current_date.substr(5,2)+'"></select></label>';dp_day='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.day+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-day" id="eventpost-datepicker-native-'+current_id+'-day" value="'+current_date.substr(8,2)+'" data-value="'+current_date.substr(8,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';dp_year='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.year+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-year" id="eventpost-datepicker-native-'+current_id+'-year" value="'+current_date.substr(0,4)+'" data-value="'+current_date.substr(0,4)+'" size="4" maxlength="4" autocomplete="off" /></label>';dp_hour='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.hour+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-hour" id="eventpost-datepicker-native-'+current_id+'-hour" value="'+current_date.substr(11,2)+'" data-value="'+current_date.substr(11,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';dp_minute='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.minute+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-minute" id="eventpost-datepicker-native-'+current_id+'-minute" value="'+current_date.substr(14,2)+'" data-value="'+current_date.substr(14,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';datepickerhtml=eventpost.datepickeri18n.order;datepickerhtml=datepickerhtml.replace("%1$s",dp_month);datepickerhtml=datepickerhtml.replace("%2$s",dp_day);datepickerhtml=datepickerhtml.replace("%3$s",dp_year);datepickerhtml=datepickerhtml.replace("%4$s",dp_hour);datepickerhtml=datepickerhtml.replace("%5$s",dp_minute);jQuery(this).after(datepickerhtml);for(m=1;m<12;m+=1){m0=m>9?m:"0"+m;selected="";if(m0===current_date.substr(5,2)){selected=" selected"}jQuery("select",jQuery(this).parent()).append('<option value="'+m0+'"'+selected+">"+m0+"-"+eventpost.datepickeri18n.months[m]+"</option>")}}).hide();jQuery(".postbox .eventpost-datepicker-simple-wrap, .postbox .eventpost-datepicker-native-wrap").each(function(){jQuery(this).append('<p>\n<a href="#eventpost-edit_timestamp-'+current_id+'" class="save-timestamp hide-if-no-js button">'+eventpost.datepickeri18n.ok+'</a>\n<a href="#eventpost-edit_timestamp-'+current_id+'" class="cancel-timestamp hide-if-no-js button-cancel">'+eventpost.datepickeri18n.cancel+"</a>\n</p>").before('<a href="#'+jQuery(this).attr("id")+'" class="eventpost-datepicker-native-edit-link">'+eventpost.datepickeri18n.edit+"</a>")}).hide();jQuery(".eventpost-datepicker-simple-edit-link, .eventpost-datepicker-native-edit-link").click(function(a){a.preventDefault();jQuery(this).next(".eventpost-datepicker-simple-wrap, .eventpost-datepicker-native-wrap").toggle(300)});jQuery(".eventpost-datepicker-simple-wrap .save-timestamp, .eventpost-datepicker-native-wrap .save-timestamp").click(function(a){jQuery(this).parent().parent().toggle(300)});jQuery(".eventpost-datepicker-simple-wrap .cancel-timestamp, .eventpost-datepicker-native-wrap .cancel-timestamp").click(function(a){jQuery(".eventpost-datepicker-control",jQuery(this).parent().parent()).each(function(){jQuery(this).val(jQuery(this).data("value"))}).last().trigger("change");jQuery(this).parent().parent().toggle(300)});jQuery(".eventpost-datepicker-control").change(function(){eventpost_concat_time();eventpost_chkdate();var a=jQuery(this).parents(".eventpost-date-wrapper").data("id").replace("_date","");var b=jQuery("#"+a+"_date_human");if(jQuery(this).val()!==""){jQuery.post(ajaxurl,{action:"EventPostHumanDate",date:eventpost_getdate_sql(a)},function(c){b.html(c)})}});jQuery("#event-post-date-all-day").on("change click",function(){eventpost_set_allday()});eventpost_set_allday();if(typeof ol!=="undefined"){ep_map=undefined;ep_vectorSource=undefined;ep_feature=undefined;ep_proj_source=new ol.proj.Projection({code:"EPSG:4326"});ep_proj_destination=new ol.proj.Projection({code:"EPSG:900913"});marker="";ep_marker=undefined;lat=0;lon=0;map_id="event-post-map-preview"}jQuery("#"+map_id).each(function(){marker=jQuery(this).data("marker");jQuery(this).css({width:"100%",height:"200px",position:"relative",cursor:"move"});var a=new ol.proj.transform([lon,lat],ep_proj_source,ep_proj_destination);ep_vectorSource=new ol.source.Vector();ep_view=new ol.View({center:a,zoom:12});ep_map=new ol.Map({target:map_id,layers:[new ol.layer.Tile({source:new ol.source.XYZ({urls:eventpost_params.maptiles[eventpost_params.defaulttile]["urls"]})}),new ol.layer.Vector({source:ep_vectorSource})],view:ep_view});ep_map.addControl(new ol.control.Zoom());jQuery(this).append('<img id="'+map_id+'-fixed-marker" src="'+marker+'" tabIndex="-1" draggable="false" alt="position">');jQuery(this).append('<div id="'+map_id+'-startdrag" class="ep-block-draging"><span>'+eventpost.start_drag+"</span></div>");jQuery(this).append('<a id="'+map_id+'-stopdrag" class="ep-stop-draging button button-default">'+eventpost.stop_drag+"</a>");jQuery(this).after('<p style="text-align:center;"><a class="button button-default" id="'+map_id+'-get-current-loc"><span class="dashicons dashicons-marker"></span> '+eventpost.use_current_location+"</a></p>");jQuery("#"+map_id+"-fixed-marker").css({left:jQuery(this).width()/2-16,top:100-16,});jQuery("#"+map_id+"-get-current-loc").click(function(){eventpost_location()});jQuery(".ep-stop-draging").hide().click(function(){ep_set_can_drag(false)});jQuery(".ep-block-draging").click(function(){ep_set_can_drag(true)});ep_map.on("moveend",function(){if(ep_can_drag_map){map_coord=ep_view.getCenter();local_coord=new ol.proj.transform(map_coord,ep_proj_destination,ep_proj_source);if(local_coord[0]===0&&local_coord[1]===0){local_coord=["",""]}jQuery("#geo_longitude").val(local_coord[0]);jQuery("#geo_latitude").val(local_coord[1])}});ep_set_coord();jQuery("#geo_longitude, #geo_latitude").on("change blur",function(){ep_set_coord()})});jQuery("#event_post_date .event-color-section label").on("focus click",function(){jQuery("#"+map_id+"-fixed-marker").attr("src",jQuery("img",jQuery(this)).attr("src"))});if(jQuery("body").hasClass("widgets-php")){jQuery(".widget").each(function(){wid=jQuery(this).attr("id");if(wid.indexOf("eventpostmap")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_map")}else{if(wid.indexOf("eventpostcal")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_cal")}else{if(wid.indexOf("eventpost")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_list")}}}})}}); 
     2var ep_map,ep_can_drag_map,ep_view,ep_vectorSource,ep_feature,ep_proj_source,ep_proj_destination,marker,ep_marker,lat,lon,map_id,ep_geoloasked=false,ep_geolocalized=false,ep_currentloc=[0,0];function eventpost_numdate(b){var a=new RegExp("[-: T/]","g");if(b.replace){b=b.replace(a,"")}return parseInt(b)}function eventpost_getdate(a){d=jQuery("#"+a+"_date").val();return d?eventpost_numdate(d.substring(0,16)+":00"):""}function eventpost_getdate_sql(a){return jQuery("#"+a+"_date").val()}function eventpost_concat_time(){jQuery(".eventpost-datepicker-simple-wrap").each(function(){d=jQuery(this).find(".eventpost-datepicker-simple-date").val()+" "+jQuery(this).find(".eventpost-datepicker-simple-hour").val()+":"+jQuery(this).find(".eventpost-datepicker-simple-time").val()+":00";jQuery(this).find(".eventpost-datepicker-simple").val(d)});jQuery(".eventpost-datepicker-native-wrap").each(function(){year=parseInt(jQuery(this).find(".eventpost-datepicker-native-year").val());month=parseInt(jQuery(this).find(".eventpost-datepicker-native-month").val());if(month<10){month="0"+month}day=parseInt(jQuery(this).find(".eventpost-datepicker-native-day").val());if(day<10){day="0"+day}hour=parseInt(jQuery(this).find(".eventpost-datepicker-native-hour").val());if(hour<10){hour="0"+hour}minute=parseInt(jQuery(this).find(".eventpost-datepicker-native-minute").val());if(minute<10){minute="0"+minute}d=year+"-"+month+"-"+day+" "+(isNaN(hour)?"00":hour)+":"+(isNaN(minute)?"00":minute)+":00";jQuery(this).find(".eventpost-datepicker-native").val(d)})}function eventpost_set_allday(){set=jQuery("#event-post-date-all-day").is(":checked");if(set===true){jQuery(".eventpost-datepicker-native-hour, .eventpost-datepicker-native-minute, .eventpost-datepicker-simple-hour, .eventpost-datepicker-simple-time").val("00").trigger("change").parent().hide(300)}else{jQuery(".eventpost-datepicker-native-hour, .eventpost-datepicker-native-minute, .eventpost-datepicker-simple-hour, .eventpost-datepicker-simple-time").parent().show(300)}}function eventpost_chkdate(){var b=eventpost_getdate(eventpost.META_START);var a=eventpost_getdate(eventpost.META_END);if(a===""||b>a){jQuery("#"+eventpost.META_END+"_date").val(jQuery("#"+eventpost.META_START+"_date").val());jQuery("#"+eventpost.META_END+"_date").parents("label").find(".human_date").html(jQuery("#"+eventpost.META_START+"_date").parents("label").find(".human_date").html());jQuery("#"+eventpost.META_END+"_date").parents("label").effect("shake");fields=["simple-date","simple-hour","simple-time","native-year","native-month","native-day","native-hour","native-minute",];for(f in fields){fname=fields[f];jQuery(".eventpost-datepicker-"+fname,jQuery("#"+eventpost.META_END+"_date").parents("label")).val(jQuery(".eventpost-datepicker-"+fname,jQuery("#"+eventpost.META_START+"_date").parents("label")).val())}jQuery(".eventpost-datepicker-control",jQuery("#"+eventpost.META_END+"_date").parents("label")).last().trigger("change");a=b}if(b===0){jQuery(".event-post-event_begin_date-remove").hide()}else{jQuery(".event-post-event_begin_date-remove").show()}if(a===0){jQuery(".event-post-event_end_date-remove").hide()}else{jQuery(".event-post-event_end_date-remove").show()}}function eventpost_getlocation(a){ep_currentloc=[a.coords.latitude,a.coords.longitude]}function eventpost_location(){if("geolocation" in navigator){if(ep_geoloasked===false){ep_geoloasked=true;navigator.geolocation.getCurrentPosition(eventpost_getlocation);var a=navigator.geolocation.watchPosition(function(b){if(ep_geolocalized===false){ep_geolocalized=true;eventpost_getlocation(b);eventpost_apply("",ep_currentloc[0],ep_currentloc[1])}})}else{if(ep_geolocalized===true){eventpost_apply("",ep_currentloc[0],ep_currentloc[1])}}}if(ep_currentloc!=="no"){return ep_currentloc}else{return[lat,lon]}}function eventpost_apply(c,a,b){if(jQuery("#geo_address").val()===""&&c!==""){jQuery("#geo_address").val(c)}jQuery("#geo_latitude").val(a);jQuery("#geo_longitude").val(b).trigger("change");eventpost_search_form()}function eventpost_edit(){sctype=jQuery("#ep_sce_type").val();if(sctype==="list"){jQuery("#ep_sce_maponly").hide();jQuery("#ep_sce_listonly").show()}if(sctype==="map"){jQuery("#ep_sce_maponly").show();jQuery("#ep_sce_listonly").hide()}var a="[events_"+sctype;jQuery("#event_post_sc_edit input,#event_post_sc_edit select").each(function(){if(!jQuery(this).hasClass("event_post_sc_no_use")){var c=jQuery(this).parent().parent().parent().attr("class");var b=jQuery(this).data("att");var e=jQuery(this).val();if(b!==null&&e!==""&&(c==="all"||c===sctype)){a+=" "+b+'="'+e+'"'}}});a+="]";jQuery("#ep_sce_shortcode").html(a)}function eventpost_insertcontent(c){if(IEbof){switchEditors.go("content","html");document.post.content.value+=c;switchEditors.go("content","tinymce")}else{document.post.content.value+=c;if(document.all){value=c;document.getElementById("content_ifr").name="content_ifr";var b=document.getElementById("content_ifr").document.selection;if(tinyMCE.activeEditor.selection){tinyMCE.activeEditor.selection.setContent(c)}else{if(tinyMCE.activeEditor){tinyMCE.activeEditor.execCommand("mceInsertRawHTML",false,c)}else{if(b){var a=b.createRange();a.pasteHTML(value)}else{}}}}else{document.getElementById("content_ifr").name="content_ifr";if(document.content_ifr){document.content_ifr.document.execCommand("insertHTML",false,c)}else{if(document.getElementById("content_ifr").contentDocument){document.getElementById("content_ifr").contentDocument.execCommand("insertHTML",false,c)}else{if(tinyMCE.activeEditor.selection){tinyMCE.activeEditor.selection.setContent(c)}else{tinyMCE.activeEditor.execCommand("mceInsertRawHTML",false,c)}}}}}}function eventpost_search_location(){var b=jQuery("#event_address_search_txt").attr("value");if(b===""){eventpost_search_form();jQuery("#eventaddress_result").append('<span class="alert">'+eventpost.empty_address+"</span>");return}var a={action:"EventPostGetLatLong",q:b};jQuery("#eventaddress_result").html(b+'<br/><img src="'+eventpost.imgpath+'loader.gif" alt="..."/>');jQuery.post(eventpost.ajaxurl,a,function(e){eventpost_search_form();var g="";for(var c in e){c=e[c];if(c.lat!==undefined&&c.lon!==undefined&&c.display_name!==undefined){g+="<p><a onclick='eventpost_apply(\""+c.display_name.replace("'","&apos;").replace('"',"&quot;")+'","'+c.lat+'","'+c.lon+"\")'>";if(c.icon!==undefined){g+='<img src="'+c.icon+'" alt="'+c.type+'"/>'}g+=c.display_name+"</a></p>"}}jQuery("#eventaddress_result").append(g)},"json")}function eventpost_search_form(){jQuery("#eventaddress_result").html('<input type="search" id="event_address_search_txt" placeholder="'+eventpost.search+'"/><button id="event_address_search_bt" class="button"><span class="dashicons dashicons-search"></span><span class="screen-reader-text">ok</span></button>');jQuery("#event_address_search_txt").on("keydown",function(b){var a=b.keyCode||b.which;if(a===13){b.preventDefault();eventpost_search_location();return false}});jQuery("#event_address_search_bt").click(function(){eventpost_search_location()})}function ep_set_coord(){lat=parseFloat(jQuery("#geo_latitude").val());lon=parseFloat(jQuery("#geo_longitude").val());if(isNaN(lat)){lat=0}if(isNaN(lon)){lon=0}var a=new ol.proj.transform([lon,lat],ep_proj_source,ep_proj_destination);ep_map.getView().setCenter(a);if(lat===0&&lon===0){ep_map.getView().setZoom(1)}else{ep_map.getView().setZoom(12)}}function ep_set_can_drag(a){if(a===true){ep_can_drag_map=true;jQuery(".ep-block-draging").hide();jQuery(".ep-stop-draging").show()}else{ep_can_drag_map=false;jQuery(".ep-block-draging").show();jQuery(".ep-stop-draging").hide()}}jQuery(window).load(function(){jQuery("#event_address_coords").hide();jQuery("#event_address_search").click(function(){if(jQuery("#event_address_coords").css("display")==="block"){jQuery("#event_address_coords").hide(100)}else{jQuery("#event_address_coords").show(100);eventpost_search_form()}});jQuery("#event_address_unsearch").click(function(){jQuery("#event_address_coords").hide()});jQuery("#event_post_sc_edit input,#event_post_sc_edit select").change(function(){eventpost_edit()});jQuery("#ep_sce_submit").click(function(){eventpost_insertcontent(jQuery("#ep_sce_shortcode").html())});jQuery("#ep_sce_nball").click(function(){jQuery("#ep_sce_nb").val("-1");eventpost_edit()});jQuery("#ep_sce_shortcode").click(function(){jQuery(this).select()});eventpost_edit();jQuery("#eventpost-color-dropdown").hide().before(' <a href="#" id="event-color-section-more-btn">'+eventpost.datepickeri18n.edit+"</a>");jQuery("#eventpost-color-preview, #event-color-section-more-btn").click(function(a){a.preventDefault();jQuery("#eventpost-color-dropdown").toggle(300)});jQuery("#eventpost-color-dropdown input").on("change click",function(){jQuery("#eventpost-color-preview").attr("src",jQuery("#eventpost-color-preview").data("url")+jQuery(this).val()+".png");jQuery("#eventpost-color-dropdown").hide(300)});eventpost_chkdate();jQuery(".eventpost-datepicker-simple").each(function(){current_date=jQuery(this).val();current_id=jQuery(this).attr("id");jQuery(this).wrap('<div class="eventpost-datepicker-simple-wrap eventpost-date-wrapper" id="eventpost-datepicker-simple-wrap-'+current_id+'" data-id="'+current_id+'">');jQuery(this).after('<input  class="eventpost-datepicker-control eventpost-datepicker-simple-date" value="'+current_date.substr(0,10)+'" size="10" data-value="'+current_date.substr(0,10)+'"><label><span class="screen-reader-text">'+eventpost.datepickeri18n.hour+'</span><select class="eventpost-datepicker-control eventpost-datepicker-simple-hour" data-value="'+current_date.substr(11,2)+'"></select></label><label><span class="screen-reader-text">'+eventpost.datepickeri18n.minute+'</span><select class="eventpost-datepicker-control eventpost-datepicker-simple-time" data-value="'+current_date.substr(14,2)+'"></select></label>');jQuery(this).hide();for(h=0;h<24;h++){h0=h>9?h:"0"+h;h0h=h0;if(eventpost.lang==="en"){if(h<=12){h0h=h+" AM"}else{h0h=(h-12)+" PM"}}jQuery("#eventpost-datepicker-simple-wrap-"+current_id+" .eventpost-datepicker-simple-hour").append('<option value="'+h0+'"'+(h===parseInt(current_date.substr(11,2))?" selected":"")+">"+h0h+"</option>")}m_sel=false;for(m=0;m<60;m+=5){m0=m>9?m:"0"+m;selected="";if(!m_sel&&Math.abs(m-parseInt(current_date.substr(14,2)))<=3){selected=" selected";m_sel=true}jQuery("#eventpost-datepicker-simple-wrap-"+current_id+" .eventpost-datepicker-simple-time").append('<option value="'+m0+'"'+selected+">"+m0+"</option>")}});if(jQuery.datepicker){jQuery(".eventpost-datepicker-simple-date").wrap('<div class="eventpost-datepicker-simple-inputgroup">').datepicker({firstDay:1,changeYear:true,changeMonth:true,showMonthAfterYear:true,yearRange:"c-5:+5",buttonText:eventpost.date_choose,showOn:"both",dateFormat:"yy-mm-dd",autoSize:true})}jQuery(".eventpost-datepicker-native").each(function(){current_date=jQuery(this).val();current_id=jQuery(this).attr("id");jQuery(this).wrap('<div class="timestamp-wrap eventpost-timestamp-wrap eventpost-date-wrapper eventpost-datepicker-native-wrap" id="eventpost-datepicker-native-wrap-'+current_id+'" data-id="'+current_id+'">');dp_month='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.month+'</span><select class="eventpost-datepicker-control eventpost-datepicker-native-month" id="eventpost-datepicker-native-'+current_id+'-month" data-value="'+current_date.substr(5,2)+'"></select></label>';dp_day='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.day+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-day" id="eventpost-datepicker-native-'+current_id+'-day" value="'+current_date.substr(8,2)+'" data-value="'+current_date.substr(8,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';dp_year='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.year+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-year" id="eventpost-datepicker-native-'+current_id+'-year" value="'+current_date.substr(0,4)+'" data-value="'+current_date.substr(0,4)+'" size="4" maxlength="4" autocomplete="off" /></label>';dp_hour='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.hour+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-hour" id="eventpost-datepicker-native-'+current_id+'-hour" value="'+current_date.substr(11,2)+'" data-value="'+current_date.substr(11,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';dp_minute='<label><span class="screen-reader-text">'+eventpost.datepickeri18n.minute+'</span><input type="text" class="eventpost-datepicker-control eventpost-datepicker-native-minute" id="eventpost-datepicker-native-'+current_id+'-minute" value="'+current_date.substr(14,2)+'" data-value="'+current_date.substr(14,2)+'" size="2" maxlength="2" autocomplete="off" /></label>';datepickerhtml=eventpost.datepickeri18n.order;datepickerhtml=datepickerhtml.replace("%1$s",dp_month);datepickerhtml=datepickerhtml.replace("%2$s",dp_day);datepickerhtml=datepickerhtml.replace("%3$s",dp_year);datepickerhtml=datepickerhtml.replace("%4$s",dp_hour);datepickerhtml=datepickerhtml.replace("%5$s",dp_minute);jQuery(this).after(datepickerhtml);for(m=1;m<12;m+=1){m0=m>9?m:"0"+m;selected="";if(m0===current_date.substr(5,2)){selected=" selected"}jQuery("select",jQuery(this).parent()).append('<option value="'+m0+'"'+selected+">"+m0+"-"+eventpost.datepickeri18n.months[m]+"</option>")}}).hide();jQuery(".postbox .eventpost-datepicker-simple-wrap, .postbox .eventpost-datepicker-native-wrap").each(function(){jQuery(this).append('<p>\n<a href="#eventpost-edit_timestamp-'+current_id+'" class="save-timestamp hide-if-no-js button">'+eventpost.datepickeri18n.ok+'</a>\n<a href="#eventpost-edit_timestamp-'+current_id+'" class="cancel-timestamp hide-if-no-js button-cancel">'+eventpost.datepickeri18n.cancel+"</a>\n</p>").before('<a href="#'+jQuery(this).attr("id")+'" class="eventpost-datepicker-native-edit-link">'+eventpost.datepickeri18n.edit+"</a>")}).hide();jQuery(".eventpost-datepicker-simple-edit-link, .eventpost-datepicker-native-edit-link").click(function(a){a.preventDefault();jQuery(this).next(".eventpost-datepicker-simple-wrap, .eventpost-datepicker-native-wrap").toggle(300)});jQuery(".eventpost-datepicker-simple-wrap .save-timestamp, .eventpost-datepicker-native-wrap .save-timestamp").click(function(a){jQuery(this).parent().parent().toggle(300)});jQuery(".eventpost-datepicker-simple-wrap .cancel-timestamp, .eventpost-datepicker-native-wrap .cancel-timestamp").click(function(a){jQuery(".eventpost-datepicker-control",jQuery(this).parent().parent()).each(function(){jQuery(this).val(jQuery(this).data("value"))}).last().trigger("change");jQuery(this).parent().parent().toggle(300)});jQuery(".eventpost-datepicker-control").change(function(){eventpost_concat_time();eventpost_chkdate();var a=jQuery(this).parents(".eventpost-date-wrapper").data("id").replace("_date","");var b=jQuery("#"+a+"_date_human");if(jQuery(this).val()!==""){jQuery.post(eventpost.ajaxurl,{action:"EventPostHumanDate",date:eventpost_getdate_sql(a)},function(c){b.html(c)})}});jQuery("#event-post-date-all-day").on("change click",function(){eventpost_set_allday()});eventpost_set_allday();if(typeof ol!=="undefined"){ep_map=undefined;ep_vectorSource=undefined;ep_feature=undefined;ep_proj_source=new ol.proj.Projection({code:"EPSG:4326"});ep_proj_destination=new ol.proj.Projection({code:"EPSG:900913"});marker="";ep_marker=undefined;lat=0;lon=0;map_id="event-post-map-preview"}jQuery("#"+map_id).each(function(){marker=jQuery(this).data("marker");jQuery(this).css({width:"100%",height:"200px",position:"relative",cursor:"move"});var a=new ol.proj.transform([lon,lat],ep_proj_source,ep_proj_destination);ep_vectorSource=new ol.source.Vector();ep_view=new ol.View({center:a,zoom:12});ep_map=new ol.Map({target:map_id,layers:[new ol.layer.Tile({source:new ol.source.XYZ({urls:eventpost_params.maptiles[eventpost_params.defaulttile]["urls"]})}),new ol.layer.Vector({source:ep_vectorSource})],view:ep_view});ep_map.addControl(new ol.control.Zoom());jQuery(this).append('<img id="'+map_id+'-fixed-marker" src="'+marker+'" tabIndex="-1" draggable="false" alt="position">');jQuery(this).append('<div id="'+map_id+'-startdrag" class="ep-block-draging"><span>'+eventpost.start_drag+"</span></div>");jQuery(this).append('<a id="'+map_id+'-stopdrag" class="ep-stop-draging button button-default">'+eventpost.stop_drag+"</a>");jQuery(this).after('<p style="text-align:center;"><a class="button button-default" id="'+map_id+'-get-current-loc"><span class="dashicons dashicons-marker"></span> '+eventpost.use_current_location+"</a></p>");jQuery("#"+map_id+"-fixed-marker").css({left:jQuery(this).width()/2-16,top:100-16,});jQuery("#"+map_id+"-get-current-loc").click(function(){eventpost_location()});jQuery(".ep-stop-draging").hide().click(function(){ep_set_can_drag(false)});jQuery(".ep-block-draging").click(function(){ep_set_can_drag(true)});ep_map.on("moveend",function(){if(ep_can_drag_map){map_coord=ep_view.getCenter();local_coord=new ol.proj.transform(map_coord,ep_proj_destination,ep_proj_source);if(local_coord[0]===0&&local_coord[1]===0){local_coord=["",""]}jQuery("#geo_longitude").val(local_coord[0]);jQuery("#geo_latitude").val(local_coord[1])}});ep_set_coord();jQuery("#geo_longitude, #geo_latitude").on("change blur",function(){ep_set_coord()})});jQuery("#event_post_date .event-color-section label").on("focus click",function(){jQuery("#"+map_id+"-fixed-marker").attr("src",jQuery("img",jQuery(this)).attr("src"))});if(jQuery("body").hasClass("widgets-php")){jQuery(".widget").each(function(){wid=jQuery(this).attr("id");if(wid.indexOf("eventpostmap")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_map")}else{if(wid.indexOf("eventpostcal")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_cal")}else{if(wid.indexOf("eventpost")>-1){jQuery(this).addClass("eventpost_admin_widget eventpost_widget_list")}}}})}}); 
Note: See TracChangeset for help on using the changeset viewer.