add campaign tracking plugin
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
function initMetabox(){
|
||||
console.log("** initMetabox **");
|
||||
|
||||
var dateFormat = "yy-mm-dd",
|
||||
from = $( "#campaign_start_date" )
|
||||
.datepicker({
|
||||
dateFormat: dateFormat
|
||||
})
|
||||
.on( "change", function() {
|
||||
to.datepicker( "option", "minDate", getDate( this ) );
|
||||
}),
|
||||
to = $( "#campaign_end_date" ).datepicker({
|
||||
dateFormat: dateFormat
|
||||
}).on( "change", function() {
|
||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||
});
|
||||
|
||||
function getDate( element ) {
|
||||
var date;
|
||||
try {
|
||||
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||
} catch( error ) {
|
||||
date = null;
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
if($ == undefined){
|
||||
window.$ = jQuery.noConflict();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initMetabox();
|
||||
});
|
||||
1
wp/wp-content/plugins/campaign-tracking/res/js/campaign.metabox.min.js
vendored
Normal file
1
wp/wp-content/plugins/campaign-tracking/res/js/campaign.metabox.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function initMetabox(){console.log("** initMetabox **");var a="yy-mm-dd",d=$("#campaign_start_date").datepicker({dateFormat:a}).on("change",function(){c.datepicker("option","minDate",b(this))}),c=$("#campaign_end_date").datepicker({dateFormat:a}).on("change",function(){d.datepicker("option","maxDate",b(this))});function b(g){var f;try{f=$.datepicker.parseDate(a,g.value)}catch(e){f=null}return f}}if($==undefined){window.$=jQuery.noConflict()}$(function(){initMetabox()});
|
||||
Reference in New Issue
Block a user