| @@ -28,8 +28,10 @@ | ||
| 28 | 28 | if ( $this->helper->is_hostinger_admin_page() ) { |
| 29 | 29 | wp_enqueue_style( 'hostinger_main_styles', HOSTINGER_ASSETS_URL . '/css/main.css', array(), HOSTINGER_VERSION ); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | + wp_enqueue_style( 'hostinger_global_styles', HOSTINGER_ASSETS_URL . '/css/global.css', array(), HOSTINGER_VERSION ); | |
| 33 | + | |
| 32 | 34 | if ( $this->helper->is_preview_domain() && is_user_logged_in() ) { |
| 33 | 35 | wp_enqueue_style( 'hostinger-preview-styles', HOSTINGER_ASSETS_URL . '/css/hts-preview.css', array(), HOSTINGER_VERSION ); |
| 34 | 36 | } |
| 35 | 37 | } |
| @@ -38,28 +40,50 @@ | ||
| 38 | 40 | * Enqueues scripts for the Hostinger admin pages. |
| 39 | 41 | */ |
| 40 | 42 | public function admin_scripts(): void { |
| 41 | 43 | if ( $this->helper->is_hostinger_admin_page() ) { |
| 42 | - wp_enqueue_script( 'hostinger_main_scripts', HOSTINGER_ASSETS_URL . '/js/main.js', array( | |
| 44 | + wp_enqueue_script( | |
| 45 | + 'hostinger_main_scripts', | |
| 46 | + HOSTINGER_ASSETS_URL . '/js/main.js', | |
| 47 | + array( | |
| 48 | + 'jquery', | |
| 49 | + 'wp-i18n', | |
| 50 | + ), | |
| 51 | + HOSTINGER_VERSION, | |
| 52 | + false | |
| 53 | + ); | |
| 54 | + } | |
| 55 | + | |
| 56 | + wp_enqueue_script( | |
| 57 | + 'hostinger_global_scripts', | |
| 58 | + HOSTINGER_ASSETS_URL . '/js/global-scripts.js', | |
| 59 | + array( | |
| 43 | 60 | 'jquery', |
| 44 | 61 | 'wp-i18n', |
| 45 | - ), HOSTINGER_VERSION, false ); | |
| 46 | - } | |
| 62 | + ), | |
| 63 | + HOSTINGER_VERSION, | |
| 64 | + false | |
| 65 | + ); | |
| 47 | 66 | |
| 48 | - wp_enqueue_script( 'hostinger_global_scripts', HOSTINGER_ASSETS_URL . '/js/global-scripts.js', array( | |
| 49 | - 'jquery', | |
| 50 | - 'wp-i18n', | |
| 51 | - ), HOSTINGER_VERSION, false ); | |
| 52 | - | |
| 53 | 67 | if ( ! empty( Hostinger_Helper::get_api_token() ) ) { |
| 54 | - wp_enqueue_script( 'hostinger_requests_scripts', HOSTINGER_ASSETS_URL . '/js/requests.js', array( | |
| 55 | - 'jquery', | |
| 56 | - 'wp-i18n', | |
| 57 | - ), HOSTINGER_VERSION, false ); | |
| 58 | - wp_localize_script( 'hostinger_requests_scripts', 'hostingerContainer', array( | |
| 59 | - 'url' => admin_url( 'admin-ajax.php' ), | |
| 60 | - 'nonce' => wp_create_nonce( 'hts-ajax-nonce' ), | |
| 61 | - ) ); | |
| 68 | + wp_enqueue_script( | |
| 69 | + 'hostinger_requests_scripts', | |
| 70 | + HOSTINGER_ASSETS_URL . '/js/requests.js', | |
| 71 | + array( | |
| 72 | + 'jquery', | |
| 73 | + 'wp-i18n', | |
| 74 | + ), | |
| 75 | + HOSTINGER_VERSION, | |
| 76 | + false | |
| 77 | + ); | |
| 78 | + wp_localize_script( | |
| 79 | + 'hostinger_requests_scripts', | |
| 80 | + 'hostingerContainer', | |
| 81 | + array( | |
| 82 | + 'url' => admin_url( 'admin-ajax.php' ), | |
| 83 | + 'nonce' => wp_create_nonce( 'hts-ajax-nonce' ), | |
| 84 | + ) | |
| 85 | + ); | |
| 62 | 86 | } |
| 63 | 87 | } |
| 64 | 88 | } |
| 65 | 89 | |