| 1 |
jQuery(document).ready(function() { |
| 2 |
wp_insert_click_handler( |
| 3 |
'wp_insert_trackingcodes_google_analytics', |
| 4 |
'Tracking Codes : Google Analytics', |
| 5 |
'480', |
| 6 |
'480', |
| 7 |
function() { |
| 8 |
jQuery('#wp_insert_trackingcodes_analytics_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane'); |
| 9 |
}, |
| 10 |
function() { |
| 11 |
jQuery.post( |
| 12 |
jQuery('#wp_insert_admin_ajax').val(), { |
| 13 |
'action': 'wp_insert_trackingcodes_google_analytics_form_save_action', |
| 14 |
'wp_insert_nonce': jQuery('#wp_insert_nonce').val(), |
| 15 |
'wp_insert_trackingcodes_analytics_status': jQuery('#wp_insert_trackingcodes_analytics_status').prop('checked'), |
| 16 |
'wp_insert_trackingcodes_analytics_code': jQuery('#wp_insert_trackingcodes_analytics_code').val(), |
| 17 |
}, function(response) { } |
| 18 |
); |
| 19 |
}, |
| 20 |
function() { } |
| 21 |
); |
| 22 |
|
| 23 |
wp_insert_click_handler( |
| 24 |
'wp_insert_trackingcodes_header', |
| 25 |
'Tracking Codes : Header', |
| 26 |
jQuery("body").width() * 0.8, |
| 27 |
jQuery("body").height() * 0.8, |
| 28 |
function() { |
| 29 |
jQuery('#wp_insert_trackingcodes_header_code').css('height', (jQuery("body").height() * 0.5)+'px'); |
| 30 |
jQuery('#wp_insert_trackingcodes_header_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane'); |
| 31 |
}, |
| 32 |
function() { |
| 33 |
jQuery.post( |
| 34 |
jQuery('#wp_insert_admin_ajax').val(), { |
| 35 |
'action': 'wp_insert_trackingcodes_header_form_save_action', |
| 36 |
'wp_insert_nonce': jQuery('#wp_insert_nonce').val(), |
| 37 |
'wp_insert_trackingcodes_header_status': jQuery('#wp_insert_trackingcodes_header_status').prop('checked'), |
| 38 |
'wp_insert_trackingcodes_header_code': jQuery('#wp_insert_trackingcodes_header_code').val(), |
| 39 |
}, function(response) { } |
| 40 |
); |
| 41 |
}, |
| 42 |
function() { } |
| 43 |
); |
| 44 |
|
| 45 |
wp_insert_click_handler( |
| 46 |
'wp_insert_trackingcodes_footer', |
| 47 |
'Tracking Codes : Footer', |
| 48 |
jQuery("body").width() * 0.8, |
| 49 |
jQuery("body").height() * 0.8, |
| 50 |
function() { |
| 51 |
jQuery('#wp_insert_trackingcodes_footer_code').css('height', (jQuery("body").height() * 0.5)+'px'); |
| 52 |
jQuery('#wp_insert_trackingcodes_footer_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane'); |
| 53 |
}, |
| 54 |
function() { |
| 55 |
jQuery.post( |
| 56 |
jQuery('#wp_insert_admin_ajax').val(), { |
| 57 |
'action': 'wp_insert_trackingcodes_footer_form_save_action', |
| 58 |
'wp_insert_nonce': jQuery('#wp_insert_nonce').val(), |
| 59 |
'wp_insert_trackingcodes_footer_status': jQuery('#wp_insert_trackingcodes_footer_status').prop('checked'), |
| 60 |
'wp_insert_trackingcodes_footer_code': jQuery('#wp_insert_trackingcodes_footer_code').val(), |
| 61 |
}, function(response) { } |
| 62 |
); |
| 63 |
}, |
| 64 |
function() { } |
| 65 |
); |
| 66 |
}); |