| 1 |
function wp_insert_inpostads_primary_ad_code_location_change_action(identifier) { |
| 2 |
jQuery('input[name="wp_insert_inpostads['+identifier+'][location]"]').click(function() { |
| 3 |
var location = jQuery('input[name="wp_insert_inpostads['+identifier+'][location]"]:checked').val(); |
| 4 |
if((location == 'above') || (location == 'middle') || (location == 'paragraphtop')) { |
| 5 |
jQuery('#primary_ad_code_type_vicode').parent().parent().parent().show(); |
| 6 |
jQuery('#primary_ad_code_type_generic').show(); |
| 7 |
jQuery('#primary_ad_code_type_generic').parent().find('.isSelectedIndicatorText').html('Generic / Custom Ad Code (Primary Network)'); |
| 8 |
jQuery('#primary_ad_code_type_generic').parent().parent().parent().css({'width': 'calc(50% - 40px)', 'margin': '0 20px 5px', 'float': 'left'}); |
| 9 |
//jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 10 |
} else { |
| 11 |
jQuery('#primary_ad_code_type_vicode').parent().parent().parent().hide(); |
| 12 |
jQuery('#primary_ad_code_type_generic').hide(); |
| 13 |
jQuery('#primary_ad_code_type_generic').parent().find('.isSelectedIndicatorText').html('Ad Code (Primary Network)'); |
| 14 |
jQuery('#primary_ad_code_type_generic').parent().parent().parent().css({'width': '100%', 'margin': '15px 0', 'float': 'none'}); |
| 15 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 16 |
} |
| 17 |
|
| 18 |
if(location == 'middle') { |
| 19 |
jQuery('.wp_insert_inpostads_location_middle_panel').show(); |
| 20 |
} else { |
| 21 |
jQuery('.wp_insert_inpostads_location_middle_panel').hide(); |
| 22 |
} |
| 23 |
}); |
| 24 |
var location = jQuery('input[name="wp_insert_inpostads['+identifier+'][location]"]:checked').val(); |
| 25 |
if((location == 'above') || (location == 'middle') || (location == 'paragraphtop')) { |
| 26 |
jQuery('#primary_ad_code_type_vicode').parent().parent().parent().show(); |
| 27 |
jQuery('#primary_ad_code_type_generic').show(); |
| 28 |
jQuery('#primary_ad_code_type_generic').parent().find('.isSelectedIndicatorText').html('Generic / Custom Ad Code (Primary Network)'); |
| 29 |
jQuery('#primary_ad_code_type_generic').parent().parent().parent().css({'width': 'calc(50% - 40px)', 'margin': '0 20px 5px', 'float': 'left'}); |
| 30 |
//jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 31 |
} else { |
| 32 |
jQuery('#primary_ad_code_type_vicode').parent().parent().parent().hide(); |
| 33 |
jQuery('#primary_ad_code_type_generic').hide(); |
| 34 |
jQuery('#primary_ad_code_type_generic').parent().find('.isSelectedIndicatorText').html('Ad Code (Primary Network)'); |
| 35 |
jQuery('#primary_ad_code_type_generic').parent().parent().parent().css({'width': '100%', 'margin': '15px 0', 'float': 'none'}); |
| 36 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 37 |
} |
| 38 |
|
| 39 |
if(location == 'middle') { |
| 40 |
jQuery('.wp_insert_inpostads_location_middle_panel').show(); |
| 41 |
} else { |
| 42 |
jQuery('.wp_insert_inpostads_location_middle_panel').hide(); |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
function wp_insert_inpostads_primary_ad_code_type_change(identifier) { |
| 47 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').parent().hide(); |
| 48 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(function() { |
| 49 |
jQuery('.isSelectedIndicator').removeClass('active'); |
| 50 |
jQuery('#primary_ad_code_type_'+jQuery(this).val()).addClass('active'); |
| 51 |
}); |
| 52 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(); |
| 53 |
|
| 54 |
jQuery('#primary_ad_code_type_generic').click(function() { |
| 55 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 56 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(); |
| 57 |
}); |
| 58 |
jQuery('#primary_ad_code_type_generic').parent().click(function() { |
| 59 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('generic'); |
| 60 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(); |
| 61 |
}); |
| 62 |
|
| 63 |
jQuery('#primary_ad_code_type_vicode').click(function() { |
| 64 |
if(!jQuery('#primary_ad_code_type_vicode').hasClass('disabled')) { |
| 65 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('vicode'); |
| 66 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(); |
| 67 |
} |
| 68 |
}); |
| 69 |
jQuery('#primary_ad_code_type_vicode').parent().click(function() { |
| 70 |
if(!jQuery('#primary_ad_code_type_vicode').hasClass('disabled')) { |
| 71 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').val('vicode'); |
| 72 |
jQuery('#wp_insert_inpostads_'+identifier+'_primary_ad_code_type').change(); |
| 73 |
} |
| 74 |
}); |
| 75 |
} |
| 76 |
|
| 77 |
function wp_insert_inpostads_vi_customize_adcode() { |
| 78 |
jQuery('#wp_insert_inpostads_vi_customize_adcode').click(function() { |
| 79 |
jQuery('.ui-dialog-titlebar').find('button').last().button('enable').click(); |
| 80 |
jQuery('#wp_insert_vi_customize_adcode').click(); |
| 81 |
}); |
| 82 |
} |