Admin
4 years ago
Commands
4 years ago
Helpers
4 years ago
Migrations
4 years ago
ValueObjects
4 years ago
Assets.php
4 years ago
Log.php
4 years ago
LogFactory.php
4 years ago
LogModel.php
4 years ago
LogRepository.php
4 years ago
LogServiceProvider.php
4 years ago
Assets.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Log; |
| 4 | |
| 5 | use Give\Helpers\EnqueueScript; |
| 6 | use Give\Log\ValueObjects\LogType; |
| 7 | |
| 8 | /** |
| 9 | * Class Assets |
| 10 | * @package Give\Log\UserInterface |
| 11 | * |
| 12 | * @since 2.10.0 |
| 13 | */ |
| 14 | class Assets |
| 15 | { |
| 16 | /** |
| 17 | * Enqueue scripts |
| 18 | */ |
| 19 | public function enqueueScripts() |
| 20 | { |
| 21 | $data = [ |
| 22 | 'apiRoot' => esc_url_raw(rest_url('give-api/v2/logs')), |
| 23 | 'apiNonce' => wp_create_nonce('wp_rest'), |
| 24 | 'logTypes' => LogType::getTypesTranslated() |
| 25 | ]; |
| 26 | |
| 27 | EnqueueScript::make( |
| 28 | 'give-admin-log-list-table-app', |
| 29 | 'assets/dist/js/give-log-list-table-app.js' |
| 30 | )->loadInFooter() |
| 31 | ->registerTranslations() |
| 32 | ->registerLocalizeData('GiveLogs', $data) |
| 33 | ->enqueue(); |
| 34 | } |
| 35 | } |
| 36 |