|
@@ 226-229 (lines=4) @@
|
| 223 |
|
wp_enqueue_script( 'jquery-blockui' ); |
| 224 |
|
$autofill_api = wpinv_get_option('address_autofill_api'); |
| 225 |
|
$autofill_active = wpinv_get_option('address_autofill_active'); |
| 226 |
|
if (isset($autofill_active) && 1 == $autofill_active && !empty($autofill_api) && wpinv_is_checkout()) { |
| 227 |
|
wp_enqueue_script('google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . $autofill_api . '&libraries=places', array('jquery'), '', false); |
| 228 |
|
wp_enqueue_script('google-maps-init', WPINV_PLUGIN_URL . 'assets/js/gaaf.js', array('jquery'), '', true); |
| 229 |
|
} |
| 230 |
|
wp_enqueue_script( 'wpinv-front-script' ); |
| 231 |
|
wp_localize_script( 'wpinv-front-script', 'WPInv', $localize ); |
| 232 |
|
} |
|
@@ 271-274 (lines=4) @@
|
| 268 |
|
if ($post_type == 'wpi_invoice' || $post_type == 'wpi_quote' && ($pagenow == 'post-new.php' || $pagenow == 'post.php')) { |
| 269 |
|
$autofill_api = wpinv_get_option('address_autofill_api'); |
| 270 |
|
$autofill_active = wpinv_get_option('address_autofill_active'); |
| 271 |
|
if (isset($autofill_active) && 1 == $autofill_active && !empty($autofill_api)) { |
| 272 |
|
wp_enqueue_script('google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . $autofill_api . '&libraries=places', array('jquery'), '', false); |
| 273 |
|
wp_enqueue_script('google-maps-init', WPINV_PLUGIN_URL . 'assets/js/gaaf.js', array('jquery'), '', true); |
| 274 |
|
} |
| 275 |
|
} |
| 276 |
|
|
| 277 |
|
wp_register_script( 'wpinv-admin-script', WPINV_PLUGIN_URL . 'assets/js/admin' . $suffix . '.js', array( 'jquery', 'jquery-blockui' ), WPINV_VERSION ); |