@@ -17,42 +17,42 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class EspressoEditorAssetManager extends ReactAssetManager |
| 19 | 19 | { |
| 20 | - const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
| 20 | + const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @throws InvalidDataTypeException |
|
| 24 | - * @throws InvalidEntityException |
|
| 25 | - * @throws DuplicateCollectionIdentifierException |
|
| 26 | - * @throws DomainException |
|
| 27 | - */ |
|
| 28 | - public function addAssets() |
|
| 29 | - { |
|
| 30 | - parent::addAssets(); |
|
| 31 | - $this->registerJavascript(); |
|
| 32 | - } |
|
| 22 | + /** |
|
| 23 | + * @throws InvalidDataTypeException |
|
| 24 | + * @throws InvalidEntityException |
|
| 25 | + * @throws DuplicateCollectionIdentifierException |
|
| 26 | + * @throws DomainException |
|
| 27 | + */ |
|
| 28 | + public function addAssets() |
|
| 29 | + { |
|
| 30 | + parent::addAssets(); |
|
| 31 | + $this->registerJavascript(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Register javascript assets |
|
| 37 | - * |
|
| 38 | - * @throws InvalidDataTypeException |
|
| 39 | - * @throws InvalidEntityException |
|
| 40 | - * @throws DuplicateCollectionIdentifierException |
|
| 41 | - * @throws DomainException |
|
| 42 | - */ |
|
| 43 | - private function registerJavascript() |
|
| 44 | - { |
|
| 45 | - $this->addJs( |
|
| 46 | - EspressoEditorAssetManager::JS_HANDLE_EDITOR, |
|
| 47 | - [ |
|
| 48 | - ReactAssetManager::JS_HANDLE_REACT, |
|
| 49 | - ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 50 | - CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 51 | - 'wp-components', |
|
| 52 | - 'wp-i18n', |
|
| 53 | - 'wp-keycodes', |
|
| 54 | - 'wp-url', |
|
| 55 | - ] |
|
| 56 | - )->setRequiresTranslation(); |
|
| 57 | - } |
|
| 35 | + /** |
|
| 36 | + * Register javascript assets |
|
| 37 | + * |
|
| 38 | + * @throws InvalidDataTypeException |
|
| 39 | + * @throws InvalidEntityException |
|
| 40 | + * @throws DuplicateCollectionIdentifierException |
|
| 41 | + * @throws DomainException |
|
| 42 | + */ |
|
| 43 | + private function registerJavascript() |
|
| 44 | + { |
|
| 45 | + $this->addJs( |
|
| 46 | + EspressoEditorAssetManager::JS_HANDLE_EDITOR, |
|
| 47 | + [ |
|
| 48 | + ReactAssetManager::JS_HANDLE_REACT, |
|
| 49 | + ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 50 | + CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 51 | + 'wp-components', |
|
| 52 | + 'wp-i18n', |
|
| 53 | + 'wp-keycodes', |
|
| 54 | + 'wp-url', |
|
| 55 | + ] |
|
| 56 | + )->setRequiresTranslation(); |
|
| 57 | + } |
|
| 58 | 58 | } |
@@ -21,97 +21,97 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class WordpressPluginsPageAssetManager extends ReactAssetManager |
| 23 | 23 | { |
| 24 | - const JS_HANDLE_WP_PLUGINS_PAGE = 'eventespresso-core-app'; |
|
| 24 | + const JS_HANDLE_WP_PLUGINS_PAGE = 'eventespresso-core-app'; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var ExitModal $exit_modal |
|
| 28 | - */ |
|
| 29 | - private $exit_modal; |
|
| 26 | + /** |
|
| 27 | + * @var ExitModal $exit_modal |
|
| 28 | + */ |
|
| 29 | + private $exit_modal; |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * WordpressPluginsPageAssetManager constructor. |
|
| 34 | - * |
|
| 35 | - * @param AssetCollection $assets |
|
| 36 | - * @param DomainInterface $domain |
|
| 37 | - * @param Registry $registry |
|
| 38 | - * @param ExitModal $exit_modal |
|
| 39 | - */ |
|
| 40 | - public function __construct( |
|
| 41 | - AssetCollection $assets, |
|
| 42 | - DomainInterface $domain, |
|
| 43 | - Registry $registry, |
|
| 44 | - ExitModal $exit_modal |
|
| 45 | - ) { |
|
| 46 | - $this->exit_modal = $exit_modal; |
|
| 47 | - parent::__construct($domain, $assets, $registry); |
|
| 48 | - } |
|
| 32 | + /** |
|
| 33 | + * WordpressPluginsPageAssetManager constructor. |
|
| 34 | + * |
|
| 35 | + * @param AssetCollection $assets |
|
| 36 | + * @param DomainInterface $domain |
|
| 37 | + * @param Registry $registry |
|
| 38 | + * @param ExitModal $exit_modal |
|
| 39 | + */ |
|
| 40 | + public function __construct( |
|
| 41 | + AssetCollection $assets, |
|
| 42 | + DomainInterface $domain, |
|
| 43 | + Registry $registry, |
|
| 44 | + ExitModal $exit_modal |
|
| 45 | + ) { |
|
| 46 | + $this->exit_modal = $exit_modal; |
|
| 47 | + parent::__construct($domain, $assets, $registry); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @inheritDoc |
|
| 53 | - */ |
|
| 54 | - public function addAssets() |
|
| 55 | - { |
|
| 56 | - parent::addAssets(); |
|
| 57 | - $this->registerJavascript(); |
|
| 58 | - $this->registerStyleSheets(); |
|
| 59 | - add_action('admin_enqueue_scripts', [$this, 'enqueueBrowserAssets'], 10); |
|
| 60 | - } |
|
| 51 | + /** |
|
| 52 | + * @inheritDoc |
|
| 53 | + */ |
|
| 54 | + public function addAssets() |
|
| 55 | + { |
|
| 56 | + parent::addAssets(); |
|
| 57 | + $this->registerJavascript(); |
|
| 58 | + $this->registerStyleSheets(); |
|
| 59 | + add_action('admin_enqueue_scripts', [$this, 'enqueueBrowserAssets'], 10); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * Register javascript assets |
|
| 65 | - * |
|
| 66 | - * @throws InvalidDataTypeException |
|
| 67 | - * @throws InvalidEntityException |
|
| 68 | - * @throws DuplicateCollectionIdentifierException |
|
| 69 | - * @throws DomainException |
|
| 70 | - */ |
|
| 71 | - private function registerJavascript() |
|
| 72 | - { |
|
| 73 | - $this->addJs( |
|
| 74 | - WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 75 | - [ |
|
| 76 | - CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 77 | - ReactAssetManager::JS_HANDLE_REACT, |
|
| 78 | - ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 79 | - 'wp-components', |
|
| 80 | - 'wp-i18n', |
|
| 81 | - 'wp-keycodes', |
|
| 82 | - 'wp-url', |
|
| 83 | - ] |
|
| 84 | - ) |
|
| 85 | - ->setRequiresTranslation() |
|
| 86 | - ->setInlineDataCallback( |
|
| 87 | - function () { |
|
| 88 | - wp_localize_script( |
|
| 89 | - WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 90 | - 'eeExitSurveyInfo', |
|
| 91 | - $this->exit_modal->getExitSurveyInfo() |
|
| 92 | - ); |
|
| 93 | - wp_add_inline_script( |
|
| 94 | - WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 95 | - " |
|
| 63 | + /** |
|
| 64 | + * Register javascript assets |
|
| 65 | + * |
|
| 66 | + * @throws InvalidDataTypeException |
|
| 67 | + * @throws InvalidEntityException |
|
| 68 | + * @throws DuplicateCollectionIdentifierException |
|
| 69 | + * @throws DomainException |
|
| 70 | + */ |
|
| 71 | + private function registerJavascript() |
|
| 72 | + { |
|
| 73 | + $this->addJs( |
|
| 74 | + WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 75 | + [ |
|
| 76 | + CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 77 | + ReactAssetManager::JS_HANDLE_REACT, |
|
| 78 | + ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 79 | + 'wp-components', |
|
| 80 | + 'wp-i18n', |
|
| 81 | + 'wp-keycodes', |
|
| 82 | + 'wp-url', |
|
| 83 | + ] |
|
| 84 | + ) |
|
| 85 | + ->setRequiresTranslation() |
|
| 86 | + ->setInlineDataCallback( |
|
| 87 | + function () { |
|
| 88 | + wp_localize_script( |
|
| 89 | + WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 90 | + 'eeExitSurveyInfo', |
|
| 91 | + $this->exit_modal->getExitSurveyInfo() |
|
| 92 | + ); |
|
| 93 | + wp_add_inline_script( |
|
| 94 | + WordpressPluginsPageAssetManager::JS_HANDLE_WP_PLUGINS_PAGE, |
|
| 95 | + " |
|
| 96 | 96 | var eeDomain='wpPluginsPage'; |
| 97 | 97 | ", |
| 98 | - 'before' |
|
| 99 | - ); |
|
| 100 | - } |
|
| 101 | - ); |
|
| 102 | - } |
|
| 98 | + 'before' |
|
| 99 | + ); |
|
| 100 | + } |
|
| 101 | + ); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Register CSS assets. |
|
| 107 | - * |
|
| 108 | - * @throws DuplicateCollectionIdentifierException |
|
| 109 | - * @throws InvalidDataTypeException |
|
| 110 | - * @throws InvalidEntityException |
|
| 111 | - * @throws DomainException |
|
| 112 | - */ |
|
| 113 | - private function registerStyleSheets() |
|
| 114 | - { |
|
| 115 | - wp_enqueue_style('wp-components'); |
|
| 116 | - } |
|
| 105 | + /** |
|
| 106 | + * Register CSS assets. |
|
| 107 | + * |
|
| 108 | + * @throws DuplicateCollectionIdentifierException |
|
| 109 | + * @throws InvalidDataTypeException |
|
| 110 | + * @throws InvalidEntityException |
|
| 111 | + * @throws DomainException |
|
| 112 | + */ |
|
| 113 | + private function registerStyleSheets() |
|
| 114 | + { |
|
| 115 | + wp_enqueue_style('wp-components'); |
|
| 116 | + } |
|
| 117 | 117 | } |